-
Notifications
You must be signed in to change notification settings - Fork 52
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
Fix building on Android #112
base: main
Are you sure you want to change the base?
Conversation
Fix only for NDK below 23.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
You're right that some of this is quite ugly, especially the requirement to symlink ar
. Surely there is a better solution?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this file get respected when frida-rust is used as a library, or only when running cargo build
from this directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only for local building and building of examples. In the case of using the crate as a library, an user must take care of creating this file in his own crate.
To be honest, I'm not sure, I tried to do it as much as possible without the user's involvement, but this is impossible, because in addition to having to create symbolic links, you still have to set environment variables for Android. |
Symlinks are a no-go because they don't function correctly under Windows. Honestly, I'm not clear on why it's needed at all because we have the frida-build crate which is around to provide shared code for build.rs. Can we use that instead please? Thanks. |
Unfortunately, I did not find any way to set the path to These changes (including symlinks) are only necessary to build and run examples or libraries and executables that will include Frida as a dependency: I can delete them, nothing will change from this except that the examples will no longer be built for Android platform. I added these changes so that an user would have an example of how and what to do to build Frida as a dependency for his/her Android project, but unfortunately I still run into a problem with Once again, I did not find another way to set the path to |
This PR contains several workarounds in order to be able to use the crate for Android. Some of them look quite messy, but unfortunately I couldn't find a way to do it better.
For NDK versions 25 and higher, it is also necessary to create a symbolic link to
ar
, since there is no longer the ability to set customar
in Rust (cargo config, codegen options):If someone knows how to solve this, then I will add it to the PR.