1 Star 0 Fork 0

GrantWoo/VirtualAppDoc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
VStubContentProvider.puml 4.63 KB
一键复制 编辑 原始数据 按行查看 历史
@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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/grantwoo/VirtualAppDoc.git
git@gitee.com:grantwoo/VirtualAppDoc.git
grantwoo
VirtualAppDoc
VirtualAppDoc
master

搜索帮助