Apktool: using @android:autoVerify tag leads to BrutException

Created on 6 Oct 2016  Â·  3Comments  Â·  Source: iBotPeaches/Apktool

Information

  1. Apktool Version (apktool -version) -
    Apktool v2.2.0 - a tool for reengineering Android apk files
    with smali v2.1.3 and baksmali v2.1.3
  2. Operating System (Mac, Linux, Windows) -
    OS X El Capitan 10.11.6 (15G1104)
  3. APK From? (Playstore, ROM, Other) -
    Other (example app to showcase issue)

    Stacktrace/Logcat

W: [redacted]/AutoVerifyTest/app/build/outputs/apk/target-apk.out/AndroidManifest.xml:9: error: No resource identifier found for attribute 'autoVerify' 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/73/pc2yx9vj2yj6p411gldwfr3r0000gn/T/brut_util_Jar_715835828751781889.tmp, p, --forced-package-id, 127, --min-sdk-version, 23, --target-sdk-version, 23, --version-code, 1, --version-name, 1.0, -F, /var/folders/73/pc2yx9vj2yj6p411gldwfr3r0000gn/T/APKTOOL7521204568345793784.tmp, -0, arsc, -0, arsc, -I, [redacted]/Library/apktool/framework/1.apk, -S, [redacted]/AutoVerifyTest/app/build/outputs/apk/target-apk.out/res, -M, [redacted]/AutoVerifyTest/app/build/outputs/apk/target-apk.out/AndroidManifest.xml]
    at brut.androlib.Androlib.buildResourcesFull(Androlib.java:473)
    at brut.androlib.Androlib.buildResources(Androlib.java:407)
    at brut.androlib.Androlib.build(Androlib.java:306)
    at brut.androlib.Androlib.build(Androlib.java:263)
    at brut.apktool.Main.cmdBuild(Main.java:224)
    at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/73/pc2yx9vj2yj6p411gldwfr3r0000gn/T/brut_util_Jar_715835828751781889.tmp, p, --forced-package-id, 127, --min-sdk-version, 23, --target-sdk-version, 23, --version-code, 1, --version-name, 1.0, -F, /var/folders/73/pc2yx9vj2yj6p411gldwfr3r0000gn/T/APKTOOL7521204568345793784.tmp, -0, arsc, -0, arsc, -I, [redacted]/Library/apktool/framework/1.apk, -S, [redacted]/AutoVerifyTest/app/build/outputs/apk/target-apk.out/res, -M, [redacted]/AutoVerifyTest/app/build/outputs/apk/target-apk.out/AndroidManifest.xml]
    at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:439)
    at brut.androlib.Androlib.buildResourcesFull(Androlib.java:459)
    ... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/73/pc2yx9vj2yj6p411gldwfr3r0000gn/T/brut_util_Jar_715835828751781889.tmp, p, --forced-package-id, 127, --min-sdk-version, 23, --target-sdk-version, 23, --version-code, 1, --version-name, 1.0, -F, /var/folders/73/pc2yx9vj2yj6p411gldwfr3r0000gn/T/APKTOOL7521204568345793784.tmp, -0, arsc, -0, arsc, -I, [redacted]/Library/apktool/framework/1.apk, -S, [redacted]/AutoVerifyTest/app/build/outputs/apk/target-apk.out/res, -M, [redacted]/AutoVerifyTest/app/build/outputs/apk/target-apk.out/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. apktool decode -fo target-apk.out app-debug.apk
  2. apktool build -fo output.apk target-apk.out/

    Frameworks

None

APK

app-debug.apk.zip

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything?
    Yes
  2. If you are trying to install a modified apk, did you resign it?
    No
  3. Are you using the latest apktool version?
    Yes

Most helpful comment

It was suppose to be last weekend and now there is a hurricane incoming this weekend :/

Maybe 2 weeks?

In the meantime, follow these steps.

  1. Download this Nougat framework - https://github.com/iBotPeaches/Apktool/blob/master/brut.apktool/apktool-lib/src/main/resources/brut/androlib/android-framework.jar (Gotta download the raw file, hard to directly link to)
  2. apktool if android-framework.jar. This will install to 1.apk and be Nougat compatible.
  3. Reattempt decode & build.

All 3 comments

➜  Bug1340 apktool d app-debug.apk  
I: Using Apktool 2.2.1-4c93cb-SNAPSHOT on app-debug.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/ibotpeaches/.local/share/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
➜  Bug1340 apktool b app-debug
I: Using Apktool 2.2.1-4c93cb-SNAPSHOT
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
I: Copying unknown files/dir...
➜  Bug1340 

This is an outdated framework problem. Will be solved in 2.2.1 release with new Android Nougat framework.

Hi @iBotPeaches, thanks for your response. Do you have a timeline for the release 2.2.1? We're currently trying to decide whether it's worth implementing a workaround or not.

It was suppose to be last weekend and now there is a hurricane incoming this weekend :/

Maybe 2 weeks?

In the meantime, follow these steps.

  1. Download this Nougat framework - https://github.com/iBotPeaches/Apktool/blob/master/brut.apktool/apktool-lib/src/main/resources/brut/androlib/android-framework.jar (Gotta download the raw file, hard to directly link to)
  2. apktool if android-framework.jar. This will install to 1.apk and be Nougat compatible.
  3. Reattempt decode & build.
Was this page helpful?
0 / 5 - 0 ratings