Compare commits

..

1 Commits

Author SHA1 Message Date
Jobobby04 3de4711e03 Try this Shizuku fix 2024-10-27 13:34:33 -04:00
2 changed files with 8 additions and 3 deletions
@@ -14,10 +14,12 @@ import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import logcat.LogPriority
import rikka.shizuku.Shizuku
import rikka.shizuku.ShizukuRemoteProcess
import tachiyomi.core.common.util.system.logcat
import tachiyomi.i18n.MR
import java.io.BufferedReader
import java.io.InputStream
import java.lang.reflect.Method
class ShizukuInstaller(private val service: Service) : Installer(service) {
@@ -93,9 +95,9 @@ class ShizukuInstaller(private val service: Service) : Installer(service) {
super.onDestroy()
}
private val newProcess: Method
private fun exec(command: String, stdin: InputStream? = null): ShellResult {
@Suppress("DEPRECATION")
val process = Shizuku.newProcess(arrayOf("sh", "-c", command), null, null)
val process = newProcess.invoke(null, arrayOf("sh", "-c", command), null, null) as ShizukuRemoteProcess
if (stdin != null) {
process.outputStream.use { stdin.copyTo(it) }
}
@@ -122,6 +124,9 @@ class ShizukuInstaller(private val service: Service) : Installer(service) {
service.stopSelf()
false
}
newProcess = Shizuku::class.java
.getDeclaredMethod("newProcess", Array::class.java, Array::class.java, String::class.java)
newProcess.isAccessible = true
}
}
+1 -1
View File
@@ -4,7 +4,7 @@ leakcanary = "2.14"
moko = "0.24.2"
okhttp_version = "5.0.0-alpha.14"
richtext = "0.20.0"
shizuku_version = "13.1.0"
shizuku_version = "13.1.5"
sqldelight = "2.0.2"
sqlite = "2.4.0"
voyager = "1.0.0"