desword / android-apktool

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

Could not decode arsc file #680

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. download most recent GApps and take the Phonesky.apk which is the Play Store 
(com.android.vending)
2. execute 'apktool d Phonesky.apk'

What is the expected output? What do you see instead?
expected output: folder with decompiled (re)sources

instead:
I: Using Apktool 2.0.0-Beta9 on Phonesky.apk
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:54)
        at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibRes
ources.java:604)
        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: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)
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:43)
        at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:95)
        at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:81)
        at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
        ... 7 more

What version of the product are you using? On what operating system?
apktool v2.0.0 Beta9, Windows 8.1

Thank you for this great tool and your help!

Original issue reported on code.google.com by roe...@gmail.com on 26 Sep 2014 at 11:40

Attachments:

GoogleCodeExporter commented 9 years ago
This same problem is apparent in new Google Search. 

Original comment by connor.tumbleson on 26 Sep 2014 at 11:43

GoogleCodeExporter commented 9 years ago
Hi,

We've just made a small investigation and found out that the problem appears 
when an apk is built using build-tools version 21.1.1 (maybe this is also valid 
for all 21.x serie). Hope this may help!

Also we checked the apktool-2.0_RC2 version and it seems that it solves the 
problem. However, I attach the log for you.

Original comment by y.zhalne...@gmail.com on 21 Nov 2014 at 1:37

Attachments:

GoogleCodeExporter commented 9 years ago
[build-tools version 21.1.1 ] Used apktool_2.0.0rc2.jar and getting following 
error: 

W: Could not decode attr value, using undecoded value instead: ns=android, name=
textAllCaps, value=0xffffffff
W: Could not decode attr value, using undecoded value instead: ns=android, name=
textCursorDrawable, value=0x00000000
I: Decoding values */* XMLs...
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec:
0x010300e1
        at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:59)
        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(ResReferen
ceValue.java:60)
        at brut.androlib.res.data.value.ResReferenceValue.encodeAsResXml(ResRefe
renceValue.java:47)
        at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlAttr(ResSca
larValue.java:45)
        at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(Re
sStyleValue.java:49)
        at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResour
ces.java:564)
        at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:327
)
        at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:123)
        at brut.androlib.ApkDecoder.decode(ApkDecoder.java:102)
        at brut.apktool.Main.cmdDecode(Main.java:170)
        at brut.apktool.Main.main(Main.java:86)

How do I debug? Found this thread 
https://code.google.com/p/android-apktool/issues/detail?id=161 . But solutions 
dint help much.

Original comment by thtsar...@gmail.com on 21 Nov 2014 at 3:57

GoogleCodeExporter commented 9 years ago
apktool_2.0.0rc3.jar solved the problem for me and generated the source files 
without error. It was different APK ofcourse

Original comment by HemalAda...@gmail.com on 30 Dec 2014 at 8:50

GoogleCodeExporter commented 9 years ago
apktool_2.0.0rc3.jar solved me ! ^_^

Original comment by maoruibi...@gmail.com on 5 Jan 2015 at 9:52

GoogleCodeExporter commented 9 years ago
I used apktool_2.0.0rc3.jar but get similar error

I: Using Apktool 2.0.0-RC3 on rcd.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Erik.L\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:
0x0101048f
        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.decoder.ResAttrDecoder.decode(ResAttrDecoder.java:3
6)
        at brut.androlib.res.decoder.AXmlResourceParser.getAttributeValue(AXmlRe
sourceParser.java:369)
        at org.xmlpull.v1.wrapper.classic.XmlPullParserDelegate.getAttributeValu
e(XmlPullParserDelegate.java:69)
        at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartT
ag(StaticXmlSerializerWrapper.java:267)
        at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(Stati
cXmlSerializerWrapper.java:211)
        at brut.androlib.res.decoder.XmlPullStreamDecoder$1.event(XmlPullStreamD
ecoder.java:83)
        at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDe
coder.java:141)
        at brut.androlib.res.decoder.ResStreamDecoderContainer.decode(ResStreamD
ecoderContainer.java:33)
        at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:1
14)
        at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:9
9)
        at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:323
)
        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)
Here is apk
https://www.dropbox.com/s/gmqyw004kvx383b/cd.apk?dl=0

Original comment by nikramon...@gmail.com on 12 Jan 2015 at 4:13

GoogleCodeExporter commented 9 years ago
worked by removing framework apk. Thanks.

Original comment by nikramon...@gmail.com on 12 Jan 2015 at 4:19

GoogleCodeExporter commented 9 years ago
I got the same issue. Could anyone helps?

Original comment by shumin2...@gmail.com on 27 Jan 2015 at 9:05

GoogleCodeExporter commented 9 years ago
I have the same issue please help

Original comment by chanty.c...@gmail.com on 9 Mar 2015 at 6:03