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

FR: loading the native library specified by the filename argument #57

Open
artyomd opened this issue Mar 8, 2019 · 6 comments
Open

Comments

@artyomd
Copy link

artyomd commented Mar 8, 2019

There should be an API interface for System.load, which will take the library path and try to load it with System.load. If loading fails, it will try to load dependencies and try again.

@philippb
Copy link
Contributor

@artyomd thanks for submitting your PR in references to this feature request.
Can you please elaborate why you think ReLinked needs this functionality?

@artyomd
Copy link
Author

artyomd commented Mar 18, 2019

@philippb Thanks for your response. So there are 2 ways of loading native libraries, the first one is with System.loadLibrary providing a library name, and the second one with System.load providing a file path. ReLinker supports loading libraries by name but does not support loading from a path, yet. And there are many reasons to download native libraries at app runtime and load them with System.load instead of shipping the app with them. So I thought why not to implement that functionality? I don't think that there is a reason why ReLinker must not have this functionality. @philippb What you think about this?

@benjamin-bader
Copy link
Contributor

Android Q is going to specifically disallow downloading and executing native code, JFYI.

@artyomd
Copy link
Author

artyomd commented Mar 19, 2019

@benjamin-bader What do you mean by saying disallow? I don't think that android will remove or deprecate System.load method. Btw, ReLinker currently relies on System.load. In the other side, there will be always a way to get a native library from somewhere at runtime. So as far as I know only google play store bans apps that download and execute native code. So the os itself cannot restrict an app from doing that. And there are apps that are not being published in play store. So the functionality to load an external native lib is there, why not use that? Anyway, you are just a library project maintainers, why not to support that functionality for the ones who want to do that kind of things?

@benjamin-bader
Copy link
Contributor

I don't mean that System.load is going away, but it turns out I'm wrong in a different way.

What's changed in Q is that you may not exec() a downloaded native binary; you can still load a .so that was downloaded and made executable. That, which is the use case you are referring to, is likely going to be banned in R.

See the following thread: https://www.reddit.com/r/androiddev/comments/b2inbu/psa_android_q_blocks_executing_binaries_in_your/

@artyomd
Copy link
Author

artyomd commented Mar 20, 2019

@benjamin-bader Thanks for your response. It will be banned in the future or not, currently does not matter, but it is a common use case and ReLinker can address that.

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

No branches or pull requests

3 participants