yashsingh1/xdaforums huggingface dataset:
[Android Software Development] invano:
Hi [MENTION=3924617]iBotPeaches[/MENTION],

I'm trying to decompile Keyguard.apk (com.android.keyguard) from KK but I have problems in decoding resources + an exception.

Maybe it's helpful for you the log:

Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 0x01040ab5
at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:61)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:58)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:54)
at brut.androlib.res.data.value.ResReferenceValue.getReferent(ResReferenceValue.java:62)
at brut.androlib.res.data.value.ResReferenceValue.encodeAsResXml(ResReferenceValue.java:46)
at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlAttr(ResScalarValue.java:44)
at brut.androlib.res.decoder.ResAttrDecoder.decode(ResAttrDecoder.java:40)
at brut.androlib.res.decoder.AXmlResourceParser.getAttributeValue(AXmlResourceParser.java:313)
at org.xmlpull.v1.wrapper.classic.XmlPullParserDelegate.getAttributeValue(XmlPullParserDelegate.java:69)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartTag(StaticXmlSerializerWrapper.java:267)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(StaticXmlSerializerWrapper.java:211)
at brut.androlib.res.decoder.XmlPullStreamDecoder$1.event(XmlPullStreamDecoder.java:80)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDecoder.java:130)
at brut.androlib.res.decoder.ResStreamDecoderContainer.decode(ResStreamDecoderContainer.java:34)
at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:107)
at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:91)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:238)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:115)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)

I ofc have the frameworks in the right place and I tried with apktool 1.5.2 ans 2.0.0 - beta7
[Android Software Development] L_S:
Use apktool from this: http://slimroms.net/index.php/downloads/dlsearch/viewcategory/1151-development made for roms with trds (dark ui switch). I tried on beanstalk and rr and only with this works :)
[Android Software Development] Ticklefish:
Got a strange issue with an LG rom. The 'lgsetting.apk' has some changes in 'arrays.xml' when decompiled and recompiled with apktool 2.0.0b9:

I did some googling and discovered this was a known issue with older apktools since LG have constructed the apk differently to how they should...but I thought it was fixed for apktool 2..?

The files can be found here:

http://www.mediafire.com/download/l1lj45g177mj66o/4_Tickle.7z

Any help would be appreciated. :good:

On a separate note, would it be possible to include an option in apktool 2 to output to a text file as well as to the screen? It's not a must-have, but it would be very handy! :)
[Android Software Development] TorqueWrench001:
Awesome! So far this is working. Installed framework and decompiled. Now to try some mods.

Hit your thanks button L_S, thank you for replying, I was kind of stumped.
[Android Software Development] iBotPeaches:
I thought I did fix this, I must of broken it. Yet, unit-tests are 100% still. I'll re-add these examples into unit-tests then fix it, I wonder whats tripping it up. (Its basically double escaping / escaping when it shouldn't).
[Android Software Development] Ticklefish:
Thank you. I hate to give you more to do..but it's definitely appreciated!
[Android Software Development] DSA:
:1453: error: Error: No resource found that matches the given name (at 'dialogTi
tleDecorLayout' with value '@layout/dialog_title_holo_light').

concentrate on that bit
[Android Software Development] iBotPeaches:
https://github.com/iBotPeaches/Apktool/commit/251a6bbb11d64f106f268b9de3156bef7f8c2c76

I couldn't duplicate this at all with my local install :( however there has been about 20 commits since Beta 9. So maybe it was fixed.

EDIT: I have no plans for adding output to text file, as that can be done with basic piping in unix.
[Android Software Development] Ticklefish:
Well, that's alright then. :D

I was actually after outputting to text file in MS-DOS..but I hadn't thought about the need for unix compatibility. That might make things more complicated than it needs to be. Oh well, it was only an idea.
[Android Software Development] cowsquad:
No disrespect but you look smart :) you should move to Linux LOL
[Android Software Development] Ticklefish:
Oh, one day, one day. Funny you mention it really..I'm thinking about trying out Linux as soon as I get some free time.

It's finding that free time which is the tricky part. To those of you who aren't married or who don't have kids, I say TAKE ADVANTAGE OF YOUR FREEDOM NOW!!
[Android Software Development] Bouziane_Dr:
Solution

Try this process:

0. Run if framework ---------> Code: java -jar apktool.jar if framework-res.apk

1. Decompile YourAPK ---------> Code: java -jar apktool.jar d -s YourAPK.apk

2. Open apk file in 7zip (open not extract!)

3. Copy RESSOURCES.arsc to the decompiled dir (YourAPK folder)

4. Recompile YourAPK ---------> Code: java -jar apktool.jar b YourAPK

I use apktool but that's true for apkmultitool, VTS, androidMultitool ....
[Android Software Development] spiderio:
Hi guys..

I have an error when recompiling some system apk

I already installing frameworks res, lge-res and system-ui

I think this apk need another dependency

How do I know what apk/resource that it need???
[Android Software Development] DSA:
Well what do the logs state? Are we meant to guess?
[Android Software Development] spiderio:
First error is missing resource [MENTION=294944]COM[/MENTION].lge.internal:style/Holo.white.

After that the error related to missing translation

Warning : String pin_menu_pin Has no default translation In d:/apktool/LGKeyguard/res
[Android Software Development] ag4751:
The warning are not a problem for you its the styles error that is but without seeing the full details again we would just be guessing
[Android Software Development] opssemnik:
Ok found the answer. but another question. is there anyway to make apktool show me all the errors that i´ve got in my xml´s?

it compiles,find the first error. and throw it away
[Android Software Development] steal25:
while trying to decompile Phone.apk from the latest KK release for htc one m8 i get this error

C:\Users\edward\Desktop\stock m8 rooted\2.0\system\priv-app>apktool2 d "C:\Users\edward\Desktop\stock m8 rooted\2.0\system\priv-app\Phone.apk"
I: Using Apktool 2.0.0-Beta8-d5d03fe1e4 on Phone.apk
I: Loading resource table...
[COLOR="Red"][B]Exception in thread "main" brut.androlib.AndrolibException: Multiple resources:
spec=0x7f0a0088 dimen/custom_15_font_size, config=-mdpi[/B][/COLOR]
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:63)
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:56)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:199)

at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:168
)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:134)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:10
9)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:81)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibRes
ources.java:603)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.jav
a:74)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.jav
a:66)
at brut.androlib.Androlib.getResTable(Androlib.java:49)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:93)
at brut.apktool.Main.cmdDecode(Main.java:169)
at brut.apktool.Main.main(Main.java:85)

I've tried with both the latest apktool2 and apktol 1.5.3 with the same results, I've even tried hex editing the dimen out befro decompiling and same result. any help would be appreciated. Thanks
[Android Software Development] metalfan78:
I was getting those same errors until I got the framework and HTC resources installed correctly, since then I haven't had errors. I don't know if that helps or not.
[Android Software Development] steal25:
are you talking about the one i posted? If so you can successfullt decompile Phone.apk fro the latest KK release for htc one m8?
[Android Software Development] metalfan78:
Let me try the phone apk real quick
[Android Software Development] steal25:
If it works let me know how, because the error has nothing to do with what res is installed it's an error in the apk it's self
[Android Software Development] metalfan78:
I got 'invalid theme mode' errors, but it decompiled fine. It automatically dropped some resources like dimen-xdhpi-err5

C:\apktool>apktool d Phone.apk

I: Baksmaling...

I: Loading resource table...

W: Invalid theme mode value: 4

W: Invalid config flags detected. Dropping resources: dimen-mdpi-ERR0

W: Invalid theme mode value: 5

W: Invalid config flags detected. Dropping resources: dimen-mdpi-ERR1

W: Invalid theme mode value: 4

W: Invalid config flags detected. Dropping resources: dimen-hdpi-ERR2

W: Invalid theme mode value: 5

W: Invalid config flags detected. Dropping resources: dimen-hdpi-ERR3

W: Invalid theme mode value: 4

W: Invalid config flags detected. Dropping resources: dimen-xhdpi-ERR4

W: Invalid theme mode value: 5

W: Invalid config flags detected. Dropping resources: dimen-xhdpi-ERR5

W: Invalid theme mode value: 4

W: Invalid config flags detected. Dropping resources: dimen-xxhdpi-ERR6

W: Invalid theme mode value: 5

W: Invalid config flags detected. Dropping resources: dimen-xxhdpi-ERR7

W: Skipping "android" package group

I: Loaded.

I: Decoding AndroidManifest.xml with resources...

I: Loading resource table from file: C:\Users\Kevin\apktool\framework\1.apk

I: Loaded.

I: Regular manifest package...

I: Decoding file-resources...

I: Loading resource table from file: C:\Users\Kevin\apktool\framework\2.apk

I: Loaded.

I: Decoding values */* XMLs...

I: Done.

I: Copying assets and libs...

C:\apktool>
[Android Software Development] iBotPeaches:
Hmm.

Those with new M8 apks. Could you go here: https://code.google.com/p/android-apktool/issues/detail?id=534 , and start uploading frameworks & affected apks.

Maybe some of these newer HTC apks will have a key to solve all the previous HTC problems.
[Android Software Development] steal25:
I dont get that error with latest apktool2 and updated resources, Latest com.htc.resources installs with out those errors, and can be de/recompiled with out causing the errors through out system like before; this issue with phone apk looks like it has either double public identifiers or some how has that dimen in dimens.xml twice
[Android Software Development] metalfan78:
Yea, so far that's the only apk that has given me errors. I've decompiled a few others no problem
[Android Software Development] steal25:
Posted there, thanks for your help!
[Android Software Development] Phone_Guru:
Will Apktool work with Java 8 or should I keep Java 7 installed?

Any progress with the Google apps bug?

Thanks.
[Android Software Development] biobio76:
can anybody tell me how to decompile correctly some apks from an HUAWEI rom...android 4.2.2

my problem is I was able somehow to deodex this rom, but when I try to load framework-res.apk as well as framework-res-hwext.apk I got

below error:

W: Config flags size > 38. Exceeding bytes: 0x9C00.

W: Invalid config flags detected: string-ERR0

W: Config flags size > 38. Exceeding bytes: 0x9C00.

W: Invalid config flags detected: string-ERR1

W: Config flags size > 38. Exceeding bytes: 0x8801.

W: Invalid config flags detected: string-ERR2

W: Config flags size > 38. Exceeding bytes: 0x9C00.

W: Invalid config flags detected: string-ERR3

W: Config flags size > 38. Exceeding bytes: 0x9C00.

W: Invalid config flags detected: string-ERR4

W: Config flags size > 38. Exceeding bytes: 0x9C00.

W: Invalid config flags detected: string-zh-rCN-ERR5

W: Config flags size > 38. Exceeding bytes: 0x9C00.

W: Invalid config flags detected: string-zh-rCN-ERR6

W: Config flags size > 38. Exceeding bytes: 0x9C00.

W: Invalid config flags detected: string-zh-rCN-ERR7

W: Config flags size > 38. Exceeding bytes: 0x9C00.

W: Invalid config flags detected: string-zh-rCN-ERR8

W: Config flags size > 38. Exceeding bytes: 0x9C00.

W: Invalid config flags detected: plurals-ERR9

W: Config flags size > 38. Exceeding bytes: 0x9C00.

W: Invalid config flags detected: plurals-ERR10

W: Config flags size > 38. Exceeding bytes: 0x9C00.

W: Invalid config flags detected: plurals-ERR11

W: Config flags size > 38. Exceeding bytes: 0x9C00.

W: Invalid config flags detected: plurals-ERR12

W: Config flags size > 38. Exceeding bytes: 0x9C00.

W: Invalid config flags detected: plurals-zh-rCN-ERR13

W: Config flags size > 38. Exceeding bytes: 0x9C00.

W: Invalid config flags detected: plurals-zh-rCN-ERR14

W: Config flags size > 38. Exceeding bytes: 0x9C00.

W: Invalid config flags detected: plurals-zh-rCN-ERR15

W: Config flags size > 38. Exceeding bytes: 0x9C00.

W: Invalid config flags detected: plurals-zh-rCN-ERR16

don't really what to do ....
[Android Software Development] Primokorn:
I have almost the same issue with the Contacts.apk from a CM11 based ROM even after installed the framework-res.apk (APKTOOL 2.0.0 BETA 9).

Today do u have a solution to solve this?
[Android Software Development] iBotPeaches:
Nope, still researching. Sorry. I have no clue about Java8, didn't even know it was out yet.

My guess is non-standard qualifiers. Which is what explains those errors. Huawei is notorious for modifying AOSP for no reason all over the place, thus producing these APKs.
[Android Software Development] biobio76:
Thanks for your explanation..... But do you think, somehow, one way can be found to decompile the apks I need?

I am stacked on this since weeks and nobody can help me... Sigh
[Android Software Development] slim80:
Apktool v2.0 RC1 work fine for me with java 8 update 5 (win 8.1).

Inviato dal mio SM-G900F utilizzando Tapatalk
[Android Software Development] Phone_Guru:
Do you ONLY have java 8 installed or 7 as well and what's APKTool 2.0 RC1? The last release was beta 9.
[Android Software Development] slim80:
I installed java 8 over java 7. Now i have only java 8.

I compiled apktool RC1 from source files. But i think that it's the same. No changes between b9 last source and RC1 ;)

Inviato dal mio SM-G900F utilizzando Tapatalk
[Android Software Development] Theos_:
Hi [MENTION=1989166]spiderio[/MENTION],

I think i have the same problem with the same apk.

I need to mod LGKeyguard.apk (from Gpro II rom) to fix the quickcover on 380dpi

but i have the same errors when i recompile.

can you help me ?

[ Thx for you rom and your quickwindow fix on 4.2.2(spiderio : http://xdaforums.com/show...3&postcount=89), Amazing work !! :good:

but i really want to fix the quickwindow size on CloudyProII 2.0) ]

Thx,

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

Sorry for my frenchy English ;)
[Android Software Development] superuser.pm:
help me i have same issue when i compliling

i'm installed java and framework-res.apk

i can decompli file .apk but can't recompli
[Android Software Development] Spannaa:
Try using APKtool from this thread instead of easy apk disassembler ;)

Sent from my GT-I9300...
[Android Software Development] krija:
Everything what you need is at lge-res.apk. decompile it and there (res\values\styles.xml) you can find something like this:

<style name="Widget.Holo.Light.Button" parent="@style/Widget.Button">
<item name="android:textAppearance">?android:textAppearanceMediumInverse</item>
<item name="android:textSize">18.0sp</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">@color/primary_text_holo_light</item>
<item name="android:background">@drawable/btn_default_holo_light</item>
<item name="android:minWidth">64.0dip</item>
<item name="android:minHeight">48.0dip</item>
</style>

This little example is from cloudyflex 2.0.

And i think now you know what to do ;)

Good luck!
[Android Software Development] kermage:
currently using the latest apktool, java, and windows 8.1...no problems so far :D
[Android Software Development] Jarmezrocks:
This was what we used to have to do way back in version 1.5 or something like that?

This has come back to haunt us.
[Android Software Development] zelendel:
It's because you didn't install the systemui apk when you installed the other frameworks. You have to install both the framework-res, systemui as well as any oem frameworks files.
[Android Software Development] zelendel:
Is there a normal systemui?
[Android Software Development] zelendel:
Let me get home and I'll look more. I am mobile right now so can't dig in to deep. I'll let you know when/if I find something before the OP replies.
[Android Software Development] deuce_biggins:
Not my expertise but...did you run "apktool if SystemUI.apk" prior to decompiling? Also, I had issues on windows using 64 bit java and apktool 2.0...I had to use 32 bit
[Android Software Development] Ticklefish:
LG strikes again..

I've got a SystemUI.apk that won't recompile as it complains about 'com.lge.internal'..

When decompiled, there's mention of a renamed manifest package.

Decompiling:

Recompiling:

This is using both the public beta of apktool 2 as well as some versions compiled from the latest committs. Interestingly, apktool 1.5.2 has no problems at all. There are some translation warnings but that's it..

Here are the apk's: https://www.mediafire.com/?tgnwol24tckm2wy
[Android Software Development] anagramgenius:
how to install the framework file in the working folder rather than C:\Users\*******\apktool\ ?
[Android Software Development] sixgunmojo:
Yes, I ran "apktool if SystenUI.apk". I've briefly looked at installing 32 bit java on a 64 bit linux box and.........eff me, probably be better to wait til I have access to my mom's or sister's windows box. Still gonna try to figure this out though. :mad:

[MENTION=5772646]deuce_biggins[/MENTION] Double thanks amigo! :good::good:15 mins after i posted this I found a mostly painless (only took about an hour :)) way to run both 32 and 64 bit java on my box and everything appears to be working, or at least it re-compiles now. I'll test with some mods tomorrow cause I'm to old to be up this late hacking my boxes :p
[Android Software Development] iBotPeaches:
Fixed: https://github.com/iBotPeaches/Apktool/commit/584d1cda18bd372a72cbb5759adc9d24a194014e

-p,--frame-path <dir> Uses framework files located in <dir>.
[Android Software Development] romasik:
Please help me , not compile apk (non system) for android 4.4.2

All try :(

java version "1.7.0_51"

Java(TM) SE Runtime Environment (build 1.7.0_51-b13)

Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)

ERROR: input directory 'C:\Users\Romasik\AppData\Local\Temp\APKTOOL3239419219362118088.tmp' does not exist

Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\Romasik\AppData\Local\Temp\brut_util_Jar_8857049550375331072.tmp, p, --forced-package-id, 127, --min-sdk-version, 4, --target-sdk-version, 14, --version-code, 1, --version-name, , -F, C:\Users\Romasik\AppData\Local\Temp\APKTOOL3239419219362118088.tmp, -0, arsc, -I, C:\Users\Romasik\apktool\framework\1.apk, -S, D:\Android\APKmanager\other\..\projects\LS980_AutoRec.apk\res, -M, D:\Android\APKmanager\other\..\projects\LS980_AutoRec.apk\AndroidManifest.xml]

at brut.androlib.Androlib.buildResourcesFull(Androlib.java:434)

at brut.androlib.Androlib.buildResources(Androlib.java:362)

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

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

at brut.apktool.Main.cmdBuild(Main.java:233)

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

Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\Romasik\AppData\Local\Temp\brut_util_Jar_8857049550375331072.tmp, p, --forced-package-id, 127, --min-sdk-version, 4, --target-sdk-version, 14, --version-code, 1, --version-name, , -F, C:\Users\Romasik\AppData\Local\Temp\APKTOOL3239419219362118088.tmp, -0, arsc, -I, C:\Users\Romasik\apktool\framework\1.apk, -S, D:\Android\APKmanager\other\..\projects\LS980_AutoRec.apk\res, -M, D:\Android\APKmanager\other\..\projects\LS980_AutoRec.apk\AndroidManifest.xml]

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:481)

at brut.androlib.Androlib.buildResourcesFull(Androlib.java:415)

... 5 more

Caused by: brut.common.BrutException: could not exec command: [C:\Users\Romasik\AppData\Local\Temp\brut_util_Jar_8857049550375331072.tmp, p, --forced-package-id, 127, --min-sdk-version, 4, --target-sdk-version, 14, --version-code, 1, --version-name, , -F, C:\Users\Romasik\AppData\Local\Temp\APKTOOL3239419219362118088.tmp, -0, arsc, -I, C:\Users\Romasik\apktool\framework\1.apk, -S, D:\Android\APKmanager\other\..\projects\LS980_AutoRec.apk\res, -M, D:\Android\APKmanager\other\..\projects\LS980_AutoRec.apk\AndroidManifest.xml]

at brut.util.OS.exec(OS.java:89)

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:475)

... 6 more
[Android Software Development] BeansTown106:
has anyone fixed the issue with apktool if framework-res.apk with the newer slimroms/liquid etc the ones that have the holo dark folders etc?

this is my error.. :(

really need to get into this apk so i can match up some id's against touchwiz for some aosp mods im porting

apktool if framework-res.apk
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x01080220 drawable/default_wallpaper, config=-sw600dp-nodpi
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:63)
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:56)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:193)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:162)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:128)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:103)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:81)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:40)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResources.java:675)
at brut.androlib.Androlib.installFramework(Androlib.java:641)
at brut.apktool.Main.cmdInstallFramework(Main.java:252)
at brut.apktool.Main.main(Main.java:91)

EDIT: sorry found slimroms apktool that worked https://github.com/SlimRoms/apktool use the kk2.0 branch not kk1.0
[Android Software Development] zelendel:
Most roms other then CM will be using that so you may want to hold on to it. Mainly as the themes will work differently with anything that uses their toggle or the new theme engine they are working on.
[Android Software Development] Kapiljhajhria:
32 bit ubuntu

can i use apktool on 32bit ubuntu system?
[Android Software Development] Lgrootnoob:
still plaguing me.

http://pastebin.com/gFPevnp0

is it because apkmultitool isnt updated yet?