mirror of
https://github.com/KitsunePie/AppErrorsTracking.git
synced 2025-09-04 02:05:16 +08:00
Support Android 15 (#370)
This commit is contained in:
@@ -60,6 +60,7 @@ import com.fankes.apperrorstracking.utils.tool.FrameworkTool
|
|||||||
import com.fankes.apperrorstracking.wrapper.BuildConfigWrapper
|
import com.fankes.apperrorstracking.wrapper.BuildConfigWrapper
|
||||||
import com.highcapable.yukihookapi.hook.bean.VariousClass
|
import com.highcapable.yukihookapi.hook.bean.VariousClass
|
||||||
import com.highcapable.yukihookapi.hook.entity.YukiBaseHooker
|
import com.highcapable.yukihookapi.hook.entity.YukiBaseHooker
|
||||||
|
import com.highcapable.yukihookapi.hook.factory.constructor
|
||||||
import com.highcapable.yukihookapi.hook.factory.field
|
import com.highcapable.yukihookapi.hook.factory.field
|
||||||
import com.highcapable.yukihookapi.hook.factory.hasMethod
|
import com.highcapable.yukihookapi.hook.factory.hasMethod
|
||||||
import com.highcapable.yukihookapi.hook.factory.method
|
import com.highcapable.yukihookapi.hook.factory.method
|
||||||
@@ -111,7 +112,7 @@ object FrameworkHooker : YukiBaseHooker() {
|
|||||||
*/
|
*/
|
||||||
private val pkgList = if (ProcessRecordClass.hasMethod { name = "getPkgList"; emptyParam() })
|
private val pkgList = if (ProcessRecordClass.hasMethod { name = "getPkgList"; emptyParam() })
|
||||||
ProcessRecordClass.method { name = "getPkgList"; emptyParam() }.get(proc).call()
|
ProcessRecordClass.method { name = "getPkgList"; emptyParam() }.get(proc).call()
|
||||||
else ProcessRecordClass.field { name = "pkgList" }.get(proc).any()
|
else ProcessRecordClass.field { name { it.endsWith("pkgList", true) } }.get(proc).any()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前包列表数组大小
|
* 获取当前包列表数组大小
|
||||||
@@ -376,10 +377,20 @@ object FrameworkHooker : YukiBaseHooker() {
|
|||||||
registerLifecycle()
|
registerLifecycle()
|
||||||
/** 干掉原生错误对话框 - 如果有 */
|
/** 干掉原生错误对话框 - 如果有 */
|
||||||
ErrorDialogControllerClass?.apply {
|
ErrorDialogControllerClass?.apply {
|
||||||
method {
|
if (hasMethod { name = "hasCrashDialogs"; emptyParam() }) {
|
||||||
name = "hasCrashDialogs"
|
method {
|
||||||
emptyParam()
|
name = "hasCrashDialogs"
|
||||||
}.hook().replaceToTrue()
|
emptyParam()
|
||||||
|
}.hook().replaceToTrue()
|
||||||
|
|
||||||
|
} else {
|
||||||
|
constructor {
|
||||||
|
paramCount = 1
|
||||||
|
}.hook().after {
|
||||||
|
field { name = "mCrashDialogs" }.get(instance).set(emptyList<Any>())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
method {
|
method {
|
||||||
name = "showCrashDialogs"
|
name = "showCrashDialogs"
|
||||||
paramCount = 1
|
paramCount = 1
|
||||||
|
Reference in New Issue
Block a user