yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] TUN_SD:
ok, I decompiled the systemUI and there are some 9.pngs that are not correctly decompiled. that means for me (somebody may correct me) that the systemUI is modded after compiling. the pngs are added directly to the apk.

replace the pngs with the attached and delete the files with the same name.

because there are files with xyz.9.png and the "same" file xyz.png without the 9.

check this and it will work. (for me it worked)
[G1 Android Development] shanman-2:
I take it you are talking about my issue and you used the original SystemUI.apk from Hyperdroid 5.8.0. Well thats what I did and it no work!!

It is definitely an issue with pngs as the error start point seemed to move...

Where did you get the pngs in the zip file?
[G1 Android Development] mattmanwrx:
No, i beleive they have just taken those images from any other rom, and asking you to change the images before decompiling. If you do it that way then there should be no errors!!

Basicall open the .apk with something like 7zip, replace the offending images with what was posted above, then decompile and compile and you should see no errors... However, I may have misunderstood too! :)
[G1 Android Development] TUN_SD:
no, Decompile your system ui normal. Ignore the errors. Then delete the 3 double (??) Files I discribed above. (3 x .PNG & 3x 9.png) then copy the attached files in that folder and try compile. If you only replace the PNG in the opened apk you will get errors too.

send with ice cold fingers
[G1 Android Development] shanman-2:
Hey just dropped the whole drawable -hdpi folder from dorimanx rom SystemUI.apk into the Hyperdroid rom SystemUI.apk using 7zip and guess what it compiles:):):).

Lots of offending drawables!!!

Just needed to see that fn systemui,apk compile and I did, now I can die in peace..lol.

Thanks guys:p
[G1 Android Development] udK:
ouch sorry, wrong post.
[G1 Android Development] xavierjohn22:
Sorry to invade brut. Lol

Version 4.0.1

Multiple input folder support

Multiple apktool version support

Decompile and recompile with... what apktool version

And display what apktool version deconpiled the apk

Choose smali and baksmali versions

V4.0.3

++ Etc etc, maybe this week

Sent from my HTC Desire
[G1 Android Development] silverxbv2:
So I have one that I have never run into or even heard of before. With the latest Google+ app, if I open the app up in 7zip, all of the drawable folders have more pngs in them than if I decompile the app and look at the same folders.

So like drawable hdpi has 291 images in 7zip, but only 271 when decompiled with apktool 1.4.3. All of the drawable folders are this way. Has anyone ran into this before?

Edit....

I may have figured this out but now it leads to another question. The app I'm looking at has been modded and has a lot of extra pngs in it. So when It's decompiled It's only showing me the pngs that have an id in public.xml.

So why does that not throw an error at decompile, and why is it not creating the ids at recompile?
[G1 Android Development] mattmanwrx:
Have u installed the framework and com.HTC.resources for it to pull the resources from?

Read up on the framework files on apktool Google project page...
[G1 Android Development] mattmanwrx:
Could it be that the modder has compiled the app from within another app and pulled them over with 7zip? Just a guess...
[G1 Android Development] TUN_SD:
Let me know when its finished!

send with ice cold fingers
[G1 Android Development] xavierjohn22:
V4.0.1 uploaded,

V4.0.3 on saturday.

Thread on my signature. Ill leave bruts thread now. My apologies. Cheers.

Sent from my HTC Desire
[G1 Android Development] mekanismen:
Also trying to recompile Swiftkey, and getting millions of lines with some kind of resource errors. Tried installing the framework-res.apk from AOKP several times, no success.

Anyone bother helping a noob?
[G1 Android Development] djdarkknight96:
Decompile with this apktool then get apkmultitool "google it" move your files to that and use it to compile. That's what I've done to fix that kind of issue. I've never tried to edit swift key but it worked with Swype!

Skanky CM9 GNex sent this from the xda app!
[G1 Android Development] djdarkknight96:
You might wanna try decompile with apk manager or apk multitool. They can decompile from other resources other that framework. I've never tried with apktool so not sure you can.

Skanky CM9 GNex sent this from the xda app!
[G1 Android Development] ihtfp69:
I could be wrong but unless the drawables are used in layouts apktool will not auto assign ids since doing so is pointless. Why have drawables that are never used?
[G1 Android Development] silverxbv2:
I believe you are right. My edit didn't make sense now that I reread it. My assumption was that the app I was looking at was done "right".

Apktool would not throw an error when decompiling because there is no reference to the extra images. So of course it would not create IDs when recompiling. It still doesn't see the extra images.

Side note, nice to see you in these parts. Skyraider was one of my favorites. :D

Sent from my ADR6425LVW
[G1 Android Development] tommytomatoe:
Whoa look who it is! The mastermind.

Actually on build, apktool will assign all drawables (and all resources) ids regardless if their referenced or not in the layouts. I added the additional widget pngs for the extended quick settings and built the apk to generate the ids before I modified the smali to comply with the resources.

But you're definitely right. Unused resources is just a waste of space.

Edit..it probably.goes without saying. But thank you very much for sharing the extended quick settings :-)
[G1 Android Development] 1982Strand:
I'm translating MIUI ICS, which i can get done with a couple of workarounds and some manual editing of a few files.

But just wanted to ask about the following errors, to get a better understanding of what's actually happening and the meaning of the errors. I know that at least some of the errors is not something i can do anything about just yet.. (Unless i'm doing something wrong in the first place..)

I'm using latest aapt.exe (r16) and apktool 1.4.3, on windows 7 - 64bit.

I installed:

framework-res.apk as 1.apk

com.htc.resources.apk as 2.apk

framework-miui-res.apk as 3.apk - and after decompile i edit apktool.yml, adding - 2

For testing purposes, i don't change anything here when recompiling, to rule out that my edits are causing the problems.

The apks seem to decompile fine, at least i don't get any errors here. But it's when i recompile they appear.

First, it's the Email.apk:

Email.apk errors

I found a workaround that fixes the errors, so that's fine, but i'm curious as to what goes wrong?

Then, it's the framework-miui-res.apk:

framework-miui-res.apk errors

This one is interesting.. It seems that in some of the xml's, something's changed in the tags, i need to manually edit those tags to be the right format again. Funny thing is, it's not ALL tags that changes, only some of them.

Fixing the first 4 errors also fixes the rest of the erros, but what's really happening?

Similar errors with framework-res.apk:

framework-res.apk errors

With this one, i can make an error-free recompile, if i decompile first using a modded apktool: 1.4.2.31e6dc5 (found HERE), then recompiling with the 1.4.3. I don't know what the differences are, but it works. Why?

Anyways, thanks for this great tool!

Looking forward to your replies :)

Files used: Download
[G1 Android Development] TUN_SD:
I had those errors too, was driving me nuts.

try the attached, maybe they are different to yours. for me they are working.

(decompile with 1.4.2, compile with 1.4.3 as you did already)
[G1 Android Development] 1982Strand:
It seems they're same as mine, i get exactly same output :)

I've edited my first post to include the files i use, so anyone can try it out if they want, to see if they get different results..
[G1 Android Development] TUN_SD:
ok, thought it would help.

maybe MIUI is too different to mod like cm7/cm9.

read about that a few days ago. but I´m not sure about that.

good luck!
[G1 Android Development] 1982Strand:
Thanks :) But i understand how to fix the errors and i CAN get it to recompile without errors. The thing is, i'd like to know WHY i get the errors and what they mean. Why is it changing/breaking resources?
[G1 Android Development] Cryptrix:
Error help

I get this error whenever I try to recompile an APK that has been edited. It works fine when I recompile an APK that has not been edited yet. Can anybody help me figure out how to fix it? :D

C:\Users\Mike>apktool b C\Users\Mike\Projects\Android\BatteryRemoval
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.Direc
toryException: java.io.FileNotFoundException: C\Users\Mike\Projects\Android\Batt
eryRemoval (The system cannot find the path specified)
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:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.directory.DirectoryException: java.io.FileNotFoundException: C\U
sers\Mike\Projects\Android\BatteryRemoval (The system cannot find the path speci
fied)
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: C\Users\Mike\Projects\Android\BatteryR
emoval (The system cannot find the path specified)
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

C:\Users\Mike>
[G1 Android Development] pendo:
Hey TT ;)

I know you weren't implying it was ok to do so...but just wanted to comment for the others that just because a resource (png, xml, etc) isn't being used makes it ok to remove it all nonchalant-like. Just gotta make sure your resource id's are all sequential with no gaps in numeration.

The man himself has a great post on it here.

:cool:
[G1 Android Development] tommytomatoe:
Pendo!!!

Yeah good clarification. He is indeed the man. :-)
[G1 Android Development] i04055:
anyone know what is this error?

--------------------------------------------------------------------------
|Wed 03/21/2012 -- 14:15:13.99|
--------------------------------------------------------------------------
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) Client VM (build 20.4-b02, mixed mode, sharing)
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: E:\android\apk_manager_4.9\other\..\projects\SystemUI.apk\res/drawable-sw600dp-hdpi
invalid resource directory name: E:\android\apk_manager_4.9\other\..\projects\SystemUI.apk\res/layout-sw600dp
invalid resource directory name: E:\android\apk_manager_4.9\other\..\projects\SystemUI.apk\res/values-sw600dp
invalid resource directory name: E:\android\apk_manager_4.9\other\..\projects\SystemUI.apk\res/values-sw600dp-port
invalid resource directory name: E:\android\apk_manager_4.9\other\..\projects\SystemUI.apk\res/values-sw720dp
invalid resource directory name: E:\android\apk_manager_4.9\other\..\projects\SystemUI.apk\res/values-sw720dp-port
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\DOCUME~1\edp\LOCALS~1\Temp\APKTOOL3363711159800956907.tmp, -I, C:\Documents and Settings\edp\apktool\framework\1.apk, -S, E:\android\apk_manager_4.9\other\..\projects\SystemUI.apk\res, -M, E:\android\apk_manager_4.9\other\..\projects\SystemUI.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:\DOCUME~1\edp\LOCALS~1\Temp\APKTOOL3363711159800956907.tmp, -I, C:\Documents and Settings\edp\apktool\framework\1.apk, -S, E:\android\apk_manager_4.9\other\..\projects\SystemUI.apk\res, -M, E:\android\apk_manager_4.9\other\..\projects\SystemUI.apk\AndroidManifest.xml]
at brut.util.OS.exec(Unknown Source)
... 7 more

I got that error when trying to build SystemUI.apk without any editing, just decompile and than recompile....

I'm using apktool for windows anyway...
[G1 Android Development] intronauta:
welcome to the club!! Is that SystemUI of SGS2-ICS?

I have the same errors using apktool 1.4.3, it fails with all folders that include numbers. (At least with the linux version)

One solution would be decompile with 1.4.2 and recompile with 1.4.3 in windows, but It doesn't work for me.

Damn samsung :/

edit:

I've solved updating the sdk and re-downloading apktool without overwrite the aapt file. (readed in the issues section of apktool-googlecode).
[G1 Android Development] 1982Strand:
In regards to my last post, i didn't really get any (informative) answers, but it resulted in many people asking me how to fix those errors i wrote about :)

Instead of answering every single PM, i thought i'd post in the thread instead..

click the link in my signature and there's a guide for you ;)

Hope you find it useful, wouldn't hurt to hit the thanks button if you think it was :D
[G1 Android Development] itsmikeramsay:
OK so I decompiled with the modded 1.4.2.31 and tried compiling with 1.4.3 and I'm still getting the same error. This time the slashes are the same in direction...

I'm not sure what it is. I did see it mentioned I need to remove some "white spaces" or something like that? My Autotool is in C:\. It's in a folder called XDAAutoTool. I'm not sure what else I can do. I'll just have to compare the set up on my other PC...there's something I'm missing because I have absolutely no issues with it on there....Anyone have any other ideas, please feel free to throw them out there. Otherwise thanks guys for all the help.
[G1 Android Development] TUN_SD:
try that! http://www.galaxynexusforum.com/for...562-how-decompile-compile-using-apktools.html

always success for me
[G1 Android Development] 1982Strand:
Yep, works good :-) IMO it's even easier though with XJs AutoTool for Windows ;-)

Just my 2c

Sent from my Commodore 64
[G1 Android Development] carlonchete:
invalid config flags

Hi guys,im trying to decompile settingsproviders.apk from a huawei u8650 2.3.3 gingerbread rom with all apktool.jar files from 1.3.2 to 1.4.3 but i always get this

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

|30/03/2012 -- 10:42:58,52|

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

java version "1.6.0_31"

Java(TM) SE Runtime Environment (build 1.6.0_31-b05)

Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)

No se encuentra C:\apkmanager\place-apk-here-for-modding\../place-apk-here-for-modding/signedSettingsProvider.apk

No se encuentra C:\apkmanager\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedSettingsProvider.apk

I: Baksmaling...

I: Loading resource table...

W: Config flags size > 36. Exceeding bytes: 0x48030000.

W: Invalid config flags detected. Dropping resources: bool-w7dp-ERR0

W: Config flags size > 36. Exceeding bytes: 0x9C000000.

W: Invalid config flags detected. Dropping resources: bool-w92dp-ERR1

W: Config flags size > 36. Exceeding bytes: 0x48030000.

W: Invalid config flags detected. Dropping resources: bool-w177dp-ERR2

W: Config flags size > 36. Exceeding bytes: 0x9E000000.

W: Invalid config flags detected. Dropping resources: bool-w197dp-ERR3

W: Config flags size > 36. Exceeding bytes: 0x48030000.

W: Invalid config flags detected. Dropping resources: integer-w7dp-ERR4

W: Config flags size > 36. Exceeding bytes: 0xFA000000.

W: Invalid config flags detected. Dropping resources: integer-w101dp-ERR5

W: Config flags size > 36. Exceeding bytes: 0x48030000.

W: Invalid config flags detected. Dropping resources: integer-w177dp-ERR6

W: Config flags size > 36. Exceeding bytes: 0x48030000.

W: Invalid config flags detected. Dropping resources: string-w177dp-ERR7

W: Config flags size > 36. Exceeding bytes: 0x48030000.

W: Invalid config flags detected. Dropping resources: string-w237dp-ERR8

W: Config flags size > 36. Exceeding bytes: 0x9C000000.

W: Invalid config flags detected. Dropping resources: fraction-w92dp-ERR9

I: Loaded.

I: Loading resource table from file: D:\Documents and Settings\xxx\apktool\framework\1.apk

I: Loaded.

I: Decoding file-resources...

I: Decoding values*/* XMLs...

I: Done.

I: Copying assets and libs...

can some body help me?what can i do?
[G1 Android Development] andoyanna:
Hi everyone! I'm using Apktool v1.4.3 to decompile SystemUI.apk from samsung galaxy s2 ROM and have this error:

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

C:\APKTOOLS>apktool d SystemUI.apk systemui

I: Baksmaling...

Exception in thread "main" java.lang.RuntimeException: bad magic value: 64 65 78

0a 30 33 36 00

at org.jf.dexlib.DexFile.(DexFile.java:377)

at org.jf.dexlib.DexFile.(DexFile.java:274)

at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:44)

at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:33)

at brut.androlib.Androlib.decodeSourcesSmali(Androlib.java:68)

at brut.androlib.ApkDecoder.decode(ApkDecoder.java:85)

at brut.apktool.Main.cmdDecode(Main.java:128)

at brut.apktool.Main.main(Main.java:65)

C:\APKTOOLS>

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

what seems to be the problem?

what bad magic value means?

Thanks in advance for any help

By the way it is android 4.0.3 ics rom.

And im using windows 7 starter netbook

Thanks again!!!
[G1 Android Development] TUN_SD:
try this guide http://xdaforums.com/showpost.php?p=24145937&postcount=1625 only a few posts above yours...
[G1 Android Development] andoyanna:
I tried it but sadly got the same error message! But thanks anyway.

Hope somebody could give a solution to this...

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

C:\APKTOOLS>apktool d SystemUI.apk systemui

I: Baksmaling...

Exception in thread "main" java.lang.RuntimeException: bad magic value: 64 65 78

0a 30 33 36 00

at org.jf.dexlib.DexFile.(DexFile.java:377)

at org.jf.dexlib.DexFile.(DexFile.java:274)

at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:44)

at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:33)

at brut.androlib.Androlib.decodeSourcesSmali(Androlib.java:68)

at brut.androlib.ApkDecoder.decode(ApkDecoder.java:85)

at brut.apktool.Main.cmdDecode(Main.java:128)

at brut.apktool.Main.main(Main.java:65)

C:\APKTOOLS>

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[G1 Android Development] 1982Strand:
Try switching smali/baksmali version. For ICS roms you should use 1.3.2 and 1.2.6 for GB

Sent from my Commodore 64
[G1 Android Development] he_stheone64:
If you only edit png`s and xml code and no smali, then you can compile with the following workaround:

1. Extract and save classes.dex from systemui

2. Delete classes.dex inside systemui and decompile

3. Make your changes and compile

4. Now insert your saved classes.dex and you`re all set
[G1 Android Development] andoyanna:
Thanks it works! I just want to make my phone look different! :):):)
[G1 Android Development] andoyanna:
Thanks for the suggestion i will try it if theres a need to decompile dex file! I haven't got to that point yet! :)
[G1 Android Development] sambastrakan:
Hello ... and help !

Anyone knows a way to decompile/recompile Contacts.apk from CM7 ?

Even without making any modification the recompiled contacts.apk makes android.process.acore to force close. There are no errors during decompiling/recompiling and I tried diferent versions of apktool and aapt.exe ...

Contacts.apk is the only one app that cause problem.

any idea ???
[G1 Android Development] acocalypso:
hi i try to decompile framework.jar

and getting this error message:

I: Baksmaling...

Exception in thread "main" java.lang.RuntimeException: bad magic value: 64 65 78

0a 30 33 36 00

at org.jf.dexlib.DexFile.<init>(DexFile.java:377)

at org.jf.dexlib.DexFile.<init>(DexFile.java:274)

at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:44)

at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:33)

at brut.androlib.Androlib.decodeSourcesSmali(Androlib.java:68)

at brut.androlib.ApkDecoder.decode(ApkDecoder.java:85)

at brut.apktool.Main.cmdDecode(Main.java:128)

at brut.apktool.Main.main(Main.java:65)

can someone tell me whats wrong?
[G1 Android Development] slapshot136:
Hello, I am having some problems building with the APK tool - I want to edit the framework-res.apk, but even if I don't edit it at all, I can't seem to build it

running on windows 7 x64, I started with only 4 files: aapt.exe, apktool.bat, apktool.jar, and framework-res.apk

ran exactly this:

C:\Users\me\apktool>apktool if framework-res.apk -ICS
I: Framework installed to: C:\Users\me\apktool\framework\1--ICS.apk

C:\Users\me\apktool>apktool d -t ICS framework-res.apk
I: Loading resource table...
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...

C:\Users\me\apktool>apktool b framework-res
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\Users\me\apktool\framework-res\
wable-sw600dp-hdpi
invalid resource directory name: C:\Users\me\apktool\framework-res\
out-sw600dp
invalid resource directory name: C:\Users\me\apktool\framework-res\
out-w600dp
invalid resource directory name: C:\Users\me\apktool\framework-res\
ues-h720dp

without touching anything, also tried with admin command prompt, no difference

am I doing something wrong?
[G1 Android Development] TUN_SD:
try that guide

always working for me!
[G1 Android Development] Rookie407:
trying to recompile framework-res.apk. now in this instance im trying to add reboot options to the power menu. when i attempt to recompile i get the following error:

i have it listed in the strings.xml properly and its in the public.xml under strings and drawable, i also have the image where it should be. i dont get this error with the reboot or recovery options so whats causing the issue with the reboot_download option?

thanks in advance.
[G1 Android Development] TUN_SD:
as far as I know, (somebody may correct me) it is not recomended, to edit the public xml. it´s created during the compile prozess.

try to delete (backup) the public and try again.
[G1 Android Development] xavierjohn22:
Correct on the it is created during compile process.
[G1 Android Development] Rookie407:
i've made the reboot options work on many a phone before but i've never come across this issue.
[G1 Android Development] TUN_SD:
why are these options not implemented in your rom?
[G1 Android Development] Rookie407:
found the issue. seems i was using a number that was too high. exmple 00419 doesnt then jump to 00420 it jumps to 0041a... my bad. =P