代码拉取完成,页面将自动刷新
@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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。