From df036658167e88030752130b6d27778ebc6d0778 Mon Sep 17 00:00:00 2001 From: Mygod Date: Sat, 28 Jul 2018 20:12:04 +0800 Subject: [PATCH] Refinements --- README.md | 4 ++++ mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt | 2 +- mobile/src/main/java/be/mygod/vpnhotspot/util/NoisySu.kt | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d2d53c12..7e7d21de 100644 --- a/README.md +++ b/README.md @@ -56,3 +56,7 @@ Without root, you can only: tethering/bypassing tethering limits: (note: these apps are neither free nor open source) * [PdaNet+](https://play.google.com/store/apps/details?id=com.pdanet) * [NetShare-no-root-tethering](https://play.google.com/store/apps/details?id=kha.prog.mikrotik) + +### Misc + +This app doesn't require Busybox, but if you have installed it, please make sure it's v1.28.1 or higher. diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt b/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt index c393965e..ce3fa9b6 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt @@ -134,7 +134,7 @@ class RepeaterService : Service(), WifiP2pManager.ChannelListener, SharedPrefere p2pManager = getSystemService()!! onChannelDisconnected() app.pref.registerOnSharedPreferenceChangeListener(this) - } catch (exc: KotlinNullPointerException) { + } catch (exc: RuntimeException) { exc.printStackTrace() Crashlytics.logException(exc) } diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/util/NoisySu.kt b/mobile/src/main/java/be/mygod/vpnhotspot/util/NoisySu.kt index ac56eb80..cb5ed785 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/util/NoisySu.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/util/NoisySu.kt @@ -9,7 +9,7 @@ import java.io.InputStream private const val NOISYSU_TAG = "NoisySU" private const val NOISYSU_SUFFIX = "SUCCESS\n" -private class SuFailure : RuntimeException() +private class SuFailure(msg: String?) : RuntimeException(msg) fun loggerSuStream(command: String): InputStream? { val process = try { @@ -44,7 +44,7 @@ echo $NOISYSU_SUFFIX""") out = out?.removeSuffix(NOISYSU_SUFFIX) if (!out.isNullOrBlank()) { Crashlytics.log(Log.INFO, NOISYSU_TAG, out) - if (report) Crashlytics.logException(SuFailure()) + if (report) Crashlytics.logException(SuFailure(out)) } return result }