From 6af69686043a71eda00a6ad5677e7896180a7694 Mon Sep 17 00:00:00 2001 From: Mygod Date: Sun, 20 Jun 2021 14:11:38 -0400 Subject: [PATCH] Refine SettingsGlobalPut --- mobile/src/main/java/be/mygod/vpnhotspot/root/MiscCommands.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/root/MiscCommands.kt b/mobile/src/main/java/be/mygod/vpnhotspot/root/MiscCommands.kt index 34773089..10179637 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/root/MiscCommands.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/root/MiscCommands.kt @@ -213,8 +213,8 @@ data class SettingsGlobalPut(val name: String, val value: String) : RootCommandN override suspend fun execute() = withContext(Dispatchers.IO) { val process = ProcessBuilder("settings", "put", "global", name, value).fixPath(true).start() val error = process.inputStream.bufferedReader().readText() - check(process.waitFor() == 0) - if (error.isNotEmpty()) throw RemoteException(error) + val exit = process.waitFor() + if (exit != 0 || error.isNotEmpty()) throw RemoteException("Process exited with $exit: $error") null } }