Apktool: brut.common.BrutException: could not exec (exit code = 1)

Created on 11 Aug 2018  路  4Comments  路  Source: iBotPeaches/Apktool

Information

  1. Apktool Version 2.3.4 -
  2. Operating System Win7 Pro SP1 X64 -
  3. APK From? ROM -

Stacktrace/Logcat

I: Framework installed to: bin\framework\1.apk
I: Using Apktool 2.3.4_0503
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
W: R:\apktool\BatchApkTool\_INPUT_APK\SecSettings_ESS\res\values\anims.xml:3: error: Resource entry tapandpay_payment_detail is already defined.
W: res\anim\tapandpay_payment_detail.xml:0: Originally defined here.
W: 
W: R:\apktool\BatchApkTool\_INPUT_APK\SecSettings_ESS\res\values\drawables.xml:3: error: Resource entry action_bar_button is already defined.
W: res\drawable\action_bar_button.xml:0: Originally defined here.
W: 
.... (over 50 of such lines)
W: 
W: res\menu\vpn.xml:0: error: Resource entry vpn is already defined.
W: R:\apktool\BatchApkTool\_INPUT_APK\SecSettings_ESS\res\values\menus.xml:8: Originally defined here.
W: 
W: res\menu\wifi_setup.xml:0: error: Resource entry wifi_setup is already defined.
W: R:\apktool\BatchApkTool\_INPUT_APK\SecSettings_ESS\res\values\menus.xml:9: Originally defined here.
W: 
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\Lesha\AppData\Local\Temp\BAT_temp\brut_util_Jar_2960767681264662620.tmp, p, --forced-package-id, 127, --min-sdk-version, 19, --target-sdk-version, 19, --version-code, 19, --version-name, 4.4.4-G3608ZMS1APF1, --no-version-vectors, -F, C:\Users\Lesha\AppData\Local\Temp\BAT_temp\APKTOOL2088831215920501854.tmp, -0, arsc, -I, bin\framework\1.apk, -S, R:\apktool\BatchApkTool\_INPUT_APK\SecSettings_ESS\res, -M, R:\apktool\BatchApkTool\_INPUT_APK\SecSettings_ESS\AndroidManifest.xml]
[*] ---> Recompilation error "SecSettings_ESS"

Steps to Reproduce

  1. decompile and recompile the apk (recompilation error)

Frameworks

APK is from an OEM ROM (Samsung).
framework: http://rgho.st/8FGRSlG97

APK

SecSettings_ESS.apk: http://rgho.st/8YL6J2HmZ

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

I've been debugging a similar issue. The exec that is failing is an invocation of aapt v1 using the 'p' command to repackage the APK. Many newer APKs seem to need aapt v2. Until apktool switches completely to aapt v2, as of v2.3.4 it bundles both aapt v1 and v2 binaries in the jar, and you can force apktool to use aapt v2 by adding --use-aapt2:

apktool b --use-aapt2 -o out.apk directory

If you're curious, you can invoke aapt2 directly by copying the array-formatted command line from the 'could not exec' line, replacing ", " with " " in a text editor, and replacing the first item (brut_util_Jar) with the path to the aapt2 binary in your Android SDK (e.g. sdk/build-tools/26.0.2/aapt2).

All 4 comments

I've been debugging a similar issue. The exec that is failing is an invocation of aapt v1 using the 'p' command to repackage the APK. Many newer APKs seem to need aapt v2. Until apktool switches completely to aapt v2, as of v2.3.4 it bundles both aapt v1 and v2 binaries in the jar, and you can force apktool to use aapt v2 by adding --use-aapt2:

apktool b --use-aapt2 -o out.apk directory

If you're curious, you can invoke aapt2 directly by copying the array-formatted command line from the 'could not exec' line, replacing ", " with " " in a text editor, and replacing the first item (brut_util_Jar) with the path to the aapt2 binary in your Android SDK (e.g. sdk/build-tools/26.0.2/aapt2).

I've been debugging a similar issue. The exec that is failing is an invocation of aapt v1 using the 'p' command to repackage the APK. Many newer APKs seem to need aapt v2. Until apktool switches completely to aapt v2, as of v2.3.4 it bundles both aapt v1 and v2 binaries in the jar, and you can force apktool to use aapt v2 by adding --use-aapt2:

apktool b --use-aapt2 -o out.apk directory

If you're curious, you can invoke aapt2 directly by copying the array-formatted command line from the 'could not exec' line, replacing ", " with " " in a text editor, and replacing the first item (brut_util_Jar) with the path to the aapt2 binary in your Android SDK (e.g. sdk/build-tools/26.0.2/aapt2).

this actually helped to rebuild the decompiled apk, gave me some warnings but served my purpose.
here are the warnings https://pastebin.com/8CsfD1jC

I used apktool empty-framework-dir before the rebuild command
Worked for me

Unfortunately I don't have Samsung and a couple years of this ticket and nothing moved. I'm just going to close since I won't be able to do anything.

Was this page helpful?
0 / 5 - 0 ratings