From 340106a670eccfd878bbd29bc866d58c60baeccd Mon Sep 17 00:00:00 2001 From: liaozhiqin Date: Thu, 18 May 2023 12:11:29 +0800 Subject: [PATCH 1/2] fix EvilMethodTracer lose stack --- .../com/tencent/matrix/trace/tracer/EvilMethodTracer.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/matrix/matrix-android/matrix-trace-canary/src/main/java/com/tencent/matrix/trace/tracer/EvilMethodTracer.java b/matrix/matrix-android/matrix-trace-canary/src/main/java/com/tencent/matrix/trace/tracer/EvilMethodTracer.java index 9a7dbad07..33196dcc9 100644 --- a/matrix/matrix-android/matrix-trace-canary/src/main/java/com/tencent/matrix/trace/tracer/EvilMethodTracer.java +++ b/matrix/matrix-android/matrix-trace-canary/src/main/java/com/tencent/matrix/trace/tracer/EvilMethodTracer.java @@ -81,10 +81,16 @@ public boolean isValid() { @Override public void onDispatchBegin(String log) { indexRecord = AppMethodBeat.getInstance().maskIndex("EvilMethodTracer#dispatchBegin"); + if (config.isAppMethodBeatEnable()) { + AppMethodBeat.i(AppMethodBeat.METHOD_ID_DISPATCH); + } } @Override public void onDispatchEnd(String log, long beginNs, long endNs) { + if (config.isAppMethodBeatEnable()) { + AppMethodBeat.o(AppMethodBeat.METHOD_ID_DISPATCH); + } long dispatchCost = (endNs - beginNs) / Constants.TIME_MILLIS_TO_NANO; try { if (dispatchCost >= evilThresholdMs) { From c1100e5989d586cf9a70c687cd273e600148d92f Mon Sep 17 00:00:00 2001 From: liaozhiqin Date: Wed, 24 May 2023 12:45:24 +0800 Subject: [PATCH 2/2] fix support agp 7.3.1 use asm7 --- .../main/kotlin/com/tencent/matrix/plugin/compat/AgpCompat.kt | 1 + .../kotlin/com/tencent/matrix/plugin/compat/VersionsCompat.kt | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/matrix/matrix-android/matrix-gradle-plugin/src/main/kotlin/com/tencent/matrix/plugin/compat/AgpCompat.kt b/matrix/matrix-android/matrix-gradle-plugin/src/main/kotlin/com/tencent/matrix/plugin/compat/AgpCompat.kt index a5a962181..2e1c87fff 100644 --- a/matrix/matrix-android/matrix-gradle-plugin/src/main/kotlin/com/tencent/matrix/plugin/compat/AgpCompat.kt +++ b/matrix/matrix-android/matrix-gradle-plugin/src/main/kotlin/com/tencent/matrix/plugin/compat/AgpCompat.kt @@ -40,6 +40,7 @@ class AgpCompat { @JvmStatic val asmApi: Int get() = when { + VersionsCompat.greatThanOrEqual(AGPVersion.AGP_7_3_1) -> Opcodes.ASM7 VersionsCompat.greatThanOrEqual(AGPVersion.AGP_7_0_0) -> Opcodes.ASM6 else -> Opcodes.ASM5 } diff --git a/matrix/matrix-android/matrix-gradle-plugin/src/main/kotlin/com/tencent/matrix/plugin/compat/VersionsCompat.kt b/matrix/matrix-android/matrix-gradle-plugin/src/main/kotlin/com/tencent/matrix/plugin/compat/VersionsCompat.kt index 9d1ca9530..14e53042f 100644 --- a/matrix/matrix-android/matrix-gradle-plugin/src/main/kotlin/com/tencent/matrix/plugin/compat/VersionsCompat.kt +++ b/matrix/matrix-android/matrix-gradle-plugin/src/main/kotlin/com/tencent/matrix/plugin/compat/VersionsCompat.kt @@ -24,7 +24,8 @@ enum class AGPVersion( AGP_3_6_0("3.6.0"), AGP_4_0_0("4.0.0"), AGP_4_1_0("4.1.0"), - AGP_7_0_0("7.0.0") + AGP_7_0_0("7.0.0"), + AGP_7_3_1("7.3.1") } class VersionsCompat {