package com.stericson.RootTools;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import com.stericson.RootShell.RootShell;
import com.stericson.RootShell.exceptions.RootDeniedException;
import com.stericson.RootShell.execution.Command;
import com.stericson.RootShell.execution.Shell;
import com.stericson.RootShell.execution.Shell.ShellContext;
import com.stericson.RootTools.containers.Mount;
import com.stericson.RootTools.containers.Permissions;
import com.stericson.RootTools.containers.Symlink;
import com.stericson.RootTools.internal.Remounter;
import com.stericson.RootTools.internal.RootToolsInternalMethods;
import com.stericson.RootTools.internal.Runner;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeoutException;

public final class RootTools
{
  public static boolean debugMode;
  public static int default_Command_Timeout = 20000;
  public static boolean handlerEnabled;
  private static RootToolsInternalMethods rim = null;
  public static String utilPath;
  
  static
  {
    debugMode = false;
    handlerEnabled = true;
  }
  
  public static boolean checkUtil(String paramString)
  {
    return getInternals().checkUtil(paramString);
  }
  
  public static void closeAllShells()
    throws IOException
  {}
  
  public static void closeCustomShell()
    throws IOException
  {}
  
  public static void closeShell(boolean paramBoolean)
    throws IOException
  {
    RootShell.closeShell(paramBoolean);
  }
  
  public static boolean copyFile(String paramString1, String paramString2, boolean paramBoolean1, boolean paramBoolean2)
  {
    return getInternals().copyFile(paramString1, paramString2, paramBoolean1, paramBoolean2);
  }
  
  public static boolean deleteFileOrDirectory(String paramString, boolean paramBoolean)
  {
    return getInternals().deleteFileOrDirectory(paramString, paramBoolean);
  }
  
  public static boolean exists(String paramString)
  {
    return exists(paramString, false);
  }
  
  public static boolean exists(String paramString, boolean paramBoolean)
  {
    return RootShell.exists(paramString, paramBoolean);
  }
  
  public static List<String> findBinary(String paramString)
  {
    return RootShell.findBinary(paramString);
  }
  
  public static void fixUtil(String paramString1, String paramString2)
  {
    getInternals().fixUtil(paramString1, paramString2);
  }
  
  public static boolean fixUtils(String[] paramArrayOfString)
    throws Exception
  {
    return getInternals().fixUtils(paramArrayOfString);
  }
  
  public static List<String> getBusyBoxApplets()
    throws Exception
  {
    return getBusyBoxApplets("");
  }
  
  public static List<String> getBusyBoxApplets(String paramString)
    throws Exception
  {
    return getInternals().getBusyBoxApplets(paramString);
  }
  
  public static String getBusyBoxVersion()
  {
    return getBusyBoxVersion("");
  }
  
  public static String getBusyBoxVersion(String paramString)
  {
    return getInternals().getBusyBoxVersion(paramString);
  }
  
  public static Shell getCustomShell(String paramString)
    throws IOException, TimeoutException, RootDeniedException
  {
    return getCustomShell(paramString, 10000);
  }
  
  public static Shell getCustomShell(String paramString, int paramInt)
    throws IOException, TimeoutException, RootDeniedException
  {
    return RootShell.getCustomShell(paramString, paramInt);
  }
  
  public static Permissions getFilePermissionsSymlinks(String paramString)
  {
    return getInternals().getFilePermissionsSymlinks(paramString);
  }
  
  public static String getInode(String paramString)
  {
    return getInternals().getInode(paramString);
  }
  
  private static final RootToolsInternalMethods getInternals()
  {
    if (rim == null)
    {
      RootToolsInternalMethods.getInstance();
      return rim;
    }
    return rim;
  }
  
  public static String getMountedAs(String paramString)
    throws Exception
  {
    return getInternals().getMountedAs(paramString);
  }
  
  public static ArrayList<Mount> getMounts()
    throws Exception
  {
    return getInternals().getMounts();
  }
  
  public static List<String> getPath()
  {
    return Arrays.asList(System.getenv("PATH").split(":"));
  }
  
  public static Shell getShell(boolean paramBoolean)
    throws IOException, TimeoutException, RootDeniedException
  {
    return getShell(paramBoolean, 0);
  }
  
  public static Shell getShell(boolean paramBoolean, int paramInt)
    throws IOException, TimeoutException, RootDeniedException
  {
    return getShell(paramBoolean, paramInt, Shell.defaultContext, 3);
  }
  
  public static Shell getShell(boolean paramBoolean, int paramInt, Shell.ShellContext paramShellContext)
    throws IOException, TimeoutException, RootDeniedException
  {
    return getShell(paramBoolean, paramInt, paramShellContext, 3);
  }
  
  public static Shell getShell(boolean paramBoolean, int paramInt1, Shell.ShellContext paramShellContext, int paramInt2)
    throws IOException, TimeoutException, RootDeniedException
  {
    return RootShell.getShell(paramBoolean, paramInt1, paramShellContext, paramInt2);
  }
  
  public static Shell getShell(boolean paramBoolean, Shell.ShellContext paramShellContext)
    throws IOException, TimeoutException, RootDeniedException
  {
    return getShell(paramBoolean, 0, paramShellContext, 3);
  }
  
  public static long getSpace(String paramString)
  {
    return getInternals().getSpace(paramString);
  }
  
  public static String getSymlink(String paramString)
  {
    return getInternals().getSymlink(paramString);
  }
  
  public static ArrayList<Symlink> getSymlinks(String paramString)
    throws Exception
  {
    return getInternals().getSymlinks(paramString);
  }
  
  public static String getWorkingToolbox()
  {
    return getInternals().getWorkingToolbox();
  }
  
  public static boolean hasBinary(Context paramContext, String paramString)
  {
    return getInternals().isBinaryAvailable(paramContext, paramString);
  }
  
  public static boolean hasEnoughSpaceOnSdCard(long paramLong)
  {
    return getInternals().hasEnoughSpaceOnSdCard(paramLong);
  }
  
  public static boolean hasUtil(String paramString1, String paramString2)
  {
    return getInternals().hasUtil(paramString1, paramString2);
  }
  
  public static boolean installBinary(Context paramContext, int paramInt, String paramString)
  {
    return installBinary(paramContext, paramInt, paramString, "700");
  }
  
  public static boolean installBinary(Context paramContext, int paramInt, String paramString1, String paramString2)
  {
    return getInternals().installBinary(paramContext, paramInt, paramString1, paramString2);
  }
  
  public static boolean isAccessGiven()
  {
    return RootShell.isAccessGiven();
  }
  
  public static boolean isAppletAvailable(String paramString)
  {
    return isAppletAvailable(paramString, "");
  }
  
  public static boolean isAppletAvailable(String paramString1, String paramString2)
  {
    return getInternals().isAppletAvailable(paramString1, paramString2);
  }
  
  public static boolean isBusyboxAvailable()
  {
    return RootShell.isBusyboxAvailable();
  }
  
  public static boolean isNativeToolsReady(int paramInt, Context paramContext)
  {
    return getInternals().isNativeToolsReady(paramInt, paramContext);
  }
  
  public static boolean isProcessRunning(String paramString)
  {
    return getInternals().isProcessRunning(paramString);
  }
  
  public static boolean isRootAvailable()
  {
    return RootShell.isRootAvailable();
  }
  
  public static boolean islog()
  {
    return debugMode;
  }
  
  public static boolean killProcess(String paramString)
  {
    return getInternals().killProcess(paramString);
  }
  
  public static void log(String paramString)
  {
    log(null, paramString, 3, null);
  }
  
  public static void log(String paramString, int paramInt, Exception paramException)
  {
    log(null, paramString, paramInt, paramException);
  }
  
  public static void log(String paramString1, String paramString2)
  {
    log(paramString1, paramString2, 3, null);
  }
  
  public static void log(String paramString1, String paramString2, int paramInt, Exception paramException)
  {
    String str;
    if ((paramString2 != null) && (!paramString2.equals("")) && (debugMode))
    {
      str = paramString1;
      if (paramString1 == null) {
        str = "RootTools v4.2";
      }
    }
    switch (paramInt)
    {
    default: 
      return;
    case 1: 
      Log.v(str, paramString2);
      return;
    case 2: 
      Log.e(str, paramString2, paramException);
      return;
    }
    Log.d(str, paramString2);
  }
  
  public static Intent offerBusyBox(Activity paramActivity, int paramInt)
  {
    return getInternals().offerBusyBox(paramActivity, paramInt);
  }
  
  public static void offerBusyBox(Activity paramActivity)
  {
    getInternals().offerBusyBox(paramActivity);
  }
  
  public static Intent offerSuperUser(Activity paramActivity, int paramInt)
  {
    return getInternals().offerSuperUser(paramActivity, paramInt);
  }
  
  public static void offerSuperUser(Activity paramActivity)
  {
    getInternals().offerSuperUser(paramActivity);
  }
  
  public static boolean remount(String paramString1, String paramString2)
  {
    return new Remounter().remount(paramString1, paramString2);
  }
  
  public static void restartAndroid()
  {
    log("Restart Android");
    killProcess("zygote");
  }
  
  public static void runBinary(Context paramContext, String paramString1, String paramString2)
  {
    new Runner(paramContext, paramString1, paramString2).start();
  }
  
  public static void runShellCommand(Shell paramShell, Command paramCommand)
    throws IOException
  {
    paramShell.add(paramCommand);
  }
  
  public static void setRim(RootToolsInternalMethods paramRootToolsInternalMethods)
  {
    rim = paramRootToolsInternalMethods;
  }
}


/* Location:              /home/enzo/Documents/hacking/malwares/viking-horde/classes.jar!/com/stericson/RootTools/RootTools.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */