-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Using native-image and Android apk files. #8941
Comments
The Android SDK is required to build an Android application. The SDK is typically provided in a developer's environment, and helps assemble the APK; the Android Runtime then takes over to run the application, and probably provides this class. GraalVM builds ahead of time (AOT), and, unless it is given access to the Android runtime, it probably won't be able to find those classes, as you've seen here. What are you trying to accomplish? Android applications run on the Dalvik VM, which executes Java bytecode. I don't think it is possible to natively compile an Android application. It may be possible to build shared libraries and use them on Android. |
Thanks for your reply. I want to get the LLVM bitcode of an Android apk file to analyze the app with a static analysis tool called ClearBlue that does so on LLVM IR. |
Hi @maryammsd, |
GraalVM Native Image Error Report
Build Output
Stack Trace
GraalVM Setup
21.0.1+12
GraalVM CE 21.0.1-dev+12.1
21.0.1+12-jvmci-23.1-b22
GraalVM
release
fileBuilder Setup
Class path
Module path
Builder arguments
Builder properties
Hello, I wanna use GraalVM to get the binary of an Android apk file for performing static analysis. Since Android apps do not have a main method, I tried to modify the Android APK file with soot that adds dummyMainMethod, get .class files, modify the name of dummyMainMethod to main, and repack .class files to a jar file.
I know the jar is not executable, and that is not my concern right now ( ;) )since I just want to get the binary and do some static analysis :D. However, when I use native-image, I get the error of java.lang.NoClassDefFoundError: android/app/Application
since native-image and JVM are not built with Android packages and classes. I was wondering whether there is any easy way to use --module-path and --add-modules to resolve this issue. Looking forward to your feedback and help :)
Features enabled
The text was updated successfully, but these errors were encountered: