So, I've successfully (I think) modded my own SystemUI.apk to simply just get rid of the hideous VZW 4G LTE in the notification bar. I've watched videos, read threads old and new, and still don't know for sure if I'm doing everything correctly. Not just whether I'm doing it correctly, but If I'm over doing things.
My understanding is that stock is odex. And everywhere I've read is the first step is to deodex. So I learned baksmali and deodexed SystemUI.odex. Realized nothing of these smali files needed modding for my intention, so smali'd back to the classes.dex file.
I then used apktool to decompile SystemUI.apk. Herein lies my first confusion. SystemUI.apk already contains the same classes.dex file that I deodexed in the first step above. Why is the same coding in two separate places? If it was actually an odex file structure, wouldn't SystemUI.odex only contain these files? And SystemUI.apk be absent of the classes.dex?
So I then changed the flags necessary in the bools.xml file and made some changes to the pngs to accomplish my task. Used apktool again to compile, and had my freshly and simply modded SystemUI.apk. No issues on the phone at all.
Is there anything that needs to be done after the compile? Is using the zipalign tool necessary? The only reason I ask is that when I do the check on my modded SystemUI.apk, I get errors. When I run the -f command, things get "fixed" and a second verification checks out.
Second, if the system is truly odex, do I need to odex and create a new SystemUI.odex file to "match" SystemUI.apk? Despite the fact that no coding was modified in classes.dex? I used the Auto Odexer Script to accomplish this for grins. It spit out a new SystemUI.apk and SystemUI.odex.
All three of scenarios above worked (recompiled SystemUI, zipaligned SystemUI, and odexed SystemUI). But which is the correct way?
Related
hi guys,
i am looking for way to easily "combine" multiple same jar files.
one example: i want to use 2-3 mods which are in services.jar but when i overwrite this file with another services.jar in /system/framework i always have only one mod logically.
so i can't use "trackball notification", "battery percent" and "browser mod" together.
i found way how to do but it's not easy. i unpacked jar and got classes.dex which i dedexed with baksmali and got many smali files then i combine the changed files from all mods and combine them via smali back to dex file and pack them back in jar file.
is there easier way to do it?
Use the diff command, using logical attributes (otherwise as soon as you see some new code, the rest that follows may make you believe there is something new)
And write your own Jar file
then post it back up here for us all to use; including the mods you've installed...
Mostly, though, I would say this belongs in a different forum
houmles said:
hi guys,
i am looking for way to easily "combine" multiple same jar files.
one example: i want to use 2-3 mods which are in services.jar but when i overwrite this file with another services.jar in /system/framework i always have only one mod logically.
so i can't use "trackball notification", "battery percent" and "browser mod" together.
i found way how to do but it's not easy. i unpacked jar and got classes.dex which i dedexed with baksmali and got many smali files then i combine the changed files from all mods and combine them via smali back to dex file and pack them back in jar file.
is there easier way to do it?
Click to expand...
Click to collapse
Your only other option would be to download the aosp source and compile the changes in yourself. Most of these changes are already in cyanogen's latest github.
The browser one is the only one i'm not sure of
Wasssup fellas! Ok so I'm no themer but I've started to delve into your world a little bit. I'm looking to draw on the experience of any of you that have successfully modified the Rosie. So here's my set up
I've got Apktool set up in Ubuntu before you ask I downloaded 1.3.1 not 1.3.2
I have all the dependencies in place
I've installed the framework (apktool if com.htc.resources.apk)
Rosie.apk decompiles with no errors (apktool d Rosie.apk out)
I've modified /res/values/colors.xml to add transparency to the app drawer? (This may be my issue)
Compiled (cd out/ .......apktool b) compiles with no errors
I've tried this signing Rosie.apk, Not signing it, Copying out the "Res" and "Resource" file and going into the original Rosie.apk with Ark Manager without extracting the archive and dropped in the "Res and "Resource" files.
Same result each time when I push the file via ADB or put it in a flashable zip the phone boots goes through the animation capacitive keys light up then the phone gets stuck on the last frame of the boot animation and just hangs there forever no boot loops just hangs there?
Any help would be more than appreciated, thanks guys!
Lou
(Bumping this)
After you've pushed the .apk - Type "adb logcat" and post it here.
I have been struggling with her too but I think I cracked her Just compile it again then use WinRAR (or whatever you're using) and take classes.dex from the newly compiled Rosie.apk and put the new classes.dex in the old Rosie.apk and then you should be fine. Ofc if you had modified some PNGs you would just take the res folder too
BTW could you tell me what to edit to get the transparent app drawer?
Bump. Did you ever get this working. I have been missing with Rosie.apk for about a week now. I am able to decompile, recompile and push without any errors. But non of my changes seem to take place.
sednafx said:
Bump. Did you ever get this working. I have been missing with Rosie.apk for about a week now. I am able to decompile, recompile and push without any errors. But non of my changes seem to take place.
Click to expand...
Click to collapse
I read somewhere that you also have to apply some changes to fusion.apk
If I can find the guide for this, I'll link it.
Hi,
i'am searching for a guide how to manipulate correctly the framework-res.apk.
All ways i have tested fails.
I would modify some symbols in Notification bar (battery 1%) but all Time the my Phone run into bootloop or all Application Crashes after Startup.
I've tryed Apk Manager 4.9 / and Manualy with apktool.
Help plz .....
what i did :
1-extract apk (i use 7zip/WinRAR)
2-edit/replace image file(s)
3-repack with zero compression level ('store' level)
4-sign the apk
5-replace file using apk or create flashable recovery zip.
regards.
signing the framework-res.apk will not work.. will make the device go into bootloop
what you need is extract the framework-res.apk using apktool and edit the things you want and then compile it again using apktool .... now open the original framework-res.apk and replace the file resources.arsc with the edited compiled one..
this way you will retain the signature of the original framework-res.apk
PapaDocta said:
signing the framework-res.apk will not work.. will make the device go into bootloop
what you need is extract the framework-res.apk using apktool and edit the things you want and then compile it again using apktool .... now open the original framework-res.apk and replace the file resources.arsc with the edited compiled one..
this way you will retain the signature of the original framework-res.apk
Click to expand...
Click to collapse
But when i add some new Files and Edit some XML the Sign will be Corrupted ?
no it won't...
You need to do two copies.. the original file and the moded one...
1. make a backup of the original file
2. extract the original file using apktool
3. edit and modify anything you like
4. compile the edited file
5. rename the compiled file to framework-res.zip and take the modified resources.arsc
6. using winrar or 7zip open (to view not extract) the backed up framework-res.apk
7. place the moded resources.arsc into the backed up framework-res.apk
by doing this you retain the original signature of the backed up file and not breaking it..
Thx, will test it ;-)
kowalski99 said:
But when i add some new Files and Edit some XML the Sign will be Corrupted ?
Click to expand...
Click to collapse
Android system, signs system apk's on boot, you shouldnt sign them
Sent from my Desire HD using Tapatalk
My signed apk just work well.
AFAIK, we only cant re-sign htc's apk.
PapaDocta said:
signing the framework-res.apk will not work.. will make the device go into bootloop
what you need is extract the framework-res.apk using apktool and edit the things you want and then compile it again using apktool .... now open the original framework-res.apk and replace the file resources.arsc with the edited compiled one..
this way you will retain the signature of the original framework-res.apk
Click to expand...
Click to collapse
The right approach always depends, what you want to change. There is no need to decompile, if you only change a few standard png. If you change xml in values folder like color, styles or arrays, you can certainly not delete resources.arsc - resources have nothing to do with the signature anyway. So if you want to play safe, you should insert the original Meta-Inf (signature) and Android Manifest after compile. It is also recommended to zipalign the final apk in order to reduce RAM usage.
thanks he_stheone64 for the clarification.. i reached that conclusion based on my own research on the net and yeah i used to change the XML files to add language support and that the only way that worked with me..
And be sure to have a working and up-to-date sdk before trying to use apktool...
First, using a old sdk release i got a partially working result (few graphics bugs and strange reboots), then with a badly updated sdk on top off the old i got apktool making many errors. Finally, re-installing the last sdk from start i got apktool and my resulting apk working correctly.
NOTE: If you want to edit framework-res.apk or systemui.apk, follow this guide, it's the best available:good:
http://forum.xda-developers.com/showthread.php?t=2086771
Now, lets start
smali, dex....whaaat?
It's simple our odexed ROMs have .apk which use .odex files which contain cache. When the ROM is deodexed the .apk contains classes.dex which now contains information present in the .odex files!:good:
Smali is nothing but disassembled .dex file! The .dex file is disassembled into java code which can be edited via Notepad ++( simple notepad works too)
WHY?
Why do you need to edit classes.dex !
For me, i was trying to make CRT on/off animation which required editing classes.dex in service.jar!
More edits where classes.dex inside services.jar is needed
- Changing status bar clock color
- Changing text color in notification bar
- More? Tell Me!:highfive:
HOW?
Requirements: Java SDK!
I have APK Multi Tool, although it decompiles .apk and .dex files inside the apk, it doesn't provide option to decompile a separate classes.dex!
Still it's best software for decompiling apks and more!
Smali-Me 1.0
Download and Instructions:
http://www.wrapcode.com/android/baksmali-smali-dex-files/
ROM Tools by iamareebjamal - More noob friendly
http://forum.xda-developers.com/showthread.php?t=2163286
Once you have decompiled classes.dex, you'll get various folder with various files. Edit the files required and then recompile!
So after generating new classes.dex, put it back to services.jar by opening the file in winzip!:good:
ONE MORE THING
Make your own flashable zip
The recompiled systemui.apk or framework-res.apk, when pushed via root explorer give lot of force closes. This is normal, however if u wish to avoid it u can create a cwm flashable zip for the same!:good:
I'm attaching the sample.zip here and u can add your files in the specified folders. For more details read the source forum:
http://forum.xda-developers.com/showthread.php?t=1721680
Reserved- for more stuff!
Subscribed.. will see what it is later
Hey, add this to your guide, i far more easier and nice to look at too than smali me
http://forum.xda-developers.com/showthread.php?p=40435351#post40435351
This guide we will use systemui as an example for deodexing.
Download androblacks apktool below. Install.
Open apk and update it when prompted. go into settings. Make sure you tick "root" option at the bottom. Close the app.
Use any root file browser and create a folder on SD card called "apktool."
Go into system/privapp and copy over systemUI.apk and systemui.odex into apktool folder on SD card. Go back to system/framework and Copy over framework-res.apk to apktool folder on SD card.
Open apktool app and click on internal storage. Select apktool folder. Click on framework-res and in select install as framework. When its done select systemui.apk and also install as framework.
Once completed click on systemui.odex and select decompile for android N. When finished long press on the decompiled odex folder and select recompile. It will create a systemui.dex file. Click on the systemui.dex file and select "add to apk" option. The dex file will now be added to the original systemui.apk. to make sure it worked click on the apk file in your root browser and select view, inside you will see a classes.dex file. Use apktool to now decompile the original systemui.apk and you will now have a decompiled smali folder.
I used this method to deodex my systemui in order to make the necessary mods for 3minit battery mod.
Link to andro Black's apktool:
https://www.androidfilehost.com/?fid=817550096634742560
Hi thanks for sharing this. It seems really cool but when would this be needed? Is this supposed to be for odexed roms and what does deodexing really do anyway? Or is this just because it's possible. Thanks
Odexed applications cannot be decompiled and edited to the same level that a deodexed application can. I'm not going to go into the detailed differences between odex/deodex, a simple google search will clear that up. Odex apks are bifurcated, with odex file containing optimized code readily available for the system to use.
Anyone wishing to modify an apk, especially theming, will need to deal with deodexed files, no odex.
Pain-N-Panic said:
Odexed applications cannot be decompiled and edited to the same level that a deodexed application can. I'm not going to go into the detailed differences between odex/deodex, a simple google search will clear that up. Odex apks are bifurcated, with odex file containing optimized code readily available for the system to use.
Anyone wishing to modify an apk, especially theming, will need to deal with deodexed files, no odex.
Click to expand...
Click to collapse
Oh okay that makes sense whenever I've modified apks they've been deodexed but I've never really looked at odexed files as I'm always on a custom ROM. Thanks
Sorry for noobish questions. When finished do you recompile the SystemUi_src? Also if doing other apps do you need to install each apk as framework? The system/framework only gets done once, but if moving on to others do I need to delete the other apk that was installed as framework?
Delete