mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-06 02:35:40 +08:00
Fix YukiHookDataChannel in lower Android 12 has a launcher Activity in front bug and not got current Activity
This commit is contained in:
@@ -135,9 +135,9 @@ class YukiHookDataChannel private constructor() {
|
|||||||
* @return [Boolean]
|
* @return [Boolean]
|
||||||
*/
|
*/
|
||||||
private fun isCurrentBroadcast(context: Context?) = runCatching {
|
private fun isCurrentBroadcast(context: Context?) = runCatching {
|
||||||
isXposedEnvironment || context?.javaClass?.name == ((context ?: receiverContext)
|
isXposedEnvironment || (((context ?: receiverContext)
|
||||||
?.getSystemService(ACTIVITY_SERVICE) as? ActivityManager?)
|
?.getSystemService(ACTIVITY_SERVICE) as? ActivityManager?)
|
||||||
?.getRunningTasks(9999)?.let { it[it.lastIndex]?.topActivity?.className }
|
?.getRunningTasks(9999)?.filter { context?.javaClass?.name == it?.topActivity?.className }?.size ?: 0) > 0
|
||||||
}.getOrNull() ?: loggerW(msg = "Couldn't got current Activity status because a SecurityException blocked it").let { false }
|
}.getOrNull() ?: loggerW(msg = "Couldn't got current Activity status because a SecurityException blocked it").let { false }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user