Deodex - odex. Just one jar. Possible? - Android Q&A, Help & Troubleshooting

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

Related

[Q] What is deodexed?

I run into this question and I have this question as well.
What is deodexed?
Apk files have respective odexes that devs use to supposedly save space. Deodexing means you convert it back to a .dex file and put it back inside the apk. This allows you to easily replace files (not having to worry about odexes), but the main point was to deodex services.jar so that you can change all text to different colors (such as the clock color to white) and to deodex services.jar, you need to deodex everything. this is not me talking its a quote from another site by the way

Recompling an apk questions

Trying to modify contacts.apk to make the dialer multi-dpi compatible. Did that and it works.
My issue is recompiling the apk. Everytime I recompile the apk with apktool it looses over a megabyte in size. In my case went from 4.49MB to 3.19MB after rebuilding. Only file modified was dialer_app.xml and it's size stayed about the same.
I've brought framework-res.apk and twframework.apk into apktool. After copying the resulting contacts.apk back to the device it is not recognized.
I've also tried copying the META-INF directory from the original apk over to the new one. Still no luck. I'm new to this and if anyone has some help for me it would be greatly appreciated!
Did you sign your new apk after recompiling it ?
Do you have classes.dex and resources.arsc files in your new apk ?
since its a system apk I've read it shouldn't be signed. Only thing I did was copy the META-INF folder to the new apk. In the new apk I do see classes.dex and resources.arsc. All the files appear to be there but the apk has shrunken in size.
I'm guessing I'm missing something simple here. But I'm new to this. Been at it for a few hours haven't had any luck.
I am new in development field. I have two questions 1. Is there same meaning for building and recompiling using apk tool? 2. I know framework-res.apk is needed for apktool d com, but where and the what is the use of twframework.apk file. Please explain anyone .
Recompiled apks will be quite a bit smaller as they will have more compression applied, this is normal, just be careful as if the tool compresses it to much you will get fc's. But it should work fine.
idhbar said:
I am new in development field. I have two questions 1. Is there same meaning for building and recompiling using apk tool? 2. I know framework-res.apk is needed for apktool d com, but where and the what is the use of twframework.apk file. Please explain anyone .
Click to expand...
Click to collapse
Read the apktool website for info about framework files, as far as which one to use, if you are decompiling a la2 or la4 base use a kl2 or kk5 framework without jkays built in as the laX frameworks are kinda buggy.
Sent from my GT-I9100 using Tapatalk

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]

[Q] deodexing and odexing back

I am trying to edit a smali file in the framework.odex file on my stock touchwiz rom.
I first deodexed it with baksmali.jar
I got the "out" folder containing the .smali files which I wanted to edit. Great! right??
Without touching anything in the "out" folder, I attempted to odex back as a test.
I did so using smali.jar and got a my new framework.odex file in the smali/baksmali folder as expected.
However, the output framework.odex file is slightly smaller than the original framework.odex file which makes no sense to me.
The output file caused the device to bootloop when I replaced the original framework.odex file on the device with the one output from smali.jar.
I cannot seem to get a straight explanation on how to do this properly. I do not want to deodex my entire rom when all I need is to change a couple values in the AudioService.smali of my odexed framework.jar.
Can someone please help me deodex this freaking framework.odex file and odex it back so it actually works on the phone. I know I am close and there is a simple step I am missing yet I cannot figure it out to save my life.
Please help!!!!
Cheers!
Mike

Categories

Resources