Loading core/java/android/content/pm/PackageParser.java +16 −2 Original line number Original line Diff line number Diff line Loading @@ -8444,6 +8444,21 @@ public class PackageParser { public static PackageInfo generatePackageInfoFromApex(File apexFile, boolean collectCerts) public static PackageInfo generatePackageInfoFromApex(File apexFile, boolean collectCerts) throws PackageParserException { throws PackageParserException { PackageInfo pi = new PackageInfo(); PackageInfo pi = new PackageInfo(); int parseFlags = 0; if (collectCerts) { parseFlags |= PARSE_COLLECT_CERTIFICATES; try { if (apexFile.getCanonicalPath().startsWith("/system")) { // Don't need verify the APK integrity of APEXes on /system, just like // we don't do that for APKs. // TODO(b/126514108): we may be able to do this for APEXes on /data as well. parseFlags |= PARSE_IS_SYSTEM_DIR; } } catch (IOException e) { throw new PackageParserException(INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION, "Failed to get path for " + apexFile.getPath(), e); } } // TODO(b/123086053) properly fill in the ApplicationInfo with data from AndroidManifest // TODO(b/123086053) properly fill in the ApplicationInfo with data from AndroidManifest // Add ApplicationInfo to the PackageInfo. // Add ApplicationInfo to the PackageInfo. Loading @@ -8458,8 +8473,7 @@ public class PackageParser { // TODO(b/123052859): We should avoid these repeated calls to parseApkLite each time // TODO(b/123052859): We should avoid these repeated calls to parseApkLite each time // we want to generate information for APEX modules. // we want to generate information for APEX modules. PackageParser.ApkLite apk = PackageParser.parseApkLite(apexFile, PackageParser.ApkLite apk = PackageParser.parseApkLite(apexFile, parseFlags); collectCerts ? PackageParser.PARSE_COLLECT_CERTIFICATES : 0); pi.packageName = apk.packageName; pi.packageName = apk.packageName; ai.packageName = apk.packageName; ai.packageName = apk.packageName; Loading Loading
core/java/android/content/pm/PackageParser.java +16 −2 Original line number Original line Diff line number Diff line Loading @@ -8444,6 +8444,21 @@ public class PackageParser { public static PackageInfo generatePackageInfoFromApex(File apexFile, boolean collectCerts) public static PackageInfo generatePackageInfoFromApex(File apexFile, boolean collectCerts) throws PackageParserException { throws PackageParserException { PackageInfo pi = new PackageInfo(); PackageInfo pi = new PackageInfo(); int parseFlags = 0; if (collectCerts) { parseFlags |= PARSE_COLLECT_CERTIFICATES; try { if (apexFile.getCanonicalPath().startsWith("/system")) { // Don't need verify the APK integrity of APEXes on /system, just like // we don't do that for APKs. // TODO(b/126514108): we may be able to do this for APEXes on /data as well. parseFlags |= PARSE_IS_SYSTEM_DIR; } } catch (IOException e) { throw new PackageParserException(INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION, "Failed to get path for " + apexFile.getPath(), e); } } // TODO(b/123086053) properly fill in the ApplicationInfo with data from AndroidManifest // TODO(b/123086053) properly fill in the ApplicationInfo with data from AndroidManifest // Add ApplicationInfo to the PackageInfo. // Add ApplicationInfo to the PackageInfo. Loading @@ -8458,8 +8473,7 @@ public class PackageParser { // TODO(b/123052859): We should avoid these repeated calls to parseApkLite each time // TODO(b/123052859): We should avoid these repeated calls to parseApkLite each time // we want to generate information for APEX modules. // we want to generate information for APEX modules. PackageParser.ApkLite apk = PackageParser.parseApkLite(apexFile, PackageParser.ApkLite apk = PackageParser.parseApkLite(apexFile, parseFlags); collectCerts ? PackageParser.PARSE_COLLECT_CERTIFICATES : 0); pi.packageName = apk.packageName; pi.packageName = apk.packageName; ai.packageName = apk.packageName; ai.packageName = apk.packageName; Loading