Merge "Allow apps to load libraries from under /data" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a31657911c
@@ -465,20 +465,18 @@ public final class LoadedApk {
|
|||||||
final String zip = mIncludeCode ? TextUtils.join(File.pathSeparator, zipPaths) : "";
|
final String zip = mIncludeCode ? TextUtils.join(File.pathSeparator, zipPaths) : "";
|
||||||
final boolean isBundledApp = mApplicationInfo.isSystemApp()
|
final boolean isBundledApp = mApplicationInfo.isSystemApp()
|
||||||
&& !mApplicationInfo.isUpdatedSystemApp();
|
&& !mApplicationInfo.isUpdatedSystemApp();
|
||||||
String libraryPermittedPath = mDataDir;
|
|
||||||
|
// Apps are allowed to open any native library under /data
|
||||||
|
// TODO (dimitry):This is something which could be limited to apps own directory
|
||||||
|
// later on but currently there are number of apps relying on this.
|
||||||
|
// (see http://b/27588281 and http://b/26954419 for examples)
|
||||||
|
String libraryPermittedPath = "/data";
|
||||||
if (isBundledApp) {
|
if (isBundledApp) {
|
||||||
// This is necessary to grant bundled apps access to
|
// This is necessary to grant bundled apps access to
|
||||||
// libraries located in subdirectories of /system/lib
|
// libraries located in subdirectories of /system/lib
|
||||||
libraryPermittedPath += File.pathSeparator +
|
libraryPermittedPath += File.pathSeparator +
|
||||||
System.getProperty("java.library.path");
|
System.getProperty("java.library.path");
|
||||||
}
|
}
|
||||||
// DO NOT SHIP: this is a workaround for apps loading native libraries
|
|
||||||
// provided by 3rd party apps using absolute path instead of corresponding
|
|
||||||
// classloader; see http://b/26954419 for example.
|
|
||||||
if (mApplicationInfo.targetSdkVersion <= 23) {
|
|
||||||
libraryPermittedPath += File.pathSeparator + "/data/app";
|
|
||||||
}
|
|
||||||
// -----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
final String librarySearchPath = TextUtils.join(File.pathSeparator, libPaths);
|
final String librarySearchPath = TextUtils.join(File.pathSeparator, libPaths);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user