zhanwei / android-apktool

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

Error using decode with today's build source at commit 848f0d6b5fb195f73222177ee161e35e6a1e65a6 #642

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I built apktool-cli.jar from https://github.com/iBotPeaches/Apktool source 
today, June 7th, 2014. It seems to work better than other pre-compiled versions 
I've downloaded before but this apk gives errors.
2. Enter: java -jar 
~/apktool/brut.apktool/apktool-cli/build/libs/apktool-cli.jar decode 
com.sudosurootdev.theme.inverted-1.apk
3.

What is the expected output? What do you see instead?
Expected: 
I: Using Apktool 2.0.0-848f0d-SNAPSHOT on com.sudosurootdev.theme.inverted-1.apk
I: Loading resource table...
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /root/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...

RECEIVED:
I: Using Apktool 2.0.0-848f0d-SNAPSHOT on com.sudosurootdev.theme.inverted-1.apk
I: Loading resource table...
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /root/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 
0x0108068a
    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(ResReferenceValue.java:60)
    at brut.androlib.res.data.value.ResReferenceValue.encodeAsResXml(ResReferenceValue.java:47)
    at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlValue(ResScalarValue.java:57)
    at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(ResStyleValue.java:65)
    at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:556)
    at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:312)
    at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:119)
    at brut.androlib.ApkDecoder.decode(ApkDecoder.java:115)
    at brut.apktool.Main.cmdDecode(Main.java:169)
    at brut.apktool.Main.main(Main.java:85)

What version of the product are you using? On what operating system?
Master source commit: 848f0d6b5fb195f73222177ee161e35e6a1e65a6

Please provide any additional information below.

There is no apktool.yml file, there is a good AndroidManifest.xml, a res 
directory which seems to be complete with tons of xml values & png images, and 
there is a smali directory with only about 6 smali files at the end of the 
smali directory tree. There should be a lot more. I'm going to look at the 
source, which I forked, at those error points and see if I can notice any 
issues but I am not great with Java yet.

Original issue reported on code.google.com by sudosurootdev on 8 Jun 2014 at 1:13

GoogleCodeExporter commented 9 years ago
The APK is inverted? That means it was modified at the resource level. Apktool 
doesn't have support for this inverted flag.

Original comment by connor.tumbleson on 8 Jun 2014 at 1:15

GoogleCodeExporter commented 9 years ago
OK, actually I just realized that the source I said I built that from, 
https://github.com/iBotPeaches/Apktool is the one which gave no smali files.

This source: https://github.com/brutall/brut.apktool is the one which did build 
smali's. It still threw that error but there were some smali files, because 
that source has a commit:

https://github.com/brutall/brut.apktool/commit/01bb423db4b3cad74564239c99e9065ea
d4af51f 

...which adds case UI_MODE_TYPE_INVERTED:

Original comment by sudosurootdev on 8 Jun 2014 at 3:23

GoogleCodeExporter commented 9 years ago
Pull that commit into the source, build it and use it. 

It won't be in mainline Apktool, since it constantly changes shapes/sizes and 
can't confirm its stability like AOSP.

Original comment by connor.tumbleson on 8 Jun 2014 at 3:25

GoogleCodeExporter commented 9 years ago
Thanks for the response. I am building it now. 1 quick question, if you are
the, or a, maintainer for apktool... what is the difference in the small
and regular jar file that is built? Different sizes but they seem to do the
same thing.

Original comment by sudosurootdev on 8 Jun 2014 at 4:06