diff --git a/app/build.gradle b/app/build.gradle index 8946cd6..eeb1f4a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -63,4 +63,5 @@ monitorPlugin { ] methodStatus = 2 disableStackMapFrame = false + interceptPackageName = "com.peakmain" } diff --git a/plugin/src/main/groovy/com/peakmain/analytics/plugin/ext/MonitorConfig.groovy b/plugin/src/main/groovy/com/peakmain/analytics/plugin/ext/MonitorConfig.groovy index 34fd5f7..40c10be 100644 --- a/plugin/src/main/groovy/com/peakmain/analytics/plugin/ext/MonitorConfig.groovy +++ b/plugin/src/main/groovy/com/peakmain/analytics/plugin/ext/MonitorConfig.groovy @@ -1,6 +1,7 @@ package com.peakmain.analytics.plugin.ext import com.peakmain.analytics.plugin.utils.MethodFieldUtils +import org.apache.http.util.TextUtils /** * author :Peakmain @@ -36,7 +37,10 @@ class MonitorConfig { * 是否禁用开启堆栈分析,默认是禁用 */ public boolean disableStackMapFrame = true - public String interceptPackageName = "com/atour" + /** + * 拦截点击的包名前缀 + */ + public String interceptPackageName = "" void convertConfig() { for (String value : special) { @@ -52,6 +56,9 @@ class MonitorConfig { } else { statusEnum = MethodFieldUtils.StatusEnum.METHOD_STATE_NORMAL } + if (!TextUtils.isEmpty(interceptPackageName)) { + interceptPackageName = interceptPackageName.replace(".", ",") + } } MethodFieldUtils.StatusEnum getStatusEnum() { diff --git a/plugin/src/main/groovy/com/peakmain/analytics/plugin/visitor/MonitorMethodCalledReplaceAdapter.groovy b/plugin/src/main/groovy/com/peakmain/analytics/plugin/visitor/MonitorMethodCalledReplaceAdapter.groovy index 76e328c..f74077c 100644 --- a/plugin/src/main/groovy/com/peakmain/analytics/plugin/visitor/MonitorMethodCalledReplaceAdapter.groovy +++ b/plugin/src/main/groovy/com/peakmain/analytics/plugin/visitor/MonitorMethodCalledReplaceAdapter.groovy @@ -40,7 +40,7 @@ class MonitorMethodCalledReplaceAdapter extends MonitorDefalutMethodAdapter { HashMap methodReplaceBeans = MonitorHookMethodConfig.methodCalledBeans String desc = owner + name + descriptor if (!monitorConfig.whiteList.contains(mClassName) && !monitorConfig.exceptSet.contains(mClassName)&&methodReplaceBeans.containsKey(desc)) { - println("调用方法的class:" + mClassName + ",方法的名字:" + name + ",方法的描述符:" + descriptor) + //println("调用方法的class:" + mClassName + ",方法的名字:" + name + ",方法的描述符:" + descriptor) MethodCalledBean bean = methodReplaceBeans.get(desc) super.visitMethodInsn(bean.newOpcode, bean.newMethodOwner, bean.newMethodName, bean.newMethodDescriptor.get(descriptor), false) } else { diff --git a/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-groovydoc.jar b/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-groovydoc.jar index 4e59c74..f973cf9 100644 Binary files a/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-groovydoc.jar and b/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-groovydoc.jar differ diff --git a/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-groovydoc.jar.md5 b/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-groovydoc.jar.md5 index 91cb09c..31463ab 100644 --- a/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-groovydoc.jar.md5 +++ b/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-groovydoc.jar.md5 @@ -1 +1 @@ -aa3d302743bf0d0125e80c7933e12ef3 \ No newline at end of file +27c19848aa9bd8546e6068ebc6b989d4 \ No newline at end of file diff --git a/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-groovydoc.jar.sha1 b/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-groovydoc.jar.sha1 index 404ce47..b5bdfa2 100644 --- a/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-groovydoc.jar.sha1 +++ b/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-groovydoc.jar.sha1 @@ -1 +1 @@ -bb33bdf0292444a4f68911b2e81aeb6b166710b2 \ No newline at end of file +bd05d9db1481a5aebf6ad430260ee19c8f5dbebb \ No newline at end of file diff --git a/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-sources.jar b/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-sources.jar index f661ecb..9485917 100644 Binary files a/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-sources.jar and b/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-sources.jar differ diff --git a/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-sources.jar.md5 b/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-sources.jar.md5 index 12e200f..96535a6 100644 --- a/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-sources.jar.md5 +++ b/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-sources.jar.md5 @@ -1 +1 @@ -cac97c3ae5be0ec78f886f3cb968286a \ No newline at end of file +8622ac6bb5e33536d1bc79cc324aebee \ No newline at end of file diff --git a/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-sources.jar.sha1 b/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-sources.jar.sha1 index e9bd0f3..817e3b4 100644 --- a/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-sources.jar.sha1 +++ b/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0-sources.jar.sha1 @@ -1 +1 @@ -eef649de0f4810ba60c657dba1d8595e63a03ccd \ No newline at end of file +8105e71e5afa9e411efec76caa79f1246d10f1d2 \ No newline at end of file diff --git a/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.jar b/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.jar index 7b5f6b0..249f175 100644 Binary files a/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.jar and b/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.jar differ diff --git a/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.jar.md5 b/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.jar.md5 index 3708d59..282265f 100644 --- a/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.jar.md5 +++ b/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.jar.md5 @@ -1 +1 @@ -71c760bab10c33f06b2a44b960682d88 \ No newline at end of file +80f08d2fe3fb596f26014efb6c9e2fb2 \ No newline at end of file diff --git a/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.jar.sha1 b/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.jar.sha1 index 5828291..92472e7 100644 --- a/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.jar.sha1 +++ b/repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.jar.sha1 @@ -1 +1 @@ -d67a3ab5517114e573367604d41fcb8bbaec0c81 \ No newline at end of file +c8d23317c80adf1954aa03fbba093fa0cecc1b63 \ No newline at end of file diff --git a/repo/com/peakmain/android.plugin/maven-metadata.xml b/repo/com/peakmain/android.plugin/maven-metadata.xml index c4d4074..8b5ad4b 100644 --- a/repo/com/peakmain/android.plugin/maven-metadata.xml +++ b/repo/com/peakmain/android.plugin/maven-metadata.xml @@ -7,6 +7,6 @@ 1.0.0 - 20220518064857 + 20220518070554 diff --git a/repo/com/peakmain/android.plugin/maven-metadata.xml.md5 b/repo/com/peakmain/android.plugin/maven-metadata.xml.md5 index 4094688..29b5dd3 100644 --- a/repo/com/peakmain/android.plugin/maven-metadata.xml.md5 +++ b/repo/com/peakmain/android.plugin/maven-metadata.xml.md5 @@ -1 +1 @@ -fa781a6335847929e9b713610faab9d7 \ No newline at end of file +e37940be461e4b4bde420f8581ca616b \ No newline at end of file diff --git a/repo/com/peakmain/android.plugin/maven-metadata.xml.sha1 b/repo/com/peakmain/android.plugin/maven-metadata.xml.sha1 index d9f5bce..007affe 100644 --- a/repo/com/peakmain/android.plugin/maven-metadata.xml.sha1 +++ b/repo/com/peakmain/android.plugin/maven-metadata.xml.sha1 @@ -1 +1 @@ -a18657fdc1e3e97eb0e5a22a5e2ce0348ca52083 \ No newline at end of file +fe0294d18a7304bb6385a33edb90d2ffa0eb51c6 \ No newline at end of file