Loading libs/androidfw/AssetManager.cpp +25 −13 Original line number Diff line number Diff line Loading @@ -288,24 +288,36 @@ bool AssetManager::createIdmap(const char* targetApkPath, const char* overlayApk { AutoMutex _l(mLock); const String8 paths[2] = { String8(targetApkPath), String8(overlayApkPath) }; Asset* assets[2] = {NULL, NULL}; bool ret = false; { ResTable tables[2]; for (int i = 0; i < 2; ++i) { asset_path ap; ap.type = kFileTypeRegular; ap.path = paths[i]; Asset* ass = openNonAssetInPathLocked("resources.arsc", Asset::ACCESS_BUFFER, ap); if (ass == NULL) { assets[i] = openNonAssetInPathLocked("resources.arsc", Asset::ACCESS_BUFFER, ap); if (assets[i] == NULL) { ALOGW("failed to find resources.arsc in %s\n", ap.path.string()); return false; goto exit; } tables[i].add(ass); if (tables[i].add(assets[i]) != NO_ERROR) { ALOGW("failed to add %s to resource table", paths[i].string()); goto exit; } return tables[0].createIdmap(tables[1], targetCrc, overlayCrc, } ret = tables[0].createIdmap(tables[1], targetCrc, overlayCrc, targetApkPath, overlayApkPath, (void**)outData, outSize) == NO_ERROR; } exit: delete assets[0]; delete assets[1]; return ret; } bool AssetManager::addDefaultAssets() { const char* root = getenv("ANDROID_ROOT"); Loading services/core/java/com/android/server/pm/Installer.java +9 −0 Original line number Diff line number Diff line Loading @@ -295,6 +295,15 @@ public class Installer extends SystemService { } } public void removeIdmap(String overlayApkPath) throws InstallerException { if (!checkBeforeRemote()) return; try { mInstalld.removeIdmap(overlayApkPath); } catch (Exception e) { throw InstallerException.from(e); } } public void rmdex(String codePath, String instructionSet) throws InstallerException { assertValidInstructionSet(instructionSet); if (!checkBeforeRemote()) return; Loading Loading
libs/androidfw/AssetManager.cpp +25 −13 Original line number Diff line number Diff line Loading @@ -288,24 +288,36 @@ bool AssetManager::createIdmap(const char* targetApkPath, const char* overlayApk { AutoMutex _l(mLock); const String8 paths[2] = { String8(targetApkPath), String8(overlayApkPath) }; Asset* assets[2] = {NULL, NULL}; bool ret = false; { ResTable tables[2]; for (int i = 0; i < 2; ++i) { asset_path ap; ap.type = kFileTypeRegular; ap.path = paths[i]; Asset* ass = openNonAssetInPathLocked("resources.arsc", Asset::ACCESS_BUFFER, ap); if (ass == NULL) { assets[i] = openNonAssetInPathLocked("resources.arsc", Asset::ACCESS_BUFFER, ap); if (assets[i] == NULL) { ALOGW("failed to find resources.arsc in %s\n", ap.path.string()); return false; goto exit; } tables[i].add(ass); if (tables[i].add(assets[i]) != NO_ERROR) { ALOGW("failed to add %s to resource table", paths[i].string()); goto exit; } return tables[0].createIdmap(tables[1], targetCrc, overlayCrc, } ret = tables[0].createIdmap(tables[1], targetCrc, overlayCrc, targetApkPath, overlayApkPath, (void**)outData, outSize) == NO_ERROR; } exit: delete assets[0]; delete assets[1]; return ret; } bool AssetManager::addDefaultAssets() { const char* root = getenv("ANDROID_ROOT"); Loading
services/core/java/com/android/server/pm/Installer.java +9 −0 Original line number Diff line number Diff line Loading @@ -295,6 +295,15 @@ public class Installer extends SystemService { } } public void removeIdmap(String overlayApkPath) throws InstallerException { if (!checkBeforeRemote()) return; try { mInstalld.removeIdmap(overlayApkPath); } catch (Exception e) { throw InstallerException.from(e); } } public void rmdex(String codePath, String instructionSet) throws InstallerException { assertValidInstructionSet(instructionSet); if (!checkBeforeRemote()) return; Loading