Apktool icon indicating copy to clipboard operation
Apktool copied to clipboard

Cant Recompile apk from ROM Miui 11

Open reactmorelab opened this issue 6 years ago • 4 comments

Information

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

Stacktrace/Logcat From Decompile and Recompile

This log from Decompile

I: Using Apktool 2.3.4 on Bluetooth.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home.local/share/apktool/framework/1.apk
I: Loading resource table from file: /home.local/share/apktool/framework/16.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...

This Log From Recompile

I: Using Apktool 2.3.4
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
brut.androlib.AndrolibException: brut.common.BrutException: could not exec: [/home/.local/share/apktool/framework/brut_util_Jar_5707862774674324740.tmp, p, --forced-package-id, 127, --min-sdk-version, 28, --target-sdk-version, 28, --version-code, 28, --version-name, 9, --no-version-vectors, -F, /home/.local/share/apktool/framework/APKTOOL5926607831175708308.tmp, -0, arsc, -0, res/drawable-xhdpi-v4/notification_bg_low_normal.9.png, -0, res/drawable-xhdpi-v4/notification_bg_low_pressed.9.png, -0, res/drawable-xhdpi-v4/notification_bg_normal.9.png, -0, res/drawable-xhdpi-v4/notification_bg_normal_pressed.9.png, -0, png, -0, arsc, -I, /home.local/share/apktool/framework/1.apk, -I, /home.local/share/apktool/framework/16.apk, -S, /storage/emulated/0/repo/apktool/Bluetooth/res, -M, /storage/emulated/0/repo/apktool/Bluetooth/AndroidManifest.xml]

Steps to Reproduce

  1. apktool b Bluetooth
  2. apktool d Bluetooth.apk

Frameworks

If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files (.apks that live in /system/framework and /system/priv-app)

  • Framework-res.apk = 1.apk
  • Framework-ext-res.apk = 17.apk
  • Miui.apk = 16.apk
  • Miuisystem.apk 127.apk

Hi i try decompile and recompile apk rom on Termux any solution ?

reactmorelab avatar Jan 14 '20 11:01 reactmorelab

Have you tried using the latest version of apktool? 2.3.4. is quite old now...

Ticklefish avatar Jan 15 '20 15:01 Ticklefish

Have you tried using the latest version of apktool? 2.3.4. is quite old now...

$ apktool b Settings
I: Using Apktool 2.4.1
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 resources has changed...
I: Building resources...
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 132): [/home/.local/share/apktool/framework/brut_util_Jar_1428683792399205670.tmp, p, --forced-package-id, 127, --min-sdk-version, 28, --target-sdk-version, 28, --version-code, 28, --version-name, 9, --no-version-vectors, -F, /home/.local/share/apktool/framework/APKTOOL3675842332138637425.tmp, -e, /home/.local/share/apktool/framework/APKTOOL6423420985375138253.tmp, -0, arsc, -I, /home.local/share/apktool/framework/1.apk, -I, /home.local/share/apktool/framework/16.apk, -I, /home.local/share/apktool/framework/17.apk, -I, /home.local/share/apktool/framework/18.apk, -S, /storage/emulated/0/repo/apktool/Settings/res, -M, /storage/emulated/0/repo/apktool/Settings/AndroidManifest.xml]

I try on latest apktool

reactmorelab avatar Jan 16 '20 13:01 reactmorelab

I did some Googling on exit code 132 and it looks like that's caused by aapt having trouble crunching PNG files on 32 bit systems. https://stackoverflow.com/questions/27715506/error-executing-aapt-return-code-132-problems

Try using the "--no-crunch" option when you're recompiling.

It's always worth looking at the error codes that are given when de/recompiling fails. A lot of the time they say what's causing the problem.

Ticklefish avatar Jan 16 '20 14:01 Ticklefish

Tickle hit the details, 32 bit systems with image manipulation is tough unless you install a lot of packages.

32bit + MIUI = bad day and not something we really support anymore and without any application not sure how detailed our investigation can get.

Closing for now.

iBotPeaches avatar Apr 12 '20 10:04 iBotPeaches