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.
Hello,
little background. i know my way around ROM installation (changing Kernels,modems, installing themes etc.) and read about how to use apk manager.
one of the things i still can't figure out, and seems to me like the next step is modifiyng themes.
i am currently using Perception 10.2, with stock theme. i really like the paragon basic theme + few more icons and items from phoneix and other themes.
i wend ahead and decompiled framework-res.apk from all the themes, and tried to copy over the images from the paragon drawable-hdpi folder to the same folder in Perception.
importent note, i know that there might be an issue with editing a .9.png file, but i assumed copying over a file that works in another rom is acceptable.
hope some of you are still with me.. here is the catch... tried to Compile the apk... and errors...
here is a parital log:
--------
|Sat 01/22/2011 -- 17:23:37.28|
--------------------------------------------------------------------------
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)
'adb' is not recognized as an internal or external command,
operable program or batch file.
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
libpng error: Read Error
ERROR: Failure processing PNG image Z:\F\kombinator work\android hack and hebrew\Developer\Tools\apk_manager_4.9\other\..\projects\framework-res.apk\res\drawable-hdpi\btn_zoom_down_disabled.9.png
libpng error: Read Error
ERROR: Failure processing PNG image Z:\F\kombinator work\android hack and hebrew\Developer\Tools\apk_manager_4.9\other\..\projects\framework-res.apk\res\drawable-hdpi\btn_zoom_down_disabled_focused.9.png
libpng error: Read Error
ERROR: Failure processing PNG image Z:\F\kombinator work\android hack and hebrew\Developer\Tools\apk_manager_4.9\other\..\projects\framework-res.apk\res\drawable-hdpi\btn_zoom_down_normal.9.png
libpng error: Read Error
ERROR: Failure processing PNG image Z:\F\kombinator work\android hack and hebrew\Developer\Tools\apk_manager_4.9\other\..\projects\framework-res.apk\res\drawable-hdpi\btn_zoom_down_pressed.9.png
libpng error: Read Error
ERROR: Failure processing PNG image Z:\F\kombinator work\android hack and hebrew\Developer\Tools\apk_manager_4.9\other\..\projects\framework-res.apk\res\drawable-hdpi\btn_zoom_down_selected.9.png
libpng error: Read Error
Click to expand...
Click to collapse
different error:
Z:\F\kombinator work\android hack and hebrew\Developer\Tools\apk_manager_4.9\other\..\projects\framework-res.apk\res\values\public.xml:3756: error: Public symbol drawable/zzzzz_tw_quickcontact_slider_grip_left declared here is not defined.
Z:\F\kombinator work\android hack and hebrew\Developer\Tools\apk_manager_4.9\other\..\projects\framework-res.apk\res\values\public.xml:3757: error: Public symbol drawable/zzzzz_tw_quickcontact_slider_grip_right declared here is not defined.
Click to expand...
Click to collapse
i hope someone can make sense out of this... i thought it would be a simple proccess, hope i did something wrong and it will be an easy fix...
Thank you so much for reading this far, your help will be appreciated!
Yossi
The problem you're having is with semi-transparent .9 files. The Android SDK png handler can't decompile them, so when you look at them in explorer they'll have a default image meaning they're corrupt.
The easiest way to deal with them is to not decompile and recompile.
PNG Only: With apk manager, take the original framework files from the ROM (or phone if stock) and drop them into place-apk-here-for-modding, then take the themed frameworks, rename them (something like framework-resParagon.apk) and drop those into place-apk-here-for-modding.
Select each one and extract (not decompile).
Open the drawable-hdpi folders side-by-side of the original and the theme, and drag (Copy) the ones you want to the original.
Then Zip the original and select System APK, and you're done. The reason this work is because the .9 files are still in their compiled state.
If you need to copy xml files, do this first, then the first step for png files: Decompile the two, copy the XML files, and recompile. Compiled XML files convert the png names to IDs which may be different between two roms. If you already have .9.png files that don't decompile, here's the fun part and I guess I'm doing all of this out of order, sorry...
Have an orginal apk decompiled with a different name, extract your modded apk, drag the drawable-hdpi out to say desktop, delete that project, decompile, drag the original decompiled drawable-hdpi into your modded one, and now you can edit/copy XML files and recompile. Then delete the project, extract, delete drawable-hdpi and drag the desktop drawable-hdpi to the project and zip it up. Done.
Or quick version.. 7zip helps.
right click the apk you want the images from, extract it.
right click open archive the apk you want the images in.
navage down to the folder that the images are stored in while in 7zip.
go back to the extracted folder and navagate down to the folder the images you want are in.
drag and drop them into the open archive 7zip window.
close archive
push
whiteguypl said:
Or quick version.. 7zip helps.
right click the apk you want the images from, extract it.
right click open archive the apk you want the images in.
navage down to the folder that the images are stored in while in 7zip.
go back to the extracted folder and navagate down to the folder the images you want are in.
drag and drop them into the open archive 7zip window.
close archive
push
Click to expand...
Click to collapse
CuriousTech said:
The problem you're having is with semi-transparent .9 files. The Android SDK png handler can't decompile them, so when you look at them in explorer they'll have a default image meaning they're corrupt.
The easiest way to deal with them is to not decompile and recompile.
PNG Only: With apk manager, take the original framework files from the ROM (or phone if stock) and drop them into place-apk-here-for-modding, then take the themed frameworks, rename them (something like framework-resParagon.apk) and drop those into place-apk-here-for-modding.
Select each one and extract (not decompile).
Open the drawable-hdpi folders side-by-side of the original and the theme, and drag (Copy) the ones you want to the original.
Then Zip the original and select System APK, and you're done. The reason this work is because the .9 files are still in their compiled state.
If you need to copy xml files, do this first, then the first step for png files: Decompile the two, copy the XML files, and recompile. Compiled XML files convert the png names to IDs which may be different between two roms. If you already have .9.png files that don't decompile, here's the fun part and I guess I'm doing all of this out of order, sorry...
Have an orginal apk decompiled with a different name, extract your modded apk, drag the drawable-hdpi out to say desktop, delete that project, decompile, drag the original decompiled drawable-hdpi into your modded one, and now you can edit/copy XML files and recompile. Then delete the project, extract, delete drawable-hdpi and drag the desktop drawable-hdpi to the project and zip it up. Done.
Click to expand...
Click to collapse
Thanks guys! i knew there should be a simple solution!
will try this soon. and post results!
Yossi
Also make sure to double check the sizes, the height and width my be different and give you issues if you copy and past the pngs
Sent from my SGH-I897 using XDA App
Also with 2.2.1 there's a problem with compressed apk files, so in apk manager, you need to set compression to 0. It's not a problem when dropping them into an apk with 7zip.
Different sized png files are usually the expanded notification bar switches. The darkness theme for example uses smaller ones. The size change is in twframework-res.apk/res/layout/status_bar_expanded.xml so those should be copied together (decompiled).
Another way to customize just 1 or a few .xml or .9.png files is to decompile the original, edit the xml or .9.png (with your modified one in mind), then compile. Then rip the compiled files from it and drop them into the themed one, assuming you already used the original the first time.
CuriousTech said:
Also with 2.2.1 there's a problem with compressed apk files, so in apk manager, you need to set compression to 0. It's not a problem when dropping them into an apk with 7zip.
Different sized png files are usually the expanded notification bar switches. The darkness theme for example uses smaller ones. The size change is in twframework-res.apk/res/layout/status_bar_expanded.xml so those should be copied together (decompiled).
Another way to customize just 1 or a few .xml or .9.png files is to decompile the original, edit the xml or .9.png (with your modified one in mind), then compile. Then rip the compiled files from it and drop them into the themed one, assuming you already used the original the first time.
Click to expand...
Click to collapse
so, double - checking that i understood...
method1: replacing images (same size) using copmpiled source and destination.
if i want to copy iver png's from one theme to another, i only decompress (or 7ZIP - open) the apk's - Replace the pics, and compress bacl (with compression set to 0).
method 2 : replacing images of different sizes
if the images are of different sizes, i should decompile both apk's, than i should copy the corrosponding XML from the new image's source, and drop in the original drawable directory, compile the apk, than copy over the image using method 1.
am i correct?
Thank you all for your help!!!
Yossi
In method 1, don't decompress it when using 7zip (or any other), just open the apk, drop the files in where they go, leaving the apk (zip) intact. If you extract the full apk, modify the files, and compress it back to a new apk it will lose the signature. That's what apk manager does when you zip it and select "system APK". It copies the signature from the original to the new one. Think of it like a zip comment. It's not a file, but a chunk of data attached to the zip that can't be copied from one zip to another.
Method 2: Too complicated. Just use method 1 to do as much as you can.
Whoever put the theme together originally did it incorrectly/lazily.
If you want to spend the time fixing it, then you need to decompile the same version of the .apk (the Samsung stock version, for example) and copypasta the themed one on top of it, while keeping the 1 pixel border.
One more question...or maybe two
when i decompile a framework-res.apk, i only get one drawable-hdpi folder.
if i open the apk using 7zip...i have a 2 folders: one is the same... and and another one that have this name: drawable-hdpi-v4
i replaced all the items i wanted in the drawable-hdpi folder..uploaded to the phone...and nothing happend... than i tried copying over some items to the drawable-hdpi-v4 foder..than i saw the changes.... the question is... do i have to copy the files to both follders? or just the drawable-hdpi-v4 folder?
another question tha poped into my mind right now, is it common that after i replace the framework-res.apk, my accounts data gets erased? (gmail account, facebook, etc)?
Thanks!
Yossi
Get the apktool in this thread and rename your old one just in case:
http://forum.xda-developers.com/showthread.php?t=864424&page=5
Oh, read the thread too. Good info!
The -v4 folders are higher resolution, or supposed to be. They take priority over the others, so if the image is only in drawable-hdpi it will be used, if it's in both the -v4 is used, or if it's only in -v4 it's used. I just leave the non-v4 alone, but it might save space to empty it, just scared to try.
You shouldn't lose account data though. That might indicate a problem. Not sure?
MikeyMike01 said:
Whoever put the theme together originally did it incorrectly/lazily.
Click to expand...
Click to collapse
I don't think the theme makers are to blame. Try decompiling a stock apk, then set the opacity of any .9.png to anything but 100%, draw9patch it again, then compile, then decompile and try to view that png. It's going to be damaged.
Well, it's actually easier to photoshop a compiled one, then remove the .9 and drop in draw9patch but you know what I mean.
I just don't think apktool can handle the extra info in a png.
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 guys,
im currently using netdrg`s sense theme http://forum.xda-developers.com/showthread.php?t=1048792
Now i changed all the green elements of the framework-res.apk to blue. Ive done everything so far, but i have no clue how to edit the color of the progress bar. (the bar when u change the volume, download something and so on...)
Ive heard that u have to edit an xml file, but as i have no clue about editing these files, i want to ask for a little favour.
Ive attached the xml file, and the color which i will use is 1761ab (hex).
So ill thank the guy who will do this for me a thousand times and i can share the theme with you afterwards!
lg l
In order to edit this xml file you need to decompile framework-res.apk. You can use apk_manager. Once the framework has been decompiled you can easily change the hex color for the progress bar (remember that the first 2 digit are for alpha channel). After that you need to recompile the framework. Actually there is another way to do that, but it‘s a bit triky as you need to modify the xmls file by using an hex editor..
If you want i can modify and compile the xml attached for you! Let me know m8
hey, thanks for your answer.
I put the framework-res.apk in the "place here for modding" folder, opened the script and hit 9 to decompile.
Then i edited all the values in the xml file in the "projects" folder and saved it.
Now i compile it, delete the file i edited in the "keep" folder and that other file mentioned.
Now i tried to apply the compiled framework_res.apk back to the system which results in a bootloop, what am i doin wrong?
soulcrash said:
hey, thanks for your answer.
I put the framework-res.apk in the "place here for modding" folder, opened the script and hit 9 to decompile.
Then i edited all the values in the xml file in the "projects" folder and saved it.
Now i compile it, delete the file i edited in the "keep" folder and that other file mentioned.
Now i tried to apply the compiled framework_res.apk back to the system which results in a bootloop, what am i doin wrong?
Click to expand...
Click to collapse
Ok, you are getting close to the solution
Once you got the unsignedframework.zip inside the place-apk-here-for-modding folder, you have to do a little trick in order to get it working...
Unzip all the content of the "unsignedframework-res.apk". You should have 5 objects (3 folders, 2 files).
Zip these files with Winrar/Winzip (whatever) but you must choose "No compression (store)" method to zip it.
Rename this zip into "framework-res.apk".
Put it into an update.zip and it should be OK to flash trough the recovery mode.
keep me updated
hi,
well i try it on systemui and framework-res.
With stock apk, i have no prob. decompiling and recompiling.
But if i change for example, an xml file for crt off in framework-res, and then recompile, (with suppressing of resources.arsc in keep folder of course), in the new apk i don't have the resource.arsc file.
i try on smali file too. I don't touch xml (so i let the resource.arsc in keep folder) but i modify a smali file. In the new apk, i have te resource.arcs but not the class.dex.
Anyone know why ? and how to resolve it ?
it happens as soon as i change a file. I am fed up with all of these. Help me please.
Thanks.