desword / android-apktool

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

Error unpacking com.android.webview for Lollipop #706

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create and launch Lollipop AVD
2. Pull APK : adb pull /system/app/webview/webview.apk
3. Pull FW resources :  adb pull /system/framework/framework-res.apk
4. Install FW : apktool if --frame-path ./ framework-res.apk
5. Use apktool to decode APK :  apktool d --no-src --no-res --frame-path ./ 
webview.apk

What is the expected output? What do you see instead?
APK should unpack.

I see exception:
I: Using Apktool 2.0.0-ce2088-SNAPSHOT on webview.apk
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Invalid value type: 
7
    at brut.androlib.res.data.value.ResValueFactory.factory(ResValueFactory.java:62)
    at brut.androlib.res.decoder.ARSCDecoder.readValue(ARSCDecoder.java:211)
    at brut.androlib.res.decoder.ARSCDecoder.readComplexEntry(ARSCDecoder.java:199)
    at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:169)
    at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:157)
    at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:125)
    at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:100)
    at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:78)
    at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:47)
    at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:606)
    at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:75)
    at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:67)
    at brut.androlib.Androlib.getResTable(Androlib.java:61)
    at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:206)
    at brut.androlib.ApkDecoder.decode(ApkDecoder.java:92)
    at brut.apktool.Main.cmdDecode(Main.java:165)
    at brut.apktool.Main.main(Main.java:81)

What version of the product are you using? On what operating system?
2.0.0-ce2088-SNAPSHOT (master), Ubuntu 14.04 64-bit

Please provide any additional information below.
806435d75ba2d15f8de6f78c963a93ce  webview.apk

Original issue reported on code.google.com by JaVal...@gmail.com on 18 Nov 2014 at 6:16

Attachments:

GoogleCodeExporter commented 9 years ago
Issue 707 has been merged into this issue.

Original comment by connor.tumbleson on 18 Nov 2014 at 8:04

GoogleCodeExporter commented 9 years ago
Pretty much same as #653 in terms of that Lollipop is involved.

There is a new enum it looks like "TYPE_DYNAMIC_REFERENCE" w/ value of 7. It 
looks like it holds a dynamic ResTable reference which needs to be followed 
then used like a regular ole TYPE_REFERENCE (0x01).

So need to follow reference. Get the table entry, then return it. That should 
solve it.

Original comment by connor.tumbleson on 19 Nov 2014 at 11:25

GoogleCodeExporter commented 9 years ago
Fixed. 
https://github.com/iBotPeaches/Apktool/commit/554591a339360dd6af6b5cc4f5aa5eeda7
a5c3b1

Binary to follow in weekend.

Original comment by connor.tumbleson on 21 Nov 2014 at 5:45