sky201503 / android-apktool2

Automatically exported from code.google.com/p/android-apktool
0 stars 0 forks source link

Can't distinguish resources with "xlarge" #163

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Decode an apk which has "xlarge" resources (such as Advanced Task Manager v5.4) 
with apktool 1.3.1.

After completed decoding, you will find that the "layout-xlarge" and 
"layout-xlarge-land" folders has been renamed to "layout-v4" and 
"layout-land-v4", which is completely NOT incorrect!

If I correct the two folders' name to the proper ones, then I'll receive an 
Error output:

I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\Users\Anrik\Desktop\APKTool\apk\res/layout-x
large
invalid resource directory name: C:\Users\Anrik\Desktop\APKTool\apk\res/layout-x
large-land
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\Anrik\AppData\Local\Temp\A
PKTOOL4385591240347207579.tmp, -I, C:\Users\Anrik\apktool\framework\1.apk, -S, C
:\Users\Anrik\Desktop\APKTool\apk\res, -M, C:\Users\Anrik\Desktop\APKTool\apk\An
droidManifest.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:\U
sers\Anrik\AppData\Local\Temp\APKTOOL4385591240347207579.tmp, -I, C:\Users\Anrik
\apktool\framework\1.apk, -S, C:\Users\Anrik\Desktop\APKTool\apk\res, -M, C:\Use
rs\Anrik\Desktop\APKTool\apk\AndroidManifest.xml]
        at brut.util.OS.exec(Unknown Source)
        ... 7 more

If I use apktool 1.3.2, then I'll receive an Error output when decoding: 

I: Copying raw classes.dex file...
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources:
spec=0x7f030000 layout/activity_application_tab, config=[DEFAULT]
        at brut.androlib.res.data.ResConfig.addResource(Unknown Source)
        at brut.androlib.res.data.ResConfig.addResource(Unknown Source)
        at brut.androlib.res.decoder.ARSCDecoder.readEntry(Unknown Source)
        at brut.androlib.res.decoder.ARSCDecoder.readConfig(Unknown Source)
        at brut.androlib.res.decoder.ARSCDecoder.readType(Unknown Source)
        at brut.androlib.res.decoder.ARSCDecoder.readPackage(Unknown Source)
        at brut.androlib.res.decoder.ARSCDecoder.readTable(Unknown Source)
        at brut.androlib.res.decoder.ARSCDecoder.decode(Unknown Source)
        at brut.androlib.res.AndrolibResources.getResPackagesFromApk(Unknown Sou
rce)
        at brut.androlib.res.AndrolibResources.loadMainPkg(Unknown Source)
        at brut.androlib.res.AndrolibResources.getResTable(Unknown Source)
        at brut.androlib.Androlib.getResTable(Unknown Source)
        at brut.androlib.ApkDecoder.getResTable(Unknown Source)
        at brut.androlib.ApkDecoder.decode(Unknown Source)
        at brut.apktool.Main.cmdDecode(Unknown Source)
        at brut.apktool.Main.main(Unknown Source)

I have tried Honeycomb's framework-res.apk but still not work. I think maybe 
apktool is not compatible for "xlarge" resources.

Original issue reported on code.google.com by liyuanmi...@gmail.com on 6 May 2011 at 8:08

GoogleCodeExporter commented 9 years ago

Original comment by Brut.alll on 6 May 2011 at 9:51

GoogleCodeExporter commented 9 years ago
I got the same problem as you. And i tried to download the latest Apktool and 
the problem was solved.

Original comment by htc.jack...@gmail.com on 26 Aug 2011 at 3:29