preface

I believe we all know that a lot of difficulties in Android app development, in fact, ultimately need plug-in technology to solve.

Nowadays, the use of plug-in technology is very common, such as wechat, QQ, Taobao, Tmall, Space, Ctrip, Dianping, mobile phone butler and so on, which we are not familiar with.

Plug-in technology can bring huge benefits to project development, such as: parallel and efficient development, module decoupling, lifting the limit of a single dex function exceeding 65535, dynamic update and upgrade, load on demand, etc.

To master plug-in technology, you need the following basic android and related knowledge, such as:

  1. Android application installation, loading process

  2. Android application running mechanism, life cycle call principle

  3. Principles of Android application resource compilation and packaging

  4. Principle of Reading Resources for Android applications

  5. The operating principle of AMS, PMS, NMS and other system services in Android system

  6. Incremental updating

  7. HOOK etc.

This paper will be from the basic principle of plug-in to Android plug-in and then to dachang architecture evolution practical application, summed up a more comprehensive and complete Android plug-in technology and the importance of plug-in to Android development.

Principle of plug-in

1. Class loading

2. Parent delegation mechanism

3. Load resources

4. Four components are supported

5 ProxyActivity agent

6 hook way

7 Other Components

8 Android dynamic loading framework DL architecture and basic principle analysis

9 Android plug-in framework DynamicLoadApk source analysis

A preliminary study of Android plug-in

1. Implementing a plug-in framework from scratch (1)

  • concept

  • Problems solved by plug-ins

  • Comparison of plug-in frameworks

  • Plug-in implementation

  • This implementation class

2. Implementing a plug-in framework from scratch (2)

  • The start process of the Activity

  • To find a place to Hook

  • Lu code phase

  • Proxy objects

  • Replace the original Intent

  • ActivityThread

  • Replace the intent for the broker back

  • Pay attention to

3. Implementing a plug-in framework from scratch (3)

  • Plug-in resource loading

  • Android resource loading process

  • ActivityManager

  • ActivityThread

  • AppCompatActivity

  • conclusion

Dachang architecture evolution

1.360 Plugin development DroidPlugin

  • Plug-in development 360 DroidPlugin source code analysis

  • Hook mechanism class diagram relationship

  • Sequence diagram relationship of Hook mechanism

  • Manifest Permission Application

  • What does the base Hook do?

  • ProxyHook

  • BaseHookHandle

  • HookedMethodHandler

  • ReplaceCallingPackageHookedMethodHandler

  • IO redirect

  • The recursive traversal

  • IPackageManager, for example

  • Binder agent for 360 DroidPlugin source code analysis for plug-in development

2. Didi VirtualApk

  • configuration

  • application

  • The principle of

  • conclusion

  • The problem

3. Plug-in based on VirtualAPK Android reconstruction

  • Plug-in Hello World

  • Choice of plug-in framework

  • Principle of plug-in

  • Introducing the pain of plugins

  • conclusion

4. Neptune framework of iQiyi plug-in principle analysis

  • Plug-in basic knowledge

  • Class loading

  • Resource usage restrictions in plug-in

  • Apk packaging process

  • Plug-in of four components

  • Neptune source code analysis

  • Plug-in Activity task stack

  • Handles broadcasts in plug-ins

360 open source comprehensive plug-in framework RePlugin combat

  • RePlugin introduction

  • Host access Steps

  • Plug-in Access Procedure

  • Using ChaJia

6. Analysis of Tencent plug-in framework Shadow project

  • Framework Introduction

  • Frame structure analysis

  • Sample Code androidmanifest.xml analysis

  • The Activity implementation

  • Replace the parent class of the plug-in Activity

  • The Service implementation

  • BroadcastReceiver implementation

  • ContentProvider implementation

  • The framework itself is dynamic

  • conclusion

Conclusion:

Plug-in technology can be said to be one of the skills Android senior engineers must have, from the concept of plug-in in 2012 (Android version), to the plug-in in 2016 flowers bloom, until now has become an essential focus of Android development, it can be said that, Plug-in technology is leading the advancement of Android technology.

I believe that a senior programmer must be diligent, can quickly master a large number of new technology, new framework, not only understand the principle, but also the new technology into the company’s products. This is an important measure of a programmer’s ability to work, so how to use technology freely? Only practice.

If you need the full Android advanced plug-in enhanced combat document, just support me on this article.

More support, you can get free information

Quick Access: Download it here! Sincerity full!!

More information on the Android architecture is available for free here.

Sorting is not easy, feel helpful friends can help like share support small series ~

Your support, my motivation; I wish you a bright future and continuous offer!!