Apktool icon indicating copy to clipboard operation
Apktool copied to clipboard

[BUG] Framework.jar cannot be recompiled normally. The latest apktool

Open mandfx opened this issue 4 years ago • 3 comments

Information

  1. Apktool Version (apktool -version) - 2.6.0
  2. Operating System (Mac, Linux, Windows) - Windows10
  3. APK From? (Playstore, ROM, Other) - framework.jar

Stacktrace/Logcat

java -jar apktool_2.6.0.jar d framework-test.jar
I: Using Apktool 2.6.0 on framework-test.jar
I: Baksmaling classes.dex...
I: Baksmaling classes2.dex...
I: Baksmaling classes3.dex...
I: Baksmaling classes4.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...

java -jar apktool_2.6.0.jar b framework-test.jar.out
I: Using Apktool 2.6.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
framework-test.jar.out\smali\android\Manifest$permission.smali[1750,27] Hidden API restrictions are only supported on api 29 and above.
framework-test.jar.out\smali\android\Manifest$permission.smali[1751,12] mismatched tree node: I_ORDERED_METHOD_ITEMS expecting I_FIELDS
Could not smali file: android/Manifest$permission.smali

java -jar apktool_2.6.0.jar b -api 29 framework-test.jar.out
I: Using Apktool 2.6.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 sources has changed...
I: Smaling smali_classes4 folder into classes4.dex...
W: Could not find resources
I: Building apk file...
I: Copying unknown files/dir...
I: Built apk...

Steps to Reproduce

  1. apktool

Frameworks

MIUI12.5 /system/framework/framework.jar framework-test.zip

Questions to ask before submission

  1. After compiling, you can't turn on the first screen of the card, including after cracking the signature. After adding - API 29, it can be compiled normally.
  2. adb logcat :09-19 12:25:43.787 7256 7256 W zygote64: Failed to open .dex from file '/system/framework/framework.jar': Failure to verify dex file '/system/framework/framework.jar': Non-zero padding e6 before section of type 61440 at offset 0x94634d 09-19 12:25:43.799 7257 7257 W zygote : Failed to open .dex from file '/system/framework/framework.jar': Failure to verify dex file '/system/framework/framework.jar': Non-zero padding e6 before section of type 61440 at offset 0x94634d

mandfx avatar Sep 19 '21 04:09 mandfx

Going to mark as 3rd party. We need this fix - https://github.com/JesusFreke/smali/pull/816

iBotPeaches avatar Nov 27 '21 12:11 iBotPeaches

Seem like JesusFreke has discontinued Smali project, this issue won't fix any more :(

thanhpv15 avatar Feb 25 '22 16:02 thanhpv15

Seem like JesusFreke has discontinued Smali project, this issue won't fix any more :(

Without a source, thats not the nicest thing to say.

iBotPeaches avatar Feb 25 '22 16:02 iBotPeaches

I believe resolved with this: https://github.com/iBotPeaches/Apktool/pull/2941

iBotPeaches avatar Nov 21 '22 11:11 iBotPeaches