adil192/SamsungAppsPatcher

Apktool build error

Closed this issue · 5 comments

Describe the bug
After running ./wearable-patcher.sh shealth

Apktool build error

~/SamsungAppsPatcher/decompiled $ apktool b shealth/ --output out.apk
I: Using Apktool 2.6.1
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/data/data/com.termux/files/usr/tmp/brut_util_Jar_22721310018420179231920746392872093442.tmp, p, --forced-package-id, 127, --min-sdk-version, 26, --target-sdk-version, 31, --version-code, 6222007, --version-name, 6.22.2.007, --no-version-vectors, -F, /data/data/com.termux/files/usr/tmp/APKTOOL427404339190470838.tmp, -e, /data/data/com.termux/files/usr/tmp/APKTOOL17802574958280800067.tmp, -0, arsc, -I, /data/data/com.termux/files/home/.local/share/apktool/framework/1.apk, -S, /data/data/com.termux/files/home/SamsungAppsPatcher/decompiled/shealth/res, -M, /data/data/com.termux/files/home/SamsungAppsPatcher/decompiled/shealth/AndroidManifest.xml]

apktool --version: 2.6.1

Try using the --use-aapt2 flag

apktool b shealth/ --output out.apk --use-aapt2

No difference it's on the latest version of S Health from APK mirror.

~/SamsungAppsPatcher/decompiled $ apktool b shealth/ --output out.apk --use-aapt2
I: Using Apktool 2.6.1
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
W: /data/data/com.termux/files/usr/tmp/brut_util_Jar_18186411071765651377133333703238989527.tmp[1]: ELF: inaccessible or not found
W: /data/data/com.termux/files/usr/tmp/brut_util_Jar_18186411071765651377133333703238989527.tmp[47]: syntax error: unexpected ')'
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/data/data/com.termux/files/usr/tmp/brut_util_Jar_18186411071765651377133333703238989527.tmp, compile, --dir, /data/data/com.termux/files/home/SamsungAppsPatcher/decompiled/shealth/res, --legacy, -o, /data/data/com.termux/files/home/SamsungAppsPatcher/decompiled/shealth/build/resources.zip]-

I can't reproduce the error on my side.
Can you try decompiling and recompiling sheath without patches?

./wearable-patcher.sh shealth --no-patch
cd decompiled
apktool b shealth/ --output out.apk --use-aapt2

Yes the same error still occurs without patches applied. It's looking for some temp file it can't find.

I can't say I know how termux works, maybe try reinstalling termux? Regardless, this is an issue with apktool/termux so I'm going to close this issue