yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] Madala_ZA:
How are you modding the .9.png's? In PS or GIMP etc you must not mod the outer border of 1 pixel. I mean, you can open any .9.png in an image editor, make your mod within the 1 pixel border and save over the original .9.png and it should work fine. That's what I do (using APK Manager). I have no issues. There's other ways to edit .9.pngs using the SDK. But I use the image editor way, I find it much easier. I'm sure other members will add more methods also..
[G1 Android Development] dreamsforgotten:
Use the app draw9patch to re draw the lines when you are done then run the edited draw 9 images through eclipse to compile it. My guide in the signature will show that done in steps. The first 4-5 post in it are all different guides
[G1 Android Development] Jwtiyar:
thanks ,doesnt work
[G1 Android Development] MongooseHelix:
As you found out root explorer and then ftp/emailing/mounting sdcard works also. If you want to use the adb pull option sometime, the phone doesn't need to be in fastboot or any special mode. Just have it connected to the PC, have usb debugging enabled on the phone, and have adb set up and the sdk's platform-tools directory in your path. You can check in a cmd prompt if adb is working by running the command "adb devices". It should list your device...mine shows "HT9AZHG18407 device".

As for the error, I mostly use apktool itself since my main comp is a Mac but I tried using option 10 on my Windows machine and got the same error. I then looked at the Script.bat code and figured out why it is happening. The framework-res.apk is actually getting "installed" by apktool at C:/Users/%USER_NAME%/apktool/framework/1.apk but it then checks to see if 2.apk exists and since it doesn't, the error is thrown.

The easiest fix for this is to just remove the check as it's not really needed anyways. Using an editor like Notepad++, open up your Script.bat, press ctrl+f to find "apktool\framework\2.apk", then remove that line down until the "echo Decompiling Apk" line, save & close the file, then run this modified Script.bat file. After selecting SystemUI.apk as the project, running option 10 should work when you point it to the framework-res.apk file. It did for me at least.
[G1 Android Development] MongooseHelix:
To understand what nine-patch(.9.png) images are, you can read about them here. Their purpose is to resize automatically depending on their container/view and still have the same look. To do this, borders are drawn around it to define which regions of the png to stretch. As quantumtraveler & dreamsforgotten have pointed out, you can edit or create these carefully using an editor like gimp or photoshop or by using the SDK's draw9patch tool.
[G1 Android Development] c010:
anybody can help? i have no issue with my desktop but not sure what went wrong with my laptop.
[G1 Android Development] MongooseHelix:
You need to upgrade java to version 1.6. Once you do that it shouldn't give that error.
[G1 Android Development] TheNewGuy:
Thank you for your help. (And others) I am making my way thru the guide and i believe this is what I was looking for. Thank You! I am still getting to know eclipse/draw9patch.... but I have been wanting a good reason to learn eclipse anyway! :) after following the guide on my first attempt I have gotten an error when exporting from eclipse. If I can't figure it out on my own I will post back....

Thanks again for your time.
[G1 Android Development] dreamsforgotten:
Np keep in touch if there is an x next to the image when you add it in eclipse it won't export, its telling you the patch is bad
[G1 Android Development] TheNewGuy:
Ok.. i think that I have successfully used draw9patch to remake the border.... and successfully used eclipse to decompile the image.... however when I extract the image from the apk that eclipse made, and put that in the projects folder.... i still get an error with apk_manager when I try to recompile.

First I have verified that the problem is this single 9.png... if I replace it with the stock version then apk_manager finishes successfully.

So I have a couple follow up questions....

First. When using draw9patch... does the border have to be complete? The program does not seem to allow me to place a pixel in the corners... i have made a line for each side. But it won't let me put a pixel in the very corner... and it looks like it would make the border incomplete... is this the problem? How do I fix it?

Secondly... when saving using draw9patch I don't see any confirmation... is that normal... if I had not saved correctly would eclipse work at the next step?

Third.... when I have a recompiled.apk made from eclipse, what should I do with that image? Do I need to inject it into a framework-res.apk so that apk_manager can decompile it... then recompile.... or do I extract it from the apk and put it in the projects folder as i already tried? I am trying to diagnose were I went wrong.. i know it must be something simple that I have not done correctly....

Thanks again for your time.
[G1 Android Development] dreamsforgotten:
Two things to remember. Draw 9 patch will not allow you a border work a gap in it. This means the line has to be solid regardless of the length. Also when you are done copy this image in framework-res only after you have recompiled it. Apk manager errors when you mod a stock image almost as if it knows the precise file size because minute changes get noticed
[G1 Android Development] TheNewGuy:
Thanks again for the reply..

It appears my only problem was trying to recompile with apk_manager... the image I had is already compiled with eclipse...and must be decompiled again with apk_manager before apk_manager can recompile it....

If I inject my modded and border corrected/compiled 9.png into my framework-res.apk, i can now decompile/recompile with apk_manager without any errors! YAY

This is what I was trying to do. I really want to be able to put my theme in my source code so that when I compile a new ROM my theme and personal modifications and already installed.

So I was using "recompiling" with apk_manager as a tool to figure out what needs to be fixed for it to work at the time of compiling the ROM.

Fwiw I guess the "gap" at the corners is not a gap at all.... just me not discribing it correctly. I never saw an "X" in eclipse...

So thanks again for your help and your excellent guides.. i will shoot some help points your way! :)

Now on to the tedious job of doing this procedure with each of like 50. 9.Png's!

One parting question... can I compile more than one image at a time with eclipse? If I correct the borders of several images using draw9patch, can I put them all in the drawable folder in eclipse and export the whole lot at once? That could save start least some time....

Thanks again.
[G1 Android Development] dreamsforgotten:
No problem any time and yes you can do 100 images if there is no x next any of them. Glad you where you need to be!
[G1 Android Development] chubbzlou:
This helped me with the same error http://xdaforums.com/showpost.php?p=9543972&postcount=792.
[G1 Android Development] Jwtiyar:
thanks i installed sox also .
[G1 Android Development] flonec:
hi

apk manager 4.9 no worki

log.txt

java version "1.6.0_26"

Java(TM) SE Runtime Environment (build 1.6.0_26-b03)

Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

'adb' is not recognized as an internal or external command,

operable program or batch file

I do not know... someone help me.. thank
[G1 Android Development] Jwtiyar:
any help plaz??

thanks.
[G1 Android Development] xrabbitfootx:
sorry, i'm kind of new to this and am getting an error when compiling a gingerbread framework-res.apk. (i'm making my way through code.google.com/p/android-apktool/ )

- android sdk installed

- gingerbread framework-res.apk renamed to 1.apk in C:\Users\Owner\apktool\framework

here's the error:

java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
libpng error: Read Error
ERROR: Failure processing PNG image C:\Users\Owner\Documents\droYd\apk_manager_4.9\other\..\projects\PEGBv6-framework-res.apk\res\drawable-hdpi\btn_toggle_on.9.png
libpng error: Read Error

...

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Owner\AppData\Local\Temp\APKTOOL8182787043912330880.tmp, -x, -S, C:\Users\Owner\Documents\droYd\apk_manager_4.9\other\..\projects\PEGBv6-framework-res.apk\res, -M, C:\Users\Owner\Documents\droYd\apk_manager_4.9\other\..\projects\PEGBv6-framework-res.apk\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:174)
at brut.apktool.Main.main(Main.java:59)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Owner\AppData\Local\Temp\APKTOOL8182787043912330880.tmp, -x, -S, C:\Users\Owner\Documents\droYd\apk_manager_4.9\other\..\projects\PEGBv6-framework-res.apk\res, -M, C:\Users\Owner\Documents\droYd\apk_manager_4.9\other\..\projects\PEGBv6-framework-res.apk\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more

any help is greatly appreciated,

best,

rf
[G1 Android Development] dreamsforgotten:
A bad .9.png for button toggle on copy the original image into your drawable folder.
[G1 Android Development] dreamsforgotten:
Download the android sdk, search how to set it up, how to upgrade your platform tools folder and add that folder to your path. The guide in my signature explains the steps I think post number 2
[G1 Android Development] xrabbitfootx:
dreamsforgotten, thank you for the quick response!

the code i posted was shortened. it looks like every single .9.png threw an error. do you, or anybody, know why that happened?

i'll re-copy the .9.png's to the drawable-hdpi folder. (still making my way through the code.google.com/p/android-apktool/ and your theming guide) *edit* i re-copied them in. no dice. :(

best,

rf
[G1 Android Development] TheNewGuy:
You need to download a stock version of the framework-res.apk you are trying to decompile... pull all the .9.png's from that stock framework-res.apk....then inject them into the themed framework-res.apk you are trying to decompile....then when you try to decompile using apk_manager it should work..

Why did this happen? A lot of people don't know that when you moddify a .9.png with gimp or photo shop it will still work when injected into the rom...but it is not right...it needs to have the 1 pixle border corrected using "draw9patch" then recompiled using eclipse....then if you inject it into the framework-res.apk it is actually proper...like a stock version...

Dreamsforgotten has some guides in his sig that will tell you how to do all this....I am using them myself right now!
[G1 Android Development] CleveRuse:
Ive asked one of these questions before but didn't really get an answer. Well first, Does any one know how to get around the error in Linux where u can't use the draw9patch app in the SDK, due the draw9patch.jar not being found? Cuz its certainly in there.

Or does anyone know of a Linux substitute for Xultimates? Like I said, I already got an answer (no), kinda, on that but maybe someone else knows of one.
[G1 Android Development] xrabbitfootx:
pardon my noobness :) that worked! :)

i didn't think i'd have to do that because i hadn't altered any .9.png's. the ones i did i used draw9patch. i guess i messed up somewhere. thank you!

best,

rf
[G1 Android Development] Mjuksel:
could someone compile a file for me, since i cant get it to work :( ?

or maybe anyone that can explain me this error ?

--------------------------------------------------------------------------
|vr 08-07-2011 -- 21:41:37,18|
--------------------------------------------------------------------------
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
--------------------------------------------------------------------------
|vr 08-07-2011 -- 21:42:03,37|
--------------------------------------------------------------------------
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
C:\apk_manager_4.9\other\..\projects\framework-res.apk\res\layout\status_bar_expanded.xml:5: error: Error parsing XML: duplicate attribute
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Mjuksel\AppData\Local\Temp\APKTOOL4554741090717303056.tmp, -x, -S, C:\apk_manager_4.9\other\..\projects\framework-res.apk\res, -M, C:\apk_manager_4.9\other\..\projects\framework-res.apk\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(Unknown Source)
at brut.androlib.Androlib.buildResourcesFull(Unknown Source)
at brut.androlib.Androlib.buildResources(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.apktool.Main.cmdBuild(Unknown Source)
at brut.apktool.Main.main(Unknown Source)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Mjuksel\AppData\Local\Temp\APKTOOL4554741090717303056.tmp, -x, -S, C:\apk_manager_4.9\other\..\projects\framework-res.apk\res, -M, C:\apk_manager_4.9\other\..\projects\framework-res.apk\AndroidManifest.xml]
at brut.util.OS.exec(Unknown Source)
... 7 more
[G1 Android Development] Jwtiyar:
after downloading r12 SDK the problem solved ,thanks.
[G1 Android Development] Mjuksel:
can somebody help me with APK Manager ?

decompiling is easy breasy, but when coming to compile the apk i get an error :(

took framework from something i cooked on UOT, then removed the music controls + toggle buttons..

--------------------------------------------------------------------------
|vr 08-07-2011 -- 21:41:37,18|
--------------------------------------------------------------------------
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
--------------------------------------------------------------------------
|vr 08-07-2011 -- 21:42:03,37|
--------------------------------------------------------------------------
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
C:\apk_manager_4.9\other\..\projects\framework-res.apk\res\layout\status_bar_expanded.xml:5: error: Error parsing XML: duplicate attribute
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Mjuksel\AppData\Local\Temp\APKTOOL4554741090717303056.tmp, -x, -S, C:\apk_manager_4.9\other\..\projects\framework-res.apk\res, -M, C:\apk_manager_4.9\other\..\projects\framework-res.apk\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(Unknown Source)
at brut.androlib.Androlib.buildResourcesFull(Unknown Source)
at brut.androlib.Androlib.buildResources(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.apktool.Main.cmdBuild(Unknown Source)
at brut.apktool.Main.main(Unknown Source)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Mjuksel\AppData\Local\Temp\APKTOOL4554741090717303056.tmp, -x, -S, C:\apk_manager_4.9\other\..\projects\framework-res.apk\res, -M, C:\apk_manager_4.9\other\..\projects\framework-res.apk\AndroidManifest.xml]
at brut.util.OS.exec(Unknown Source)
... 7 more
[G1 Android Development] tommytomatoe:
Which version of aapt do you have? Update sdk to 11 or 12.
[G1 Android Development] xda-dev2k:
hi all... I've read dozen of posts here in your thread and I'm actually stoned right now :)

my question is, I wanted to extract the email.apk (system app) from the galaxy tab 10.1 and prepare it to be installed on an Iconia A500.

I couldn't find out how to proceed (and if it's possible) in order to obtain this version on my tablet.

Any help would be veeeery appreciated.
[G1 Android Development] CleveRuse:
Ok I'm LOST! First off, Im on Linux. I've been having strange things happening since some programs updated ( like losing my Network Connection icon and having it show up now on the secondary users desktop, while it used to be that she couldn't get it to display, now I can't.)

So I try to theme an app using APK Manager but now my 'out' folder is X'ed out, along w/ its contents, and it says I don't have permissions to view the folder/files. So i checked and I'm still the owner, my perms are all checked, I believe my group is still the same (same as my user name). Under 'System/Administration/User and Groups' I see that I'm still an Admin., I have all User Privileges marked true, my main group matches my user name and my ID is still 1000. Also my password is still valid. Please, someone tell me WTF is happening here, LOL. Thnx in advance for ur patience and concern:(

It may very well have nothing to do with APK Mgr. but i figure its a fine place to start, plus all of u seem very experienced in such matters
[G1 Android Development] Mjuksel:
i was on 11, now updating to 12..

do i need to apply anything else? or edit some windows settings?
[G1 Android Development] dreamsforgotten:
Try to navigate through terminal into the folder (apk manager) and type sudo rm -rf out then recreate the out folder in your file browser as your regular username seems as if root gained control
[G1 Android Development] CleveRuse:
Thnx, I'll try it. Wut exactly will that do? First here's is Wut I tried:

sudo chown -R ab:ab /'path-to-folder'

Chmod -R 755 /'path-to-folder'

("ab" is my username n group)

And it worked! I then modded an APK, didn't like it, went back, and it was "Root" again! ??? So confused, LOL.

BTW, u r AWESOME! U help everyone and without bein rude. Ima bout to go on my PC just to hit the 'thanks' button.
[G1 Android Development] CleveRuse:
Ok, well its been deleted n re-created so that I'm the owner.... Let's hope it stays that way. I don't see why not, but I also didn't see it being taken over by root the last 2 times, LOL.
[G1 Android Development] dreamsforgotten:
Is apk manager running as root for some reason because the scripts create the out folder when you decompile and thanks for the compliment!
[G1 Android Development] dreamsforgotten:
Sorry for the double post, quote fail, if you have work you need to access in it while its root you can sudo dolphin to open dolphin as root as well
[G1 Android Development] CleveRuse:
Lol, its a little late for that... future reference tho. But hey, its still working perfectly!

I think I've asked this already over here...really not sure...but I'm having trouble editing .9png's cuz my "draw9patch can't be found"... Oh now I remember. U said, I think, that's why u use windows to edit things? Well I don't have that option..... yet. So is there no way to make it recognizable? Sorry if u answered this before n I just didn't catch it. Oh, and I googled this pretty extensively believe it or not. Found a lot of complaints, no solution ....Just a shot on the dark.
[G1 Android Development] CleveRuse:
Edit above: It's my draw9patch.jar file from my draw9patch compiler from my SDK that isn't being recognized, not the whole d9pc app itself as implied in the above post.
[G1 Android Development] dreamsforgotten:
On linux draw9 patch doesn't work with my setup for the video driver I forget why. Never found a fix sept use xp cause I'm lazy
[G1 Android Development] Mjuksel:
Okay guys, it's a miracle ! I can compile apks now :D

Now i have the following, my compiled framework-res.apk is much smaller..

i tried setting compression to 0 and memory to 512 but that didn't help :)
[G1 Android Development] dreamsforgotten:
Does it work when you flash?
[G1 Android Development] CleveRuse:
Ok I know that if I'm just editing png's, I don't need to sign...supposedly, but if I open an apk, extract the images to my desktop, change the hue, drop images bak into the apk, then try to install it, I get an error saying something like "package not properly signed" or something bout the signature. Any thoughts on why?

Also, I keep hearing that I don't need a d9p compiler to change the hue of .9png's, while others say don't touch them. I know personally, that if i "touch" them without setting the parameters for the patches, it looks terrible. Is there an application that leaves the patch info untouched when editing?
[G1 Android Development] tommytomatoe:
As soon as you modify the apk by opening it up you break the integrity of the signature. You will need to resign it after making your PNG changes. I'm not sure who told you that it doesn't need resigning but it does if it is a data app. And I bet they were referring to system apps. If that is the case you don't install those. Push them to system/app

As for 9.png I always redraw the patches when I modify them. There might be a tool out there but I don't know. I decompile the 9.png first (using a jar made by Brut.all) then I edit them then I recompile with aapt. That is my usual procedure.
[G1 Android Development] tommytomatoe:
I hope I didn't sound mean. Not my goal to make you a moron. Lol.

Good luck with what you're trying to do :-)
[G1 Android Development] Mjuksel:
Uhm yes it does actually ! :P
[G1 Android Development] dreamsforgotten:
Lol that's what counts!
[G1 Android Development] ecsnead69:
New Market??

I am working on themeing the market that was just release and I am running into an issue with two folders that I have not seen in an app before, mipmap-hpdi and mipmap-mpdi? I am receiving the errors below....

--------------------------------------------------------------------------

|Wed 07/13/2011 -- 19:40:22.05|

--------------------------------------------------------------------------

java version "1.6.0_25"

Java(TM) SE Runtime Environment (build 1.6.0_25-b06)

Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)

I: Checking whether sources has changed...

I: Checking whether resources has changed...

I: Building resources...

invalid resource directory name: D:\Android Theme\OG_apk_manager_4.9\other\..\projects\Vending.apk\res/mipmap-hdpi

invalid resource directory name: D:\Android Theme\OG_apk_manager_4.9\other\..\projects\Vending.apk\res/mipmap-mdpi

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Eric\AppData\Local\Temp\APKTOOL6136248488386063666.tmp, -I, C:\Users\Eric\apktool\framework\1.apk, -S, D:\Android Theme\OG_apk_manager_4.9\other\..\projects\Vending.apk\res, -M, D:\Android Theme\OG_apk_manager_4.9\other\..\projects\Vending.apk\AndroidManifest.xml]

at brut.androlib.res.AndrolibResources.aaptPackage(Unknown Source)

at brut.androlib.Androlib.buildResourcesFull(Unknown Source)

at brut.androlib.Androlib.buildResources(Unknown Source)

at brut.androlib.Androlib.build(Unknown Source)

at brut.androlib.Androlib.build(Unknown Source)

at brut.apktool.Main.cmdBuild(Unknown Source)

at brut.apktool.Main.main(Unknown Source)

Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Eric\AppData\Local\Temp\APKTOOL6136248488386063666.tmp, -I, C:\Users\Eric\apktool\framework\1.apk, -S, D:\Android Theme\OG_apk_manager_4.9\other\..\projects\Vending.apk\res, -M, D:\Android Theme\OG_apk_manager_4.9\other\..\projects\Vending.apk\AndroidManifest.xml]

at brut.util.OS.exec(Unknown Source)

... 7 more