// Path: app/src/main/java/com/google/android/diskusage/datasource/DataSource.java
// public abstract class DataSource {
//   private static DataSource currentDataSource = new DefaultDataSource();
// 
//   public static DataSource get() {
//     return currentDataSource;
//   }
// 
//   public static void override(DataSource dataSource) {
//     LoadableActivity.resetStoredStates();
//     currentDataSource = dataSource;
//   }
// 
//   public abstract int getAndroidVersion();
// 
//   public abstract List<PkgInfo> getInstalledPackages(PackageManager pm);
// 
//   public abstract StatFsSource statFs(String mountPoint);
// 
//   @TargetApi(Build.VERSION_CODES.FROYO)
//   public abstract PortableFile getExternalFilesDir(Context context);
//   @TargetApi(Build.VERSION_CODES.KITKAT)
//   public abstract PortableFile[] getExternalFilesDirs(Context context);
// 
//   public abstract PortableFile getExternalStorageDirectory();
// 
//   public abstract InputStream createNativeScanner(
//       Context context, String path,
//       boolean rootRequired) throws IOException, InterruptedException;
// 
//   public abstract boolean isDeviceRooted();
// 
//   public abstract LegacyFile createLegacyScanFile(String root);
// 
//   public final BufferedReader getProcReader() throws IOException {
//     return new BufferedReader(new InputStreamReader(getProc()));
//   }
// 
//   public abstract InputStream getProc() throws IOException;
// 
//   public abstract void getPackageSizeInfo(
//       PkgInfo pkgInfo,
//       Method getPackageSizeInfo,
//       PackageManager pm,
//       AppStatsCallback callback) throws Exception;
// 
//   public abstract PortableFile getParentFile(PortableFile file);
// }
// 
// Path: app/src/main/java/com/google/android/diskusage/datasource/PortableFile.java
// public interface PortableFile {
//   @TargetApi(Build.VERSION_CODES.LOLLIPOP)
//   boolean isExternalStorageEmulated();
//   @TargetApi(Build.VERSION_CODES.LOLLIPOP)
//   boolean isExternalStorageRemovable();
// 
//   /** Retries with getAbsolutePath() on IOException */
//   String getCanonicalPath();
//   String getAbsolutePath();
// 
//   @TargetApi(Build.VERSION_CODES.GINGERBREAD)
//   long getTotalSpace();
// }


import android.content.Context;
import android.util.Log;
import com.google.android.diskusage.datasource.DataSource;
import com.google.android.diskusage.datasource.PortableFile;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
  public boolean hasApps() {
    return forceHasApps;
  }

  private static List<MountPoint> mountPoints = new ArrayList<>();
  private static Map<String,MountPoint> mountPointForKey = new HashMap<>();

  int getChecksum() {
    return RootMountPoint.checksum;
  }

  public static MountPoint getForKey(Context context, String key) {
    initMountPoints(context);
    MountPoint mountPoint = mountPointForKey.get(key);
    if (mountPoint != null) {
      return mountPoint;
    }
    return RootMountPoint.getForKey(context, key);
  }

  public static List<MountPoint> getMountPoints(Context context) {
    initMountPoints(context);
    RootMountPoint.initMountPoints(context);
    return mountPoints;
  }

  private static void initMountPoints(Context context) {
    if (init) return;
    init = true;

// Path: app/src/main/java/com/google/android/diskusage/datasource/DataSource.java
// public abstract class DataSource {
//   private static DataSource currentDataSource = new DefaultDataSource();
// 
//   public static DataSource get() {
//     return currentDataSource;
//   }
// 
//   public static void override(DataSource dataSource) {
//     LoadableActivity.resetStoredStates();
//     currentDataSource = dataSource;
//   }
// 
//   public abstract int getAndroidVersion();
// 
//   public abstract List<PkgInfo> getInstalledPackages(PackageManager pm);
// 
//   public abstract StatFsSource statFs(String mountPoint);
// 
//   @TargetApi(Build.VERSION_CODES.FROYO)
//   public abstract PortableFile getExternalFilesDir(Context context);
//   @TargetApi(Build.VERSION_CODES.KITKAT)
//   public abstract PortableFile[] getExternalFilesDirs(Context context);
// 
//   public abstract PortableFile getExternalStorageDirectory();
// 
//   public abstract InputStream createNativeScanner(
//       Context context, String path,
//       boolean rootRequired) throws IOException, InterruptedException;
// 
//   public abstract boolean isDeviceRooted();
// 
//   public abstract LegacyFile createLegacyScanFile(String root);
// 
//   public final BufferedReader getProcReader() throws IOException {
//     return new BufferedReader(new InputStreamReader(getProc()));
//   }
// 
//   public abstract InputStream getProc() throws IOException;
// 
//   public abstract void getPackageSizeInfo(
//       PkgInfo pkgInfo,
//       Method getPackageSizeInfo,
//       PackageManager pm,
//       AppStatsCallback callback) throws Exception;
// 
//   public abstract PortableFile getParentFile(PortableFile file);
// }
// 
// Path: app/src/main/java/com/google/android/diskusage/datasource/PortableFile.java
// public interface PortableFile {
//   @TargetApi(Build.VERSION_CODES.LOLLIPOP)
//   boolean isExternalStorageEmulated();
//   @TargetApi(Build.VERSION_CODES.LOLLIPOP)
//   boolean isExternalStorageRemovable();
// 
//   /** Retries with getAbsolutePath() on IOException */
//   String getCanonicalPath();
//   String getAbsolutePath();
// 
//   @TargetApi(Build.VERSION_CODES.GINGERBREAD)
//   long getTotalSpace();
// }


// Path: app/src/main/java/com/google/android/diskusage/MountPoint.java
import android.content.Context;
import android.util.Log;
import com.google.android.diskusage.datasource.DataSource;
import com.google.android.diskusage.datasource.PortableFile;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

  public boolean hasApps() {
    return forceHasApps;
  }

  private static List<MountPoint> mountPoints = new ArrayList<>();
  private static Map<String,MountPoint> mountPointForKey = new HashMap<>();

  int getChecksum() {
    return RootMountPoint.checksum;
  }

  public static MountPoint getForKey(Context context, String key) {
    initMountPoints(context);
    MountPoint mountPoint = mountPointForKey.get(key);
    if (mountPoint != null) {
      return mountPoint;
    }
    return RootMountPoint.getForKey(context, key);
  }

  public static List<MountPoint> getMountPoints(Context context) {
    initMountPoints(context);
    RootMountPoint.initMountPoints(context);
    return mountPoints;
  }

  private static void initMountPoints(Context context) {
    if (init) return;
    init = true;

    for (PortableFile dir : DataSource.get().getExternalFilesDirs(context)) {