Loading core/jni/android_util_AssetManager.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -163,7 +163,7 @@ static void NativeVerifySystemIdmaps(JNIEnv* /*env*/, jclass /*clazz*/) { } // Generic idmap parameters const char* argv[9]; const char* argv[10]; int argc = 0; struct stat st; Loading Loading @@ -203,6 +203,10 @@ static void NativeVerifySystemIdmaps(JNIEnv* /*env*/, jclass /*clazz*/) { argv[argc++] = AssetManager::ODM_OVERLAY_DIR; } if (stat(AssetManager::OEM_OVERLAY_DIR, &st) == 0) { argv[argc++] = AssetManager::OEM_OVERLAY_DIR; } // Finally, invoke idmap (if any overlay directory exists) if (argc > 5) { execv(AssetManager::IDMAP_BIN, (char* const*)argv); Loading Loading @@ -241,6 +245,10 @@ static jobjectArray NativeCreateIdmapsForStaticOverlaysTargetingAndroid(JNIEnv* input_dirs.push_back(AssetManager::ODM_OVERLAY_DIR); } if (stat(AssetManager::OEM_OVERLAY_DIR, &st) == 0) { input_dirs.push_back(AssetManager::OEM_OVERLAY_DIR); } if (input_dirs.empty()) { LOG(WARNING) << "no directories for idmap2 to scan"; return env->NewObjectArray(0, g_stringClass, nullptr); Loading core/jni/fd_utils.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -104,6 +104,8 @@ bool FileDescriptorWhitelist::IsAllowed(const std::string& path) const { static const char* kProductServicesOverlayDir = "/product_services/overlay"; static const char* kSystemOdmOverlayDir = "/system/odm/overlay"; static const char* kOdmOverlayDir = "/odm/overlay"; static const char* kSystemOemOverlayDir = "/system/oem/overlay"; static const char* kOemOverlayDir = "/oem/overlay"; static const char* kApkSuffix = ".apk"; if ((android::base::StartsWith(path, kOverlayDir) Loading @@ -114,7 +116,9 @@ bool FileDescriptorWhitelist::IsAllowed(const std::string& path) const { || android::base::StartsWith(path, kSystemProductServicesOverlayDir) || android::base::StartsWith(path, kProductServicesOverlayDir) || android::base::StartsWith(path, kSystemOdmOverlayDir) || android::base::StartsWith(path, kOdmOverlayDir)) || android::base::StartsWith(path, kOdmOverlayDir) || android::base::StartsWith(path, kSystemOemOverlayDir) || android::base::StartsWith(path, kOemOverlayDir)) && android::base::EndsWith(path, kApkSuffix) && path.find("/../") == std::string::npos) { return true; Loading libs/androidfw/AssetManager.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ const char* AssetManager::VENDOR_OVERLAY_DIR = "/vendor/overlay"; const char* AssetManager::PRODUCT_OVERLAY_DIR = "/product/overlay"; const char* AssetManager::PRODUCT_SERVICES_OVERLAY_DIR = "/product_services/overlay"; const char* AssetManager::ODM_OVERLAY_DIR = "/odm/overlay"; const char* AssetManager::OEM_OVERLAY_DIR = "/oem/overlay"; const char* AssetManager::OVERLAY_THEME_DIR_PROPERTY = "ro.boot.vendor.overlay.theme"; const char* AssetManager::TARGET_PACKAGE_NAME = "android"; const char* AssetManager::TARGET_APK_PATH = "/system/framework/framework-res.apk"; Loading libs/androidfw/include/androidfw/AssetManager.h +1 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ public: static const char* PRODUCT_OVERLAY_DIR; static const char* PRODUCT_SERVICES_OVERLAY_DIR; static const char* ODM_OVERLAY_DIR; static const char* OEM_OVERLAY_DIR; /* * If OVERLAY_THEME_DIR_PROPERTY is set, search for runtime resource overlay * APKs in VENDOR_OVERLAY_DIR/<value of OVERLAY_THEME_DIR_PROPERTY> in Loading services/core/java/com/android/server/pm/PackageManagerService.java +9 −0 Original line number Diff line number Diff line Loading @@ -598,6 +598,8 @@ public class PackageManagerService extends IPackageManager.Stub private static final String ODM_OVERLAY_DIR = "/odm/overlay"; private static final String OEM_OVERLAY_DIR = "/oem/overlay"; /** Canonical intent used to identify what counts as a "web browser" app */ private static final Intent sBrowserIntent; static { Loading Loading @@ -2631,6 +2633,13 @@ public class PackageManagerService extends IPackageManager.Stub | SCAN_AS_SYSTEM | SCAN_AS_ODM, 0); scanDirTracedLI(new File(OEM_OVERLAY_DIR), mDefParseFlags | PackageParser.PARSE_IS_SYSTEM_DIR, scanFlags | SCAN_AS_SYSTEM | SCAN_AS_OEM, 0); mParallelPackageParserCallback.findStaticOverlayPackages(); Loading
core/jni/android_util_AssetManager.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -163,7 +163,7 @@ static void NativeVerifySystemIdmaps(JNIEnv* /*env*/, jclass /*clazz*/) { } // Generic idmap parameters const char* argv[9]; const char* argv[10]; int argc = 0; struct stat st; Loading Loading @@ -203,6 +203,10 @@ static void NativeVerifySystemIdmaps(JNIEnv* /*env*/, jclass /*clazz*/) { argv[argc++] = AssetManager::ODM_OVERLAY_DIR; } if (stat(AssetManager::OEM_OVERLAY_DIR, &st) == 0) { argv[argc++] = AssetManager::OEM_OVERLAY_DIR; } // Finally, invoke idmap (if any overlay directory exists) if (argc > 5) { execv(AssetManager::IDMAP_BIN, (char* const*)argv); Loading Loading @@ -241,6 +245,10 @@ static jobjectArray NativeCreateIdmapsForStaticOverlaysTargetingAndroid(JNIEnv* input_dirs.push_back(AssetManager::ODM_OVERLAY_DIR); } if (stat(AssetManager::OEM_OVERLAY_DIR, &st) == 0) { input_dirs.push_back(AssetManager::OEM_OVERLAY_DIR); } if (input_dirs.empty()) { LOG(WARNING) << "no directories for idmap2 to scan"; return env->NewObjectArray(0, g_stringClass, nullptr); Loading
core/jni/fd_utils.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -104,6 +104,8 @@ bool FileDescriptorWhitelist::IsAllowed(const std::string& path) const { static const char* kProductServicesOverlayDir = "/product_services/overlay"; static const char* kSystemOdmOverlayDir = "/system/odm/overlay"; static const char* kOdmOverlayDir = "/odm/overlay"; static const char* kSystemOemOverlayDir = "/system/oem/overlay"; static const char* kOemOverlayDir = "/oem/overlay"; static const char* kApkSuffix = ".apk"; if ((android::base::StartsWith(path, kOverlayDir) Loading @@ -114,7 +116,9 @@ bool FileDescriptorWhitelist::IsAllowed(const std::string& path) const { || android::base::StartsWith(path, kSystemProductServicesOverlayDir) || android::base::StartsWith(path, kProductServicesOverlayDir) || android::base::StartsWith(path, kSystemOdmOverlayDir) || android::base::StartsWith(path, kOdmOverlayDir)) || android::base::StartsWith(path, kOdmOverlayDir) || android::base::StartsWith(path, kSystemOemOverlayDir) || android::base::StartsWith(path, kOemOverlayDir)) && android::base::EndsWith(path, kApkSuffix) && path.find("/../") == std::string::npos) { return true; Loading
libs/androidfw/AssetManager.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ const char* AssetManager::VENDOR_OVERLAY_DIR = "/vendor/overlay"; const char* AssetManager::PRODUCT_OVERLAY_DIR = "/product/overlay"; const char* AssetManager::PRODUCT_SERVICES_OVERLAY_DIR = "/product_services/overlay"; const char* AssetManager::ODM_OVERLAY_DIR = "/odm/overlay"; const char* AssetManager::OEM_OVERLAY_DIR = "/oem/overlay"; const char* AssetManager::OVERLAY_THEME_DIR_PROPERTY = "ro.boot.vendor.overlay.theme"; const char* AssetManager::TARGET_PACKAGE_NAME = "android"; const char* AssetManager::TARGET_APK_PATH = "/system/framework/framework-res.apk"; Loading
libs/androidfw/include/androidfw/AssetManager.h +1 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ public: static const char* PRODUCT_OVERLAY_DIR; static const char* PRODUCT_SERVICES_OVERLAY_DIR; static const char* ODM_OVERLAY_DIR; static const char* OEM_OVERLAY_DIR; /* * If OVERLAY_THEME_DIR_PROPERTY is set, search for runtime resource overlay * APKs in VENDOR_OVERLAY_DIR/<value of OVERLAY_THEME_DIR_PROPERTY> in Loading
services/core/java/com/android/server/pm/PackageManagerService.java +9 −0 Original line number Diff line number Diff line Loading @@ -598,6 +598,8 @@ public class PackageManagerService extends IPackageManager.Stub private static final String ODM_OVERLAY_DIR = "/odm/overlay"; private static final String OEM_OVERLAY_DIR = "/oem/overlay"; /** Canonical intent used to identify what counts as a "web browser" app */ private static final Intent sBrowserIntent; static { Loading Loading @@ -2631,6 +2633,13 @@ public class PackageManagerService extends IPackageManager.Stub | SCAN_AS_SYSTEM | SCAN_AS_ODM, 0); scanDirTracedLI(new File(OEM_OVERLAY_DIR), mDefParseFlags | PackageParser.PARSE_IS_SYSTEM_DIR, scanFlags | SCAN_AS_SYSTEM | SCAN_AS_OEM, 0); mParallelPackageParserCallback.findStaticOverlayPackages();