diff --git a/app/src/main/java/com/vanced/manager/core/io/ManagerSuFile.kt b/app/src/main/java/com/vanced/manager/core/io/ManagerSuFile.kt index 7c97db25..9b2d1b48 100644 --- a/app/src/main/java/com/vanced/manager/core/io/ManagerSuFile.kt +++ b/app/src/main/java/com/vanced/manager/core/io/ManagerSuFile.kt @@ -5,11 +5,12 @@ import com.topjohnwu.superuser.io.SuFile import com.vanced.manager.core.util.errString import com.vanced.manager.core.util.outString import java.io.File +import java.io.IOException class ManagerSuFile : SuFile { sealed class SuFileResult { - data class Success(val result: V? = null) : SuFileResult() + data class Success(val output: String) : SuFileResult() data class Error(val error: String) : SuFileResult() } @@ -27,6 +28,12 @@ class ManagerSuFile : SuFile { return SuFileResult.Success(cmd.outString) } - fun deleteResult() = cmd("rm -f @@ || rmdir -f @@") + override fun delete(): Boolean { + val result = cmd("rm -f @@ || rmdir -f @@") + if (result is SuFileResult.Error) + throw SUIOException(result.error) + + return true + } } \ No newline at end of file diff --git a/app/src/main/java/com/vanced/manager/core/io/SUIOException.kt b/app/src/main/java/com/vanced/manager/core/io/SUIOException.kt new file mode 100644 index 00000000..e9af15da --- /dev/null +++ b/app/src/main/java/com/vanced/manager/core/io/SUIOException.kt @@ -0,0 +1,4 @@ +package com.vanced.manager.core.io + +class SUIOException { +} \ No newline at end of file