Skip to content

Commit

Permalink
添加使用
Browse files Browse the repository at this point in the history
  • Loading branch information
陈少平 committed Jul 21, 2021
1 parent f01c7a2 commit 8061085
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@
使用\
1 . 在工程根目录下的gradle添加如下代码

```

buildscript {
dependencies {
classpath 'com.csp.blackHook:buildSrc:1.0.0'
}
}

\在app module下的build.gradle添加如下代码,hookMethodList是需要hook的方法的集合,每次hook一个新的方法的时候,新建一个HookMethod对象,
传入hook的类的路径,方法名,方法签名,插入字节码的闭包即可,如下代码所示,hook startService()方法和startForegroundService()方法\
```

在app module下的build.gradle添加如下代码,hookMethodList是需要hook的方法的集合,每次hook一个新的方法的时候,新建一个HookMethod对象,
传入hook的类的路径,方法名,方法签名,插入字节码的闭包即可,如下代码所示,hook startService()方法和startForegroundService()方法

```
apply plugin: 'com.csp.blackHook.killer'

List<HookMethod> getHookMethods() {
Expand Down Expand Up @@ -54,3 +59,4 @@
//表示需要被hook的方法
hookMethodList = getHookMethods()
}
```

0 comments on commit 8061085

Please sign in to comment.