-
Notifications
You must be signed in to change notification settings - Fork 187
/
VAHook.puml
91 lines (70 loc) · 1.51 KB
/
VAHook.puml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
@startuml
interface IBinder
abstract class Hook {
getName()
beforeHook
onHook
afterHook
isEnable
}
interface IHookObject {
void addHook(Hook hook);
removeHook(hookName);
getHook(name);
getProxyObject();
}
class HookObject {
Map<String, Hook> mHookMaps;
mBaseObject;
mProxyObject;
}
class PatchObject {
hookObject
}
class ActivityManagerPatch {
}
interface Injectable {
inject()
isEnvBad()
}
class IInterface {
IBinder asBinder();
}
class IActivityManager {
startActivity()
broadcastIntent()
}
IHookObject <|-- HookObject
HookObject <|-- PatchObject
Injectable <|-- PatchObject
Hook <|-- StartActivity
Hook <|-- BroadcastIntent
IHookObject *-- IInterface
HookObject *-- Hook
ActivityManagerPatch *-- StartActivity
ActivityManagerPatch *-- BroadcastIntent
IBinder <|-- HookBinder
IHookObject <|-- HookBinder
IInterface <|-- IActivityManager
PatchObject <|-- ActivityManagerPatch
class PatchManager {
Map<Class, Injectable> mPatchMaps;
init()
injectAll()
addAllPatches()
addPatch()
addAllPatches()
}
PatchManager *-- ActivityManagerPatch
note top of Hook
该类是对方法的hook,每个Hook对象都对应于一个方法,
如IActivityManager.startActivity
endnote
note top of HookObject
该类对应于一个被hook的类,所有内部都代理了IInterface的某个具体子类,
该类中有一张表,存储了每个被hook的方法的Hook对象.
该类中对接口类使用
Proxy.newProxyInstance
InvocationHandler
endnote
@enduml