Catch IOExceptions when doing SU

This commit is contained in:
Mygod
2018-01-13 19:05:59 +08:00
parent f6a5ed9d64
commit d278c5daab
3 changed files with 29 additions and 11 deletions

View File

@@ -194,7 +194,7 @@ class RepeaterService : Service(), WifiP2pManager.ChannelListener, VpnListener.C
handler.removeCallbacks(onVpnUnavailable)
when (status) {
Status.STARTING -> {
val matcher = patternNetworkInfo.matcher(loggerSu("dumpsys ${Context.WIFI_P2P_SERVICE}"))
val matcher = patternNetworkInfo.matcher(loggerSu("dumpsys ${Context.WIFI_P2P_SERVICE}") ?: "")
when {
!matcher.find() -> startFailure("Root unavailable")
matcher.group(2) == "true" -> {