Apktool: Use Apktool(2.2.2) rebuild unmodified weixin6.3.7.apk found error: No resource identifier found for attribute in package 'com.tencent.mm', however V2.0.3 is ok
Information
- Apktool Version (
2.2.2
) - - Operating System (Mac) -
- APK From? (http://weixin.qq.com/cgi-bin/readtemplate?lang=zh_CN&t=weixin_faq_list) -
Stacktrace/Logcat
Below is use 2.2.2 version to rebuild unmodified weixin6.3.7:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:5: error: No resource identifier found for attribute 'key' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:5: error: No resource identifier found for attribute 'layout' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:6: error: No resource identifier found for attribute 'persistent' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:6: error: No resource identifier found for attribute 'title' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:6: error: No resource identifier found for attribute 'key' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:6: error: No resource identifier found for attribute 'layout' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:7: error: No resource identifier found for attribute 'title' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:7: error: No resource identifier found for attribute 'key' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:7: error: No resource identifier found for attribute 'layout' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:9: error: No resource identifier found for attribute 'title' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:9: error: No resource identifier found for attribute 'key' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:9: error: No resource identifier found for attribute 'layout' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:10: error: No resource identifier found for attribute 'title' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:10: error: No resource identifier found for attribute 'key' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:10: error: No resource identifier found for attribute 'layout' in package 'com.tencent.mm'
W:
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/brut_util_Jar_5322325296887264747.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 23, --version-code, 861, --version-name, 6.3.25, --no-version-vectors, -F, /var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/APKTOOL3485422076297709042.tmp, -0, arsc, -0, zip, -0, sec, -0, conf, -0, dat, -0, assets/emojicompactfile, -0, data, -0, svg, -0, apk, -0, arsc, -I, /Users/yanzi/Library/apktool/framework/1.apk, -S, /Users/yanzi/work/d-apk/weixin2/weixin637/res, -M, /Users/yanzi/work/d-apk/weixin2/weixin637/AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:477)
at brut.androlib.Androlib.buildResources(Androlib.java:411)
at brut.androlib.Androlib.build(Androlib.java:310)
at brut.androlib.Androlib.build(Androlib.java:263)
at brut.apktool.Main.cmdBuild(Main.java:227)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/brut_util_Jar_5322325296887264747.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 23, --version-code, 861, --version-name, 6.3.25, --no-version-vectors, -F, /var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/APKTOOL3485422076297709042.tmp, -0, arsc, -0, zip, -0, sec, -0, conf, -0, dat, -0, assets/emojicompactfile, -0, data, -0, svg, -0, apk, -0, arsc, -I, /Users/yanzi/Library/apktool/framework/1.apk, -S, /Users/yanzi/work/d-apk/weixin2/weixin637/res, -M, /Users/yanzi/work/d-apk/weixin2/weixin637/AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:440)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:463)
... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/brut_util_Jar_5322325296887264747.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 23, --version-code, 861, --version-name, 6.3.25, --no-version-vectors, -F, /var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/APKTOOL3485422076297709042.tmp, -0, arsc, -0, zip, -0, sec, -0, conf, -0, dat, -0, assets/emojicompactfile, -0, data, -0, svg, -0, apk, -0, arsc, -I, /Users/yanzi/Library/apktool/framework/1.apk, -S, /Users/yanzi/work/d-apk/weixin2/weixin637/res, -M, /Users/yanzi/work/d-apk/weixin2/weixin637/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:95)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:434)
... 6 more
Below is use Apktool(2.0.3) log:
/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/drawables.xml:165: error: invalid symbol: 'do'
/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/drawables.xml:358: error: invalid symbol: 'if'
/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/layouts.xml:165: error: invalid symbol: 'do'
/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/layouts.xml:341: error: invalid symbol: 'if'
/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/strings.xml:170: error: invalid symbol: 'do'
/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/strings.xml:352: error: invalid symbol: 'if'
/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/dimens.xml:165: error: invalid symbol: 'do'
/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/dimens.xml:341: error: invalid symbol: 'if'
/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/styles.xml:791: error: invalid symbol: 'do'
/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/styles.xml:2168: error: invalid symbol: 'if'
/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/colors.xml:165: error: invalid symbol: 'do'
/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/colors.xml:341: error: invalid symbol: 'if'
/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/ids.xml:75: error: invalid symbol: 'do'
/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/ids.xml:251: error: invalid symbol: 'if'
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [/var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/brut_util_Jar_4887173892981919240.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 23, --version-code, 861, --version-name, 6.3.25, -F, /var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/APKTOOL8826980659801902946.tmp, -0, arsc, -0, zip, -0, sec, -0, conf, -0, dat, -0, , -0, data, -0, arsc, -I, /Users/yanzi/Library/apktool/framework/1.apk, -S, /Users/yanzi/work/d-apk/weixin2/weixin637/res, -M, /Users/yanzi/work/d-apk/weixin2/weixin637/AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:472)
at brut.androlib.Androlib.buildResources(Androlib.java:410)
at brut.androlib.Androlib.build(Androlib.java:298)
at brut.androlib.Androlib.build(Androlib.java:268)
at brut.apktool.Main.cmdBuild(Main.java:225)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [/var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/brut_util_Jar_4887173892981919240.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 23, --version-code, 861, --version-name, 6.3.25, -F, /var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/APKTOOL8826980659801902946.tmp, -0, arsc, -0, zip, -0, sec, -0, conf, -0, dat, -0, , -0, data, -0, arsc, -I, /Users/yanzi/Library/apktool/framework/1.apk, -S, /Users/yanzi/work/d-apk/weixin2/weixin637/res, -M, /Users/yanzi/work/d-apk/weixin2/weixin637/AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:425)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:458)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [/var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/brut_util_Jar_4887173892981919240.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 23, --version-code, 861, --version-name, 6.3.25, -F, /var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/APKTOOL8826980659801902946.tmp, -0, arsc, -0, zip, -0, sec, -0, conf, -0, dat, -0, , -0, data, -0, arsc, -I, /Users/yanzi/Library/apktool/framework/1.apk, -S, /Users/yanzi/work/d-apk/weixin2/weixin637/res, -M, /Users/yanzi/work/d-apk/weixin2/weixin637/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:419)
... 6 more
You can find some do and if errors, use sed
replace, and then rebuild is ok!
Steps to Reproduce
-
apktool d weixin637.apk
-
apktool b weixin637
APK
If this APK can be freely shared, please upload/attach a link to it. weixin6.3.7
Questions to ask before submission
- Have you tried
apktool d
,apktool b
without changing anything? yes - If you are trying to install a modified apk, did you resign it? I didn’t get to this step
- Are you using the latest apktool version? yes
Hello, I use apktool latest version(2.2.2) to decompile weixin6.3.7.apk, nothing change and then rebuild, found so much No resource identifier found for attribute in package com.tencent.mm errors. However, use apktool(2.0.3), there is no such error, after fix do and if errors, and then rebuild is ok. I have tested, from 2.1.1 version later, It will encounter No resource identifier found for attribute in package errors, which make me believe 2.0.3 version is perfect on Mac.
However , when i test on Windows7, I found 2.1.1 is the last ok version for weixin6.3.7.apk on Windows. So it make me very depressed。
Different with 1421, the attribute is definited by package com.tencent.mm
, not android standard package.
Thanks for your help!
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 15 (2 by maintainers)
from what I understand, there’s no easy way to work out the obfuscation, however, you can work around it by skipping decompiling resources with
-r
when decompilingjust a suggestion, could we add an option to selectively decode some of the resources? For instance, I get tons of “No resource identifier found for attribute” errors on layout resources, but all I need to do is edit
res/xml/network_security_config.xml