Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recompile error #3421

Closed
satwik2305 opened this issue Nov 6, 2023 · 1 comment · Fixed by #3396
Closed

Recompile error #3421

satwik2305 opened this issue Nov 6, 2023 · 1 comment · Fixed by #3396
Milestone

Comments

@satwik2305
Copy link

satwik2305 commented Nov 6, 2023

Information
Apktool Version (apktool -version) -2.9.0
Operating System (Mac, Linux, Windows) -Linux Ubuntu 16.04 LTS
APK From? (Playstore, ROM, Other) -apkmirror website

I am getting this output

Using APK template: insta.apk
[-] No platform was selected, choosing Msf::Module::Platform::Android from the payload
[-] No arch selected, selecting arch: dalvik from the payload
[*] Creating signing key and keystore..
[*] Decompiling original APK..
[*] Decompiling payload APK..
[*] Locating hook point..
[*] Adding payload as package com.instagram.lite.jzeyl
[*] Loading /tmp/d20231106-3813-4gh8ot/original/smali/com/facebook/lite/ClientApplicationSplittedShell.smali and injecting payload..
[*] Poisoning the manifest with meterpreter permissions..
[*] Adding <uses-permission android:name="android.permission.READ_SMS"/>
[*] Adding <uses-permission android:name="android.permission.READ_CALL_LOG"/>
[*] Adding <uses-permission android:name="android.permission.WRITE_SETTINGS"/>
[*] Adding <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
[*] Adding <uses-permission android:name="android.permission.RECEIVE_SMS"/>
[*] Adding <uses-permission android:name="android.permission.WRITE_CALL_LOG"/>
[*] Adding <uses-permission android:name="android.permission.SEND_SMS"/>
[*] Adding <uses-permission android:name="android.permission.SET_WALLPAPER"/>
[*] Rebuilding apk with meterpreter injection as /tmp/d20231106-3813-4gh8ot/output.apk
[-] I: Using Apktool 2.9.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
W: /tmp/d20231106-3813-4gh8ot/original/res/values-v31/dimens.xml:3: error: resource android:dimen/accessibility_touch_slop is private.
W: /tmp/d20231106-3813-4gh8ot/original/res/values-v31/dimens.xml:4: error: resource android:dimen/action_bar_content_inset_material is private.
W: error: failed linking references.
brut.androlib.exceptions.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_110712780810945718532875994717472525175.tmp, link, -o, /tmp/APKTOOL16855285275858765827.tmp, --package-id, 127, --min-sdk-version, 26, --target-sdk-version, 33, --version-code, 531759363, --version-name, 379.0.0.8.118, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, --no-compile-sdk-metadata, -e, /tmp/APKTOOL13285101113605007712.tmp, -0, arsc, -I, /home/x/.local/share/apktool/framework/1.apk, --manifest, /tmp/d20231106-3813-4gh8ot/original/AndroidManifest.xml, /tmp/d20231106-3813-4gh8ot/original/build/resources.zip]
[*] Unable to rebuild apk. Trying rebuild with AAPT2..
[-] I: Using Apktool 2.9.0
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
W: /tmp/d20231106-3813-4gh8ot/original/res/values-v31/dimens.xml:3: error: resource android:dimen/accessibility_touch_slop is private.
W: /tmp/d20231106-3813-4gh8ot/original/res/values-v31/dimens.xml:4: error: resource android:dimen/action_bar_content_inset_material is private.
W: error: failed linking references.
brut.androlib.exceptions.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_72218526281389051833249447892547790279.tmp, link, -o, /tmp/APKTOOL13476345298012357878.tmp, --package-id, 127, --min-sdk-version, 26, --target-sdk-version, 33, --version-code, 531759363, --version-name, 379.0.0.8.118, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, --no-compile-sdk-metadata, -e, /tmp/APKTOOL9681155900505149997.tmp, -0, arsc, -I, /home/x/.local/share/apktool/framework/1.apk, --manifest, /tmp/d20231106-3813-4gh8ot/original/AndroidManifest.xml, /tmp/d20231106-3813-4gh8ot/original/build/resources.zip]

Error: Unable to rebuild apk with apktool

@iBotPeaches
Copy link
Owner

I have a patch in progress which patches aapt2 to ignore these more restrictive properties. Its linked above.

This is a good workaround for now. I'm debating reworking Apktool's framework management to hold all API versions, then we pick the version correlating to manifest. This would help avoid some of these issues.

iBotPeaches added a commit that referenced this issue Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants