com.stericson.RootTools.execution
Class Shell

java.lang.Object
  extended by com.stericson.RootTools.execution.Shell

public class Shell
extends java.lang.Object


Nested Class Summary
protected static class Shell.Worker
           
 
Field Summary
static boolean isExecuting
           
static boolean isReading
           
 
Method Summary
 Command add(Command command)
           
 void close()
           
static void closeAll()
           
static void closeCustomShell()
           
static void closeRootShell()
           
static void closeShell()
           
 int getCommandQueuePosition(Command cmd)
           
 java.lang.String getCommandQueuePositionString(Command cmd)
           
static Shell getOpenShell()
           
static boolean isAnyShellOpen()
           
static boolean isCustomShellOpen()
           
static boolean isRootShellOpen()
           
static boolean isShellOpen()
           
protected  void notifyThreads()
           
static void runCommand(Command command)
           
static void runRootCommand(Command command)
           
static Shell startCustomShell(java.lang.String shellPath)
           
static Shell startCustomShell(java.lang.String shellPath, int timeout)
           
static Shell startRootShell()
           
static Shell startRootShell(int timeout)
           
static Shell startRootShell(int timeout, int retry)
           
static Shell startShell()
           
static Shell startShell(int timeout)
           
 void useCWD(android.content.Context context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isExecuting

public static boolean isExecuting

isReading

public static boolean isReading
Method Detail

add

public Command add(Command command)
            throws java.io.IOException
Throws:
java.io.IOException

useCWD

public void useCWD(android.content.Context context)
            throws java.io.IOException,
                   java.util.concurrent.TimeoutException,
                   RootDeniedException
Throws:
java.io.IOException
java.util.concurrent.TimeoutException
RootDeniedException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

closeCustomShell

public static void closeCustomShell()
                             throws java.io.IOException
Throws:
java.io.IOException

closeRootShell

public static void closeRootShell()
                           throws java.io.IOException
Throws:
java.io.IOException

closeShell

public static void closeShell()
                       throws java.io.IOException
Throws:
java.io.IOException

closeAll

public static void closeAll()
                     throws java.io.IOException
Throws:
java.io.IOException

getCommandQueuePosition

public int getCommandQueuePosition(Command cmd)

getCommandQueuePositionString

public java.lang.String getCommandQueuePositionString(Command cmd)

getOpenShell

public static Shell getOpenShell()

isShellOpen

public static boolean isShellOpen()

isCustomShellOpen

public static boolean isCustomShellOpen()

isRootShellOpen

public static boolean isRootShellOpen()

isAnyShellOpen

public static boolean isAnyShellOpen()

notifyThreads

protected void notifyThreads()

runRootCommand

public static void runRootCommand(Command command)
                           throws java.io.IOException,
                                  java.util.concurrent.TimeoutException,
                                  RootDeniedException
Throws:
java.io.IOException
java.util.concurrent.TimeoutException
RootDeniedException

runCommand

public static void runCommand(Command command)
                       throws java.io.IOException,
                              java.util.concurrent.TimeoutException
Throws:
java.io.IOException
java.util.concurrent.TimeoutException

startRootShell

public static Shell startRootShell()
                            throws java.io.IOException,
                                   java.util.concurrent.TimeoutException,
                                   RootDeniedException
Throws:
java.io.IOException
java.util.concurrent.TimeoutException
RootDeniedException

startRootShell

public static Shell startRootShell(int timeout)
                            throws java.io.IOException,
                                   java.util.concurrent.TimeoutException,
                                   RootDeniedException
Throws:
java.io.IOException
java.util.concurrent.TimeoutException
RootDeniedException

startRootShell

public static Shell startRootShell(int timeout,
                                   int retry)
                            throws java.io.IOException,
                                   java.util.concurrent.TimeoutException,
                                   RootDeniedException
Throws:
java.io.IOException
java.util.concurrent.TimeoutException
RootDeniedException

startCustomShell

public static Shell startCustomShell(java.lang.String shellPath)
                              throws java.io.IOException,
                                     java.util.concurrent.TimeoutException,
                                     RootDeniedException
Throws:
java.io.IOException
java.util.concurrent.TimeoutException
RootDeniedException

startCustomShell

public static Shell startCustomShell(java.lang.String shellPath,
                                     int timeout)
                              throws java.io.IOException,
                                     java.util.concurrent.TimeoutException,
                                     RootDeniedException
Throws:
java.io.IOException
java.util.concurrent.TimeoutException
RootDeniedException

startShell

public static Shell startShell()
                        throws java.io.IOException,
                               java.util.concurrent.TimeoutException
Throws:
java.io.IOException
java.util.concurrent.TimeoutException

startShell

public static Shell startShell(int timeout)
                        throws java.io.IOException,
                               java.util.concurrent.TimeoutException
Throws:
java.io.IOException
java.util.concurrent.TimeoutException