Go Back   Android Forums > Android Phones > Motorola Triumph > Triumph - All Things Root

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

Like Tree1Likes
  • 1 Post By g60madman

test: Reply
 
LinkBack Thread Tools
Old September 29th, 2012, 07:24 PM   #1 (permalink)
Member
Thread Author (OP)
 
Join Date: Oct 2011
Posts: 122
 
Device(s):
Carrier: Not Provided

Thanks: 36
Thanked 27 Times in 24 Posts
Default Framework error. Need help with compile.

Hey guys. I've been trying to learn about framework on android with my Triumph. But everytime I change something inside, I get error when I load the ROM on my phone. The error is com.android.phone has stopped working.

I've been following instructions on how to use apktool, apk multi too, apkchanger and also baksmali.jar and smali.jar.

What I'm trying to do is trying to change color of notification bar text, lock screen texts, fonts and colors. But none of those work for me. I've tried one after one and they all gave me same error com.android.phone has stopped working. Then I get stuck in boot loop.

I tested with simple notification text color change by decompiling classes.dex out of services.jar and changing just a single line to change the color. Still gave me error.

It seems to me that I cannot modify anything inside framework folder or it'll throw error at me. I would like to know how you guys did it and what am I missing? I've tried using UOT Kitchen and the framework-res.apk cooked from there works just fine except it cannot change the color of the text since it's in services.jar.

I've tried compiling classes.dex with 512M parameter and without the parameter. Still got the same error. For other stuffs, in APK Multi Tool, I tried setting compression to 0, memory size to 512 and didn't work. Tried playing around with settings and still didn't work.I cannot figure out what I'm missing anymore.

TL;DR - Framework modification fail for everything, even the smallest change. Please help.

nyioo7 is offline  
Reply With Quote
sponsored links
Old September 30th, 2012, 04:28 AM   #2 (permalink)
ROM Developer
 
BSydz's Avatar
 
Join Date: Mar 2012
Location: The Mitten
Posts: 950
 
Device(s): Motorola Triumph Sharpened, Samsung Intercept
Carrier: Not Provided

Thanks: 863
Thanked 935 Times in 365 Posts
Default

Are you just using the .jar that is in the dist folder? You have to use the original signed .jar with the META-INF folder, that is the signed part. If that is the issue then use 7zip to open the original .jar and put the modified dex file in there. Tip: When you change framework-res delete the folder that you are replacing because sometimes it will just merge and things will be messed up. Hope this helps.
__________________
"If somethings in your way, you gotta move it or use it." - Me

If you would like to thank me, beyond just saying thanks, you can donate to my coffee fund to keep my eyes open.
Donate
BSydz is online now  
Reply With Quote
The Following 2 Users Say Thank You to BSydz For This Useful Post:
inub (October 4th, 2012), nyioo7 (September 30th, 2012)
Old September 30th, 2012, 04:57 PM   #3 (permalink)
Member
Thread Author (OP)
 
Join Date: Oct 2011
Posts: 122
 
Device(s):
Carrier: Not Provided

Thanks: 36
Thanked 27 Times in 24 Posts
Default

Hey. Thanks for the reply.

I'm using the services.jar that I got the classes.dex out. I just replace the classes.dex after modifying. The services.jar is from stock ROM too. So, I think I'm using the original .jar. Even the slightest change in classes.dex is throwing me error.

Also, the framework-res.apk seems to do the same. Even the slightest change causes the error. Its' also from stock ROM too. Am I missing something here? Both processes are showing me the exact same error. So, I think the way I'm putting them back in is not right. Do I need to sign them back? I thought system files do not require signing since they are already signed.

I am using winrar to open .jar and putting back dex file. Is that the problem?
nyioo7 is offline  
Reply With Quote
Old October 3rd, 2012, 09:52 PM   #4 (permalink)
Member
Thread Author (OP)
 
Join Date: Oct 2011
Posts: 122
 
Device(s):
Carrier: Not Provided

Thanks: 36
Thanked 27 Times in 24 Posts
Default

Any help guys? Am I compiling it wrong? framework-res.apk modified at UOT kitchen works just fine. But when I modify the exact same code in the XML files from stock framework-res.apk, I get the error and boot loop.
nyioo7 is offline  
Reply With Quote
Old October 4th, 2012, 04:35 PM   #5 (permalink)
ROM Developer
 
g60madman's Avatar
 
Join Date: Oct 2011
Location: New Mexico, USA
Gender: Male
Posts: 1,816
 
Device(s): I have worked on: Galaxy Nexus, HTC Evo V 4g, Motorola Triumph, Samsung S3, S4 and Victory
Carrier: Verizon

Thanks: 844
Thanked 2,808 Times in 772 Posts
Default

Quote:
Originally Posted by nyioo7 View Post
Any help guys? Am I compiling it wrong? framework-res.apk modified at UOT kitchen works just fine. But when I modify the exact same code in the XML files from stock framework-res.apk, I get the error and boot loop.
When decompiling I see you are using apktool. When I do everything I am doing it in linux using the apktool. The other thing to remember is no matter what part of the ROM you are working on, make sure to load in the framework-res.apk from the rom even if you are working on the framework-res.apk so it knows what settings to decompile. So first run

$ apktool if framework-res.apk

So for each ROM you are decompiling and recompiling this needs to be done. So lets say you choose to decompile frameworks.jar from MIUI and CM7 you need to first load the MIUI framework-res.apk from MIUI then decompile MIUI frameworks.jar. Then load the CM7 frameworks-res.apk then decompile CM7 frameworks.jar. And the same thing goes for recompiling it. If you have further questions please feel free to post.
g60madman is offline  
Reply With Quote
The Following 2 Users Say Thank You to g60madman For This Useful Post:
inub (October 4th, 2012), nyioo7 (October 4th, 2012)
Old October 4th, 2012, 05:14 PM   #6 (permalink)
Junior Member
 
Join Date: Mar 2012
Location: Chambersburg, Pa
Posts: 68
 
Device(s): Paranoid Android Ver1.6
Carrier: Not Provided

Thanks: 40
Thanked 21 Times in 11 Posts
Default

thanks i was having that same problem the other day
inub is offline  
Reply With Quote
The Following User Says Thank You to inub For This Useful Post:
g60madman (October 4th, 2012)
Old October 4th, 2012, 06:56 PM   #7 (permalink)
Member
Thread Author (OP)
 
Join Date: Oct 2011
Posts: 122
 
Device(s):
Carrier: Not Provided

Thanks: 36
Thanked 27 Times in 24 Posts
Default

Quote:
Originally Posted by g60madman View Post
When decompiling I see you are using apktool. When I do everything I am doing it in linux using the apktool. The other thing to remember is no matter what part of the ROM you are working on, make sure to load in the framework-res.apk from the rom even if you are working on the framework-res.apk so it knows what settings to decompile. So first run

$ apktool if framework-res.apk

So for each ROM you are decompiling and recompiling this needs to be done. So lets say you choose to decompile frameworks.jar from MIUI and CM7 you need to first load the MIUI framework-res.apk from MIUI then decompile MIUI frameworks.jar. Then load the CM7 frameworks-res.apk then decompile CM7 frameworks.jar. And the same thing goes for recompiling it. If you have further questions please feel free to post.
Hey. Thanks for the reply. One thing I'm not clear on this is that, when I run apktool if command, it installs the framework-res.apk in a folder. So, my question is, how do I decompile frameworks.jar? I am currently decompiling jar file I want to modify (services.jar) using baksmali.jar and recompiling with smali.jar. These compilers do not seem to have anything to do with apktool. Am I missing a step? Because it's throwing me the same error. com.android.phone process has stopped working and goes into boot loop.

I am able to modify the framework-res.apk now. My problem was that I was not deleting the res folder or any folders I modified. It was because I did not understand fully of how apktool compile.
nyioo7 is offline  
Reply With Quote
Old October 4th, 2012, 10:04 PM   #8 (permalink)
ROM Developer
 
g60madman's Avatar
 
Join Date: Oct 2011
Location: New Mexico, USA
Gender: Male
Posts: 1,816
 
Device(s): I have worked on: Galaxy Nexus, HTC Evo V 4g, Motorola Triumph, Samsung S3, S4 and Victory
Carrier: Verizon

Thanks: 844
Thanked 2,808 Times in 772 Posts
Default

Quote:
Originally Posted by nyioo7 View Post
Hey. Thanks for the reply. One thing I'm not clear on this is that, when I run apktool if command, it installs the framework-res.apk in a folder. So, my question is, how do I decompile frameworks.jar? I am currently decompiling jar file I want to modify (services.jar) using baksmali.jar and recompiling with smali.jar. These compilers do not seem to have anything to do with apktool. Am I missing a step? Because it's throwing me the same error. com.android.phone process has stopped working and goes into boot loop.

I am able to modify the framework-res.apk now. My problem was that I was not deleting the res folder or any folders I modified. It was because I did not understand fully of how apktool compile.
Ill put together a quick cheat sheet on what I am doing in ubuntu give me some time
g60madman is offline  
Reply With Quote
The Following User Says Thank You to g60madman For This Useful Post:
nyioo7 (October 4th, 2012)
Old October 4th, 2012, 10:14 PM   #9 (permalink)
Member
Thread Author (OP)
 
Join Date: Oct 2011
Posts: 122
 
Device(s):
Carrier: Not Provided

Thanks: 36
Thanked 27 Times in 24 Posts
Default

Wow dude. Thanks!
nyioo7 is offline  
Reply With Quote
Old October 5th, 2012, 11:57 AM   #10 (permalink)
ROM Developer
 
g60madman's Avatar
 
Join Date: Oct 2011
Location: New Mexico, USA
Gender: Male
Posts: 1,816
 
Device(s): I have worked on: Galaxy Nexus, HTC Evo V 4g, Motorola Triumph, Samsung S3, S4 and Victory
Carrier: Verizon

Thanks: 844
Thanked 2,808 Times in 772 Posts
Default

Quote:
Originally Posted by nyioo7 View Post
Wow dude. Thanks!
Alright wrote it up for Ubuntu should work perfectly based on the tools I also put in the download site.

AndroidDecompileRecompile - mtdev-cm - How to decompile and recompile all things Android - CyanogenMod by Team MTDEV - Google Project Hosting
inub likes this.
g60madman is offline  
Reply With Quote
The Following 2 Users Say Thank You to g60madman For This Useful Post:
inub (October 8th, 2012), nyioo7 (October 5th, 2012)
sponsored links
Old October 7th, 2012, 07:36 PM   #11 (permalink)
Member
Thread Author (OP)
 
Join Date: Oct 2011
Posts: 122
 
Device(s):
Carrier: Not Provided

Thanks: 36
Thanked 27 Times in 24 Posts
Default

Quote:
Originally Posted by g60madman View Post
Alright wrote it up for Ubuntu should work perfectly based on the tools I also put in the download site.

AndroidDecompileRecompile - mtdev-cm - How to decompile and recompile all things Android - CyanogenMod by Team MTDEV - Google Project Hosting
Hey g60madman. If you got time, could you give me a quick tip on how to modify and recompile jar file? I've tried recompiling service.jar with modified original classes.dex and it's giving me error and boot loop. I'm using " java -Xmx512M -jar smali.jar" to recompile. But it seems to be wrong at some point.

This is what I was doing. Trying to change the clock color in task bar. I changed const/4 v8, 0x0 to const v8, 0x000000. It would compile just fine with this but it gives me error when I apply it to the phone.
nyioo7 is offline  
Reply With Quote
Old October 7th, 2012, 09:01 PM   #12 (permalink)
ROM Developer
 
g60madman's Avatar
 
Join Date: Oct 2011
Location: New Mexico, USA
Gender: Male
Posts: 1,816
 
Device(s): I have worked on: Galaxy Nexus, HTC Evo V 4g, Motorola Triumph, Samsung S3, S4 and Victory
Carrier: Verizon

Thanks: 844
Thanked 2,808 Times in 772 Posts
Default

Quote:
Originally Posted by nyioo7 View Post
Hey g60madman. If you got time, could you give me a quick tip on how to modify and recompile jar file? I've tried recompiling service.jar with modified original classes.dex and it's giving me error and boot loop. I'm using " java -Xmx512M -jar smali.jar" to recompile. But it seems to be wrong at some point.

This is what I was doing. Trying to change the clock color in task bar. I changed const/4 v8, 0x0 to const v8, 0x000000. It would compile just fine with this but it gives me error when I apply it to the phone.
Follow the step 1 procedure I did in the write up but run it the same against the services. The way the step 1 procedure was written is for every files in system/frameworks you don't need to run the java command or anything like that just the following....

Copy service.jar to tools folder
$ cd ~/tools

Rename the service.jar
$ mv service.jar service-org.jar

Decompile and make changes
$ ./apktool d service-org.jar

Recompile service.jar and copy to ROM.
$ ./apktool b fservice-org.jar service.jar

If you have further questions please let feel free to post
g60madman is offline  
Reply With Quote
The Following User Says Thank You to g60madman For This Useful Post:
nyioo7 (October 8th, 2012)
Old October 8th, 2012, 05:49 AM   #13 (permalink)
Member
Thread Author (OP)
 
Join Date: Oct 2011
Posts: 122
 
Device(s):
Carrier: Not Provided

Thanks: 36
Thanked 27 Times in 24 Posts
Default

Quote:
Originally Posted by g60madman View Post
Follow the step 1 procedure I did in the write up but run it the same against the services. The way the step 1 procedure was written is for every files in system/frameworks you don't need to run the java command or anything like that just the following....

Copy service.jar to tools folder
$ cd ~/tools

Rename the service.jar
$ mv service.jar service-org.jar

Decompile and make changes
$ ./apktool d service-org.jar

Recompile service.jar and copy to ROM.
$ ./apktool b fservice-org.jar service.jar

If you have further questions please let feel free to post
Ohhh. So, I was extracting and decompiling classes.dex. Thanks.
nyioo7 is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Phones > Motorola Triumph > Triumph - All Things Root
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 07:21 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.