Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No resource identifier found for attribute 'networkSecurityConfig' in package 'android' #1371

Closed
xaywe opened this issue Nov 23, 2016 · 4 comments

Comments

@xaywe
Copy link

xaywe commented Nov 23, 2016

Information

  1. Apktool Version (apktool -version) - 2.2.1
  2. Operating System (Mac, Linux, Windows) -Mac
  3. APK From? (Playstore, ROM, Other) - Other

Stacktrace/Logcat

I: Using Apktool 2.2.1
I: Smaling smali folder into classes.dex...
I: Building resources...
W: /tmp/apktool/result/AndroidManifest.xml:15: error: No resource identifier found for attribute 'networkSecurityConfig' in package 'android'
W:
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/lp/cwd098392572b2w4gf0474lc0000gn/T/brut_util_Jar_7861807700606846493.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 24, --version-code, 16112112, --version-name, F, -F, /var/folders/lp/cwd098392572b2w4gf0474lc0000gn/T/APKTOOL2967809708839644739.tmp, -0, arsc, -0, properties, -0, arsc, -I, /Users/blabla/Library/apktool/framework/1.apk, -S, /tmp/apktool/result/res, -M, /tmp/apktool/result/AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:478)
at brut.androlib.Androlib.buildResources(Androlib.java:412)
at brut.androlib.Androlib.build(Androlib.java:311)
at brut.androlib.Androlib.build(Androlib.java:264)
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/lp/cwd098392572b2w4gf0474lc0000gn/T/brut_util_Jar_7861807700606846493.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 24, --version-code, 16112112, --version-name, Furby, -F, /var/folders/lp/cwd098392572b2w4gf0474lc0000gn/T/APKTOOL2967809708839644739.tmp, -0, arsc, -0, properties, -0, arsc, -I, /Users/blabla/Library/apktool/framework/1.apk, -S, /tmp/apktool/result/res, -M, /tmp/apktool/result/AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:439)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:464)
... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/lp/cwd098392572b2w4gf0474lc0000gn/T/brut_util_Jar_7861807700606846493.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 24, --version-code, 16112112, --version-name, F, -F, /var/folders/lp/cwd098392572b2w4gf0474lc0000gn/T/APKTOOL2967809708839644739.tmp, -0, arsc, -0, properties, -0, arsc, -I, /Users/blabla/Library/apktool/framework/1.apk, -S, /tmp/apktool/result/res, -M, /tmp/apktool/result/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:95)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:433)
... 6 more

Steps to Reproduce

  1. APK with a custom Security Network ->https://developer.android.com/training/articles/security-config.html
  2. Decompile apk 'apktool.sh d app.apk -f -o result/'
  3. Mount apk decompiled 'apktool.sh b result/ -f -o app.rebuild.apk'
  4. Exception reported
@levyitay
Copy link

I have the same issue, couldn't find a workaround

@iBotPeaches
Copy link
Owner

https://developer.android.com/training/articles/security-config.html

As you can see networkSecurityConfig is an Android N attribute, so this is probably a framework problem. If you have at least apktool 2.2.1, run apktool empty-framework-dir --force and try again.

@xaywe
Copy link
Author

xaywe commented Nov 24, 2016

Thank you! It worked! :)

@iBotPeaches
Copy link
Owner

Glad you solved it. Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants