简体   繁体   English

从SD卡动态加载共享库

[英]Dynamically load shared library from sd card

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 我想使用dlopen从SD卡动态加载库,但执行此操作时出现错误:dlopen失败:无法映射“ /storage/emulated/0/Documents/Tests/armeabi-v7a/libtest.so”段2:不允许操作

When i use it for internal storage it's work. 当我将其用于内部存储时,它可以工作。 What can i do to solve this problem? 我该怎么做才能解决这个问题?

This is disallowed by Android's security policy. Android的安全策略不允许这样做。 Anyone can write to that location, so loading code from it is an easily exploitable attack vector. 任何人都可以写入该位置,因此从该位置加载代码是容易利用的攻击媒介。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM