-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Build Failure with Apktool 2.9.3 on Linux due to Syntax Error in Temporary File #3498
Comments
May you pull the aapt(s) prebuilts from here and execute them in isolation to test? https://github.com/iBotPeaches/Apktool/tree/master/brut.apktool/apktool-lib/src/main/resources/prebuilt My guess is one of 2 things is happening
They are static binaries so they should not depend on any shared objects. |
Hey, was any solution found because I just ran into the exact same issue? |
Are you positive its the same issue? If so, may you follow my unanswered question above? |
Thank you for your suggestion. I followed your instructions to pull and execute the aapt prebuilts in isolation. Here are the results I obtained: When attempting to execute each of the binaries (aapt, aapt2, aapt_64, and aapt2_64), I encountered an "exec format error" for each one. This suggests that the binaries are incompatible with my system's architecture. I'm currently running Kali Linux Rolling 2023.4 on an Apple M2 MacBook, installed via a virtual machine (VMware) that supports Apple Silicon. The system is using an aarch64 architecture as indicated by the uname -a command output. However, upon inspecting the aapt binary with the file command, it's shown to be an ELF 32-bit LSB executable intended for Intel architectures, which confirms the incompatibility. Given this information, it appears the issue lies with the architecture mismatch rather than permissions or the copy process of the binaries into /tmp for execution. The binaries are built for a different architecture than what's supported on my current setup, which is based on ARM architecture (Apple Silicon) within the VM environment. Is there a version of these prebuilts available for ARM architectures, or would you recommend an alternative approach to running these tools on an ARM-based system? Looking forward to your guidance. |
Odd @MohamedAl-Kainai - I run apktool on my M1 - did the arch change between M2? I guess I'm a bit lost on the intended arch. If you are running Kali on a Apple M2, but inside a VM that supports Apple Silicon I guess I don't know what it should be. We have code to read Java vars to determine which arch/os to use. Like maybe this mac binaries are the intended one? https://github.com/iBotPeaches/Apktool/tree/master/brut.apktool/apktool-lib/src/main/resources/prebuilt/macosx |
A fix that worked for me is downgrading to 2.8.1 (not sure if this step is needed) and afterwards running the following command: |
Thanks - good to know. So we either don't support the arch intended with aapt or improperly detecting the right arch to use. |
Thanks for sharing your solution! I tried running the command |
This solution worked for me too, thanks! |
May some of you with this issue give me an output of: I'm curious of a few of those to see if our OS Detection is invalid and feeding wrong arch binaries to you forcing the usage of qemu emulation. |
Information
apktool -version
) - 2.9.3java --version
) - openjdk 17.0.10 2024-01-16 OpenJDK Runtime Environment (build 17.0.10+7-Debian-1) OpenJDK 64-Bit Server VM (build 17.0.10+7-Debian-1, mixed mode, sharing)Stacktrace/Logcat
Steps to Reproduce
apktool d base.apk
to decompile an APK.apktool b base
.Frameworks
N/A - This issue occurred with a standard APK not specific to any OEM.
APK
The APK in question is available on the Playstore: Phone Directory & Caller ID.
Questions to ask before submission
apktool d
,apktool b
without changing anything? - Yes, the error occurs even without making any changes to the decompiled APK.The text was updated successfully, but these errors were encountered: