mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-07 03:05:36 +08:00
Modify add try catch on findUserId function in AppParasitics
This commit is contained in:
@@ -122,11 +122,12 @@ internal object AppParasitics {
|
|||||||
* @param packageName 当前包名
|
* @param packageName 当前包名
|
||||||
* @return [Int]
|
* @return [Int]
|
||||||
*/
|
*/
|
||||||
internal fun findUserId(packageName: String) =
|
internal fun findUserId(packageName: String) = runCatching {
|
||||||
UserHandleClass.method {
|
UserHandleClass.method {
|
||||||
name = "getUserId"
|
name = "getUserId"
|
||||||
param(IntType)
|
param(IntType)
|
||||||
}.ignored().get().int(systemContext.packageManager.getApplicationInfo(packageName, PackageManager.GET_ACTIVITIES).uid)
|
}.ignored().get().int(systemContext.packageManager.getApplicationInfo(packageName, PackageManager.GET_ACTIVITIES).uid)
|
||||||
|
}.getOrNull() ?: 0
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hook 模块 APP 相关功能 - 包括自身激活状态、Resources Hook 支持状态以及 [SharedPreferences]
|
* Hook 模块 APP 相关功能 - 包括自身激活状态、Resources Hook 支持状态以及 [SharedPreferences]
|
||||||
|
Reference in New Issue
Block a user