如何获取已安装软件包的 lib 文件夹的路径 [英] How to get the path to the lib folder for an installed package

查看:15
本文介绍了如何获取已安装软件包的 lib 文件夹的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

共享库 .so 文件放在 lib/armeabi 的一个 apk 文件中.

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

我已阅读安装后的库被提取到/data/data/application_package/lib

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

如何在运行时在我的应用程序中获取此目录的确切路径?应用程序是否可以读取此目录?还是只允许可执行访问?如果它是可读的 - 这对于受版权保护的应用程序仍然适用吗?

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?

推荐答案

您可以通过以下方式获得确切的路径:

You can get the exact path with:

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.

这篇关于如何获取已安装软件包的 lib 文件夹的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆