diff options
author | Samuel Holland <samuel@sholland.org> | 2018-01-09 06:23:34 -0600 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2018-01-09 08:13:11 -0600 |
commit | 52e8eef9ce217efd02104e4158c02fdb92383b1c (patch) | |
tree | 59260039fce415f7e004b903bf40681f323fd9c6 /app/src/main/java/com/wireguard/android/util/ToolsInstaller.java | |
parent | TunnelListFragment: Remove useless keyword (diff) | |
download | wireguard-android-52e8eef9ce217efd02104e4158c02fdb92383b1c.tar.xz wireguard-android-52e8eef9ce217efd02104e4158c02fdb92383b1c.zip |
RootShell: Simplify, synchronize, clean up
Signed-off-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to '')
-rw-r--r-- | app/src/main/java/com/wireguard/android/util/ToolsInstaller.java | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/app/src/main/java/com/wireguard/android/util/ToolsInstaller.java b/app/src/main/java/com/wireguard/android/util/ToolsInstaller.java index b2f6e22a..51c2bbbc 100644 --- a/app/src/main/java/com/wireguard/android/util/ToolsInstaller.java +++ b/app/src/main/java/com/wireguard/android/util/ToolsInstaller.java @@ -1,7 +1,6 @@ package com.wireguard.android.util; import android.content.Context; -import android.system.ErrnoException; import android.system.OsConstants; import android.util.Log; @@ -69,7 +68,7 @@ public final class ToolsInstaller { script.append("exit ").append(OsConstants.EALREADY).append(';'); try { return rootShell.run(null, script.toString()) == OsConstants.EALREADY; - } catch (final ErrnoException | IOException | NoRootException ignored) { + } catch (final IOException | NoRootException ignored) { return false; } } @@ -84,7 +83,7 @@ public final class ToolsInstaller { script.append("exit ").append(OsConstants.EALREADY).append(';'); try { return rootShell.run(null, script.toString()) == OsConstants.EALREADY; - } catch (final ErrnoException | IOException | NoRootException ignored) { + } catch (final IOException | NoRootException ignored) { return false; } } @@ -125,8 +124,6 @@ public final class ToolsInstaller { } try { return rootShell.run(null, script.toString()); - } catch (final ErrnoException e) { - return e.errno; } catch (final IOException ignored) { return OsConstants.EXIT_FAILURE; } catch (final NoRootException ignored) { @@ -143,8 +140,6 @@ public final class ToolsInstaller { } try { return rootShell.run(null, script.toString()); - } catch (final ErrnoException e) { - return e.errno; } catch (final IOException ignored) { return OsConstants.EXIT_FAILURE; } catch (final NoRootException ignored) { |