iBotPeaches / Apktool

A tool for reverse engineering Android apk files
https://apktool.org/
Apache License 2.0
20.29k stars 3.59k forks source link

BrutException during build #1653

Closed iliakonnov closed 3 years ago

iliakonnov commented 7 years ago

Information

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

Stacktrace/Logcat

$ java -jar apktool_2.3.0.jar d vkontakte.android_5.0.2_1251.apk
I: Using Apktool 2.3.0 on vkontakte.android_5.0.2_1251.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
S: WARNING: Could not write to (C:\Users\User\AppData\Local\apktool\framework), using C:\Users\User\AppData\Local\Temp\ instead...
S: Please be aware this is a volatile directory and frameworks could go missing, please utilize --frame-path if the default storage directory is unavailable
I: Loading resource table from file: C:\Users\User\AppData\Local\Temp\1.apk
I: Regular manifest package...
I: Decoding file-resources...
W: Cant find 9patch chunk in file: "drawable-mdpi-v4/ab_progress_bg.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/ab_progress_secondary.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xxhdpi-v4/ab_progress_secondary.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xxhdpi-v4/ab_progress_bg.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/ab_progress_primary.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi-v4/ab_progress_secondary.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/ab_progress_bg.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi-v4/ab_progress_primary.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-mdpi-v4/ab_progress_primary.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi-v4/ab_progress_bg.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-mdpi-v4/ab_progress_secondary.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xxhdpi-v4/ab_progress_primary.9.png". Renaming it to *.png.
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Baksmaling classes2.dex...
I: Baksmaling classes3.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...

$ java -jar apktool_2.3.0.jar b vkontakte.android_5.0.2_1251
I: Using Apktool 2.3.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes2 folder into classes2.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes3 folder into classes3.dex...
I: Checking whether resources has changed...
I: Building resources...
S: WARNING: Could not write to (C:\Users\User\AppData\Local\apktool\framework), using C:\Users\User\AppData\Local\Temp\ instead...
S: Please be aware this is a volatile directory and frameworks could go missing, please utilize --frame-path if the default storage directory is unavailable
W: C:\Users\User\decompilation\vkontakte.android_5.0.2_1251\res\values\styles.xml:2108: error: Resource entry SettingsHeaderSection already has bag item android:textAllCaps.
W: C:\Users\User\decompilation\vkontakte.android_5.0.2_1251\res\values\styles.xml:2107: Originally defined here.
W:
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\User\AppData\Local\Temp\brut_util_Jar_473167439510311661.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 22, --version-code, 1251, --version-name, 5.0.2, --no-version-vectors, -F, C:\Users\User\AppData\Local\Temp\APKTOOL5469593742570201570.tmp, -0, arsc, -0, arsc, -I, C:\Users\User\AppData\Local\Temp\1.apk, -S, C:\Users\User\decompilation\vkontakte.android_5.0.2_1251\res, -M, C:\Users\User\decompilation\vkontakte.android_5.0.2_1251\AndroidManifest.xml]
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:485)
        at brut.androlib.Androlib.buildResources(Androlib.java:419)
        at brut.androlib.Androlib.build(Androlib.java:318)
        at brut.androlib.Androlib.build(Androlib.java:270)
        at brut.apktool.Main.cmdBuild(Main.java:224)
        at brut.apktool.Main.main(Main.java:75)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\User\AppData\Local\Temp\brut_util_Jar_473167439510311661.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 22, --version-code, 1251, --version-name, 5.0.2, --no-version-vectors, -F, C:\Users\User\AppData\Local\Temp\APKTOOL5469593742570201570.tmp, -0, arsc, -0, arsc, -I, C:\Users\User\AppData\Local\Temp\1.apk, -S, C:\Users\User\decompilation\vkontakte.android_5.0.2_1251\res, -M, C:\Users\User\decompilation\vkontakte.android_5.0.2_1251\AndroidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:454)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:471)
        ... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\User\AppData\Local\Temp\brut_util_Jar_473167439510311661.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 22, --version-code, 1251, --version-name, 5.0.2, --no-version-vectors, -F, C:\Users\User\AppData\Local\Temp\APKTOOL5469593742570201570.tmp, -0, arsc, -0, arsc, -I, C:\Users\User\AppData\Local\Temp\1.apk, -S, C:\Users\User\decompilation\vkontakte.android_5.0.2_1251\res, -M, C:\Users\User\decompilation\vkontakte.android_5.0.2_1251\AndroidManifest.xml]
        at brut.util.OS.exec(OS.java:95)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:448)
        ... 6 more

Steps to Reproduce

  1. Also tried apktool empty-framework-dir --force
  2. apktool d vkontakte.android_5.0.2_1251.apk
  3. apktool b vkontakte.android_5.0.2_1251

APK

http://www60.zippyshare.com/v/DP87UMOI/file.html

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? N/A
  3. Are you using the latest apktool version? Yes
iBotPeaches commented 6 years ago
W: /home/ibotpeaches/Downloads/Apktool/1653/vkontakte.android_5.0.2_1251/res/values/styles.xml:2108: error: Resource entry SettingsHeaderSection already has bag item android:textAllCaps.
W: /home/ibotpeaches/Downloads/Apktool/1653/vkontakte.android_5.0.2_1251/res/values/styles.xml:2107: Originally defined here.

Confirmed. Sorry for the delay. This might just be a bad application though, I will have to do some more research.

galexant commented 6 years ago

@iliakonnov . It's may be resolved manually. Just delete duplicates in file res/values/styles.xml at line 2108. After that make build. Same situation with Facebook_152.0.0.42.136 and item that called android:textColor.

iBotPeaches commented 3 years ago

. File has expired and does not exist anymore on this server

Sorry, 3+ years later. I never got to it and won't be able to.

Closing.