8000 GitHub - gaoleicoding/Plug-in: 插件化
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

gaoleicoding/Plug-in

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Plugin-in插件化

Shadow:https://github.com/Tencent/Shadow

V2.3.0 Latest:https://github.com/Tencent/Shadow/releases/tag/2.3.0

1、Shadow兼容:

targetsdk 31
Gradle 7.2与AGP 7.1.1

2、Shadow支持特性

image

3、Shadow的不足之处:

(1)官方文档描述不详细

(2)官方Demo有点混乱

(3)官方demo中sample/maven/manager-project中FastPluginManager获取so有误,报错Caused by: java.lang.UnsatisfiedLinkError 。so找不到,原因是projects/sample/maven/manager-project,此demo使用v2.2.1中FastPluginManager获取so有误:https://github.com/Tencent/Shadow/blob/master/projects/sample/maven/manager-project/sample-manager/src/main/java/com/tencent/shadow/sample/manager/FastPluginManager.java

应该使用projects/sample/source/manager-project,此demo使用v2.3.0:https://github.com/Tencent/Shadow/blob/master/projects/sample/source/sample-manager/src/main/java/com/tencent/shadow/sample/manager/FastPluginManager.java

4、此项目使用Shadow实现了如下功能:

(1)完成插件化Demo,包含三个插件

(2)完成宿主和插件的交互

(3)完成插件之间的跳转

(4)有插件调用宿主能力

5、使用Shadow开发避坑指南:

(1)加载多个插件,需要对应多个manger和ProcessService,如下图: image

(2)插件使用宿主能力,避免重复冗余代码。需要在插件中用到hostWhiteList和compileOnly,如下图: image image

About

插件化

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0