2

I have installed an app on emulator, pkg name="com.example.plug". In data/data/com.example.plug/lib, there is a "libplugin1.so" file.

Now I want to get it in my own app.

I get the packageName, and then the "nativeLibraryDir", but when I try to get the String[] sharedLibraryFiles, it returns null to me.

My codes are below:

Log.d(TAG, "pkgName=" + pkgName);// fine com.example.plug

ApplicationInfo appInfo = pm.getApplicationInfo(pkgName, PackageManager.GET_SHARED_LIBRARY_FILES);

Log.d(TAG, appInfo.nativeLibraryDir);       // API 9 /data/data/com.example.plug/lib

String[] soList = appInfo.sharedLibraryFiles;   //null
4

1 回答 1

0

它对我有帮助:

packageManager.getInstalledPackages(PackageManager.GET_SHARED_LIBRARY_FILES)
于 2021-08-13T13:23:28.777 回答