desword / android-apktool

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

Apktool fails on resource decoding #758

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download JA Sensei application verion 3.2.2 (it's free app)
2. Try to d[ecode] it with apktool
3. Apktool fails to do it

What is the expected output? What do you see instead?

It seems there is some trouble in decoding resourses. If I provide --no-res 
switch, all works fine. But I need unpacked resources too =)

What version of the product are you using? On what operating system?

I've tried ApkTool version 1.5.2 and 2.0.0rc3 on Gentoo GNU/Linux x86_64, 
OpenJDK 1.7.0_71

Please provide any additional information below.
Output of ApkTool v1.5.2:
user@host ~/Desktop/APKs $ apktool d 
com.japanactivator.android.jasensei_3.2.2.apk 
I: Baksmaling...
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Could not decode 
arsc file
    at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:56)
    at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:491)
    at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:74)
    at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:66)
    at brut.androlib.Androlib.getResTable(Androlib.java:50)
    at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:189)
    at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
    at brut.apktool.Main.cmdDecode(Main.java:146)
    at brut.apktool.Main.main(Main.java:77)
Caused by: java.io.IOException: Expected: 0x001c0001, got: 0x00000000
    at brut.util.ExtDataInput.skipCheckInt(ExtDataInput.java:48)
    at brut.androlib.res.decoder.StringBlock.read(StringBlock.java:44)
    at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:102)
    at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:83)
    at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
    ... 8 more

Output of ApkTool v2.0.0rc3:
user@host ~/Desktop/APKs $ apktool d 
com.japanactivator.android.jasensei_3.2.2.apk 
I: Using Apktool 2.0.0-RC3 on com.japanactivator.android.jasensei_3.2.2.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/barracuda/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=touchscreenBlocksFocus, value=0xffffffff
I: Decoding values */* XMLs...
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 
0x01010462
    at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:59)
    at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:57)
    at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:53)
    at brut.androlib.res.data.value.ResReferenceValue.getReferent(ResReferenceValue.java:60)
    at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(ResStyleValue.java:54)
    at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:565)
    at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:328)
    at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:131)
    at brut.androlib.ApkDecoder.decode(ApkDecoder.java:101)
    at brut.apktool.Main.cmdDecode(Main.java:165)
    at brut.apktool.Main.main(Main.java:81)

Original issue reported on code.google.com by psu13pm...@gmail.com on 9 Feb 2015 at 1:12

GoogleCodeExporter commented 9 years ago
1.5.2 is not supported, thus will not work.
2.0.0 RC3 will work, but you forgot an instruction during upgrade.

Read #717, #720 or #732.

Give FrameworkFiles a read. It seems you need to delete 
$HOME/apktool/framework/1.apk

Original comment by connor.tumbleson on 9 Feb 2015 at 1:20

GoogleCodeExporter commented 9 years ago
WOW, thanks for the fast reply! It really seems that I've totally forgot about 
framework files. Very sorry, all works fine now with 2.0.0rc3!

Original comment by psu13pm...@gmail.com on 9 Feb 2015 at 1:23