yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] KBanause:
You have replaced the 9-patch-file "D:\apkm\other\..\projects\SystemUI.apk\res\drawabl e-hdpi\statusbar_background.9.png" with a non 9-patch-file. Either use a correct decompiled 9-patch-file or rename it to "D:\apkm\other\..\projects\SystemUI.apk\res\drawabl e-hdpi\statusbar_background.png" before recompiling your APK
[G1 Android Development] jgibbons1:
First time using APKTool ....

I've managed to install APKTool.

Pulled the framework files from HTC Desire HD (RCMix3D Rom)

Pulled the apk com.volosyukivan-1.apk (WifiKeyboard)

I am able to decompile and recompile with no errors but then I can't install the application. The phone says "Application not installed" and if I push the file either to data/app or system/app I get a force close.

Can someone please help? I use it a lot at work but I need to remove all the text from the browser as it has in size 30 font "Android Wifi Keyboard".

Thank you.
[G1 Android Development] tommytomatoe:
You need to do one of two things.

1. Resign the app. Then install with adb install or place on sdcard and install with filemanager llike root explorer or astro

2. Place the original META INF and AndroidManifest.XML found in the original apk In the apk located in the dist folder. Use 7z to open the apk as an archive. Lastly, push to system/app.

Check out this post if you'd like help with signing.

http://xdaforums.com/showpost.php?p=15401929&postcount=3700
[G1 Android Development] jgibbons1:
Just wanted to say thank you. Needed to sign the apk, guess i missed that part.

Thanks again.
[G1 Android Development] vegetaleb:
Ok I am getting much less errors now but I am getting this while rebuilding systemui.apk:

I edited the statusbar smali and xml files to make transparent statusbar only,why is it talking about quickpanel now?

Flashing the builded apk is giving a blank space instead of statusbar :eek:
[G1 Android Development] tommytomatoe:
Sometimes you will get that error. It usually will still work. With systemui, sometimes UT takes a restart to get the status bar back. Give that a try.
[G1 Android Development] dkdude36:
great, great tool. first time i have run into problems.

i can't decompile the systemui.apk from synergy (a sense 2.1/3.0 evo/inc/desirehd rom) correctly. getting a bunch of errors. can anybody recreate?

btw, is there any easy ways to add values besides putting them all in manually when adding png's to framework-res?
[G1 Android Development] blahbl4hblah:
In order to decompile and recompile any apk you need to download baksmali and smali, just google for it

After your done downloading it, just remove the version numbers from both and drag them to your apkmanager's other folder
[G1 Android Development] dkdude36:
What do you mean my apk manager's other folder? And I've decompiled many apk's before without needing this. Thanks for the help though

Sent from my Synergized Evo using the XDA premium app...
[G1 Android Development] tommytomatoe:
Hey dk. Do this.

Apktool if for both framework res and com.htc.res

I know that works because I have a couple mods for that rom :-)

And have you tried android-utility?

And no you don't need smali or baksmali to utilize apktool.

And as for values...when you recompile it automatically creates them :-) but there are some rules. Brut.all has a post some where on here. But generally you can just add pngs and recompile.
[G1 Android Development] dkdude36:
tommy, you are the light at the end of the tunnel. you are the night in shining armor that stands above his fallen soldier. you are the one who defends the orphans living in draught. you use tomatoe as your last name. for all this and more, you must be praised.

i didn't do com.htc.res. that was the problem. i have only done xml edits on aosp, so i didn't kno you had to do this. thanks for the help.

i have not tried android utility, i'll google it.

i was wondering about the values thing. thanks.

edit: oh forgot andorid utility's ur tool. meant to download that. dling now.
[G1 Android Development] pendo:
apktool includes baksmali/smali.
[G1 Android Development] tommytomatoe:
Gots to love apktool. :-) now to get m10 tools incorporated and working on Mac OS x.
[G1 Android Development] dkdude36:
+ANumberLargerThanTheGenitaliaOfChuckNorrisAndO.G.MudbonesCombined
[G1 Android Development] dfskevinohyeah:
What code do we need to use to create the output folder for apk because when i try to recompile a skin apk for the evo 3d i keep on getting.....

"Exception in thread "main" brut.androidlibe.AndroidlibException: crut.directory.PathNot Exist: apktoo.yml"

any help with be greatly appreciate :)

Maybe if i was to vague on the error here is what i get:

C:\Users\Kevin!>cd \

C:\>cd apktool

C:\apktool>apktool b Base.Theme.v1

Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN

otExist: apktool.yml

at brut.androlib.Androlib.readMetaFile(Androlib.java:142)

at brut.androlib.Androlib.build(Androlib.java:159)

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.directory.PathNotExist: apktool.yml

at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:

103)

at brut.androlib.Androlib.readMetaFile(Androlib.java:138)

... 4 more
[G1 Android Development] tommytomatoe:
That error happens cause the decompile process did not go smoothly. Google m10 tools. That is how you play with sense 3.0 skins.

And here is basic apktool syntax :

apktool d nameof.apk namofoutputdirectory

Ie

apktool d Rosie.apk Rosie

Where Rosie is the output folder.

If you just do apktool d Rosie.apk, then Rosie folder will be placed in current working directory.
[G1 Android Development] dfskevinohyeah:
ooooh thanks tommy and yeah m10 tools edits dock, lockring and other good stuff but there are other png's in res/drawable-hdpi that i wanted to change the color too and thanks! ill see if works all i want to do is be able to rename the darn apk because i already got the pngs all modified but renaming apks is proving to be tough ive tried for literally 3 hours using tools and other methods but none work just trying this one right now :)

If I was too vague on the error this is what i get:

C:\Users\Kevin!>cd \

C:\>cd apktool

C:\apktool>apktool b Base.Theme.v1

Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN

otExist: apktool.yml

at brut.androlib.Androlib.readMetaFile(Androlib.java: 142)

at brut.androlib.Androlib.build(Androlib.java:159)

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.directory.PathNotExist: apktool.yml

at brut.directory.AbstractDirectory.getFileInput(Abst ractDirectory.java:

103)

at brut.androlib.Androlib.readMetaFile(Androlib.java: 138)

... 4 more
[G1 Android Development] pendo:
What do you mean by trying to rename? Do you mean what name it installs as on the device? Not sure what you're trying to do..

The bold part is you're problem. This was actually just recently discussed on pages 123/124. You are having an issue during decompile, so the apktool.yml file was never created.
[G1 Android Development] tommytomatoe:
To rename the package name of the apk, ie its identity you need to change each instance of the package name. That is all over the XML and smali. I've done this for two apks (Rosie and camera) for different reasons.

And if you're just changing png...no need to decompile. Just open apk in 7zip. Replace png. Resign. Install. If it is a system apk don't resign. Push to system/app
[G1 Android Development] TylerDurben:
Hi there ;)

I have seen an graphical user interface for the apk tool in chinese language,

did anyone knows if something like that is available into english language?
[G1 Android Development] 3rdstring:
Something like this?
[G1 Android Development] TylerDurben:
thank you verry mutch ;)
[G1 Android Development] CdTDroiD:
Hi guys im having a real hard time editing layout.xml under systemUI, or any xml really, ive tried to search but cant find out whats going on, i used to be able to decompile, edit and recompile .apks with no worries but now when i edit an xml and then recompile the apk it doesnt save, when i decompile again to check it has gone back to normal... anyone have any ideas at all? help is very much appreciated.

thanks
[G1 Android Development] tommytomatoe:
What are you using to edit XML? Textedit or notepad ++ is good.

As for your issue...are you using the apk in the dist folder to decompile the second time?
[G1 Android Development] xavierjohn22:
If you are using my tool which uses bruts apktool you have to follow some rules too.

1. Are you using the apktool generated apks (bruts raw output) in build folder?

2. Are you using build usable command?

If number 1, that edits should be there.

If number 2, you need to copy the xml binary to custom res folder with the structure described in that thread, that is done after recompile since the binaries are generated in dist folder. Then do a build usable.

Later on it will be automated via a list. Still busy with rom, the commandline automation is up to date.
[G1 Android Development] 4omp:
When I decompile and compile SystemUI without changes.

C:\Users\user\Desktop\xui>apktool b SystmeUI
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.Direc
toryException: java.io.FileNotFoundException: SystmeUI (═х єфрхЄё* эрщЄш єърчрээ
√щ Їрщы)
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
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.directory.DirectoryException: java.io.FileNotFoundException: Sys
tmeUI (═х єфрхЄё* эрщЄш єърчрээ√щ Їрщы)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:55)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:38)
at brut.androlib.res.util.ExtFile.getDirectory(ExtFile.java:55)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
Caused by: java.io.FileNotFoundException: SystmeUI (═х єфрхЄё* эрщЄш єърчрээ√щ Ї
рщы)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:53)
... 7 more
[G1 Android Development] tommytomatoe:
Did you install necessary frameworks?

Run

apktool if framework-res.apk

and if you on htc rom..also run

apktool if com.htc.resources.apk
[G1 Android Development] 4omp:
what frameworks I need?

As I understand I have such frameworks.
[G1 Android Development] tommytomatoe:
Look at my post again.

You need the two framework files I listed (framework-Res and com.htc.resources) both from the same rom you are modifying. Not computer framework. Lol.

I suggest doing much more reading prior to playing with mods. It will help you on the long run to understand how things work and why.

I'm not being mean. Just saying that framework files are a basic part of apktool, et cetera.
[G1 Android Development] cripgballerkundikusu11:
need help installing on windows. how do i do it
[G1 Android Development] 4omp:
framework I can decompile and compile without problems, but I need icons from SystemUI and there I have errors
[G1 Android Development] $omator:
what is the latest apktool
[G1 Android Development] tommytomatoe:
I know man! That's why you install frameworks first In order to decompile systemUI!

For exactly this:

apktool if framework-res.apk

apktool if com.htc.resources.apk

apktool d SystemUI.apk

{Mod}

apktool b SystemUI.apk

Done.

I assume you're modifying an htc rom.
[G1 Android Development] tommytomatoe:
Technically 1.4.2. Officially 1.4.1.
[G1 Android Development] 4omp:
Thanks.

and what is happen now.

C:\Users\user\Desktop\****>apktool d -f WidgetLocker_Lockscreen_v2.1.0.apk
I: Baksmaling...
testI: Loading resource table...
W: Skipping "android" package group
I: Loaded.
I: Loading resource table from file: C:\Users\user\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String ind
ex out of range: 8
at java.lang.String.charAt(Unknown Source)
at brut.androlib.res.xml.ResXmlEncoders.findNonPositionalSubstitutions(R
esXmlEncoders.java:165)
at brut.androlib.res.xml.ResXmlEncoders.hasMultipleNonPositionalSubstitu
tions(ResXmlEncoders.java:138)
at brut.androlib.res.data.value.ResStringValue.serializeExtraXmlAttrs(Re
sStringValue.java:63)
at brut.androlib.res.data.value.ResScalarValue.serializeToResValuesXml(R
esScalarValue.java:65)
at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResour
ces.java:264)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:137
)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:93)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:120)
at brut.apktool.Main.main(Main.java:57)

C:\Users\user\Desktop\****>
[G1 Android Development] tommytomatoe:
Why are you decompiling widget locker? Just use 7zip, pull out res folder and change pngs, put back res folder replacing old one. Push to system/app or "resign and install".
[G1 Android Development] pendo:
Hey....wasn't that one of the errors that we saw when we first saw 1.4.1 come out?

Anyway, just to add a to your reply a bit ;) you can also modify 9 patch images as well, and use xeudoxus's xUltimate draw9patch compiler. I can't testify personally to its operation as it's a windows program, but considering who made it I feel pretty comfortable recommending it.

If it's an xml that you're wishing to mod, you can sometimes get away with compiling your xml in another apk then swap it with 7zip. (kinda hit or miss with this....depends on what you're changing)

And lastly if there's something in the dex file you're wanting to edit, you can call baksmali directly. However you're limited in what changes you could make. For instance some of my theming mods require me to manually create new resource id's so decompiling smali isn't enough. But basically, as long as you don't need to change anything in resources.arsc or AndroidManifest there are other ways to mod an apk---albeit much less conveniently.
[G1 Android Development] cripgballerkundikusu11:
hi guys, just a question here. how do you install this on windows 7. i need som innstructions because i cant find any guide showing this. thanks in advance
[G1 Android Development] tommytomatoe:
Pendo always has my back :-)

Btw...have you seen this one for Mac?

http://xdaforums.com/showthread.php?t=1181284
[G1 Android Development] tommytomatoe:
It is pretty easy on windows.

Downloaded the two zips. One for apktool.jar and the other for the wrapped and aapt.

Unzip the contents. Place them all (should be three files) inside your Windows directory. Where is that?

If you click on your hard drive in My Computer you will see a list of directories. You see a folder called Windows.

It is directly located at "C:\Windows" if you are familiar with cmd prompt.

After all that...you can now run apktool. But expect troubles ahead! Make sure youhave tthe android-sdk downloaded and have installed the API current with your rom. You will want to use that aapt. I find that the aapt from Brut doesn't build for me on some apks.

Also you will want java prior to installing. Here the commands you need:

apktool
apktool if <framework>
apktool d <source apk>
apktool b <output directory>
[G1 Android Development] cripgballerkundikusu11:
thanks for the help so do i put the commands in cmd?

edit:

when i try unzipping them with 7 zip or win rar, it says: cannot open output file: ( apktool file name.tar).

Do you know the reason?
[G1 Android Development] pendo:
No, I hadn't seen that. Cool.

Now.....if you could make a draw9patch tool that was a little bit polished....;)
[G1 Android Development] tommytomatoe:
You mean gimp? ;-)
[G1 Android Development] blunden:
I've noticed that to properly scale hdpi drawables (except the icon) the app has to be rebuilt from source. From what I understand this is because it needs to rebuild R.java and possibly adjust some xml-file.

Sometimes that's not an option however. For instance I downloaded an app that worked great but only had mdpi drawables. To fix that, I recreated all the drawables from scratch in Photoshop and Illustrator myself while also copying framework drawables when appropriate. I have however not been able to get the drawables to scale correctly on the device after recompiling the apk with the new images using apktool. It seems the same scaling applied to the app when using mdpi drawables is still applied to the new hdpi drawables.

Is there a fix for this?

EDIT: Nvm. Fixed it.
[G1 Android Development] pendo:
I've not ran into this problem myself, so I'm afraid I don't have anything specific to give you but you might check here. Might have some useful info for you.
[G1 Android Development] blunden:
It's an issue only when the app originally only had mdpi drawables and you replace them with hdpi ones. Some part of the app has to be rebuilt but apktool doesn't do it. If you have the source code though, it works like it should. The issue is when I don't have that.

EDIT: Turned out it was simply Android that assumed the drawables were mdpi since I had forgot to change the folder name to drawable-hdpi. I had forgot mdpi was default.

Thanks for your help. :)
[G1 Android Development] donhu:
Hey guys i am also having some trouble with apktool.

I am trying to edit my SystemUI.apk and things arent going well. So i decided to make sure that i can decompile and recompile the apk and get no errors.

apktool if framework-res.apk

apktool d SystemUI.apk

no errors...

changed no files or anything...

apktool b -f SystemUI newSystemUI.apk

renamed the file back to SystemUI.apk, pushed it to my phone and the status bar fails everytime!

I get it back by pushing the original SystemUI.apk

Any ideas as to what couldve gone wrong?
[G1 Android Development] tommytomatoe:
Which rom is this for? If it is from sense or touchwhiz or other proprietary rom you will also need tthe other framework (ie. Com.htc.resources.apk)

apktool if com.htc.resources.apk

And lastly you need to transfer the ORIGINAL META-INF and AndroidManifest.xml from the ORIGINAL apk to the NEW apk.

Just use 7z to pull original and put into new.
[G1 Android Development] donhu:
its a cm7 based rom and i do

apktool if framework-res.apk

everytime before i decompile just to make sure.

Ill try copying over the meta-inf and manifest xml and post back.

EDIT:

WORKS LIKE A CHARM! THANKS!
[G1 Android Development] tommytomatoe:
My pleasure man! That's one of the first things that I learned. :-)
[G1 Android Development] eva_d:
I have a possibly n00b question here... but I got a bit stuck and hoping to get a clue. I need to install a FieldTest.apk on my HTC Vision running CM7.1.0-RC1, however:

[evad@v3350 Downloads]$ adb install FieldTest.apk

961 KB/s (127564 bytes in 0.129s)

pkg: /data/local/tmp/FieldTest.apk

Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE]

So I did quick googling around, found apktool, decoded apk and removed android:sharedUserId="android.uid.phone" bit from AndroidManifest.xml and built apk back with apktool. Unfortunately, now I get:

[evad@v3350 Downloads]$ adb install FieldTest.apk

1247 KB/s (77631 bytes in 0.060s)

pkg: /data/local/tmp/FieldTest.apk

Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]

So I got stuck with apk signing. My Eclipse ADT is borked due to some weird Eclipse issue in Fedora 15 and now I'm struggling to figure out how to sign an apk using command line after making that change in manifest. Android SDK docs are mentioning something about using ant and build.xml and that's what makes me confused a bit, as I don't have those obviously. Or perhaps this is wrong way of doing this? I'd be grateful for some clues - many thanks in advance.
[G1 Android Development] 3rdstring:
Look for Zipsigner2 in the market.
[G1 Android Development] eva_d:
Nice one, thanks for suggestion. Signing works but now I have a different problem, as app does FC upon start, regardless which key I'll use for signing. Well, this is going beyond this topic, so thanks for suggesting zipsigner2 again. :)
[G1 Android Development] exorcist26:
C:\Users\ertugrul>cd C:\APKTool and the Template

C:\APKTool and the Template>apktool d Zeam_Launcher_v3.0.7.apk
I: Baksmaling...
I: Loading resource table...
W: Skipping "android" package group
I: Decoding resources...
I: Loading resource table from file: C:\Users\ertugrul\apktool\framework\1.apk
I: Copying assets and libs...

C:\APKTool and the Template>apktool b Zeam_Launcher_v3.0.7
I: Checking whether sources has changed...
I: Smaling...
Exception in thread "main" java.lang.NullPointerException
at org.jf.util.PathUtil.getRelativeFile(Unknown Source)
at org.jf.smali.smaliFlexLexer.getSourceName(Unknown Source)
at org.antlr.runtime.CommonTokenStream.getSourceName(Unknown Source)
at org.antlr.runtime.tree.CommonTreeNodeStream.getSourceName(Unknown Sou
rce)
at org.antlr.runtime.tree.TreeParser.getSourceName(Unknown Source)
at org.jf.smali.smaliTreeWalker.getErrorHeader(Unknown Source)
at org.antlr.runtime.BaseRecognizer.displayRecognitionError(Unknown Sour
ce)
at org.antlr.runtime.BaseRecognizer.reportError(Unknown Source)
at org.jf.smali.smaliTreeWalker.smali_file(Unknown Source)
at brut.androlib.mod.SmaliMod.assembleSmaliFile(Unknown Source)
at brut.androlib.src.DexFileBuilder.addSmaliFile(Unknown Source)
at brut.androlib.src.DexFileBuilder.addSmaliFile(Unknown Source)
at brut.androlib.src.SmaliBuilder.buildFile(Unknown Source)
at brut.androlib.src.SmaliBuilder.build(Unknown Source)
at brut.androlib.src.SmaliBuilder.build(Unknown Source)
at brut.androlib.Androlib.buildSourcesSmali(Unknown Source)
at brut.androlib.Androlib.buildSources(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)

what I'm doing wrong. Please help me. :(
[G1 Android Development] tommytomatoe:
You need a different aapt. Theoretically the one from sdk api 9 and 10 will work best (assuming you are dealing with apps made for gingerbread). This was one of my issues also back in the day. It was a suggestion from Pendo and has worked for everyone I've suggested it to also.