Android 12.0 without source code app to modify its icon icon

1 Overview

In the 12.0 system product rom customization development, some products need to replace the icon of the app displayed on the desktop in Launcher3. If there is no source code, the replacement will be troublesome. When the app needs to be parsed from pms, the icon icon of the app can be replaced
. that's it

2. No source code app modifies its icon related core classes

 frameworks/base/core/java/android/content/pm/PackageParser.java

3. Realization and analysis of the core function of modifying its icon icon without source code app

 @UnsupportedAppUsage
      public Package parsePackage(File packageFile, int flags, boolean useCaches)
              throws PackageParserException {
          if (packageFile.isDirectory()) {
              return parseClusterPackage(packageFile, flags);
          } else {
              return parseMonolithicPackage(packageFile, flags);
          }
      }
      
      @NonNull
      public static ParseResult<ParsingPackage> parseDefault(ParseInput input, File file,
              @ParseFlags int parseFlags,
              @NonNull List<PermissionManager.SplitPermissionInfo> splitPermissions,
           

Guess you like

Origin blog.csdn.net/baidu_41666295/article/details/130712128