Skip to content

Commit

Permalink
fix: catch unbindUserService error
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Dec 20, 2024
1 parent 7ed881a commit 277a3ab
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/src/main/kotlin/li/songe/gkd/shizuku/ShizukuApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,14 @@ fun safeGetTopActivity(): TopActivity? {
private fun unbindUserService(serviceArgs: Shizuku.UserServiceArgs, connection: ServiceConnection) {
LogUtils.d("unbindUserService", serviceArgs)
// https://github.com/RikkaApps/Shizuku-API/blob/master/server-shared/src/main/java/rikka/shizuku/server/UserServiceManager.java#L62
Shizuku.unbindUserService(serviceArgs, connection, false)
Shizuku.unbindUserService(serviceArgs, connection, true)
try {
Shizuku.unbindUserService(serviceArgs, connection, false)
Shizuku.unbindUserService(serviceArgs, connection, true)
} catch (e: Exception) {
// binder haven't been received
e.printStackTrace()
LogUtils.d(e)
}
}

data class UserServiceWrapper(
Expand Down

0 comments on commit 277a3ab

Please sign in to comment.