mirror of
https://github.com/topjohnwu/libsu.git
synced 2024-11-26 21:40:42 +00:00
Remove ROOT_MOUNT_MASTER status
This commit is contained in:
parent
ec2d4d5cd2
commit
f32602748a
@ -77,15 +77,15 @@ public abstract class Shell implements Closeable {
|
||||
*/
|
||||
public static final int ROOT_SHELL = 1;
|
||||
/**
|
||||
* Shell status: Root shell with mount master enabled.
|
||||
* One possible result of {@link #getStatus()}.
|
||||
* @deprecated Not used anymore.
|
||||
* <p>
|
||||
* Constant value {@value}.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final int ROOT_MOUNT_MASTER = 2;
|
||||
|
||||
@Retention(SOURCE)
|
||||
@IntDef({UNKNOWN, NON_ROOT_SHELL, ROOT_SHELL, ROOT_MOUNT_MASTER})
|
||||
@IntDef({UNKNOWN, NON_ROOT_SHELL, ROOT_SHELL})
|
||||
@interface Status {}
|
||||
|
||||
/**
|
||||
@ -304,8 +304,7 @@ public abstract class Shell implements Closeable {
|
||||
/**
|
||||
* Get the status of the shell.
|
||||
* @return the status of the shell.
|
||||
* Value is either {@link #UNKNOWN}, {@link #NON_ROOT_SHELL}, {@link #ROOT_SHELL}, or
|
||||
* {@link #ROOT_MOUNT_MASTER}
|
||||
* Value is either {@link #UNKNOWN}, {@link #NON_ROOT_SHELL}, or {@link #ROOT_SHELL}
|
||||
*/
|
||||
@Status
|
||||
public abstract int getStatus();
|
||||
|
@ -156,17 +156,6 @@ class ShellImpl extends Shell {
|
||||
STDIN.write(("cd " + cwd + "\n").getBytes(UTF_8));
|
||||
STDIN.flush();
|
||||
}
|
||||
|
||||
if (status == ROOT_SHELL) {
|
||||
STDIN.write(("readlink /proc/self/ns/mnt\n").getBytes(UTF_8));
|
||||
STDIN.flush();
|
||||
s = br.readLine();
|
||||
STDIN.write(("readlink /proc/1/ns/mnt\n").getBytes(UTF_8));
|
||||
STDIN.flush();
|
||||
String s2 = br.readLine();
|
||||
if (!TextUtils.isEmpty(s) && !TextUtils.isEmpty(s2) && TextUtils.equals(s, s2))
|
||||
status = ROOT_MOUNT_MASTER;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user