In July 27, 2012 , it was the first milestone in Android plug-in technology. Yimin Tu(mmin18 on Github), who worked for dianping.com , released the first Android plug-in open source project——AndroidDynamicLoader, and the App of dianping.com was based on this framework. It is a plug-in framework based on Fragment. Through the dynamic loading of the Fragments in the plug-in, the page switching was implemented in the APP, but there is only one Activity which as the container of Fragments. In the open source project, it is the first time for us to know how to use the addAssetPath method of AssetManager to handle the resources in the plug-in.

      In 2013, 23Code appeared. 23Code provides a shell where plug-ins can be dynamically downloaded and run. We can write a variety of controls outside and run them in the framework. It is the Android plug-in framework. For about this project and related open source resources, I don’t know very clear,if anyone knows the author, please contact with me.

      On March 27, 2013, BoKui, a developer of Taobao client, provide a technical sharing about Taobao's Atlas plug-in framework in the Alibaba Technology Salon No.16, including several classes of Hook, incremental update, downgrade, and compatibility such as ActivityThread and so on. Such video shows the plug-in technology from macroscopic view, and not to say how to implement it, not to mentioned as open source projects. This thinking is very advanced in 2013, but at that time, I’m still a student for Android programing.

      At 8:20 on March 30, 2014, it was the second milestone of Android plug-in technology. Mr. Ren Yugang published an Android plug-in project named dynamic-load-apk, which is not the same as many other plug-in projects. It does not modify with the internal methods of the Android system, but to solve the problem from the application layer of the App by creating a class named ProxyActivity to distribute and start the plug-in Activity. Because Ren Yugang invented a keyword called "that” in this framework, so I call it as "that" framework in this book. In fact, the author does not like the nickname, and named it as DL. When he develop this framework, there were so many difficulties, because there was no enough information on plug-in technology that could be referred to, especially before 2014.

      "That" framework only have the implementation of the plug-in activity at beginning. With the contribution of Xiao Tian and Siyu Song, the implementation of Service was available later. In April 2015, "that" framework was stabilized. At that time, I was the leader of App Technology at Tuniu. When I ever saw this framework, decided to introduce it into the Tuniu App resolutely (actually there was no other choice at that time). The developers of the specific operation were Liangliang Wang and Zhengbin Wei. They took the framework and transplanted it into the Tuniu App. The framework has withstood the verification of a million-activiation app. It is the first market App for plug-in technology.

      At the same time, Tao Zhang was also contribute to the implementation of plug-in technology. In May 2014, after reading all the source codes of DL, he released his first plug-in framework——CJFrameForAndroid. This design is similar to "that", except that he called ProxyActivity and ProxyService as hosting sites. In addition, the CJFrameForAndroid framework also presents the Activity's LaunchMode solution, which is a very important contribution to the plug-in framework and can be ported directly to "that" framework.

      In November 2014, houkx released a plug-in project named android-pluginmgr on GitHub. This framework first proposed to register a StubActivity in the AndroidManifest file to deceive AMS, but actually opened ActivityA in the plug-in. But he did not use the technology to modify with Instrumentation and ActivityThread, but through the dexmaker.jar tool dynamically generated StubActivity, StubActivity class inherited from the plug-in ActivityA.

      Today, it seems that the idea of such dynamically generated classes does not a good solution for plug-in framework, but it was not easy to acquire this point at that time. Everyone interprets their roles well in the stage of plug-in and plays a specific role at a particular time.

      At the same time, hookx also found that the permissions requested in the plug-in framework can not take effect, so you must apply for all permissions in the host app in advance.

      Android-pluginmgr has two branches, the author's idea of plug-in is located in the dev branch. Then, Lody, a high school student, took part in the open source project, and modified android-pluginmgr with Instrumentation thoughts, implemented in the master branch, but this story was happened in November 2015.

      On December 8, 2014, there was a good news, Android Studio V1.0 was available. Android developers began to abandon Eclipse gradually, and try to use Android Studio. Android Studio is compiled and packaged with Gradle, which makes the design of the plug-in framework much simpler, eliminating the inconvenience of using Eclipse to run the Android SDK.

      2015 was coming.

      Lody, the high school student, he was still a sophomore at the moment. He started studying the Android system source codes from junior school. His first well-known open source project was TurboDex, which can quickly load dex with high speed. This is very useful in plug-in frameworks because it takes a long time to load all the plug-ins for the initialization.

      At the end of March 2015, Lody released the plug-in project: Direct-Load-apk. This framework combines Yugang Ren's static proxy thoughts of “that“ framework, Houkx's pluginmgr framework whose idea is deception AMS, and modified Instrumnetation. Unfortunately, Lody was a student at that time, and did not spend much time to talk about this framework, so that too many people did not know the existence of the framework.

      The legend of Lody hasn't finished yet, he spend much time into the project of VirtualApp. It is an App just like virtual machine on the Android system, which is a deeper technical topic, and we'll talk it later.

      In May 2015, limpoxe released plug-in framework: Android-Plugin-Framework.

      In July 2015, kaedea released plug-in framework: android-dynamical-loading.

      In August 27, 2015, it was the third milestone of Android plug-in technology, and Yong Zhang's DroidPlugin came out. Yong Zhang was a developer of the 360 Mobile Assistant App team, and DroidPlugin was the plug-in framework used by the mobile assistant App. The magic of this framework is that any App can be loaded into the host. You can write a host App based on this framework, and then you can load App written by others as plug-ins.

      DroidPlugin puts the Hook to the highest.

      DroidPlugin has a powerful features, but the cost is to modify with many internal code of Android. Due to no more documentation for the DroidPlugin project, this framework is difficult to be understood. There are many articles about DroidPlugin, but the best one is written by WeiShu Tian. At that time, he also worked for the same company with Yong Zhang, he wrote out a series of articles about DroidPlugin, including the principles of Binder and AIDL, the Hook mechanism, and the plug-in mechanism for the four major components.

      2015 was the first year for Android plug-in development. Not only “that” framework and DroidPlugin, but also many plug-in frameworks were born at that time.

      OpenAtlas, the project was released on Github in May and was renamed ACDD later. It proposes to modify and regenerate the AAPT command so that the resource id of the plug-in apk is no longer only fixed 0x7f, which can be modified to a value of 0x71. This solves the problem of resource ids conflicting after consolidating plug-in resources into HostApp resources in the host.

      OpenAtlas is also based on ‘execStartActivity’ method, which was modified, in ‘Instrumentation’ which is belong to the internal code of Android. It can implementation the Activity as plug-in.

      In addition, OpenAltas also modified the ContextWrapper, rewrites the getResource method. Because the Activity is the subclass of the ContextWrapper, the plug-in Activity will inherit the getResource methods to get the resources in the plug-in——this method is not be used now , we create a base class called BasePluginActivity for the plug-in Activity and override the getResource method to fetch plug-in resource.

      Ctrip open source their plug-in framework DynamicAPK in October 2015, which is based on the OpenAltas framework and binds with Ctrip's own business logic.

      At the end of December 2015, Guangliang Lin released the Small framework. At that time, he worked for a car trading platform at Fujian. This framework was tailored to the App for the car trading platform.

      ● Corresponding to the plug-in's ClassLoader, the Small framework inserted the dex file into the Host App's ClassLoader , so that Host App can load any class of any plug-in.

      ● The Small framework is an Activity, which starts the plug-ins through Hook Instrumentation. It is the same as the DroidPlugin, a StubActivity is declared in the AndroidManifest to trick the AMS.

      ● To support for the other three components in the Small framework is to declare the plug-in's Service, Receiver, and ContentProvider in HostApp's AndroidManifest.

      ● For the resources, the Small's solution has its own method. Using AssetManager's addAssetPath() method, all the plug-in resources are merged into the host's resources, if the resource id conflict occurs, Small did not use Atlas to modify the AAPT, but in the plug-in R.java and resource. After these two files generation, just change the prefix of all resources in the plug-in R.java from 0x7f to 0x71, and also change 0x7f to 0x71 in resource.arsc.

      With the end of 2015, various technical issues involved in plug-in technology have already got one or more solutions. In this year, the plug-in technology is very varied. That period was dominated by the plug-in framework which was invented with individuals. It was basically divided into two categories. The dynamic replacement program represented by Yong Zhang's DroidPlugin, and Yugang Ren’s “That” framework is represented by a static proxy scheme.

      In 2015, Android hot fix technology and React Native appeared in the developer's world, provided the same advantages as Android plug-in technology. Android plug-in technology is no longer the only choice for developers.

      Since 2016, domestic Internet companies have gradually opened their own plug-in framework. No more technology has been adopted at this time, because all the solutions of the plug-in technology had been given by individual developers in 2015. Internet companies are the best platform to verify the feasibility of these plug-in technologies because their apps are used by millions of users.

      Let us enumerate them in chronological order:

      In August 2016, Palmeras launched Zeus.

      In March 2017, Alibaba launched Atlas.

      June 26, 2017, 360 mobile phone launched RePlugin.

      On June 29, 2017, Didi launched VisualApk.

      After reading the source code of these frameworks carefully, we can find that such open source frameworks are focus on:

      ● Plug-in compatibility, including the impact of the upgrade of the Android system on the plug-in framework, and the impact of different mobile phone ROMs.

      ● plug-in stability, for example, different kinds of unknown crashes.

      ● Management of plug-ins, including installation and uninstallation.

      In spite of the fact, a few years have passed, various plug-in frameworks have gradually become stable. Developers who are now engaged in plug-in technology only need to pay attention to the upgrade of the Android system version each year and the impact on their own framework if they eliminate such kind of influence.

      With the mature of plug-in framework, many authors of plug-in technology have begun to change their focus. Some of them are still in the area of Android. For example, based on the DroidPlugin framework, Yong Zhang is doing his startup project——lightning boxes based on DroidPlugin framework; some for the Blockchain, they focus on writing smart contracts with GO language every day.

      Thanks to those who have contributed in the field of plug-in technology, including the authors of the open source project, as well as authors who wrote the article on preaching. If some people may have some frameworks that may not be mentioned, any suggestions are welcome.

1.3 History of Android Plug-in Programing的更多相关文章

  1. Chapter 1: Plug-in programing from past to the future

    It is the best time. Although the internal API of Android not allowed to be modified by google play, ...

  2. Android二维码功能实现,在程序内嵌入ZXing项目

    转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/9526247 最近二维码真是越来越火了,随便电视上.网络上.商场里,到处都是二维码. ...

  3. Android为TV端助力 listview与recyclerview上下联动

    首先是主布局fragment里面的xml文件 <?xml version="1.0" encoding="utf-8"?><RelativeL ...

  4. Android二维码功能实现

    最近二维码真是越来越火了,随便电视上.网络上.商场里,到处都是二维码.而内嵌二维码扫描功能的软件也越来越多,QQ.微信.UC浏览器等等应用都可以对着二维码扫一扫,感觉我们自己的应用里不加上二维码扫描功 ...

  5. Android Programing 学习笔记(一)

    最近学习android 开发,拜读android programing,一步一步学习.囫囵吞枣,现已看到第十八章.今天把最近的学习过程中学到的一些内容进行一下总结. 一:Fragment 和 Acti ...

  6. Android源码目录结构详解(转载)

    转自:http://blog.csdn.net/xiangjai/article/details/9012387 在学习Android的过程中,学习写应用还好,一开始不用管太多代码,直接调用函数就可以 ...

  7. android源码的目录结构

    android源码的目录结构 [以下网络摘抄] |-- Makefile ! l/ a5 n% S% @- `0 d# z# a$ P4 V3 o7 R|-- bionic              ...

  8. Android 4.0 源代码结构

    Android源码的第一级目录结构   Android/abi (abi相关代码.ABI:application binary interface,应用程序二进制接口)   Android/bioni ...

  9. Android源码-学习随笔

    在线代码网站1:http://grepcode.com/project/repository.grepcode.com/java/ext/com.google.android/android/ 书籍: ...

随机推荐

  1. MUI之App开发

    一般开发APP分为两种:1.原生ios和android语言开发.2.混合开发,里边穿插h5的东西. 3.第三种:现在因为前端用hbuilder工具开发的情况越来越多,这家公司又提供了更多的选择,所以近 ...

  2. pycharm远程调试服务器

    1.下载专业版pycharm并激活 https://blog.csdn.net/weixin_39332299/article/details/79692283 2.创建项目,设置解释器时,选择SSH ...

  3. django实现SSO

    前言 公司的各种运维平台越来越多,用户再每个平台都注册账号,密码,密码太多记不住不说,然后有的平台过一段时间还得修改密码,烦!还不如弄个统一登录平台!! 需求分析 造这辆大车,首先就得造两个轮子 首先 ...

  4. python绘制等边三角形

    定义一个函数,参数为三角形的边长和颜色,并调用该函数绘制两个边长颜色不同的等边三角形 def draw(l,color): import turtle turtle.setup(900,600,200 ...

  5. TPshop之邮箱注册配置教程--附加常见问题集合

    ​ 准备:企业邮箱(开启POP/SMTP功能) 一.步骤教程: 1.登录企业邮箱(QQ邮箱示例) QQ邮箱 POP3:pop.qq.com SMTP:smtp.qq.com SMTP端口号:25 邮箱 ...

  6. 配置plsql远程连接oracle数据库

    1.首先安装plsql工具.(plsql如何安装就不说明了) 2.在plsql安装目录下新建“network”文件夹,在network文件夹中新建“admin”文件夹,在admin中新建“tnsnam ...

  7. Extjs6.2 项目学习系列(一)

     1. Extjs开发准备  (1).下载ExtJS  SDK GPL版 (本测试用版本 ext-6.2.0) : https://www.sencha.com/legal/gpl/ (2).下载Se ...

  8. 利用Google趋势来预测比特币价格

    预测市场是件极其困难和不可能的事情,特别是预测市场的短期行为.长期预期相对而言简单很多,因为很多事情把时间拉长,都可以预测,比如我预测烧汽油的车最终都会消失,把时间拉长,都是没问题的.但是这种预测没法 ...

  9. UOJ#416. 【APIO2018】铁人两项

    原文链接www.cnblogs.com/zhouzhendong/p/UOJ416.html 前言 完了完了SB选手Tarjan写挂. 题解 考虑先Tarjan缩个点双建个圆方树. 然后发现,确定起点 ...

  10. ftp无法上传问题

    1.背景 ftp服务端和客户端一直未做任何改动,无法上传属于突发状态,除此客户端外其他客户端上传正常 客户端(SunOS系统)可以正常连接ftp的xxx21端口,但是传输数据(文件)时无法正常传输 上 ...