Please read this whole thing before you reply!
I am trying to edit the battery icon XML files in framework-res.apk. Awhile ago I found a tool that would convert from binary XML to human-readable XML and back again, but for the life of me I cannot find it again.
Anyway, I opened stat_sys_battery_charge.xml with it and all was good, except it mentioned weird names for filenames. Eg instead of 'res/drawable-hdpi/stat_sys_battery_0.png' it was '89845b4jrqyuq34gy34q89tyq34' (or some gibberish like that).
I understand everything up to this point. I understand why those names are encoded like that. What I don't understand is how people figure out these codes. I have been using someone elses framework-res.apk as my base, and they use "v4" folders. Eg 'drawable-hdpi-v4' instead of 'drawable-hdpi'. These filename codes in the XML value were generated for this V4 folder, correct? How did they do that?
I do not want to use a V4 folder in my theme if I can avoid it. If I have to, I still have a problem as to how to correctly point to my battery icons. And no I cannot just replace the PNGs because my changing icons have more frames than the stock XML allows.
Any help would be extremely appreciated. Thank you.
TheLynxy said:
Please read this whole thing before you reply!
I am trying to edit the battery icon XML files in framework-res.apk. Awhile ago I found a tool that would convert from binary XML to human-readable XML and back again, but for the life of me I cannot find it again.
Anyway, I opened stat_sys_battery_charge.xml with it and all was good, except it mentioned weird names for filenames. Eg instead of 'res/drawable-hdpi/stat_sys_battery_0.png' it was '89845b4jrqyuq34gy34q89tyq34' (or some gibberish like that).
I understand everything up to this point. I understand why those names are encoded like that. What I don't understand is how people figure out these codes. I have been using someone elses framework-res.apk as my base, and they use "v4" folders. Eg 'drawable-hdpi-v4' instead of 'drawable-hdpi'. These filename codes in the XML value were generated for this V4 folder, correct? How did they do that?
I do not want to use a V4 folder in my theme if I can avoid it. If I have to, I still have a problem as to how to correctly point to my battery icons. And no I cannot just replace the PNGs because my changing icons have more frames than the stock XML allows.
Any help would be extremely appreciated. Thank you.
Click to expand...
Click to collapse
Well I'm using apktool for decompiling and I'm also trying to add some icons so maybe the help Daneshm90 has given me can help you Apkmanager
EDIT: Lol you didn't even write you were trying to add icons It is seriously stuck to my brain xD
Does apktool let you change the paths for the filenames in XML files, and correctly re-encodes it when you compile it back? I have been trying desperately to get apktool to work for me, but it just refuses. I'll have to try it on another computer or perhaps a VM then.
If apktool does not correctly handle paths, is there any tool that can? From what I've read, its impossible, but there must be a way!
TheLynxy said:
Does apktool let you change the paths for the filenames in XML files, and correctly re-encodes it when you compile it back? I have been trying desperately to get apktool to work for me, but it just refuses. I'll have to try it on another computer or perhaps a VM then.
If apktool does not correctly handle paths, is there any tool that can? From what I've read, its impossible, but there must be a way!
Click to expand...
Click to collapse
What do you mean by "paths in XML files"? Apktool decompiles XMLs fully, so you could do everything that you could do with your own app/sources.
Related
Okay, i need a little help, I try to add a 9.png to a sample app in eclipse so i can export it and have it show up corectly, however i get this error everytime i move the file into a drawable folder-
Description Resource Path Location Type
Unparsed aapt error(s)! Check the console for output. com_example_android_softkeyboard Unknown Android ADT Problem
This also makes it so i cannot export the apk, I have been reading and searching for a long time, but have no success.
I've followed the thread on how to edit 9.pngs also found on xda but i seem to have a problem not mentioned.
Any Help?
Shooot, i thought i was in a diffreent section my bad! Please move this!
How many other .9.png's do you have in that drawable folder? I found that if I had too many in one of the sample apk's that it would not compile. I finally just started a new one, and it hasn't let me down.
I only add one extra 9png file into the folder along with the already existing files in the folder (its a sample fromthe 2.1 sdk)
That error usually means that you have more than two stretching points on either the top of left side of the .9.png borders. Anything over two seperate points will seriously cause errors and won't let you compile. Fix it. and it'll compile.
Because you are making an app its different if you have never used it before check out draw9patch.bat in the SDK tools im sure google android wiki has something on it.
Best way to mod .9.png's is to just use the orig image and copy and paste your new stuff over old. I have been working with alot of .9.png images and this is easiest way to get around problems.
If you continue to have issues try compiling what you have without your mods maybe its the project itself.
Hi, I am wondering how I would go about changing the colour of the progress bar (in downloads etc)?
I am pretty sure the setting resides in an .xml file within the "framework-res.apk" but I don't know which one needs changing or how to edit these files?
Any help would be much appreciated.
jpool81 said:
Hi, I am wondering how I would go about changing the colour of the progress bar (in downloads etc)?
I am pretty sure the setting resides in an .xml file within the "framework-res.apk" but I don't know which one needs changing or how to edit these files?
Any help would be much appreciated.
Click to expand...
Click to collapse
Not sure.. but i would think it was a .png-file actually
Thanks, but all the .png files I can see are just the progress bar containers. There are no coloured images there at all.
in BeHero+ (a 2.1 rom) it's found at:
framework-res.apk\res\drawable-mdpi\statusbar_background.png
Ah, no I am referring to the "progress bar" that you see when downloading a file from the Browser, not the status/notification bar. Or what you see in the Market when downloading a file. By default it's green.
jpool81 said:
Hi, I am wondering how I would go about changing the colour of the progress bar (in downloads etc)?
I am pretty sure the setting resides in an .xml file within the "framework-res.apk" but I don't know which one needs changing or how to edit these files?
Any help would be much appreciated.
Click to expand...
Click to collapse
It's in framework-res/res/drawable/progress_horizontal.xml
Use apktool to decompile and rebuild the files.
Cool, thanks
I'm having trouble using the apktool. I am on Windows but can't get the right command lines. To be fair I've not used this tool before so would appreciate some kind of "dummy" guide.
jpool81 said:
I'm having trouble using the apktool. I am on Windows but can't get the right command lines. To be fair I've not used this tool before so would appreciate some kind of "dummy" guide.
Click to expand...
Click to collapse
Code:
apktool.bat d -s framework-res.apk out
that will extract/decompile it to the folder out. There is however some issues when you try to rebuild framework-res again. What I do is put the altered files into a framework-res from a 1.5 rom, and rebuild it. That works. Command to rebuild is:
Code:
apktool.bat b out
Thank you. Will give it a go. Much appreciated
ok... status_bar_close_on_cust.9.png
i believe i have followed all the guides i have seen correctly. sorry. i've been stuck on this for almost 4 hours.
i opened the apk in 7zip, exported the image.
removed the 9 from the file name
edited the png in PS
opened draw9patch,
added the full bottom and right side lines.
added the 2 dots i need on top and made the leftside work after eclipse failure
did the eclipse project thing
pulled new status_bar_close_on_cust.9.png from the eclipse created apk
opened framework-res.apk in 7zip again
i tried both..
- deleting the original image and then adding the new to the archive
- drag-drop the new image thus replacing the original
resign the rom's zip
when i install on system i get the bootloop with each loop getting shorter.
i have tried converting framework-res.apk to a zip, resigning it, and then back to an apk
i know this is a much descussed subject on this forum and all the other's i googled looking for the missing step or something i'm doing wrong
i have tried apkmanager, apktools, shorter suggested methods i've seen, and full drawn out methods.
i dont know if i'm messing something up in the png edit, the draw9patch, eclipse, signing or not the apk, or somewhere else.
i've tried pulling a logcat/boot.log from the device but i get some sort of error. i dont know if it's not creating one or i'm trying to pull it from the wrong place.
i'm sure a ton of you guys have had this happen to you. please offer some advice
Do you get an error when importing into eclipse? If so what does it say?
im sorry shoulda clarified that. originally i failed to put the patches on the left side. it failed when trying to make the apk. put thos there and the apk was created. my proplem is with the framework-res.apk i guess.
i put it back in the rom, sign it, and boot-loops.
i guess it has something to do with adding the image to the framework-res.apk. apparently it doesnt like the new image, so to speak. i have tried finding out how to re-build the framework-res.apk, to no avail. hell, i may be using the wrong terminology when searching. at this point, i have no idea.
If i change any images i use metamorph, free from the market. You dont need to sign and flash full apk's, just the files that need changing, a lot quicker and easier.
You could create your ***.9.png as a full size png and remove the 9 patch data, eg. instead of having a 5x32.9png make it 320x32.png(depending on your resolution).
In fact come to think of it ive never seen the "status_bar_close_on_cust.9.png" on my screen, just "status_bar_close_on.9.png".
EDIT: If you've used apktool or other to decompile, crop the the edges by 1 pixel each side, this will remove the 9 patch data, edit your image, then use your draw9 tool, and recompile with eclipse.
You may have been adding another 1 pixel 9patch border to the already existing 9patch border, hope that makes sense.
this is the custom pull down notification bar in gingerfly-1.7.0 based on cm6.1 i believe with some gingerbread looks.
This is how I do it:
1. Extract image from framework-res.akp. You can right click on the framework > 7-zip > open archive and extract the image this way or just extract the whole apk.
2. Edit the image. Open the image in Photoshop and do what you want. Don't worry if you don't have the border. Save the image as a .png file.
3.Add the border. Open draw9patch and add the image. A border for the dots should be created automatically so just do what you need to do and save it as the same file name. It should automatically change the file type to .9.png.
4. Compile the image.9.png. Download the file attached. In the zip, you should see a file called 'xUltimate-d9pc' and a folder called 'Original'. Put the image into the folder 'drawable inside 'res' inside 'Original'. Then open the file named 'xUltimate-d9pc' and wait. When it has finished, there should be a new folder and inside should be the compiled image.
5. Replace the image in framework. Right click framework-res.apk > 7-zip > open archive. Drag the new image into the framework, make sure you have the same file name. You shouldn't need to sign it.
Now you should have a framework-res.apk working with no problem.
I'm not sure if it will work for a custom rom as I use the framework-res.apk from my X10
Hope this helps.
that worked! thanks much!!! the one step i did add to this is to re-sign the rom. i have had nothing but problems anytime i have not signed it after making any changes. it may be an un-needed step, but it worked. thanks again!!!
Can I bump this real quick?
This is my first post here and I'm sorry if I shouldn't bump this thread but my problem is closely related and I hope someone out there knows what I'm doing wrong.
First things first, I'm using the EVO, that's probably important information.
I just flashed Warm Z TwoPointTwo and I love it, except... I really want the vanilla lockscreen. No problem, right? Just rename or delete HtcLockScreen.apk and you're good to go.
That works, and the vanilla lock screen appears upon hot reboot, but the images aren't right; they are all transparent in Warm Z. I have been trying basically all day to get the stock images back into framework-res.apk and nothing has worked; I bootloop every time.
The images are jog_tab_* except that the images in MY framework-res.apk have for example jog_tab_bar_left_end_confirm_gray.png (for all of the left and right end confirm images), whereas the AOSP framework-res.apk has 9patches for all of those.
I've tried deleting the jog_tab_* images in mine and placing in the ones from AOSP, I've tried placing the AOSP images in alongside the ones already in my copy, but nothing works.
I've tried apktool, apk manager, xultimate... I've read about 25 xda threads on this and tried every new suggestion. It bootloops no matter what I do. I think I'm missing something.
I've done the 7zip replacement without re-signing, I've re-signed, I've done xultimate with compression 0, and I've tried creating my own metamorphs. Something about Warm Z is conflicting with the vanilla images, but I'm too inexperienced in themes and the Android OS to know what's up.
Perhaps Warm Z changes definitions elsewhere as to which images are used, or perhaps something else isn't lining up properly with the vanilla lockscreen code. I hope someone out there knows what on earth I'm talking about.
Can someone tell me where I can change the font of the notifications. They come out in black and don't go with my theme, I'd like to change them to white. Thanks
Also if someone can teach me how to get the words under the icons to show up (wifi, bluetooth, gps ... )
You'll be wanting to read how to theme, there are a few threads if you search. twframework-res.apk and framework-res.apk is what you'll be modifying.
Caution swyping! Read at your own risk.
cappysw10 said:
You'll be wanting to read how to theme, there are a few threads if you search. twframework-res.apk and framework-res.apk is what you'll be modifying.
Caution swyping! Read at your own risk.
Click to expand...
Click to collapse
Thanks, I've modified both those files with all the images I need in those two folders. I just need someone to point me to the right xml file that needs editing for these two questions (and if you'd be so kind to point me to where in the xml file even better), thanks
Can anybody help me out... Pleeaase?
Sent from my SAMSUNG-SGH-I897 using XDA App
I think this is what you're looking for
http://forum.xda-developers.com/showthread.php?t=1007221
CuriousTech said:
I think this is what you're looking for
http://forum.xda-developers.com/showthread.php?t=1007221
Click to expand...
Click to collapse
Ok that somewhat helped. I'm looking at the status_bar_expanded.xml file and the last three are already at #ffffffff for white (which is what I want) but my notifications are still coming up in black
I think that's in framework-res.apk/res/layout/status_bar_latest_event_content.xml
It looks like you're trying to change a heavily modified theme back to original. It would be easiest to look at a stock framework and use those values.
CuriousTech said:
I think that's in framework-res.apk/res/layout/status_bar_latest_event_content.xml
It looks like you're trying to change a heavily modified theme back to original. It would be easiest to look at a stock framework and use those values.
Click to expand...
Click to collapse
That should do it!
CuriousTech said:
I think that's in framework-res.apk/res/layout/status_bar_latest_event_content.xml
It looks like you're trying to change a heavily modified theme back to original. It would be easiest to look at a stock framework and use those values.
Click to expand...
Click to collapse
It's actually status_bar_expanded.xml. I need to change the color from ff000000 to ffffffff, that will change it from black to white. So I decompiled framework-res.apk using apk manager. I edited the file, then when I try to compile, I get an error, even if I answer Yes Yes to the two questions and delete the resources.arsc file plust the xml file I edited. It creates an unsigned package but it's much smaller than the original. What am I doing wrong?
I'd prefer to learn how to change the font color to white, however if anybody knows which is the image file for the background I can also just change that to a white or light color that is not transparent like the current one is
What errors are you getting when you compile it? Are you trying to mod a already moded theme? It is most likely .9.png errors that you are getting and they will need to be fixed before it will recompile. Also make sure you are using apktool 1.3.1 as the newer version is known to cause recompiling issues.
The backgrounds are in framework-res
status_bar_item_background_normal.9.png
status_bar_item_app_background_normal.9.png
One is the title "Ongoing..." I think. The associated "pressed" or for when pressed.
The most significant error is the first one. Usually the ones below that are caused by it. Because of the .9.png errors, I always make xml changes to the original unthemed APK, compile it, then pull the compiled xml files out and drop them into the themed one or keep a copy of the drawable-hdpi folder with all the modified .9s (compiled) and drop them into the new APK each time. It's a pain but works.
Thanks guys. framework was previously themed, I'm trying to add my own flavor into the mix. I'll check into the .9.png files when I get home and report back.
A better explanation is that .9.png files that have an opacity set won't decompile so they're corrupt. They'll show up in the error log or show as default (cone, box, sphere) thumbnails when viewing the folder. So when you recompile, those corrupt files will throw errors.
There are a lot of other ways to get around it like keep a copy of all the problem files, and drop the stock images in the apk before decompiling, then after compiling drop the modified ones back in.
If you need to edit them it can get confusing though. They need to remain the same image size. If they're compiled, take the .9 off before modifying in draw9patch so it will add the 1px border back before compiling. Then it's back to the correct size. And since those aren't corrupt, they'll compile fine.
Hey guys, this is gonna be kind of long so bear with me:
I'm running a Le Pan TC970 and we currently have root access, but no CWM or custom ROMS. It runs on Froyo 2.2 OS and as we all know, it's ugly as sin. I've successfully managed to use this framework-res replacement script (found here: http://forum.xda-developers.com/showthread.php?t=889963) to swap out icons galore and change the status bar and notification area to blacked-out colors. I'm trying to make a theme for our community, because I know I can't be the only one looking at this ugly OS and screaming.
Well the problem I'm having is really frustrating, the black notification bar looks great, however the notifications & clock are in black font. Therefore you can't see them with the new notif/status areas. I did some research and figured out you can change some color codes in the /layout/status_bar.xml file. But when I try to open it, it's all encrypted. I used APKTool to decompile and recompile it and it wasn't encrypted. I changed the #000000 to #FFFFFF. Then, flashed it using the script. This caused a massive boot loop and I couldn't power down the tab at all. Being impatient, with the help of a friend I figured out how to rip open the tab and pull the battery, allowing me to access the proprietary recovery & I reflashed the firmware and got back to stock.
I've tried pulling that file from other themes and just replacing it, I've tried decompiling & recompiling and editing the original file, I've tried everything I can think of and every solution I've searched for has lead me to endless boot loops when I try to screw with anything besides the icons & images in hdpi folder. This is the only stopping me from having a custom theme is the damn color code. Does ANYONE have any suggestions I can try?
I don't want to continue getting boot loops because each time I have to reflash the stock firmware, re-root, tiba restore to get my root tools back and it's a big fat pain in the A$$. We have no CWM or NANDROID capabilities, so this is really my only option. Before I throw this stupid thing, I thought I'd ask around XDA and see if someone knew the solution to my problem.
Thanks for any help
you should enable usb debugging and from then you can use adb
i you make backups of the file you might try pushing it back if the edit fails
however, you might want to take a look at this topic: [TUTORIAL] Where to find the colors for making a theme
hope this topic helps you
picard666 said:
you should enable usb debugging and from then you can use adb
i you make backups of the file you might try pushing it back if the edit fails
however, you might want to take a look at this topic: [TUTORIAL] Where to find the colors for making a theme
hope this topic helps you
Click to expand...
Click to collapse
I've read this thread a few times, I could be doing something completely wrong I'm not sure. But I've used APKTool to decompile and edit the font colors as that guide suggests and then recompile and it always ends in a bootloop. I have tried pushing the individual files with adb & that was a flop also. It's just this one stinkin' XML file giving me issues. I'll try re-reading that again and see if I did something wrong, thanks for the help
dbaybay said:
I've read this thread a few times, I could be doing something completely wrong I'm not sure. But I've used APKTool to decompile and edit the font colors as that guide suggests and then recompile and it always ends in a bootloop. I have tried pushing the individual files with adb & that was a flop also. It's just this one stinkin' XML file giving me issues. I'll try re-reading that again and see if I did something wrong, thanks for the help
Click to expand...
Click to collapse
color is 8-digit number: AAEEGGBB, where AA is alpha value (or transparency, where FF is the least transparent and 00 is fully transparent), and RRGGBB is the color code in RGB hex (in the OP you wrote 6digit colors, so i'm not sure if you used those in the xml or the proper format, because using 6digit colors might be a cause of bootloop)
picard666 said:
color is 8-digit number: AAEEGGBB, where AA is alpha value (or transparency, where FF is the least transparent and 00 is fully transparent), and RRGGBB is the color code in RGB hex (in the OP you wrote 6digit colors, so i'm not sure if you used those in the xml or the proper format, because using 6digit colors might be a cause of bootloop)
Click to expand...
Click to collapse
Yeah, I meant it that way, sorry. Once the XML file was viewable in Notepad++ (it was encrypted until I used APKTool) I noticed it said "FF000000" and I wanted it white, so I replaced only the "000000" with white, leaving it exactly "FFFFFFFF".
I also tried swapping out that file with files from other themes that already had white text. Every time results in a boot loop. I'm not sure if the files for my tab are proprietary but when I edited it myself and recompiled I just don't get why it wouldn't work.
In some of the research I've been doing, I stumbled across this thread - http://forum.xda-developers.com/archive/index.php/t-1060199.html - which states that if you edit and XML file you must delete the resources.arsc so it knows to create a new one reflecting the changes.
I'm using APKTool to decompile the framework.res.apk file and once it's decompiled "resources.arsc" isn't there. It only shows back up once I recompile the framework-res.apk.
Can someone give me a lead as to if this is true and if so, how to do it properly?
try apkmanager
picard666 said:
try apkmanager
Click to expand...
Click to collapse
Tried this out, decompiled, edited, compiled, signed, flashed. Still got the bootloop and fried my 16GB microSD card. Flashed the same file several times now with no problems besides the bootloop, so this is the only thing I can accuse of frying my SD card.
Sigh. I give up at this point.