Skip to content

Commit

Permalink
Release 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Jul 11, 2018
1 parent a55d353 commit 085c0c5
Show file tree
Hide file tree
Showing 37 changed files with 592 additions and 352 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
```

Expand Down
6 changes: 3 additions & 3 deletions docs/allclasses-frame.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Jun 20 04:07:06 CST 2018 -->
<!-- Generated by javadoc (1.8.0_171) on Wed Jul 11 11:42:03 GMT 2018 -->
<title>All Classes (libsu API)</title>
<meta name="date" content="2018-06-20">
<meta name="date" content="2018-07-11">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand Down
6 changes: 3 additions & 3 deletions docs/allclasses-noframe.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Jun 20 04:07:06 CST 2018 -->
<!-- Generated by javadoc (1.8.0_171) on Wed Jul 11 11:42:03 GMT 2018 -->
<title>All Classes (libsu API)</title>
<meta name="date" content="2018-06-20">
<meta name="date" content="2018-07-11">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand Down
6 changes: 3 additions & 3 deletions docs/com/topjohnwu/superuser/BusyBox.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Jun 20 04:07:05 CST 2018 -->
<!-- Generated by javadoc (1.8.0_171) on Wed Jul 11 11:42:03 GMT 2018 -->
<title>BusyBox (libsu API)</title>
<meta name="date" content="2018-06-20">
<meta name="date" content="2018-07-11">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
Expand Down
6 changes: 3 additions & 3 deletions docs/com/topjohnwu/superuser/CallbackList.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Jun 20 04:07:05 CST 2018 -->
<!-- Generated by javadoc (1.8.0_171) on Wed Jul 11 11:42:03 GMT 2018 -->
<title>CallbackList (libsu API)</title>
<meta name="date" content="2018-06-20">
<meta name="date" content="2018-07-11">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
Expand Down
6 changes: 3 additions & 3 deletions docs/com/topjohnwu/superuser/NoShellException.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Jun 20 04:07:05 CST 2018 -->
<!-- Generated by javadoc (1.8.0_171) on Wed Jul 11 11:42:03 GMT 2018 -->
<title>NoShellException (libsu API)</title>
<meta name="date" content="2018-06-20">
<meta name="date" content="2018-07-11">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
Expand Down
6 changes: 3 additions & 3 deletions docs/com/topjohnwu/superuser/Shell.Async.Callback.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Jun 20 04:07:05 CST 2018 -->
<!-- Generated by javadoc (1.8.0_171) on Wed Jul 11 11:42:03 GMT 2018 -->
<title>Shell.Async.Callback (libsu API)</title>
<meta name="date" content="2018-06-20">
<meta name="date" content="2018-07-11">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
Expand Down
14 changes: 7 additions & 7 deletions docs/com/topjohnwu/superuser/Shell.Async.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Jun 20 04:07:05 CST 2018 -->
<!-- Generated by javadoc (1.8.0_171) on Wed Jul 11 11:42:03 GMT 2018 -->
<title>Shell.Async (libsu API)</title>
<meta name="date" content="2018-06-20">
<meta name="date" content="2018-07-11">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
Expand Down Expand Up @@ -163,7 +163,7 @@ <h3>Method Summary</h3>
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/topjohnwu/superuser/Shell.Async.html#loadScript-java.util.List-java.io.InputStream-">loadScript</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;output,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;in)</code>
<div class="block">Equivalent to <code>loadScript(output, REDIRECT_STDERR &#63; output : null, in).</div>
<div class="block">Equivalent to</div>
</td>
</tr>
<tr id="i2" class="altColor">
Expand All @@ -188,7 +188,7 @@ <h3>Method Summary</h3>
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/topjohnwu/superuser/Shell.Async.html#loadScript-com.topjohnwu.superuser.Shell.Async.Callback-java.io.InputStream-">loadScript</a></span>(<a href="../../../com/topjohnwu/superuser/Shell.Async.Callback.html" title="interface in com.topjohnwu.superuser">Shell.Async.Callback</a>&nbsp;callback,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;in)</code>
<div class="block">Equivalent to <code>output = new ArrayList&#60;String&#62;(); loadScript(output, REDIRECT_STDERR &#63; output : null, callback, in).</div>
<div class="block">Equivalent to</div>
</td>
</tr>
<tr id="i5" class="rowColor">
Expand All @@ -213,14 +213,14 @@ <h3>Method Summary</h3>
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/topjohnwu/superuser/Shell.Async.html#sh-java.util.List-java.lang.String...-">sh</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;output,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>...&nbsp;commands)</code>
<div class="block">Equivalent to <code>sh(output, REDIRECT_STDERR &#63; output : null, null, commands).</div>
<div class="block">Equivalent to</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/topjohnwu/superuser/Shell.Async.html#sh-com.topjohnwu.superuser.Shell.Async.Callback-java.lang.String...-">sh</a></span>(<a href="../../../com/topjohnwu/superuser/Shell.Async.Callback.html" title="interface in com.topjohnwu.superuser">Shell.Async.Callback</a>&nbsp;callback,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>...&nbsp;commands)</code>
<div class="block">Equivalent to <code>output = new ArrayList&#60;String&#62;(); sh(output, REDIRECT_STDERR &#63; output : null, callback, commands).</div>
<div class="block">Equivalent to</div>
</td>
</tr>
<tr id="i9" class="rowColor">
Expand Down
6 changes: 3 additions & 3 deletions docs/com/topjohnwu/superuser/Shell.Container.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Jun 20 04:07:05 CST 2018 -->
<!-- Generated by javadoc (1.8.0_171) on Wed Jul 11 11:42:03 GMT 2018 -->
<title>Shell.Container (libsu API)</title>
<meta name="date" content="2018-06-20">
<meta name="date" content="2018-07-11">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
Expand Down
6 changes: 3 additions & 3 deletions docs/com/topjohnwu/superuser/Shell.ContainerApp.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Jun 20 04:07:05 CST 2018 -->
<!-- Generated by javadoc (1.8.0_171) on Wed Jul 11 11:42:03 GMT 2018 -->
<title>Shell.ContainerApp (libsu API)</title>
<meta name="date" content="2018-06-20">
<meta name="date" content="2018-07-11">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
Expand Down
6 changes: 3 additions & 3 deletions docs/com/topjohnwu/superuser/Shell.GetShellCallback.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Jun 20 04:07:05 CST 2018 -->
<!-- Generated by javadoc (1.8.0_171) on Wed Jul 11 11:42:03 GMT 2018 -->
<title>Shell.GetShellCallback (libsu API)</title>
<meta name="date" content="2018-06-20">
<meta name="date" content="2018-07-11">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
Expand Down
22 changes: 15 additions & 7 deletions docs/com/topjohnwu/superuser/Shell.Initializer.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Jun 20 04:07:05 CST 2018 -->
<!-- Generated by javadoc (1.8.0_171) on Wed Jul 11 11:42:03 GMT 2018 -->
<title>Shell.Initializer (libsu API)</title>
<meta name="date" content="2018-06-20">
<meta name="date" content="2018-07-11">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
Expand Down Expand Up @@ -126,10 +126,18 @@ <h2 title="Class Shell.Initializer" class="title">Class Shell.Initializer</h2>
<code>Shell</code> passes the internal root shell test. In short, a non-root shell will only
be initialized with <a href="../../../com/topjohnwu/superuser/Shell.Initializer.html#onShellInit-android.content.Context-com.topjohnwu.superuser.Shell-"><code>onShellInit(Context, Shell)</code></a>, while a root shell will be initialized with
both <a href="../../../com/topjohnwu/superuser/Shell.Initializer.html#onShellInit-android.content.Context-com.topjohnwu.superuser.Shell-"><code>onShellInit(Context, Shell)</code></a> and <a href="../../../com/topjohnwu/superuser/Shell.Initializer.html#onRootShellInit-android.content.Context-com.topjohnwu.superuser.Shell-"><code>onRootShellInit(Context, Shell)</code></a>.
Please directly call the low level APIs on the passed in <code>Shell</code> instance within these
two callbacks. <strong>DO NOT</strong> use methods in <a href="../../../com/topjohnwu/superuser/Shell.Sync.html" title="class in com.topjohnwu.superuser"><code>Shell.Sync</code></a> or
<a href="../../../com/topjohnwu/superuser/Shell.Async.html" title="class in com.topjohnwu.superuser"><code>Shell.Async</code></a>. The global shell is not set yet, calling these high level APIs
will end up in an infinite loop of creating new <code>Shell</code> and calling the initializer.
<p>
Note:
<ul>
<li>Please directly call the low level APIs on the passed in <code>Shell</code> instance within
these two callbacks. <strong>DO NOT</strong> use methods in <a href="../../../com/topjohnwu/superuser/Shell.Sync.html" title="class in com.topjohnwu.superuser"><code>Shell.Sync</code></a> or
<a href="../../../com/topjohnwu/superuser/Shell.Async.html" title="class in com.topjohnwu.superuser"><code>Shell.Async</code></a>. The global shell is not set yet, calling these high level APIs
will end up in an infinite loop of creating new <code>Shell</code> and calling the initializer.</li>
<li>If you want the initializer to run in a BusyBox environment, call
<a href="../../../com/topjohnwu/superuser/BusyBox.html#setup-android.content.Context-"><code>BusyBox.setup(Context)</code></a> or set <a href="../../../com/topjohnwu/superuser/BusyBox.html#BB_PATH"><code>BusyBox.BB_PATH</code></a> before any shell will
be constructed.</li>
</ul>

<p>
An initializer will be constructed and the callbacks will be invoked each time a new
<code>Shell</code> is created. A <code>Context</code> will be passed to the callbacks, use it to
Expand Down
10 changes: 5 additions & 5 deletions docs/com/topjohnwu/superuser/Shell.Sync.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Jun 20 04:07:05 CST 2018 -->
<!-- Generated by javadoc (1.8.0_171) on Wed Jul 11 11:42:03 GMT 2018 -->
<title>Shell.Sync (libsu API)</title>
<meta name="date" content="2018-06-20">
<meta name="date" content="2018-07-11">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
Expand Down Expand Up @@ -143,7 +143,7 @@ <h3>Method Summary</h3>
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/topjohnwu/superuser/Shell.Sync.html#loadScript-java.util.List-java.io.InputStream-">loadScript</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;output,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;in)</code>
<div class="block">Equivalent to <code>loadScript(output, REDIRECT_STDERR &#63; output : null, in).</div>
<div class="block">Equivalent to</div>
</td>
</tr>
<tr id="i2" class="altColor">
Expand All @@ -166,7 +166,7 @@ <h3>Method Summary</h3>
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/topjohnwu/superuser/Shell.Sync.html#sh-java.util.List-java.lang.String...-">sh</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;output,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>...&nbsp;commands)</code>
<div class="block">Equivalent to <code>sh(output, REDIRECT_STDERR &#63; output : null, commands).</div>
<div class="block">Equivalent to</div>
</td>
</tr>
<tr id="i5" class="rowColor">
Expand Down
8 changes: 4 additions & 4 deletions docs/com/topjohnwu/superuser/Shell.Task.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_152-release) on Wed Jun 20 04:07:05 CST 2018 -->
<!-- Generated by javadoc (1.8.0_171) on Wed Jul 11 11:42:03 GMT 2018 -->
<title>Shell.Task (libsu API)</title>
<meta name="date" content="2018-06-20">
<meta name="date" content="2018-07-11">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
Expand Down Expand Up @@ -163,7 +163,7 @@ <h4>run</h4>
<dd><code>stdout</code> - the STDOUT of the shell.</dd>
<dd><code>stderr</code> - the STDERR of the shell.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code> - any exception thrown will cause the shell be shutdown immediately.</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code></dd>
</dl>
</li>
</ul>
Expand Down
Loading

0 comments on commit 085c0c5

Please sign in to comment.