-
Notifications
You must be signed in to change notification settings - Fork 187
/
VStubContentProvider.puml
122 lines (102 loc) · 4.63 KB
/
VStubContentProvider.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
@startuml
[-> StubContentProvider : call
note left
该新进程被创建的时候,该组件所属的Application类会被系统创建,
其attachBaseContext方法、onCreate方法都被会调用。
而VA中双开的应用都是利用VA预先埋下的stub provider/activity生成的进程,
因此StubContentProvider所在的进程被系统创建时,会依次自动执行VApp类的
attachBaseContext,也就是会执行VirtualCore.getCore().startup(base);
也就是自动添加了hook方法。
endnote
activate StubContentProvider
StubContentProvider -> StubContentProvider : initProcess
activate StubContentProvider
StubContentProvider -> VClientImpl : getClient
activate VClientImpl
StubContentProvider <-- VClientImpl : client:VClientImpl
deactivate VClientImpl
StubContentProvider -> VActivityManager : attachClient(client)
activate VActivityManager
VActivityManager -> VActivityManagerService : attachClient
activate VActivityManagerService
VActivityManagerService -> IVClient : bindApplication
activate IVClient
IVClient -> VClientImpl : bindApplication
activate VClientImpl
VClientImpl -> VirtualRuntime : setupRuntime
VClientImpl -> VClientImpl : sendMessage
activate VClientImpl
deactivate VClientImpl
deactivate VClientImpl
deactivate IVClient
deactivate VActivityManagerService
deactivate VActivityManager
deactivate StubContentProvider
deactivate StubContentProvider
VClientImpl -> VClientImpl : handleBindApplication
activate VClientImpl
VClientImpl -> IOHook : startDexOverride
activate IOHook
deactivate IOHook
VClientImpl -> IOHook : hookNative
activate IOHook
deactivate IOHook
VClientImpl -> ContextFixer : fixCamera
activate ContextFixer
deactivate ContextFixer
VClientImpl -> VClientImpl : fixBoundApp
activate VClientImpl
deactivate VClientImpl
note right
这个函数的作用是什么呢?
endnote
VClientImpl -> LoadedApk : makeApplication
activate LoadedApk
deactivate LoadedApk
note right
这里完成了被双开应用Applicatoin的调用过程,在被双开应用的Application.attachBaseContex
里添加代码打印调用栈,如下
java.lang.Throwable
at com.droi.helloinstantrun.PrifeApp.attachBaseContext(PrifeApp.java:16)
at android.app.Application.attach(Application.java:187)
at android.app.Instrumentation.newApplication(Instrumentation.java:997)
at android.app.Instrumentation.newApplication(Instrumentation.java:981)
at com.lody.virtual.client.hook.delegate.InstrumentationDelegate.
newApplication(InstrumentationDelegate.java:234)
at android.app.LoadedApk.makeApplication(LoadedApk.java:573)
at com.lody.virtual.client.VClientImpl.handleBindApplication(VClientImpl.java:183)
at com.lody.virtual.client.VClientImpl.access$100(VClientImpl.java:45)
at com.lody.virtual.client.VClientImpl$H.handleMessage(VClientImpl.java:123)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
endnote
VClientImpl -> VClientImpl : installContentProviders
activate VClientImpl
deactivate VClientImpl
VClientImpl -> AppInstrumentation : callApplicationOnCreate
activate AppInstrumentation
AppInstrumentation -> Instrumentation : callApplicationOnCreate
activate Instrumentation
deactivate Instrumentation
deactivate AppInstrumentation
VClientImpl -> VPackageManager : queryReceivers
activate VPackageManager
deactivate VPackageManager
VPackageManager -> VPackageManagerService : queryReceivers
activate VPackageManagerService
deactivate VPackageManagerService
VClientImpl -> VClientImpl : installReceivers
activate VClientImpl
deactivate VClientImpl
VClientImpl -> VActivityManager : appDoneExecuting
activate VActivityManager
VActivityManager -> VActivityManagerService : appDoneExecuting
activate VActivityManagerService
deactivate VActivityManagerService
deactivate VActivityManager
deactivate VClientImpl
@enduml