From 085c0c5ba70cbe78d7dee75b9c1bf79fd7b23082 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Wed, 11 Jul 2018 19:47:29 +0800 Subject: [PATCH] Release 1.3.0 --- CHANGELOG.md | 20 + README.md | 2 +- docs/allclasses-frame.html | 6 +- docs/allclasses-noframe.html | 6 +- docs/com/topjohnwu/superuser/BusyBox.html | 6 +- .../com/topjohnwu/superuser/CallbackList.html | 6 +- .../topjohnwu/superuser/NoShellException.html | 6 +- .../superuser/Shell.Async.Callback.html | 6 +- docs/com/topjohnwu/superuser/Shell.Async.html | 14 +- .../topjohnwu/superuser/Shell.Container.html | 6 +- .../superuser/Shell.ContainerApp.html | 6 +- .../superuser/Shell.GetShellCallback.html | 6 +- .../superuser/Shell.Initializer.html | 22 +- docs/com/topjohnwu/superuser/Shell.Sync.html | 10 +- docs/com/topjohnwu/superuser/Shell.Task.html | 8 +- docs/com/topjohnwu/superuser/Shell.html | 206 +++------- docs/com/topjohnwu/superuser/ShellUtils.html | 6 +- docs/com/topjohnwu/superuser/io/SuFile.html | 365 +++++++++++++++--- .../superuser/io/SuFileInputStream.html | 6 +- .../superuser/io/SuFileOutputStream.html | 6 +- .../io/SuProcessFileInputStream.html | 6 +- .../io/SuProcessFileOutputStream.html | 6 +- .../superuser/io/SuRandomAccessFile.html | 36 +- .../topjohnwu/superuser/io/package-frame.html | 6 +- .../superuser/io/package-summary.html | 6 +- .../topjohnwu/superuser/io/package-tree.html | 6 +- .../topjohnwu/superuser/package-frame.html | 6 +- .../topjohnwu/superuser/package-summary.html | 6 +- .../com/topjohnwu/superuser/package-tree.html | 6 +- docs/constant-values.html | 6 +- docs/help-doc.html | 6 +- docs/index-all.html | 90 +++-- docs/index.html | 4 +- docs/overview-frame.html | 6 +- docs/overview-summary.html | 6 +- docs/overview-tree.html | 6 +- docs/serialized-form.html | 17 +- 37 files changed, 592 insertions(+), 352 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd08acdb..ba12e7b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,23 @@ +# 1.3.0 + +### Incompatible API Changes +- `execSyncTask`, `execAsyncTask`, `createCmdTask`, and `createLoadStreamTask` is removed from the non-static APIs of `Shell`. These are implementation details that weren't supposed to be part of the API + + +### Behavior Changes +- `open` of `SuRandomAccessFile` now supports a new parameter, `mode`, just like the constructor of `RandomAccessFile` + - Deprecate: `SuRandomAccessFile.open(File)` + Recommend: `SuRandomAccessFile.open(File, String)` + - Deprecate: `SuRandomAccessFile.open(String)` + Recommend: `SuRandomAccessFile.open(String, String)` +- `onRootShellInit` of `Shell.Initializer` can now run in BusyBox environment if `BusyBox.setup(Context)` is invoked or `BusyBox.BB_PATH` is set before any `Shell` will be constructed +- `SuFile` will become a wrapper around standard `File` if no root is available +- `SuFileInputStream` and `SuFileOutputStream` will throw `FileNotFoundException` when no root is available, and opening with standard `FileInputStream` / `FileOutputStream` throws `FileNotFoundException` +- `Shell` will not be forcibly closed when an `Exception` is thrown in `Shell.Task.run` + +### Improvements +- The `minSdkVersion` of `libsu` is actually 11, changed accordingly + # 1.2.0 ### Incompatible API Changes diff --git a/README.md b/README.md index c7c449b6..8132bcc5 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ repositories { maven { url 'https://jitpack.io' } } dependencies { - implementation 'com.github.topjohnwu:libsu:1.2.0' + implementation 'com.github.topjohnwu:libsu:1.3.0' } ``` diff --git a/docs/allclasses-frame.html b/docs/allclasses-frame.html index 8ee44193..56113afd 100644 --- a/docs/allclasses-frame.html +++ b/docs/allclasses-frame.html @@ -1,10 +1,10 @@ - + - + All Classes (libsu API) - + diff --git a/docs/allclasses-noframe.html b/docs/allclasses-noframe.html index daa5ee8e..f6808433 100644 --- a/docs/allclasses-noframe.html +++ b/docs/allclasses-noframe.html @@ -1,10 +1,10 @@ - + - + All Classes (libsu API) - + diff --git a/docs/com/topjohnwu/superuser/BusyBox.html b/docs/com/topjohnwu/superuser/BusyBox.html index b8a5b4d8..5a90cde9 100644 --- a/docs/com/topjohnwu/superuser/BusyBox.html +++ b/docs/com/topjohnwu/superuser/BusyBox.html @@ -1,10 +1,10 @@ - + - + BusyBox (libsu API) - + diff --git a/docs/com/topjohnwu/superuser/CallbackList.html b/docs/com/topjohnwu/superuser/CallbackList.html index bdf18b64..5ed1db1e 100644 --- a/docs/com/topjohnwu/superuser/CallbackList.html +++ b/docs/com/topjohnwu/superuser/CallbackList.html @@ -1,10 +1,10 @@ - + - + CallbackList (libsu API) - + diff --git a/docs/com/topjohnwu/superuser/NoShellException.html b/docs/com/topjohnwu/superuser/NoShellException.html index dbbcdb64..81350704 100644 --- a/docs/com/topjohnwu/superuser/NoShellException.html +++ b/docs/com/topjohnwu/superuser/NoShellException.html @@ -1,10 +1,10 @@ - + - + NoShellException (libsu API) - + diff --git a/docs/com/topjohnwu/superuser/Shell.Async.Callback.html b/docs/com/topjohnwu/superuser/Shell.Async.Callback.html index b7ce423f..434e4ead 100644 --- a/docs/com/topjohnwu/superuser/Shell.Async.Callback.html +++ b/docs/com/topjohnwu/superuser/Shell.Async.Callback.html @@ -1,10 +1,10 @@ - + - + Shell.Async.Callback (libsu API) - + diff --git a/docs/com/topjohnwu/superuser/Shell.Async.html b/docs/com/topjohnwu/superuser/Shell.Async.html index b8bf9e56..ac6b45e6 100644 --- a/docs/com/topjohnwu/superuser/Shell.Async.html +++ b/docs/com/topjohnwu/superuser/Shell.Async.html @@ -1,10 +1,10 @@ - + - + Shell.Async (libsu API) - + @@ -163,7 +163,7 @@

Method Summary

static void loadScript(List<String> output, InputStream in) -
Equivalent to loadScript(output, REDIRECT_STDERR ? output : null, in).
+
Equivalent to
@@ -188,7 +188,7 @@

Method Summary

static void loadScript(Shell.Async.Callback callback, InputStream in) -
Equivalent to output = new ArrayList<String>(); loadScript(output, REDIRECT_STDERR ? output : null, callback, in).
+
Equivalent to
@@ -213,14 +213,14 @@

Method Summary

static void sh(List<String> output, String... commands) -
Equivalent to sh(output, REDIRECT_STDERR ? output : null, null, commands).
+
Equivalent to
static void sh(Shell.Async.Callback callback, String... commands) -
Equivalent to output = new ArrayList<String>(); sh(output, REDIRECT_STDERR ? output : null, callback, commands).
+
Equivalent to
diff --git a/docs/com/topjohnwu/superuser/Shell.Container.html b/docs/com/topjohnwu/superuser/Shell.Container.html index acb4391b..c5346433 100644 --- a/docs/com/topjohnwu/superuser/Shell.Container.html +++ b/docs/com/topjohnwu/superuser/Shell.Container.html @@ -1,10 +1,10 @@ - + - + Shell.Container (libsu API) - + diff --git a/docs/com/topjohnwu/superuser/Shell.ContainerApp.html b/docs/com/topjohnwu/superuser/Shell.ContainerApp.html index 0779f219..576d1128 100644 --- a/docs/com/topjohnwu/superuser/Shell.ContainerApp.html +++ b/docs/com/topjohnwu/superuser/Shell.ContainerApp.html @@ -1,10 +1,10 @@ - + - + Shell.ContainerApp (libsu API) - + diff --git a/docs/com/topjohnwu/superuser/Shell.GetShellCallback.html b/docs/com/topjohnwu/superuser/Shell.GetShellCallback.html index 3087bfc9..daa3a523 100644 --- a/docs/com/topjohnwu/superuser/Shell.GetShellCallback.html +++ b/docs/com/topjohnwu/superuser/Shell.GetShellCallback.html @@ -1,10 +1,10 @@ - + - + Shell.GetShellCallback (libsu API) - + diff --git a/docs/com/topjohnwu/superuser/Shell.Initializer.html b/docs/com/topjohnwu/superuser/Shell.Initializer.html index 9996fada..87fe6edb 100644 --- a/docs/com/topjohnwu/superuser/Shell.Initializer.html +++ b/docs/com/topjohnwu/superuser/Shell.Initializer.html @@ -1,10 +1,10 @@ - + - + Shell.Initializer (libsu API) - + @@ -126,10 +126,18 @@

Class Shell.Initializer

Shell passes the internal root shell test. In short, a non-root shell will only be initialized with onShellInit(Context, Shell), while a root shell will be initialized with both onShellInit(Context, Shell) and onRootShellInit(Context, Shell). - Please directly call the low level APIs on the passed in Shell instance within these - two callbacks. DO NOT use methods in Shell.Sync or - Shell.Async. The global shell is not set yet, calling these high level APIs - will end up in an infinite loop of creating new Shell and calling the initializer. +

+ Note: +

    +
  • Please directly call the low level APIs on the passed in Shell instance within + these two callbacks. DO NOT use methods in Shell.Sync or + Shell.Async. The global shell is not set yet, calling these high level APIs + will end up in an infinite loop of creating new Shell and calling the initializer.
  • +
  • If you want the initializer to run in a BusyBox environment, call + BusyBox.setup(Context) or set BusyBox.BB_PATH before any shell will + be constructed.
  • +
+

An initializer will be constructed and the callbacks will be invoked each time a new Shell is created. A Context will be passed to the callbacks, use it to diff --git a/docs/com/topjohnwu/superuser/Shell.Sync.html b/docs/com/topjohnwu/superuser/Shell.Sync.html index f82c4897..d01bc955 100644 --- a/docs/com/topjohnwu/superuser/Shell.Sync.html +++ b/docs/com/topjohnwu/superuser/Shell.Sync.html @@ -1,10 +1,10 @@ - + - + Shell.Sync (libsu API) - + @@ -143,7 +143,7 @@

Method Summary

static void loadScript(List<String> output, InputStream in) -
Equivalent to loadScript(output, REDIRECT_STDERR ? output : null, in).
+
Equivalent to
@@ -166,7 +166,7 @@

Method Summary

static void sh(List<String> output, String... commands) -
Equivalent to sh(output, REDIRECT_STDERR ? output : null, commands).
+
Equivalent to
diff --git a/docs/com/topjohnwu/superuser/Shell.Task.html b/docs/com/topjohnwu/superuser/Shell.Task.html index 180a8b22..0577ba2a 100644 --- a/docs/com/topjohnwu/superuser/Shell.Task.html +++ b/docs/com/topjohnwu/superuser/Shell.Task.html @@ -1,10 +1,10 @@ - + - + Shell.Task (libsu API) - + @@ -163,7 +163,7 @@

run

stdout - the STDOUT of the shell.
stderr - the STDERR of the shell.
Throws:
-
Exception - any exception thrown will cause the shell be shutdown immediately.
+
Exception
diff --git a/docs/com/topjohnwu/superuser/Shell.html b/docs/com/topjohnwu/superuser/Shell.html index cb35c6d6..aa711b8a 100644 --- a/docs/com/topjohnwu/superuser/Shell.html +++ b/docs/com/topjohnwu/superuser/Shell.html @@ -1,10 +1,10 @@ - + - + Shell (libsu API) - + @@ -18,7 +18,7 @@ catch(err) { } //--> -var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":9,"i6":9,"i7":9,"i8":10,"i9":6,"i10":10,"i11":10,"i12":9,"i13":9,"i14":9,"i15":10,"i16":10,"i17":9,"i18":9,"i19":9,"i20":9}; +var methods = {"i0":6,"i1":9,"i2":9,"i3":9,"i4":10,"i5":6,"i6":6,"i7":6,"i8":9,"i9":9,"i10":9,"i11":6,"i12":6,"i13":9,"i14":9,"i15":9,"i16":9}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -341,145 +341,116 @@

Method Summary

Method and Description -protected abstract Shell.Task -createCmdTask(String... commands) -
Create a task that executes shell commands.
- - - -protected abstract Shell.Task -createLoadStreamTask(InputStream is) -
Create a task that loads InputStream.
- - - -abstract void -execAsyncTask(List<String> outList, - List<String> errList, - Shell.Async.Callback callback, - Shell.Task task) -
Execute a Task, and collect outputs asynchronously.
- - - -abstract Throwable -execSyncTask(List<String> outList, - List<String> errList, - Shell.Task task) -
Execute a Task, and collect outputs synchronously.
- - - abstract Throwable execTask(Shell.Task task)
Execute a Task with the shell.
- + static int getFlags()
Get special flags that controls how Shell works and how a new Shell will be constructed.
- + static Shell getShell()
Get a Shell instance from the global container.
- + static void getShell(Shell.GetShellCallback callback)
Get a Shell instance from the global container and call a callback.
- + int getStatus()
Get the status of the shell.
- + abstract boolean isAlive()
Return whether the Shell is still alive.
- -Throwable + +abstract Throwable loadInputStream(List<String> outList, List<String> errList, InputStream in)
Synchronously load an inputstream to the shell and stores outputs to the two lists.
- -void + +abstract void loadInputStream(List<String> outList, List<String> errList, Shell.Async.Callback callback, InputStream in)
Asynchronously load an input stream to the shell, stores outputs to the two lists, and call - the callback when the InputStream is loaded and the outputs are done.
+ the callback when the execution is done. - + static Shell newInstance()
Construct a new Shell instance with the default methods.
- + static Shell newInstance(String... commands)
Construct a new Shell instance with provided commands.
- + static boolean rootAccess()
Return whether the global shell has root access.
- -void + +abstract void run(List<String> outList, List<String> errList, Shell.Async.Callback callback, String... commands)
Asynchronously run commands, stores outputs to the two lists, and call the callback when - all commands are ran and the outputs are done.
+ all commands are done. - -Throwable + +abstract Throwable run(List<String> outList, List<String> errList, String... commands)
Synchronously run commands and stores outputs to the two lists.
- + static void setContainer(Shell.Container container)
Set the container to store the global Shell instance.
- + static void setFlags(int flags)
Set special flags that controls how Shell works and how a new Shell will be constructed.
- + static void setInitializer(Class<? extends Shell.Initializer> init)
Set a desired Initializer.
- + static void verboseLogging(boolean verbose)
Set whether enable verbose logging.
@@ -690,79 +661,6 @@

Shell

Method Detail

- - - -
    -
  • -

    createCmdTask

    -
    protected abstract Shell.Task createCmdTask(String... commands)
    -
    Create a task that executes shell commands.
    -
    -
    Parameters:
    -
    commands - the commands to be exectuted.
    -
    Returns:
    -
    the created Task.
    -
    -
  • -
- - - -
    -
  • -

    createLoadStreamTask

    -
    protected abstract Shell.Task createLoadStreamTask(InputStream is)
    -
    Create a task that loads InputStream.
    -
    -
    Parameters:
    -
    is - the InputStream to be loaded.
    -
    Returns:
    -
    the created Task.
    -
    -
  • -
- - - -
    -
  • -

    execAsyncTask

    -
    public abstract void execAsyncTask(List<String> outList,
    -                                   List<String> errList,
    -                                   Shell.Async.Callback callback,
    -                                   Shell.Task task)
    -
    Execute a Task, and collect outputs asynchronously.
    -
    -
    Parameters:
    -
    outList - the list storing STDOUT outputs. null to ignore outputs.
    -
    errList - the list storing STDERR outputs. null to ignore outputs.
    -
    callback - invoked when the task is done.
    -
    task - the target list.
    -
    -
  • -
- - - -
    -
  • -

    execSyncTask

    -
    public abstract Throwable execSyncTask(List<String> outList,
    -                                       List<String> errList,
    -                                       Shell.Task task)
    -
    Execute a Task, and collect outputs synchronously.
    -
    -
    Parameters:
    -
    outList - the list storing STDOUT outputs. null to ignore outputs.
    -
    errList - the list storing STDERR outputs. null to ignore outputs.
    -
    task - the target list.
    -
    Returns:
    -
    the Throwable thrown in run(List, List, String...), - null if nothing is thrown.
    -
    -
  • -
@@ -840,7 +738,7 @@

getStatus

Returns:
the status of the shell. - Value is either UNKNOWN, NON_ROOT_SHELL, ROOT_SHELL, + Value is either UNKNOWN, NON_ROOT_SHELL, ROOT_SHELL, or ROOT_MOUNT_MASTER
@@ -865,16 +763,14 @@

isAlive

  • loadInputStream

    -
    public Throwable loadInputStream(List<String> outList,
    -                                 List<String> errList,
    -                                 InputStream in)
    +
    public abstract Throwable loadInputStream(List<String> outList,
    +                                          List<String> errList,
    +                                          InputStream in)
    Synchronously load an inputstream to the shell and stores outputs to the two lists.

    This command is useful for loading a script stored in the APK. An InputStream can be opened from assets with AssetManager.open(String) or from raw resources - with Resources.openRawResource(int). -

    - Simply performs execSyncTask(outList, errList, createLoadStreamTask(in))

    + with Resources.openRawResource(int).
    Parameters:
    outList - the list storing STDOUT outputs. null to ignore outputs.
    @@ -891,23 +787,21 @@

    loadInputStream

    • loadInputStream

      -
      public void loadInputStream(List<String> outList,
      -                            List<String> errList,
      -                            Shell.Async.Callback callback,
      -                            InputStream in)
      +
      public abstract void loadInputStream(List<String> outList,
      +                                     List<String> errList,
      +                                     Shell.Async.Callback callback,
      +                                     InputStream in)
      Asynchronously load an input stream to the shell, stores outputs to the two lists, and call - the callback when the InputStream is loaded and the outputs are done. + the callback when the execution is done.

      This command is useful for loading a script stored in the APK. An InputStream can be opened from assets with AssetManager.open(String) or from raw resources - with Resources.openRawResource(int). -

      - Simply performs execAsyncTask(outList, errList, callback, createLoadStreamTask(in))

      + with Resources.openRawResource(int).
      Parameters:
      outList - the list storing STDOUT outputs. null to ignore outputs.
      errList - the list storing STDERR outputs. null to ignore outputs.
      -
      callback - the callback when the InputStream is loaded and the outputs are done.
      +
      callback - the callback when the execution is done.
      in - the InputStream to load
    • @@ -983,19 +877,17 @@

      rootAccess

      • run

        -
        public void run(List<String> outList,
        -                List<String> errList,
        -                Shell.Async.Callback callback,
        -                String... commands)
        +
        public abstract void run(List<String> outList,
        +                         List<String> errList,
        +                         Shell.Async.Callback callback,
        +                         String... commands)
        Asynchronously run commands, stores outputs to the two lists, and call the callback when - all commands are ran and the outputs are done. -

        - Simply performs execAsyncTask(outList, errList, callback, createCmdTask(commands))

        + all commands are done.
        Parameters:
        outList - the list storing STDOUT outputs. null to ignore outputs.
        errList - the list storing STDERR outputs. null to ignore outputs.
        -
        callback - the callback when all commands are ran and the outputs are done.
        +
        callback - the callback when all commands are done.
        commands - the commands to run in the shell.
      • @@ -1006,12 +898,10 @@

        run

        • run

          -
          public Throwable run(List<String> outList,
          -                     List<String> errList,
          -                     String... commands)
          -
          Synchronously run commands and stores outputs to the two lists. -

          - Simply performs execSyncTask(outList, errList, createCmdTask(commands))

          +
          public abstract Throwable run(List<String> outList,
          +                              List<String> errList,
          +                              String... commands)
          +
          Synchronously run commands and stores outputs to the two lists.
          Parameters:
          outList - the list storing STDOUT outputs. null to ignore outputs.
          diff --git a/docs/com/topjohnwu/superuser/ShellUtils.html b/docs/com/topjohnwu/superuser/ShellUtils.html index ebb3eeec..38453b09 100644 --- a/docs/com/topjohnwu/superuser/ShellUtils.html +++ b/docs/com/topjohnwu/superuser/ShellUtils.html @@ -1,10 +1,10 @@ - + - + ShellUtils (libsu API) - + diff --git a/docs/com/topjohnwu/superuser/io/SuFile.html b/docs/com/topjohnwu/superuser/io/SuFile.html index 856f12a5..ba10d005 100644 --- a/docs/com/topjohnwu/superuser/io/SuFile.html +++ b/docs/com/topjohnwu/superuser/io/SuFile.html @@ -1,10 +1,10 @@ - + - + SuFile (libsu API) - + @@ -18,8 +18,8 @@ catch(err) { } //--> -var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10}; -var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; +var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":10,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10,"i46":42}; +var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; @@ -120,11 +120,12 @@

          Class SuFile

          extends File
          A File implementation with root access.

          - This class is meant to be used just like a normal File, so developers can access files - via root shells without messing with command-lines. + Without root access in the global shell, this class is simply just a wrapper around File. + However, when root is available, all methods will be backed by commands executing via the + global root shell.

          This class has the exact same behavior as a normal File, however non of the operations - are atomic. This is a limitation of using shells, be aware of it. + are atomic if backed with shell commands. This is a limitation of using shells, be aware of it.

          The Shell instance will be acquired via Shell.getShell(). The methods of this class require: rm, rmdir, readlink, mv, @@ -200,7 +201,7 @@

          Constructor Summary

          Method Summary

          - + @@ -218,135 +219,197 @@

          Method Summary

          + + + + - + - + - + - + - + - + - + + + + + - + - + - + + + + + + + + + - + + + + + - + - + + + + + + + + + - + - + + + + + - + - + - + - + - + - + - + - + - + - + + + + + - + - + + + + + - + - + + + + + + + + + + + + + + + + + + + + +
          All Methods Instance Methods Concrete Methods All Methods Instance Methods Concrete Methods Deprecated Methods 
          Modifier and Type Method and Description canWrite() 
          intcompareTo(File pathname) 
          boolean createNewFile() 
          boolean delete() 
          void deleteOnExit() 
          booleandeleteRecursive() equals(Object obj) 
          boolean exists() 
          SuFile getAbsoluteFile() 
          StringgetAbsolutePath() 
          SuFile getCanonicalFile() 
          String getCanonicalPath() 
          long getFreeSpace() 
          StringgetName() 
          StringgetParent() 
          SuFile getParentFile() 
          StringgetPath() 
          long getTotalSpace() 
          long getUsableSpace() 
          inthashCode() 
          booleanisAbsolute() 
          boolean isDirectory() 
          boolean isFile() 
          booleanisHidden() 
          long lastModified() 
          long length()
          Returns the length of the file denoted by this abstract pathname.
          String[] list() 
          String[] list(FilenameFilter filter) 
          SuFile[] listFiles() 
          SuFile[] listFiles(FileFilter filter) 
          SuFile[] listFiles(FilenameFilter filter) 
          boolean mkdir() 
          boolean mkdirs() 
          boolean renameTo(File dest) 
          booleansetExecutable(boolean executable) 
          boolean setExecutable(boolean executable, boolean ownerOnly) 
          boolean setLastModified(long time)
          Sets the last-modified time of the file or directory named by this abstract pathname.
          booleansetReadable(boolean readable) 
          boolean setReadable(boolean readable, boolean ownerOnly) 
          boolean setReadOnly() 
          booleansetWritable(boolean writable) 
          boolean setWritable(boolean writable, boolean ownerOnly) 
          PathtoPath() 
          StringtoString() 
          URItoURI() 
          URLtoURL() +
          Deprecated. 
          +
        + + + + @@ -507,13 +585,17 @@

        deleteOnExit

- +
  • -

    deleteRecursive

    -
    public boolean deleteRecursive()
    +

    equals

    +
    public boolean equals(Object obj)
    +
    +
    Overrides:
    +
    equals in class File
    +
@@ -542,16 +624,32 @@

getAbsoluteFile

+
+ + + @@ -561,10 +659,13 @@

getCanonicalFile

@@ -581,6 +682,32 @@

getFreeSpace

+ + + + + + + + @@ -594,6 +721,19 @@

getParentFile

+ + + + @@ -620,6 +760,32 @@

getUsableSpace

+ + + +
    +
  • +

    hashCode

    +
    public int hashCode()
    +
    +
    Overrides:
    +
    hashCode in class File
    +
    +
  • +
+ + + +
    +
  • +

    isAbsolute

    +
    public boolean isAbsolute()
    +
    +
    Overrides:
    +
    isAbsolute in class File
    +
    +
  • +
@@ -646,6 +812,19 @@

isFile

+ + + +
    +
  • +

    isHidden

    +
    public boolean isHidden()
    +
    +
    Overrides:
    +
    isHidden in class File
    +
    +
  • +
@@ -784,6 +963,19 @@

renameTo

+ + + +
    +
  • +

    setExecutable

    +
    public boolean setExecutable(boolean executable)
    +
    +
    Overrides:
    +
    setExecutable in class File
    +
    +
  • +
@@ -821,6 +1013,19 @@

setLastModified

+ + + +
    +
  • +

    setReadable

    +
    public boolean setReadable(boolean readable)
    +
    +
    Overrides:
    +
    setReadable in class File
    +
    +
  • +
@@ -848,10 +1053,23 @@

setReadOnly

+ + + +
    +
  • +

    setWritable

    +
    public boolean setWritable(boolean writable)
    +
    +
    Overrides:
    +
    setWritable in class File
    +
    +
  • +
- diff --git a/docs/com/topjohnwu/superuser/io/SuFileInputStream.html b/docs/com/topjohnwu/superuser/io/SuFileInputStream.html index 96f96b28..9fbb12b8 100644 --- a/docs/com/topjohnwu/superuser/io/SuFileInputStream.html +++ b/docs/com/topjohnwu/superuser/io/SuFileInputStream.html @@ -1,10 +1,10 @@ - + - + SuFileInputStream (libsu API) - + diff --git a/docs/com/topjohnwu/superuser/io/SuFileOutputStream.html b/docs/com/topjohnwu/superuser/io/SuFileOutputStream.html index 2df535ae..d6f449dd 100644 --- a/docs/com/topjohnwu/superuser/io/SuFileOutputStream.html +++ b/docs/com/topjohnwu/superuser/io/SuFileOutputStream.html @@ -1,10 +1,10 @@ - + - + SuFileOutputStream (libsu API) - + diff --git a/docs/com/topjohnwu/superuser/io/SuProcessFileInputStream.html b/docs/com/topjohnwu/superuser/io/SuProcessFileInputStream.html index fbf39620..ceea6e18 100644 --- a/docs/com/topjohnwu/superuser/io/SuProcessFileInputStream.html +++ b/docs/com/topjohnwu/superuser/io/SuProcessFileInputStream.html @@ -1,10 +1,10 @@ - + - + SuProcessFileInputStream (libsu API) - + diff --git a/docs/com/topjohnwu/superuser/io/SuProcessFileOutputStream.html b/docs/com/topjohnwu/superuser/io/SuProcessFileOutputStream.html index 760435b5..e2d20467 100644 --- a/docs/com/topjohnwu/superuser/io/SuProcessFileOutputStream.html +++ b/docs/com/topjohnwu/superuser/io/SuProcessFileOutputStream.html @@ -1,10 +1,10 @@ - + - + SuProcessFileOutputStream (libsu API) - + diff --git a/docs/com/topjohnwu/superuser/io/SuRandomAccessFile.html b/docs/com/topjohnwu/superuser/io/SuRandomAccessFile.html index 2cf3b899..ea62be8b 100644 --- a/docs/com/topjohnwu/superuser/io/SuRandomAccessFile.html +++ b/docs/com/topjohnwu/superuser/io/SuRandomAccessFile.html @@ -1,10 +1,10 @@ - + - + SuRandomAccessFile (libsu API) - + @@ -117,17 +117,17 @@

Class SuRandomAccessFile

Access files using the global shell instance and mimics RandomAccessFile.

This class always checks whether using a shell is necessary. If not, it simply opens a new - RandomAccessFile with mode "rw" and behaves as a wrapper. + RandomAccessFile and behaves as a wrapper.

File random access via shell is extremely limited, each I/O operation comes with a relatively large overhead. For optimal performance, please consider using SuFileInputStream and SuFileOutputStream, since these classes are specifically optimized for I/O using shell commands.

- Note: All write/writeXXX commands require busybox to work properly, as currently + Note: All write/writeXXX commands require BusyBox to work properly, as currently no existing Android version ships with a command dd that supports notrunc option. If you need root file output but unwilling to use busybox, please use - SuFileOutputStream as it uses a special workaround that does not require busybox.

+ SuFileOutputStream as it uses a special workaround that does not require BusyBox.
See Also:
RandomAccessFile
@@ -181,11 +181,13 @@

Method Summary

static SuRandomAccessFile -open(File file)  +open(File file, + String mode)  static SuRandomAccessFile -open(String path)  +open(String path, + String mode)  int @@ -319,27 +321,37 @@

length

- + - +