Apktool icon indicating copy to clipboard operation
Apktool copied to clipboard

[BUG]cannot recompile android13.apk

Open bestneville opened this issue 3 years ago • 10 comments

Information

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

Stacktrace/Logcat

I: Using Apktool 2.6.1
I: Smaling smali folder into classes.dex...
I: Smaling smali_classes20 folder into classes20.dex...
I: Smaling smali_classes18 folder into classes18.dex...
I: Smaling smali_classes11 folder into classes11.dex...
I: Smaling smali_classes16 folder into classes16.dex...
I: Smaling smali_classes17 folder into classes17.dex...
I: Smaling smali_classes10 folder into classes10.dex...
I: Smaling smali_classes19 folder into classes19.dex...
I: Smaling smali_classes21 folder into classes21.dex...
I: Smaling smali_classes9 folder into classes9.dex...
I: Smaling smali_classes7 folder into classes7.dex...
I: Smaling smali_classes6 folder into classes6.dex...
I: Smaling smali_classes8 folder into classes8.dex...
I: Smaling smali_classes15 folder into classes15.dex...
I: Smaling smali_classes12 folder into classes12.dex...
I: Smaling smali_classes13 folder into classes13.dex...
I: Smaling smali_classes14 folder into classes14.dex...
I: Smaling smali_classes3 folder into classes3.dex...
I: Smaling smali_classes4 folder into classes4.dex...
I: Smaling smali_classes5 folder into classes5.dex...
I: Smaling smali_classes2 folder into classes2.dex...
I: Building resources...
W: /Users/niewei/all/any/app-cn-release/AndroidManifest.xml:131: error: attribute android:enableOnBackInvokedCallback not found.
W: /Users/niewei/all/any/app-cn-release/AndroidManifest.xml:131: error: attribute android:localeConfig not found.
W: error: failed processing manifest.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/0m/ltd18w693fx4mgyxht34v2_c0000gp/T/brut_util_Jar_75188214170836631791981899796200836780.tmp, link, -o, /var/folders/0m/ltd18w693fx4mgyxht34v2_c0000gp/T/APKTOOL7692184737978072987.tmp, --package-id, 127, --min-sdk-version, 19, --target-sdk-version, 30, --version-code, 31600125, --version-name, 3.16.0.0-rc125, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, -e, /var/folders/0m/ltd18w693fx4mgyxht34v2_c0000gp/T/APKTOOL2225047760528473291.tmp, -0, arsc, -I, /Users/niewei/Library/apktool/framework/1.apk, --manifest, /Users/niewei/all/any/app-cn-release/AndroidManifest.xml, /Users/niewei/all/any/app-cn-release/build/resources.zip]

Steps to Reproduce

  1. apktool

Frameworks

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

APK

If this APK can be freely shared, please upload/attach a link to it.

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?
  3. Are you using the latest apktool version? YES!

bestneville avatar Aug 02 '22 07:08 bestneville

Which os are you using?

nikzdevz avatar Aug 02 '22 14:08 nikzdevz

Which os are you using?

macOs,It doesn't seem to be compatible with android13 yet

bestneville avatar Aug 03 '22 02:08 bestneville

@bestneville Use framework.jar version 33 or higher. And use aapt2 latest

framework.jar and aapt2 seem to be built into apktool. I tried to replace them, which caused some other problems. When is supported by apktool itself?

bestneville avatar Aug 03 '22 03:08 bestneville

Try this jar which i've edited
xx

How to use ? 1 - Create a folder with name tempr in same directory where you will place the jar 2 - use --use-aapt2 to recompile the apk

and let me know if its work.

nikzdevz avatar Aug 03 '22 10:08 nikzdevz

@nikzdevz - I've removed that link. If you want to share a build, please share the code changes for the build and the user can build. I don't want to risk malware or unofficial builds.

iBotPeaches avatar Aug 03 '22 12:08 iBotPeaches

@iBotPeaches ok. where to suggest the code changes ?

nikzdevz avatar Aug 03 '22 12:08 nikzdevz

@nikzdevz - I've removed that link. If you want to share a build, please share the code changes for the build and the user can build. I don't want to risk malware or unofficial builds.

I tried it and had the same error , How can I solve this error

bestneville avatar Aug 03 '22 13:08 bestneville

@iBotPeaches ok. where to suggest the code changes ?

Pull Request to this repo is preferred.

iBotPeaches avatar Aug 03 '22 13:08 iBotPeaches

@iBotPeaches :)

bestneville avatar Aug 03 '22 14:08 bestneville

I found the latest code branch already supported

bestneville avatar Aug 04 '22 06:08 bestneville

This was already resolved during the internal framework update. You could test yourself with a snapshot build here - https://github.com/iBotPeaches/Apktool/actions/runs/2644508403

iBotPeaches avatar Aug 06 '22 20:08 iBotPeaches

I was facing same issue with an app , then I tried with the latest build from master , though this issue is resolved but I am facing a new error

error: failed linking references.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/16/fss9c46s7slf3r7shkmfvmjm0000gq/T/brut_util_Jar_60540973667396634375182075550523300358.tmp, link, -o, /var/folders/16/fss9c46s7slf3r7shkmfvmjm0000gq/T/APKTOOL6954729294638853611.tmp, --package-id, 127, --min-sdk-version, 26, --target-sdk-version, 33, --version-code, 19289, --version-name, 2.74.0-automation, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, -e, /var/folders/16/fss9c46s7slf3r7shkmfvmjm0000gq/T/APKTOOL2928238007883608010.tmp, -0, arsc, -I, /Users/devtyagi/Library/apktool/framework/1.apk, --manifest, /Users/devtyagi/Work/apktool-experiment/Apktool/./apk-name/AndroidManifest.xml, /Users/devtyagi/Work/apktool-experiment/Apktool/./apk-name/build/resources.zip]

I could see that there is already an issue for this #2797 , can you please check this

Devtyagi-9 avatar Sep 01 '22 12:09 Devtyagi-9