mirror of
https://github.com/awfixers-stuff/OwnDroid.git
synced 2026-03-23 19:15:58 +00:00
Transfer ownership warning dialog
Update READMEs Display restriction id under UserRestrictionItem Optimize some Shizuku-related features Delay setting default affiliation id to wait Dhizuku initialize, fix #85
This commit is contained in:
@@ -13,32 +13,32 @@ val shizukuService = MutableStateFlow<IUserService?>(null)
|
||||
class ShizukuService: IUserService.Stub() {
|
||||
override fun destroy() { }
|
||||
|
||||
override fun execute(command: String?): String {
|
||||
override fun execute(command: String): String {
|
||||
var result = ""
|
||||
val process: Process
|
||||
try {
|
||||
process = Runtime.getRuntime().exec(command)
|
||||
val exitCode = process.waitFor()
|
||||
if(exitCode!=0){ result+="Error: $exitCode" }
|
||||
} catch(e:Exception) {
|
||||
if(exitCode != 0){ result += "Error: $exitCode" }
|
||||
} catch(e: Exception) {
|
||||
e.printStackTrace()
|
||||
return e.toString()
|
||||
}
|
||||
try {
|
||||
val outputReader = BufferedReader(InputStreamReader(process.inputStream))
|
||||
var outputLine: String
|
||||
while(outputReader.readLine().also {outputLine = it}!=null) { result+="$outputLine\n" }
|
||||
while(outputReader.readLine().also {outputLine = it} != null) { result += "$outputLine\n" }
|
||||
val errorReader = BufferedReader(InputStreamReader(process.errorStream))
|
||||
var errorLine: String
|
||||
while(errorReader.readLine().also {errorLine = it}!=null) { result+="$errorLine\n" }
|
||||
while(errorReader.readLine().also {errorLine = it} != null) { result += "$errorLine\n" }
|
||||
} catch(e: NullPointerException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
if(result=="") { return "No result" }
|
||||
if(result == "") { return "No result" }
|
||||
return result
|
||||
}
|
||||
|
||||
override fun getUid(): String {
|
||||
return Os.getuid().toString()
|
||||
override fun getUid(): Int {
|
||||
return Os.getuid()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user