yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] Brut.all:
Apktool v1.4.2 has been finally released!

added support for API14 (Android 4.0) resources

updated smali to v1.3.0

added --quiet option

fixed decoding error when string ends with '%'

fixed decoding error when <plurals> contains a reference

fixed a broken res when decoding <array> with positional substitutions

Download
[G1 Android Development] tommytomatoe:
You are the man :-)

I've been quitely following the source code builds but its good to see an official build.

all you need is a lovely signature.
[G1 Android Development] lanternslight456:
I'm trying to add framework files for miui and when I click on the wiki link I get a 500 error. how would I add the framework files?
[G1 Android Development] pendo:
Lol.....I was just coming to post about the plurals decoding error I just found.

...late again as usual :rolleyes:

Thanks Brut.all
[G1 Android Development] Brut.all:
Do you mean ClassCastException error or maybe something else? Above error was fixed 6 months ago and it was included in every 1.4.2 snapshot floating around.
[G1 Android Development] sinizter:
Using 1.4.2, latest aapt. Updated to SDK 14. Tried inherent framework-res.apk from MIUI ICS (SGH-i896) along with android.jar in SDK.

Just wondering if anybody has successfully rebuilt Swiftkey?

Decompiles fine, just can't seem to get it to build...

:(
[G1 Android Development] Brut.all:
Could you upload this apk and related framework file?
[G1 Android Development] sinizter:
Sure: http://www.mediafire.com/?7enir8vzi4h7qsp

Appreciate it.
[G1 Android Development] Brut.all:
I have created an issue: http://code.google.com/p/android-apktool/issues/detail?id=252 .

You can try solution from last 2 paragraphs - replace all http://schemas.android.com/apk/res/com.touchtype with http://schemas.android.com/apk/res/com.touchtype.swiftkey in XML files. Unfortunately I am still not able to decode it, because it references android:fragment, but that attr is missing in attached framework. android:fragment is present in vanilla ICS, but there is no @android:style/ListItem and @android:style/NotificationTitle in it. That's weird.
[G1 Android Development] pendo:
In Vending.apk, apktool is creating additional parameter reference characters and will keep adding them each time you decompile. Here's plurals from the initial decompile:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<plurals name="search_results_estimated_in_bucket">
<item quantity="other">%1$d results</item>
<item quantity="one">%1$d result</item>
</plurals>
<plurals name="notification_updates_available_message">
<item quantity="other">%1$1$d updates found for %2$2$s.</item>
<item quantity="one">%1$1$d update found for %2$2$s.</item>
</plurals>
<plurals name="plus_one_multiple_global">
<item quantity="other">"%1$s people +1'd this"</item>
<item quantity="one">"%1$s person +1'd this"</item>
</plurals>
<plurals name="plus_one_multiple_friends">
<item quantity="other">"%1$1$s and %2$2$s others +1'd this"</item>
<item quantity="one">"%1$1$s and %2$2$s other +1'd this"</item>
</plurals>
</resources>

If I compiled, then decompiled again the output was this:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<plurals name="search_results_estimated_in_bucket">
<item quantity="other">%1$d results</item>
<item quantity="one">%1$d result</item>
</plurals>
<plurals name="notification_updates_available_message">
<item quantity="other">%1$1$1$d updates found for %2$2$2$s.</item>
<item quantity="one">%1$1$1$d update found for %2$2$2$s.</item>
</plurals>
<plurals name="plus_one_multiple_global">
<item quantity="other">"%1$s people +1'd this"</item>
<item quantity="one">"%1$s person +1'd this"</item>
</plurals>
<plurals name="plus_one_multiple_friends">
<item quantity="other">"%1$1$1$s and %2$2$2$s others +1'd this"</item>
<item quantity="one">"%1$1$1$s and %2$2$2$s other +1'd this"</item>
</plurals>
</resources>

So I manually removed the additional 1$, 2$, etc and then compiled. And that fixed my fc problems I mentioned earlier about how the Market would fc only when viewing some apps.
[G1 Android Development] Brut.all:
Ahh, yes, it was fixed recently.
[G1 Android Development] sinizter:
Hmmm, that's pretty unfortunate considering I did a direct adb pull. Might have something to do with Galnet's weird MIUI build on ICS framework. I haven't the slightest clue how to replace all the xml values on W7, and even then attrs would still be missing? :(

Maybe when I switch to make the eventual switch to native ICS I'll have a go at this again.

Thanks for looking into it Brut. :)
[G1 Android Development] mybeshoo:
Thank you for this program

but while i test it i got this error :

C:\android-sdk1hhb\apktool>apktool d setting.apk
ERROR: no dump file specified

what i did to install your tool is :

Download the prepackaged APKTool zip.
Extract them to a directory
Extract framework-res.apk AND apk files i want to decompile from the my ROM and copy them to the root directory of APKTool.

i did Open a command window

Navigate to the root directory of APKtool and type the following command:

apktool if framework-res.apk

the return is :

Framework installed to: C:\Users\beshoo\apktool\framework\1.apk

but when i preform :

apktool d Settings.apk

i got :

ERROR: no dump file specified

please advice
[G1 Android Development] dkdude36:
try

apktool d settings.apk /settings
[G1 Android Development] mybeshoo:
thank you but i got :

C:\Users\beshoo>C:\android-sdk1hhb\apktool\apktool.exe d C:\android-sdk1hhb\apk

tool\setting.apk C:\android-sdk1hhb\apktool\setting

ERROR: dump failed because no AndroidManifest.xml found
[G1 Android Development] Brut.all:
apktool v1.4.3 has been released! It's a bugfix release.

updated builtin framework to SDK API14

fixed some "Multiple substitutions (...)" errors

Download
[G1 Android Development] Noed:
I've read a lot in this thread but didn't find an answer:

Is it possible to uncompress and decompile XMLs from resources.arsc only, instead of the whole APK? Then recompile it back...
[G1 Android Development] thunderteaser:
Thanks, pal. You rock!
[G1 Android Development] roofrider:
I'm trying to decompile that market...gives me the following error.

It must be one of my ignorant mistakes...can some1 shed some light?

I: Decoding file-resources...
I: Decoding values*/* XMLs...
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec:
0x01030119
at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:61)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:55)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:51)
at brut.androlib.res.data.value.ResReferenceValue.getReferent(ResReferen
ceValue.java:59)
at brut.androlib.res.data.value.ResReferenceValue.encodeAsResXml(ResRefe
renceValue.java:46)
at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlAttr(ResSca
larValue.java:43)
at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(Re
sStyleValue.java:48)
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:128)
at brut.apktool.Main.main(Main.java:65)

C:\Users\Raja>

edIT::

OKok ok...

After a tiny search...i came across pendo suggesting to delete the framework.

and it decompiled fine after doing that.

now i wonder why!!?!
[G1 Android Development] djdarkknight96:
Framework is now built in. I updated the framework manually to ICS before finding that out myself. Both ways work though!

DarkGingered CM7.2 rc0 Euroskank G2x sent this on DarkXda app!
[G1 Android Development] roofrider:
Previously in 1.4.1 i had to install framework or it gave errors while compiling...so out of habit i did that in 1.4.3 too, and so i encountered that prob.

hmm.. in 1.4.3 every app seems to build/decode just fine with the inbuilt framework...but gives error (market.apk specifically) if i install my framework

Thanks :)
[G1 Android Development] pendo:
Framework files have always been built in afaik. But the included framework files from whatever sdk it was last updated to. From time to time when new api's are released and the sdk is updated there will always be a short period of time that apktool doesn't have the latest definitions. So if you try to decode a apk that uses one of those new api's that apktool isn't aware of yet, well you get that error.

Deleting 1.apk will cause apktool to generate another one based on whatever set of api definitions it has internally. That is why deleting 1.apk worked for you like it did.

@Brut.all,

I've had a few pm's on this same subject recently, too...I would like to humbly suggest that should be some instructions or a wiki maybe about this scenario on the project site.
[G1 Android Development] roofrider:
that explains..

i think the reason i get errors when i use my framework is cuz maybe my rom(cm7.1) isn't up to date and i'm using market 3.3.11

Done.
[G1 Android Development] fear2142:
Guys, I can't compile systemUI.apk, have this problem. ICS, Galaxy Nexus.
[G1 Android Development] askpcguy:
I am reposting this here, in case there is a workaround or something. http://code.google.com/p/android-apktool/issues/detail?id=267#makechanges
[G1 Android Development] djdarkknight96:
Ahhhhh, makes sense. .....deleted the rest....duh already answered!

DarkGingered CM7.2 rc0 Euroskank G2x sent this on DarkXda app!
[G1 Android Development] fear2142:
Guys, please help me with this problem.
[G1 Android Development] pendo:
I do not have this problem with g-nexus systemui. In that error list, it's showing several directories that I do not see when I decompile as well.

I've never worked with apktool on windows, and am unfamiliar in general wrt terminal/command work in windows. Do you have access to a Linux install where you could try to decompile?

The only thing I can think of is that perhaps apktool needs to update it's 1.apk file in whatever directory it's stored in for your system. (for you maybe D:\apktool\framework ??) I'm not sure that will fix this problem though as building errors seem to be mostly associated with a problem with aapt (in my admittedly limited experience)
[G1 Android Development] SunnyOK:
In 1.4.3, \n\n is decomplied as a hiden return. This causes the problen.
[G1 Android Development] Brut.all:
What problem? It's decompiled as a new line, but not hidden.
[G1 Android Development] texture:
Hi, i try to decompile ICS framework-res.apk from HTC Sensation, i installed apktool 1.4.3,then i execute the following command:

apktool if framework-res.apk

I receive some "W: Config flags size > 36" then "I: Framework installed at..."

On the next step i decompiled framework-res apk,but when i try to rebuild it without changing nothing i have these errors:

Anyone can help me?

Thanks.
[G1 Android Development] 00McD00:
Having the exact same problem. Running Windows 7 and apktool 1.4.3 and I can't recompile an UNmodified (using the stock one just to test if it was working) SystemUI.apk from ICS 4.0.3 I get the same errors. Any help on the matter would be greatly appreciated. Also, I tried deleting the 1.apk with no luck. Thanks.

Edit: replace the file in your "apktool" folder with the one attached (unzip, use file inside) and it should solve the problems of not being able to recompile ICS system apks. Did for me at least. All it is, is the updated aapt.exe from the latest android SDK. Hope this helps!
[G1 Android Development] iBotPeaches:
Still failed :( even with the new aapt file.

Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Connor\AppData\Local\Temp\APKTOOL5233352387388256370.tmp, -x, -S, C:\Users\Connor\Desktop\New folder\framework-res\
res, -M, C:\Users\Connor\Desktop\New folder\framework-res\AndroidManifest.xml]
[G1 Android Development] alejobog:
do I feel the same with framework-res.apk Samsung vibrant ICS 4.0.3, any solution?, thank you.
[G1 Android Development] raziel23x:
there is a space in your path that its the problem
[G1 Android Development] iBotPeaches:
Thanks, I think that was just a copy and paste error though, because there is no space in any of my paths when running the program.
[G1 Android Development] Droidzone:
How does one get this:

I tried apktool d -d, but it's still .smali extension
[G1 Android Development] trailblazerz11:
I used apktool 1.4.3 and the aapt.exe from several posts back and I get attached error trying re-compile after a small edit in values/bools.xml in framework-res.apk for ICS 4.0.3 port

EDIT: Apparently adding a "%" before the second "%d" in plurals.xml for every values folder allows it to compile.

Can anyone explain why this works? And why i got erros in first place?
[G1 Android Development] roofrider:
I get the plurals.xml line 79 multiple substitutions error too when building ics framework..(just apktool d & apktool b)

waiting for a fix.

issues are already up on the project site, and he is aware of it i guess.

waiting...

------edit-------

adding % fixed it, but building took a long time.
[G1 Android Development] Droidzone:
Does anyone know how to get .java files from apks , as documented in the video on his project page. I know it was taken off on the interim, but wondering if out ever came back..
[G1 Android Development] pendo:
This probably doesn't help any unless you're building apktool yourself, but I know that in 1.4.3 there was something changed that fixed a decompile error that I found in plurals.xml from Vending.apk. Apktool 1.4.2 was adding additional reference characters 1$, 1$, etc. He edited something though in the latest version which corrected that. Might be a place to look...

Use a previous apktool.

Just to test, I have a previous version of 1.4.2 (that I had updated api's a little) that had the debug feature working.
[G1 Android Development] eckischeich:
Where is this file supposed to be dropped? Is it supposed to be in the Android SDK or in the Apktool folder? I don't have a folder called "apktool" neighter in the Android SDK nor in the Apktool folder. Even creating a new folder with that specific name, didn't solved the problem for me.
[G1 Android Development] the1dynasty:
so i think i've got the idea for decompiling files to edit them etc... now i can't figure out how to recompile them!! help???!!
[G1 Android Development] djdarkknight96:
It seems I can decompile with this then compile with apk multi tool to compile just fine. I guess that's how it's gonna be until this gets updated.

DarkGingered CM7.2 rc0 Euroskank G2x sent this on DarkXda app!
[G1 Android Development] dkdude36:
hey guys. what does W: Skipping "android" package group mean? thats the only error i'm getting when decomping swiftkey, but it causes a good few hundred lines of errors when recompiling even with no modifications.
[G1 Android Development] the1dynasty:
thanks to denverg i got everything fixed and working fine!!
[G1 Android Development] selaludiam:
i've got error, appt.exe crash when i compile SemcGenericUxpRes

i didn't change anything on it

xperia arc 2.3.4 FW .42
[G1 Android Development] jocala:
I tried:

apktool d test.apk out/

followed by

apktool b out output.apk

Where test.apk is a working program. The out/ directory contents seem to be produced ok and the file output.apk is produced w/o error but fails to run. Permissions for output.apk seem ok, if that's even an issue.

What am I missing?
[G1 Android Development] Hatman41:
I am trying to recompile systemui.apk in ICS and am getting the following error. I am using apktool 1.4.3

-----------------------------------------------------
[*] SystemUI.apk
-----------------------------------------------------
Recompiling SystemUI.apk folder...
I: Smaling...
I: Building resources...
invalid resource directory name: D:\android-sdk-windows\tools\xdaAutoTool\_INPUT_APK\SystemUI\res/drawable-sw600dp-xhdpi
invalid resource directory name: D:\android-sdk-windows\tools\xdaAutoTool\_INPUT_APK\SystemUI\res/layout-sw600dp
invalid resource directory name: D:\android-sdk-windows\tools\xdaAutoTool\_INPUT_APK\SystemUI\res/values-sw600dp
invalid resource directory name: D:\android-sdk-windows\tools\xdaAutoTool\_INPUT_APK\SystemUI\res/values-sw600dp-port
invalid resource directory name: D:\android-sdk-windows\tools\xdaAutoTool\_INPUT_APK\SystemUI\res/values-sw720dp
invalid resource directory name: D:\android-sdk-windows\tools\xdaAutoTool\_INPUT_APK\SystemUI\res/values-sw720dp-port
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Jeffrey\AppData\Local\Temp\APKTOOL6347937681071420132.tmp, -I, C:\Users\Jeffrey\apktool\framework\1.apk, -S, D:\android-sdk-windows\tools\xdaAutoTool\_INPUT_APK\SystemUI\res, -M, D:\android-sdk-windows\tools\xdaAutoTool\_INPUT_APK\SystemUI\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:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Jeffrey\AppData\Local\Temp\APKTOOL6347937681071420132.tmp, -I, C:\Users\Jeffrey\apktool\framework\1.apk, -S, D:\android-sdk-windows\tools\xdaAutoTool\_INPUT_APK\SystemUI\res, -M, D:\android-sdk-windows\tools\xdaAutoTool\_INPUT_APK\SystemUI\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more
Done!
[G1 Android Development] roofrider:
u sure ur using apktool and not autotool...if yes then remove auto tool and try, or post in that thread.

i dunno, never used autotool.
[G1 Android Development] dkdude36:
did you sign it? that's neccesary for apps that go in /data/app
[G1 Android Development] Hatman41:
Yes you were corrected I did use the autotool but I also had 1.4.3 in it..I tried it the command line way and it worked. I should have tried that before I posted. Sorry about that.
[G1 Android Development] sj8023ld:
http://code.google.com/p/android-ap... Type Status Priority Milestone Owner Summary

can any one help me ?
[G1 Android Development] devilloki:
what mean

"apktool if"
[G1 Android Development] Droidzone:
Install Framework-read the wiki
[G1 Android Development] tommytomatoe:
Sign your app :-)

Use a testsign.jar, your own private keys, or an auto sign tool. Then install.

Alternative: use archive manager like 7zip or betterzip. Take the original META-INF from old apk and put inside new apk. Then push to system/app

apktool if "name of framework apk"

Basically, you're telling apktool, if this framework, use these resources.

For some aosp based roms you are good to go (1.4.3 uses ics resources)

But for some you need custom resources. Run:

apktool if framework-res.apk

Then if you on sense, in addition yo the above command, run:

apktool if com.htc.resources.apk

If you on touchwhiz, run this instead:

apktool if tw-framework.apk (might be a different name...)

That's it! Now you have the necessary resources to decode your apk.
[G1 Android Development] jocala:
It was a system app. However, problem solved. I updated to a new version and all is well.

Thanks!
[G1 Android Development] Droidzone:
It'd be awesome if you could share the source, or at least the binary

I can do apktool d -d on mine, but the result is not java, just smali. Wonder whether Brut could update it to include options done by dex2jar and jdgui too in apktool. Now that would be awesome, even if results arent accurate...at least with the help of eclipse, one could eventually fix it.
[G1 Android Development] vegetaleb:
Still no way to decompile,edit then recompile ICS systemui.apk from sense?

It's getting me crazy!
[G1 Android Development] raziel23x:
December 7th is the last day any active development has been done. I guess he been on winter break/vacation. Hopefully there will be more development soon.
[G1 Android Development] devilloki:
thank u!i don't understand why install it!

today,with friend's help,i understand.

---------- Post added at 09:14 PM ---------- Previous post was at 09:12 PM ----------

decompile the framework-res.apk in virtuous_quattro_beta7_saga,

then doesn't compile it .
[G1 Android Development] jocala:
I tried using apktool to edit TouchWiz30Launcher.apk

Next:

Next:

The resulting apk file will not execute.

Also, I never see Loading resource table 2.apk

Finally, the 2.apk is only 60K and contains just a resources.arsc file.

This is a system apk, so it's not signed.

Thanks for any help!
[G1 Android Development] Droidzone:
It might have more dependencies than just that one file. It's a guess. HTC has minimum of two files and additional framework
[G1 Android Development] pendo:
All versions of apktool are available for download here.
[G1 Android Development] jonata:
hi,

help about this problem :

try to decompile systemUI.apl but receive error about "java is not internal or external command ..."

where I'm in wrong ?

I've download the apktoolm put into a folder and executem from terminal, this coomand :apktool if framework-res.apk

received error about "java command"

tks for help
[G1 Android Development] Droidzone:
Oh come on now...Isnt that self explanatory? You dont have java installed, or not in the path!
[G1 Android Development] Droidzone:
Thank you.. But do you have your own updated version which can generate .java files?
[G1 Android Development] jonata:
I see in my pc java version ....

wich path I need to put ?

tks mate
[G1 Android Development] pendo:
Hi Jonata,

Thank you for coming over to try and learn to do some of this yourself. ;) As mentioned in the requirements from apktool's main page you need to have Java Runtime Environment installed. JDK works as well... I don't think you're on a Mac cause you'd already be good to go. If you're on Ubuntu, this command should work for you in terminal

apt-get install sun-java6-jdk sun-java6-jre

If you're using Windows this page has downloads in 32 and 64 bit varieties.

No, I do not. I've only used that feature a handful of times myself none of which was recently. I'm not even sure where that code is within apktool, so I'm afraid I can't offer much else in the way of help.
[G1 Android Development] jonata:
hi pendo ..

now apktool works !

decompile my systemui.apk edit the file and when try to recompile the file have this :

F:\APKTool>apktool b systemui.apk

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:182)

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

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

F:\APKTool>

if resolve this, need also to sign the apk ?

tks mate
[G1 Android Development] Droidzone:
Do run

apktool

without any options to see the format of options

The format is

apktool b sourcedir destinationfile.apk

You should not sign system apks. You should sign data apks