1

I want to dynamically load library from SD card, with dlopen, but when I do it, get error: dlopen failed: couldn't map "/storage/emulated/0/Documents/Tests/armeabi-v7a/libtest.so" segment 2: Operation not permitted

When i use it for internal storage it's work. What can i do to solve this problem?

Sinigr
  • 154
  • 1
  • 11
  • Possible duplicate of [Android ndk and dynamic load library with dlopen](http://stackoverflow.com/questions/37592218/android-ndk-and-dynamic-load-library-with-dlopen) – too honest for this site Jun 04 '16 at 14:54

1 Answers1

2

This is disallowed by Android's security policy. Anyone can write to that location, so loading code from it is an easily exploitable attack vector.

Dan Albert
  • 10,079
  • 2
  • 36
  • 79
  • 3
    Thanks. But if copy from sd card location to internal location it's work – Sinigr Jun 07 '16 at 08:30
  • To a controlled location though, right? If you're on a rooted device then lots of the security restrictions are going to be pretty much neutered... – Dan Albert Jun 08 '16 at 21:35