package com.stericson.RootTools.internal;

import android.content.Context;
import android.util.Log;
import com.stericson.RootShell.execution.Command;
import com.stericson.RootShell.execution.Shell;
import com.stericson.RootTools.RootTools;
import java.io.File;
import java.io.IOException;

public class Runner
  extends Thread
{
  private static final String LOG_TAG = "RootTools::Runner";
  String binaryName;
  Context context;
  String parameter;
  
  public Runner(Context paramContext, String paramString1, String paramString2)
  {
    this.context = paramContext;
    this.binaryName = paramString1;
    this.parameter = paramString2;
  }
  
  private void commandWait(Command paramCommand)
  {
    try
    {
      if (!paramCommand.isFinished()) {
        paramCommand.wait(2000L);
      }
      return;
    }
    catch (InterruptedException localInterruptedException)
    {
      for (;;)
      {
        localInterruptedException.printStackTrace();
      }
    }
    finally {}
  }
  
  public void run()
  {
    Object localObject = null;
    try
    {
      String str = this.context.getFilesDir().getCanonicalPath();
      localObject = str;
    }
    catch (IOException localIOException)
    {
      for (;;)
      {
        try
        {
          localObject = new Command(0, false, new String[] { (String)localObject + "/" + this.binaryName + " " + this.parameter });
          Shell.startRootShell().add((Command)localObject);
          commandWait((Command)localObject);
          return;
        }
        catch (Exception localException) {}
        localIOException = localIOException;
        if (RootTools.debugMode) {
          Log.e("RootTools::Runner", "Problem occured while trying to locate private files directory!");
        }
        localIOException.printStackTrace();
      }
    }
    if (localObject != null) {}
  }
}


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