如何获得路径lib文件夹中已安装包如何获得、路径、安装包、文件

2023-09-05 09:44:02 作者:猛虎隐深山.

共享库.so文件放在LIB / armeabi在APK文件。

Shared libraries .so files are placed in lib/armeabi in an apk file.

我已阅读安装后的库被提取到/数据/数据​​/ application_package / lib目录

I have read after installation the libs gets extracted to /data/data/application_package/lib

我怎样才能让我的在运行时应用到该目录的确切路径? 这是目录应用程序可读?还是只executeable允许访问? 如果是可读的 - 这是仍然如此受版权保护的应用程序

How can I get the exact path to this directory in my application at run time? Is this directory readable by the application? Or is only executeable access allowed? If it is readable - Is this still true for copy protected applications?

推荐答案

您可以用确切的路径:

String libraryPath = getContext().getApplicationInfo().dataDir + "/lib";

目录及其文件是由应用​​程序读取。

The directory and its files are readable by the application.

Unix的权限设置为 rwxr-X - X 。因此,应用程序 同组可以读取文件

The unix permissions are set to rwxr-x--x. So applications with the same group can read the files.