public static File getApkPath(String pkgName) {
    final File[] files = APP_INSTALL_DIR.listFiles();
    if (files == null || files.length == 0) {
      return null;
    }
    for (File file : files) {
      final boolean isPackage =
          (isApkFile(file) || file.isDirectory()) && !isStageName(file.getName());
      if (!isPackage) {
        // Ignore entries which are not packages
        continue;
      }
      PackageParser.PackageLite lite = parseApk(file);
      if (lite != null && pkgName.equals(lite.packageName)) {
        // Find apk.
        return findFirstApkFile(new File(lite.codePath));
      }
    }
    return null;
  }
Directory where installed applications are stored
android/android_framework/patch-magisk/bridge/src/main/java/github/tornaco/android/thanox/magisk/bridge/util/PackageUtils.java