didi / VirtualAPK

A powerful and lightweight plugin framework for Android
Apache License 2.0
8.99k stars 1.52k forks source link

插件中的Activity只能从Host中启动?对外部不可见吗? #284

Open PhantomQi opened 5 years ago

PhantomQi commented 5 years ago

安装demo的host,且拷贝了plugindemo到/sdcard/Test.apk,运行如下命令:

activities='
com.didi.virtualapk.demo/com.didi.virtualapk.demo.MainActivity
com.didi.virtualapk/com.didi.virtualapk.demo.MainActivity
com.didi.virtualapk.demo/com.didi.virtualapk.demo.aidl.BootManagerActivity
com.didi.virtualapk/com.didi.virtualapk.demo.aidl.BootManagerActivity
com.didi.virtualapk.demo/com.didi.virtualapk.demo.SecondActivity
com.didi.virtualapk/com.didi.virtualapk.demo.SecondActivity
com.didi.virtualapk/com.didi.virtualapk.MainActivity
com.didi.virtualapk.demo/com.didi.virtualapk.demo.MainActivity
com.didi.virtualapk/com.didi.virtualapk.demo.MainActivity
com.didi.virtualapk.demo/com.didi.virtualapk.demo.aidl.BootManagerActivity
com.didi.virtualapk/com.didi.virtualapk.demo.aidl.BootManagerActivity
com.didi.virtualapk.demo/com.didi.virtualapk.demo.SecondActivity
com.didi.virtualapk/com.didi.virtualapk.demo.SecondActivity
'

adb shell am force-stop com.didi.virtualapk
for act in ${activities}
do
    adb shell am start -n $act
done

命令输出:

Starting: Intent { cmp=com.didi.virtualapk.demo/.MainActivity }
Error type 3
Error: Activity class {com.didi.virtualapk.demo/com.didi.virtualapk.demo.MainActivity} does not exist.
Starting: Intent { cmp=com.didi.virtualapk/.demo.MainActivity }
Error type 3
Error: Activity class {com.didi.virtualapk/com.didi.virtualapk.demo.MainActivity} does not exist.
Starting: Intent { cmp=com.didi.virtualapk.demo/.aidl.BootManagerActivity }
Error type 3
Error: Activity class {com.didi.virtualapk.demo/com.didi.virtualapk.demo.aidl.BootManagerActivity} does not exist.
Starting: Intent { cmp=com.didi.virtualapk/.demo.aidl.BootManagerActivity }
Error type 3
Error: Activity class {com.didi.virtualapk/com.didi.virtualapk.demo.aidl.BootManagerActivity} does not exist.
Starting: Intent { cmp=com.didi.virtualapk.demo/.SecondActivity }
Error type 3
Error: Activity class {com.didi.virtualapk.demo/com.didi.virtualapk.demo.SecondActivity} does not exist.
Starting: Intent { cmp=com.didi.virtualapk/.demo.SecondActivity }
Error type 3
Error: Activity class {com.didi.virtualapk/com.didi.virtualapk.demo.SecondActivity} does not exist.
Starting: Intent { cmp=com.didi.virtualapk/.MainActivity }
Starting: Intent { cmp=com.didi.virtualapk.demo/.MainActivity }
Error type 3
Error: Activity class {com.didi.virtualapk.demo/com.didi.virtualapk.demo.MainActivity} does not exist.
Starting: Intent { cmp=com.didi.virtualapk/.demo.MainActivity }
Error type 3
Error: Activity class {com.didi.virtualapk/com.didi.virtualapk.demo.MainActivity} does not exist.
Starting: Intent { cmp=com.didi.virtualapk.demo/.aidl.BootManagerActivity }
Error type 3
Error: Activity class {com.didi.virtualapk.demo/com.didi.virtualapk.demo.aidl.BootManagerActivity} does not exist.
Starting: Intent { cmp=com.didi.virtualapk/.demo.aidl.BootManagerActivity }
Error type 3
Error: Activity class {com.didi.virtualapk/com.didi.virtualapk.demo.aidl.BootManagerActivity} does not exist.
Starting: Intent { cmp=com.didi.virtualapk.demo/.SecondActivity }
Error type 3
Error: Activity class {com.didi.virtualapk.demo/com.didi.virtualapk.demo.SecondActivity} does not exist.
Starting: Intent { cmp=com.didi.virtualapk/.demo.SecondActivity }
Error type 3
Error: Activity class {com.didi.virtualapk/com.didi.virtualapk.demo.SecondActivity} does not exist.

这是我哪里做错了吗?还是说这就是正常现象且无解的问题?

bennyhuo commented 5 years ago

插件化框架都做不到这一点的。插件的四大组件在外部看来都是不存在的