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 91eb5f23..b69bb4bf 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/root/MiscCommands.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/root/MiscCommands.kt @@ -28,7 +28,7 @@ fun ProcessBuilder.fixPath(redirect: Boolean = false) = apply { } @Parcelize -class Dump(val path: String, val cacheDir: File = app.deviceStorage.codeCacheDir) : RootCommandNoResult { +data class Dump(val path: String, val cacheDir: File = app.deviceStorage.codeCacheDir) : RootCommandNoResult { @Suppress("BlockingMethodInNonBlockingContext") override suspend fun execute() = withContext(Dispatchers.IO) { FileOutputStream(path, true).use { out -> @@ -128,7 +128,8 @@ class ReadArp : RootCommand { @Parcelize @RequiresApi(30) -class StartTethering(private val type: Int, private val showProvisioningUi: Boolean) : RootCommand { +data class StartTethering(private val type: Int, + private val showProvisioningUi: Boolean) : RootCommand { override suspend fun execute(): ParcelableInt? { val future = CompletableDeferred() val callback = object : TetheringManager.StartTetheringCallback { @@ -151,8 +152,8 @@ class StartTethering(private val type: Int, private val showProvisioningUi: Bool @Parcelize @RequiresApi(24) @Suppress("DEPRECATION") -class StartTetheringLegacy(private val cacheDir: File, private val type: Int, - private val showProvisioningUi: Boolean) : RootCommand { +data class StartTetheringLegacy(private val cacheDir: File, private val type: Int, + private val showProvisioningUi: Boolean) : RootCommand { override suspend fun execute(): ParcelableBoolean { val future = CompletableDeferred() val callback = object : TetheringManager.StartTetheringCallback { @@ -172,7 +173,7 @@ class StartTetheringLegacy(private val cacheDir: File, private val type: Int, @Parcelize @RequiresApi(24) -class StopTethering(private val type: Int) : RootCommandNoResult { +data class StopTethering(private val type: Int) : RootCommandNoResult { override suspend fun execute(): Parcelable? { TetheringManager.stopTethering(type) return null @@ -180,7 +181,7 @@ class StopTethering(private val type: Int) : RootCommandNoResult { } @Parcelize -class SettingsGlobalPut(val name: String, val value: String) : RootCommandNoResult { +data class SettingsGlobalPut(val name: String, val value: String) : RootCommandNoResult { companion object { suspend fun int(name: String, value: Int) { try { diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/root/RepeaterCommands.kt b/mobile/src/main/java/be/mygod/vpnhotspot/root/RepeaterCommands.kt index eb0a2dcd..336e3751 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/root/RepeaterCommands.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/root/RepeaterCommands.kt @@ -49,7 +49,7 @@ object RepeaterCommands { } @Parcelize - class SetChannel(private val oc: Int) : RootCommand { + data class SetChannel(private val oc: Int) : RootCommand { override suspend fun execute() = Services.p2p!!.run { setWifiP2pChannels(obtainChannel(), 0, oc)?.let { ParcelableInt(it) } } diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/root/RoutingCommands.kt b/mobile/src/main/java/be/mygod/vpnhotspot/root/RoutingCommands.kt index 868d20dd..40fba0c6 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/root/RoutingCommands.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/root/RoutingCommands.kt @@ -45,7 +45,7 @@ object RoutingCommands { } @Parcelize - class Process(val command: List, private val redirect: Boolean = false) : RootCommand { + data class Process(val command: List, private val redirect: Boolean = false) : RootCommand { @Suppress("BlockingMethodInNonBlockingContext") override suspend fun execute() = withContext(Dispatchers.IO) { val process = ProcessBuilder(command).fixPath(redirect).start()