Skip to content

Commit

Permalink
去掉清空方法体
Browse files Browse the repository at this point in the history
  • Loading branch information
Peakmain committed May 18, 2022
1 parent 9c3ce50 commit 0a90d39
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 11 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ monitorPlugin {
]
methodStatus = 2
disableStackMapFrame = false
interceptPackageName = "com.peakmain"
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -36,7 +37,10 @@ class MonitorConfig {
* 是否禁用开启堆栈分析,默认是禁用
*/
public boolean disableStackMapFrame = true
public String interceptPackageName = "com/atour"
/**
* 拦截点击的包名前缀
*/
public String interceptPackageName = ""

void convertConfig() {
for (String value : special) {
Expand All @@ -52,6 +56,9 @@ class MonitorConfig {
} else {
statusEnum = MethodFieldUtils.StatusEnum.METHOD_STATE_NORMAL
}
if (!TextUtils.isEmpty(interceptPackageName)) {
interceptPackageName = interceptPackageName.replace(".", ",")
}
}

MethodFieldUtils.StatusEnum getStatusEnum() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class MonitorMethodCalledReplaceAdapter extends MonitorDefalutMethodAdapter {
HashMap<String, MethodCalledBean> 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 {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
aa3d302743bf0d0125e80c7933e12ef3
27c19848aa9bd8546e6068ebc6b989d4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bb33bdf0292444a4f68911b2e81aeb6b166710b2
bd05d9db1481a5aebf6ad430260ee19c8f5dbebb
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cac97c3ae5be0ec78f886f3cb968286a
8622ac6bb5e33536d1bc79cc324aebee
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eef649de0f4810ba60c657dba1d8595e63a03ccd
8105e71e5afa9e411efec76caa79f1246d10f1d2
Binary file modified repo/com/peakmain/android.plugin/1.0.0/android.plugin-1.0.0.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
71c760bab10c33f06b2a44b960682d88
80f08d2fe3fb596f26014efb6c9e2fb2
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d67a3ab5517114e573367604d41fcb8bbaec0c81
c8d23317c80adf1954aa03fbba093fa0cecc1b63
2 changes: 1 addition & 1 deletion repo/com/peakmain/android.plugin/maven-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<versions>
<version>1.0.0</version>
</versions>
<lastUpdated>20220518064857</lastUpdated>
<lastUpdated>20220518070554</lastUpdated>
</versioning>
</metadata>
2 changes: 1 addition & 1 deletion repo/com/peakmain/android.plugin/maven-metadata.xml.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fa781a6335847929e9b713610faab9d7
e37940be461e4b4bde420f8581ca616b
2 changes: 1 addition & 1 deletion repo/com/peakmain/android.plugin/maven-metadata.xml.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a18657fdc1e3e97eb0e5a22a5e2ce0348ca52083
fe0294d18a7304bb6385a33edb90d2ffa0eb51c6

0 comments on commit 0a90d39

Please sign in to comment.