zhanwei / android-apktool

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

Error when decompiling SystemUI.apk from Android 5.0.1 #745

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. apktool d -o /Users/**/Desktop/SystemUI /Users/luosen/Desktop/SystemUI.apk

What is the expected output? What do you see instead?
expected: Decompiling succeeds

error output:
I: Using Apktool 2.0.0-RC3 on SystemUI.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: 
/Users/luosen/Library/apktool/framework/1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0034
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e00a7
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=icon, value=0x7f02023e
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d000b
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0136
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0000
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0136
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e016d
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e00a6
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e016d
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=enabled, value=0x7f0b0010
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e016e
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=icon, value=0x7f030001
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0046
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0071
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0045
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0072
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0045
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0075
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0045
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0045
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0073
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0045
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0074
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0046
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0071
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0046
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0071
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0191
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0136
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0047
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 
0x7f0d0034
    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.ResReferenceValue.encodeAsResXml(ResReferenceValue.java:47)
    at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlAttr(ResScalarValue.java:45)
    at brut.androlib.res.decoder.ResAttrDecoder.decode(ResAttrDecoder.java:41)
    at brut.androlib.res.decoder.AXmlResourceParser.getAttributeValue(AXmlResourceParser.java:369)
    at org.xmlpull.v1.wrapper.classic.XmlPullParserDelegate.getAttributeValue(XmlPullParserDelegate.java:69)
    at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartTag(StaticXmlSerializerWrapper.java:267)
    at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(StaticXmlSerializerWrapper.java:211)
    at brut.androlib.res.decoder.XmlPullStreamDecoder$1.event(XmlPullStreamDecoder.java:83)
    at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDecoder.java:141)
    at brut.androlib.res.decoder.XmlPullStreamDecoder.decodeManifest(XmlPullStreamDecoder.java:153)
    at brut.androlib.res.decoder.ResFileDecoder.decodeManifest(ResFileDecoder.java:134)
    at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:296)
    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)

What version of the product are you using? On what operating system?
Apktool 2.0.0-RC3

Please provide any additional information below.
I've tried to install either framework-res.apk and framework-res-htc.apk but 
both didn't work.
ROM: HTC Sense 6 based on Android 5.0.1
These are the three files mentioned above.
Dropbox Link: 
https://www.dropbox.com/sh/5uy4661z3mmzqmd/AADR9im-6nGdbmEIBjW_u9Ffa?dl=0

Original issue reported on code.google.com by luosen1...@gmail.com on 14 Jan 2015 at 1:35

GoogleCodeExporter commented 9 years ago
Missing a framework (pkgId of 2). 

framework-res is 0x01
framework-htc-res is 0x03

Original comment by connor.tumbleson on 19 Jan 2015 at 2:15

GoogleCodeExporter commented 9 years ago
HTC Sense 6 ROM based on Android 5.0.2
I have exact the same problem. Trying to decompile the SystemUI.apk.
All 3 frameworks are installed.
framework-res = 0x01xxxxxx
com.htc.resources = 0x02xxxxxx
framework-res-htc=0x03xxxxxx

E:\Ulrich\android\One\LollipopTheming>apktool if framework-res.apk
I: Framework installed to: C:\Users\Ulrich\apktool\framework\1.apk

E:\Ulrich\android\One\LollipopTheming>apktool if com.htc.resources.apk
I: Framework installed to: C:\Users\Ulrich\apktool\framework\2.apk

E:\Ulrich\android\One\LollipopTheming>apktool if framework-res-htc.apk
I: Framework installed to: C:\Users\Ulrich\apktool\framework\3.apk

E:\Ulrich\android\One\LollipopTheming>apktool d -f SystemUI.apk
I: Using Apktool 2.0.0-RC3 on SystemUI.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Ulrich\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0034
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e00a7
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=icon, value=0x7f02023e
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d000b
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0136
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0000
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0136
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e016d
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e00a6
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e016d
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=enabled, value=0x7f0b0010
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e016e
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=icon, value=0x7f030001
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0046
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0071
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0045
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0072
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0045
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0075
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0045
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0045
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0073
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0045
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0074
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0046
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0071
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0046
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0071
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0191
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=label, value=0x7f0e0136
W: Could not decode attr value, using undecoded value instead: ns=android, 
name=theme, value=0x7f0d0047
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource 
spec:0x7f0d0034
        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.ResReferenceValue.encodeAsResXml(ResReferenceValue.java:47)
        at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlAttr(ResScalarValue.java:45)
        at brut.androlib.res.decoder.ResAttrDecoder.decode(ResAttrDecoder.java:41)
        at brut.androlib.res.decoder.AXmlResourceParser.getAttributeValue(AXmlResourceParser.java:369)
        at org.xmlpull.v1.wrapper.classic.XmlPullParserDelegate.getAttributeValue(XmlPullParserDelegate.java:69)
        at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartTag(StaticXmlSerializerWrapper.java:267)
        at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(StaticXmlSerializerWrapper.java:211)
        at brut.androlib.res.decoder.XmlPullStreamDecoder$1.event(XmlPullStreamDecoder.java:83)
        at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDecoder.java:141)
        at brut.androlib.res.decoder.XmlPullStreamDecoder.decodeManifest(XmlPullStreamDecoder.java:153)
        at brut.androlib.res.decoder.ResFileDecoder.decodeManifest(ResFileDecoder.java:134)
        at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:296)
        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)

Any Idea what i'm doing wrong?

Original comment by ullischipp on 25 Jan 2015 at 11:26

GoogleCodeExporter commented 9 years ago
Not sure. As mentioned in the previous comment, the OP did not upload all the 
frameworks. If you could upload the pkg id framework of 2 
(com.htc.resources.apk) that would be helpful.

Original comment by connor.tumbleson on 27 Jan 2015 at 9:11

GoogleCodeExporter commented 9 years ago
Sorry for my late answer. 
com.htc.resources.apk attached. Thanks for help!

Original comment by ullischipp on 2 Feb 2015 at 8:52

Attachments:

GoogleCodeExporter commented 9 years ago
ibotpeaches@raganok:~/Downloads/Apktool/Bug745$ apktool if 
com.htc.resources.apk -t bug745
I: Framework installed to: /home/ibotpeaches/apktool/framework/2-bug745.apk
ibotpeaches@raganok:~/Downloads/Apktool/Bug745$ apktool if framework-res.apk -t 
bug745
I: Framework installed to: /home/ibotpeaches/apktool/framework/1-bug745.apk
ibotpeaches@raganok:~/Downloads/Apktool/Bug745$ apktool if 
framework-res-htc.apk -t bug745
I: Decoding Shared Library (com.htc), pkgId: 2
I: Framework installed to: /home/ibotpeaches/apktool/framework/3-bug745.apk
ibotpeaches@raganok:~/Downloads/Apktool/Bug745$ apktool d SystemUI.apk -f -t 
bug745 -f
I: Using Apktool 2.0.0-8c4102-SNAPSHOT on SystemUI.apk
I: Loading resource table...
I: Decoding Shared Library (com.htc), pkgId: 2
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: 
/home/ibotpeaches/apktool/framework/1-bug745.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Loading resource table from file: 
/home/ibotpeaches/apktool/framework/2-bug745.apk
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
ibotpeaches@raganok:~/Downloads/Apktool/Bug745$ 

I couldn't duplicate this. I think your 1.apk is out of date. Try reading 
FrameworkFiles and deleting that one.

Original comment by connor.tumbleson on 3 Feb 2015 at 9:55

GoogleCodeExporter commented 9 years ago
Open apktool,Go to settings,apktool version,choose last version.
Then go back to settings,aapt version,choose last version.
Import framework.
Now you're good to go!

Original comment by wolftato...@gmail.com on 6 Mar 2015 at 1:14