From a933360b6a3928c130539deb6aa2f8f43b02fe21 Mon Sep 17 00:00:00 2001 From: lisonge Date: Tue, 7 Nov 2023 12:15:23 +0800 Subject: [PATCH] fix(shizuku): binder haven't been received --- .../main/java/li/songe/gkd/shizuku/ShizukuApi.kt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/li/songe/gkd/shizuku/ShizukuApi.kt b/app/src/main/java/li/songe/gkd/shizuku/ShizukuApi.kt index 8545556c2..7425825bc 100644 --- a/app/src/main/java/li/songe/gkd/shizuku/ShizukuApi.kt +++ b/app/src/main/java/li/songe/gkd/shizuku/ShizukuApi.kt @@ -62,11 +62,17 @@ fun IActivityTaskManager.safeGetTasks(): List? } } } - return when (getTasksFcType) { - 1 -> this.getTasks(1) - 3 -> this.getTasks(1, false, true) - 4 -> this.getTasks(1, false, true, Display.DEFAULT_DISPLAY) - else -> null + return try { + // https://bugly.qq.com/v2/crash-reporting/crashes/d0ce46b353/106137?pid=1 + // binder haven't been received + when (getTasksFcType) { + 1 -> this.getTasks(1) + 3 -> this.getTasks(1, false, true) + 4 -> this.getTasks(1, false, true, Display.DEFAULT_DISPLAY) + else -> null + } + } catch (e: Exception) { + null } }