mirror of
https://github.com/fankes/ColorOSNotifyIcon.git
synced 2025-09-05 18:25:28 +08:00
fix: catch toast when no looper
This commit is contained in:
@@ -62,6 +62,7 @@ import com.highcapable.yukihookapi.hook.factory.field
|
|||||||
import com.highcapable.yukihookapi.hook.factory.hasClass
|
import com.highcapable.yukihookapi.hook.factory.hasClass
|
||||||
import com.highcapable.yukihookapi.hook.factory.method
|
import com.highcapable.yukihookapi.hook.factory.method
|
||||||
import com.highcapable.yukihookapi.hook.factory.toClassOrNull
|
import com.highcapable.yukihookapi.hook.factory.toClassOrNull
|
||||||
|
import com.highcapable.yukihookapi.hook.log.YLog
|
||||||
import com.highcapable.yukihookapi.hook.type.java.StringClass
|
import com.highcapable.yukihookapi.hook.type.java.StringClass
|
||||||
import com.highcapable.yukihookapi.hook.xposed.application.ModuleApplication.Companion.appContext
|
import com.highcapable.yukihookapi.hook.xposed.application.ModuleApplication.Companion.appContext
|
||||||
import com.topjohnwu.superuser.Shell
|
import com.topjohnwu.superuser.Shell
|
||||||
@@ -445,7 +446,11 @@ fun execShell(cmd: String, isSu: Boolean = true) = safeOfNothing {
|
|||||||
* 弹出 [Toast]
|
* 弹出 [Toast]
|
||||||
* @param msg 提示内容
|
* @param msg 提示内容
|
||||||
*/
|
*/
|
||||||
fun toast(msg: String) = Toast.makeText(appContext, msg, Toast.LENGTH_SHORT).show()
|
fun toast(msg: String) {
|
||||||
|
runCatching {
|
||||||
|
Toast.makeText(appContext, msg, Toast.LENGTH_SHORT).show()
|
||||||
|
}.onFailure { YLog.warn(msg) }
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 跳转到指定页面
|
* 跳转到指定页面
|
||||||
|
Reference in New Issue
Block a user