Hi!
what i try to do is to make my battery icon increase in 1% or 5% increments.
i got my icons and stat_sys_battery.xml from the "HTC Desire" post below
http://208.100.42.21/showthread.php?t=724778
however, after a few days trying it, i found i couldn't just drag and drop the icons to the "drawable-hdpi" folder and also not the XML files to the "drawable" folder.
"i think" this is because my OWN original XML files are all compiled and the XML copy from the HTC Desire post haven't compile, so when i replace the XML files it doesn't know how to locate the new battery PNGs
then further reading i found out "Apktool" which allows me to decompile the framework-res.apk so i can edit the XMLs
now ... my question is when i compile the folder i have the error:
w: could not find sources
i guess it's obvious that it can't find my folder ... so what the command so be?
the decompile folder is c:\apktool\test2
my compile command is apktool b test2
please help ... please explain a bit more your reply ... i am not a programmer/developer ... thanks.
kakyoin said:
Hi!
what i try to do is to make my battery icon increase in 1% or 5% increments.
i got my icons and stat_sys_battery.xml from the "HTC Desire" post below
http://208.100.42.21/showthread.php?t=724778
however, after a few days trying it, i found i couldn't just drag and drop the icons to the "drawable-hdpi" folder and also not the XML files to the "drawable" folder.
"i think" this is because my OWN original XML files are all compiled and the XML copy from the HTC Desire post haven't compile, so when i replace the XML files it doesn't know how to locate the new battery PNGs
then further reading i found out "Apktool" which allows me to decompile the framework-res.apk so i can edit the XMLs
now ... my question is when i compile the folder i have the error:
w: could not find sources
i guess it's obvious that it can't find my folder ... so what the command so be?
the decompile folder is c:\apktool\test2
my compile command is apktool b test2
please help ... please explain a bit more your reply ... i am not a programmer/developer ... thanks.
Click to expand...
Click to collapse
Im not exactly sure what errors you're getting... But heres two things that might help.
1. If you're using an already themed framework-res.apk to decompile/edit/recompile, don't. Apk Tool needs a clean version of your framework-res.apk. So use a clean version, decompile it, edit your xml, recompile, and finally copy/extract the edited xml file and put it into the framework-res.apk of your choosing.
2. Side Note: Sometimes Apk Tool will say something like "resources could not be found". I believe this is because apk tool tries to reverse engineer the apk to source, which it can't exactly do without all of the java resource files that was used to compile the apk. For XML files however, apk tool is sufficient.
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.
Hi everyone. I have experienced about bootloop after recompiled framework-res.apk that based from Latest firmware 9.1.A.1.140. I'm trying to decompile framework-res, then I used apktool and Install both frameworks ( framework-res.apk and semcgenericuxpres.apk ) then, I decompiled. After that, I EDITED SOME XMLS LIKE STRING.XML. AFTER THAT I RECOMPILED AND GOT SUCCESS. THEN I TOOK resources.arsc from modded FW and I copied into original framework-res.apk ( compression normal ). Then I copied into SD card. I wiped cache and dalvik then Install it. After I installed, I got BOOTLOOP
PLEASE ANY SOLUTION !!
We can't edit framework-res at the moment.
http://forum.xda-developers.com/showthread.php?t=2105685
Only way is binary editing, and that's complicated.
NuriJ said:
We can't edit framework-res at the moment.
http://forum.xda-developers.com/showthread.php?t=2105685
Only way is binary editing, and that's complicated.
Click to expand...
Click to collapse
MMM.. is that another way ?
Hi guys! Ive been trying to do some jpg changes i framework file but somehow i cannot add files into framework-res.apk
I used 7zip which wouldnt let me copy files out or into the framework-res.apk showing an error.
Next i used WinRAR which allows me to copy files out of the framework-res.apk but wouldnt let me copy files into the framework-res.apk. It syas the file is corrupt.
I even tried apktool. Had problems recompiling. Please help me out guys!
Hello everyone!
I'm using an Xperia SP with ViperOS (Android 7.1.2) and wanted to patch Framework.jar with some smali files to port Xperia stock camera for AOSP. I successfully decompiled my classes.dex file which found within the framework.jar, and I replaced the necessary files in order to patch that framework which is in the attached file. (storagemanager.zip). But when recompiling with smali it gives me following error.
Code:
UNEXPECTED TOP-LEVEL EXCEPTION:
org.jf.util.ExceptionWithContext: Unsigned short value out of range: 65537
at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116)
at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:329)
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1027)
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:803)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:252)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:230)
at org.jf.smali.main.run(main.java:176)
at org.jf.smali.main.main(main.java:265)
I tried with many smali.jar versions but no help. So I think to upload my classes.dex file and the files I need to replace with files (storagemanager.zip) after decompiling classes.dex. Files should be copied to android\os\storage which get after doing baksmali for classes.dex.
If anyone can successfully patch my classes.dex I would really appreciate.
Thanks in advance