Create Odex + Resign Phone.apk - Android Q&A, Help & Troubleshooting

I have a EVO LTE running the latest stock rooted odexed ROM (3.16). There is a mod I want to make, and there is an APK (for DEODEX ROMS) available that matches my ROM version (stock 3.16)
Basically I want to add Roam only option to Phone.apk.
I took the modified apk that supposedly has the roam only option, created an .odex file for it, and signed it using the current Phone.odex using this method:
http://forum.xda-developers.com/showthread.php?t=1853569
I made sure my BOOTCLASSPATH was correct but every time I book with this Phone.apk and Phone.odex in place (that I created), I have no service.
Does anyone have any ideas on what I might be doing wrong? Or how to see and troubleshoot any error messages occuring with loading Phone.apk?

I'm only recently learning about odexing. Did you try it deodexed? Keep in mind the phone.apk you odexed probably already has a classes.dex within it. Is it zipaligned? Permissions and ownership are correct?

Related

[Q] Issues restoring framework-res.apk

Hey Guys,
I have been attempting to mod my framework-res.apk to try and add a percent battery icon (unsuccessfuly so far). Here is my issue, after finding that my modded framework file isnt working properly, I go to try and restore the original. After restoring the original I still get tons of FC's and the only way to get things back to normal is to restore my backup from CWM.
The method I am using to replace my framework-res.apk is to use a root explorer (ES File Manager) to copy the file to /system/ then from there I modify the permissions and then move the file to the framework folder, overwriting the existing file. After this, I reboot the phone.
My question is, why is my original framework-res.apk file causing force closes? It is starting to make me think that even my modded files are ok, but that the issue is arising in the manual transfer.
Sorry if the answer is posted elsewhere, I googled and was only finding issues with the apk not being compiled correctly, but that shouldnt be an issue with the original apk.
*EDIT* I figured it out. It appears it was because Jkay Deluxe was installed. I decided to reflash the rom and try with a fresh copy of the framework-res.apk and everything appears to be working now.

add 1% battery mod to odexed stock rom?

Can anyone tell me if its possible to add the 1% battery mod to a stock odex ics rom? I have a moto razr maxx. Is there a way i can mod this myself? I tried uot kitchen but it only shows increments of 10% on my phone.
Thanks!
Yes, it can be done. My phone's ROM is the stock odexed ROM and I have 1% battery increments. You need to edit framework-res.apk, you can use apktool or APK Multi Tool or whatever to unpack the APK, and rebuild it afterwards. To get 1% battery, you need to edit/replace some XMLs.
I'll try find a link to show how the XMLs should be and some commonly used icons.
EDIT: Here: http://forum.xda-developers.com/showthread.php?t=724778
Find a style you like, download it and copy the two folders from inside into the "res" folder in your unpacked APK, overwriting any existing files (you may need to rename the drawable-hdpi-v4 folder depending on your phones resolution)
But UOT should work. Make sure in the "battery" section you changed at the top from "Custom battery" to "SCB with %" and then selected the style you want.
SifJar said:
Yes, it can be done. My phone's ROM is the stock odexed ROM and I have 1% battery increments. You need to edit framework-res.apk, you can use apktool or APK Multi Tool or whatever to unpack the APK, and rebuild it afterwards. To get 1% battery, you need to edit/replace some XMLs.
I'll try find a link to show how the XMLs should be and some commonly used icons.
EDIT: Here: http://forum.xda-developers.com/showthread.php?t=724778
Find a style you like, download it and copy the two folders from inside into the "res" folder in your unpacked APK, overwriting any existing files (you may need to rename the drawable-hdpi-v4 folder depending on your phones resolution)
But UOT should work. Make sure in the "battery" section you changed at the top from "Custom battery" to "SCB with %" and then selected the style you want.
Click to expand...
Click to collapse
what phone do you have? i already tried the uot and it will not work. from what im understanding you would need to edit the systemUI.odex file to allow for battery % but i have no clue how to do it.
fix-this! said:
what phone do you have? i already tried the uot and it will not work. from what im understanding you would need to edit the systemUI.odex file to allow for battery % but i have no clue how to do it.
Click to expand...
Click to collapse
I have an HTC Explorer. But I believe the battery icon is stored in framework-res.apk, and not SystemUI.apk, so SystemUI.odex shouldn't be a problem (SystemUI.odex is the odex file of SystemUI.apk - you can't edit odexed apps, you would have to deodex SystemUI.apk first; this means combining the SystemUI.odex and SystemUI.apk files into one, deodexed SystemUI.apk, which can then be edited).
Although UOT may require you to upload a deodexed SystemUI.apk along with framework-res.apk, because some theme mods required SystemUI.apk. So you might need to get a deodexed SystemUI.apk. There's a guide to deodexing here: http://forum.xda-developers.com/showthread.php?t=1208320
It is a slightly complicated process, but it's not impossible to figure out I don't know for sure if this is what you need to do to make it work though. Make sure you have a nandroid backup before you flash the theme
i guess ill wait for a dev to deodex the stock rom then. the uot kitchen states it can work on odex roms but in my case it does not.
fix-this! said:
Can anyone tell me if its possible to add the 1% battery mod to a stock odex ics rom? I have a moto razr maxx. Is there a way i can mod this myself? I tried uot kitchen but it only shows increments of 10% on my phone.
Thanks!
Click to expand...
Click to collapse
Anything's possible... See HERE, HERE, and a mini re-odex tutorial HERE.
And, I believe there were some major framework/system changes in the transition from GB to ICS - so, the battery files may have moved to SystemUI from framework-res..
alteredlikeness said:
Anything's possible... See HERE, HERE, and a mini re-odex tutorial HERE.
And, I believe there were some major framework/system changes in the transition from GB to ICS - so, the battery files may have moved to SystemUI from framework-res..
Click to expand...
Click to collapse
thanks for that but it's a bit too over my head to attempt myself. if i uploaded my systemUI & systemUI.odex do you think you could help me out?
fix-this! said:
thanks for that but it's a bit too over my head to attempt myself. if i uploaded my systemUI & systemUI.odex do you think you could help me out?
Click to expand...
Click to collapse
You'd also need to upload all the .jar and .odex files from /system/framework I think to make it possible to deodex systemUI.apk.
EDIT: If you do that, I should probably be able to deodex it for you. (Assuming that process hasn't changed for ICS, which I don't think it has). Once you have this file deodexed, you should be able to use UOT, it supports ICS battery mods.
EDIT: If you need an easy way to copy those files off the phone, you can try this: http://androidcommander.com/
fix-this! said:
thanks for that but it's a bit too over my head to attempt myself. if i uploaded my systemUI & systemUI.odex do you think you could help me out?
Click to expand...
Click to collapse
Sorry, but I'm not too familiar with ICS yet... eagerly waiting Q3 for my phone.
Plus, I ported the battery from a deodexed set so I don't know all of the smali/xml edits involved if I were to do it from scratch...
You could still upload a whole system dump or cwm backup for me to look at ...if you wanted to. It'll let me get familiar with Moto's ICS..
SifJar said:
You'd also need to upload all the .jar and .odex files from /system/framework I think to make it possible to deodex systemUI.apk.
EDIT: If you do that, I should probably be able to deodex it for you. (Assuming that process hasn't changed for ICS, which I don't think it has). Once you have this file deodexed, you should be able to use UOT, it supports ICS battery mods.
EDIT: If you need an easy way to copy those files off the phone, you can try this: http://androidcommander.com/
Click to expand...
Click to collapse
im uploading now if someone can do this for me, i cannot figure it out. the razr devs do not seem interested in doing this on a ics leak.
http://www.mediafire.com/?m1i08symjcalvy4
uploaded system/framework & app
fix-this! said:
http://www.mediafire.com/?m1i08symjcalvy4
uploaded system/framework & app
Click to expand...
Click to collapse
Downloading now, provided it works I should have it up in 15 - 20 mins
EDIT: Appears it's a bit different, trying another approach now which will take a bit longer, but seems to be working for now at least (doing it this way means deodexing all the files).
EDIT: I'll try and get SystemUI.apk uploaded tonight, the rest will have to wait to tomorrow if you want them.
EDIT: There is a possibility I will need "init.rc" from the root of your device (i.e. not inside any folders like "system" or "data") to properly deodex all the files. A few seem to be giving errors and stuff.
Here's the (hopefully) deodexed SystemUI.apk [well, it IS deodexed, the "hopefully" refers to hopefully it's done right]. Try this with UOT (along with framework-res.apk, which isn't odexed in the first place), and as I said before, be sure to make a nandroid backup before hand.
You may also need to delete the SystemUI.odex file from your phone after applying the theme, I am not completely sure. If after applying the theme it has not worked, try doing so - worst case scenario you should be able to restore your nandroid backup if deleting the .odex file breaks something.
SifJar said:
Downloading now, provided it works I should have it up in 15 - 20 mins
EDIT: Appears it's a bit different, trying another approach now which will take a bit longer, but seems to be working for now at least (doing it this way means deodexing all the files).
EDIT: I'll try and get SystemUI.apk uploaded tonight, the rest will have to wait to tomorrow if you want them.
EDIT: There is a possibility I will need "init.rc" from the root of your device (i.e. not inside any folders like "system" or "data") to properly deodex all the files. A few seem to be giving errors and stuff.
Click to expand...
Click to collapse
heres the file you need to deodex.
fix-this! said:
heres the file you need to deodex.
Click to expand...
Click to collapse
Thanks. I can try deodex all the jars and apks with that tomorrow if you want. For now, SystemUI.apk seems to have deodexed fine without it, so you can grab it above and try UOT with it (that's the only file UOT needs other than framework-res.apk which isn't odexed anyway). Let me know if it works
SifJar said:
Thanks. I can try deodex all the jars and apks with that tomorrow if you want. For now, SystemUI.apk seems to have deodexed fine without it, so you can grab it above and try UOT with it (that's the only file UOT needs other than framework-res.apk which isn't odexed anyway). Let me know if it works
Click to expand...
Click to collapse
ill try it but if you think you could deodex everything that would be great.
used uot with the modded systemUI and it didn't work, still only getting 10% increments. i think the entire system/app & framework needs to be deodexed.
fix-this! said:
used uot with the modded systemUI and it didn't work, still only getting 10% increments. i think the entire system/app & framework needs to be deodexed.
Click to expand...
Click to collapse
Just found this HERE - looks like a good 1% battery tutorial...
But, from the look of your system, you have battery files (images/xmls) in BOTH the SystemUI.apk and framework-res.apk - how's that?
I don't think I'll be able to upload the deodexed files. It'd be a large file, and I don't really want to waste the bandwidth I'm afraid.
It's not a hard process for you to do though. There are two main options. Either buy Titanium Backup Pro for your phone, and then load it up and press menu, then "more" and then "Undo sys Dalvik integration..." which will deodex everything in /system/app (but not /system/framework), or else download this: http://forum.xda-developers.com/attachment.php?attachmentid=972719&d=1333088601 (I'd strongly recommend this second method)
Extract the ZIP, and place everything from /system/app in "_app" and everything from /system/framework in "_framework". Run AutoDEOToolMain.bat. Select option 2, then paste in this as the custom BootClassPath:
Code:
core.jar:core-junit.jar:bouncycastle.jar:ext.jar:framework.jar:framework-ext.jar:android.policy.jar:services.jar:apache-xml.jar:filterfw.jar:com.motorola.android.frameworks.jar:com.motorola.android.widget.jar:com.motorola.frameworks.core.addon.jar
Let it run, and all the deodexed files will be in the deodexed folders. Any files that weren't deodexed will be in the original folders.
This is really quite an easy process, so I'm sure you could achieve it yourself.
EDIT: There still seem to be a couple of errors with the above BootClassPath, the following two JARs seem to be missing: /system/framework/kafdex.jar and /system/framework/com.motorola.orange.simauth.jar (I removed them from the BootClassPath because the JARs were missing, if you can find these two JARs add :kafdex.jar:com.motorola.orange.simauth.jar to the end of the above BootClassPath and put the two JARs in "_framework". Then I think you will be able to deodex every JAR and APK. Without them, most still seem to work though. (A number of the APKs in /system/app do not deodex properly. A little googling has shown me that motorola often neglect to include com.motorola.orange.simauth.jar on their phones [probably to try and stop deodexing] and this is the main problem)
EDIT: Try using this tool to mod your battery: http://forum.xda-developers.com/showthread.php?t=1434061
Use the deodexed SystemUI.apk along with the standard framework-res.apk, and download one of the 1% battery mods from that thread. I really don't think the rest of the system apps being odexed should cause an issue.

[Q] Question about odexing and deodexing etc.

I have an HTC Explorer, rooted on stock ROM (and I don't want to install a custom ROM). As it is a stock ROM, all the framework jars are odexed. Most system apps are also odexed. I am currently in the process of applying a little modification to framework.jar and SystemUI.apk. I have deodexed versions of both files (manually deodexed framework.jar, SystemUI.apk I downloaded deodexed).
Basically my question is this: If I replace the stock versions of these files with the deodexed files, will that cause problems? Do I need to re-odex them? Do I need to delete the corresponding .odex files from my phone for it to work (by my understanding, classes.dex from inside the jar/apk will be ignored if there is an odex file)?
[I have already replaced SystemUI.apk with the deodexed version, and the phone functions fine, but I have not deleted the .odex and I don't think there are any changes to the apk, so I don't know if the deodexed version is being "used" so to speak. I have also been told that deodexing just one jar from the framework folder will prevent the phone from booting, which I would rather avoid]

ICS deodexing script

Hey buds,Do anyone know of a deodexing script for ICS 4.0.3 to deodex samsung ICS roms???I'm in need of it for windows.I have searched but couldn't find anything for windows and specifically not for samsung
It's for an HTC phone, but it should work for any ICS ROM as far as I can tell: http://forum.xda-developers.com/showthread.php?t=1572266
(slightly modified version of AutoDEOTool, made to work with ICS apparently)
Usage is fairly straight forward, put all from /system/app in _apk and all from /system/framework in _framework, then run the .bat and choose option 2. Paste in the BootClassPath from your init.rc (you'll need to remove the /system/framework/ from the path of each jar to make it work, a simple search and replace in a text editor should take care of that without problems) and leave it running for a while.

Deodex - odex. Just one jar. Possible?

Hello. Lets assume I have odexed firmware. There's no trouble at all to deodex apk files without deodexing the whole rom.
But what if I want to deodex jar file (Android-telephony.jar), make some changes, then odex it and run normally changed code?
What are the requirements? Is it possible
Long ago it was possible via check summ replacement in hex editor.
But now there're oat files, arm64 folders...
Anyway, Is there a guide or something?
Thanks
Anyone

Categories

Resources