diff --git a/build.gradle b/build.gradle index 88d8b760..e0953a39 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ apply plugin: 'com.github.ben-manes.versions' buildscript { ext { - androidPluginVersion = '3.2.0-rc02' + androidPluginVersion = '3.2.0-rc03' kotlinVersion = '1.2.61' androidxVersion = '1.0.0-rc02' } diff --git a/mobile/build.gradle b/mobile/build.gradle index 791c1f01..c8476eeb 100644 --- a/mobile/build.gradle +++ b/mobile/build.gradle @@ -49,7 +49,7 @@ dependencies { implementation 'com.android.billingclient:billing:1.1' implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5' implementation 'com.github.luongvo:BadgeView:1.1.5' - implementation 'com.github.topjohnwu:libsu:2.0.1' + implementation 'com.github.topjohnwu:libsu:2.0.2' implementation "com.google.android.material:material:$androidxVersion" implementation 'com.linkedin.dexmaker:dexmaker-mockito:2.19.1' implementation 'com.takisoft.preferencex:preferencex:1.0.0-alpha2' @@ -59,5 +59,4 @@ dependencies { androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4' } -kapt.generateStubs = true apply plugin: 'com.google.gms.google-services' diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/util/RootSession.kt b/mobile/src/main/java/be/mygod/vpnhotspot/util/RootSession.kt index 136f1fd0..ec9497d2 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/util/RootSession.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/util/RootSession.kt @@ -56,12 +56,11 @@ class RootSession : AutoCloseable { class UnexpectedOutputException(msg: String) : RuntimeException(msg) private fun checkOutput(command: String, result: Shell.Result, out: Boolean = result.out.isNotEmpty(), - err: Boolean = stderr.isNotEmpty()) { + err: Boolean = result.err.isNotEmpty()) { if (result.isSuccess && !out && !err) return val msg = StringBuilder("$command exited with ${result.code}") if (out) result.out.forEach { msg.append("\n$it") } - // TODO bug: https://github.com/topjohnwu/libsu/pull/23 - if (err) stderr.forEach { msg.append("\nE $it") } + if (err) result.err.forEach { msg.append("\nE $it") } throw UnexpectedOutputException(msg.toString()) } @@ -89,7 +88,7 @@ class RootSession : AutoCloseable { fun submit(command: String) { val result = execQuiet(command) if (result.code != 0) Crashlytics.log(Log.VERBOSE, TAG, "$command exited with ${result.code}") - var msg = stderr.joinToString("\n").trim() + var msg = result.err.joinToString("\n").trim() if (msg.isNotEmpty()) Crashlytics.log(Log.VERBOSE, TAG, msg) msg = result.out.joinToString("\n").trim() if (msg.isNotEmpty()) Crashlytics.log(Log.VERBOSE, TAG, msg)