Plug-in (Android)

Source: Internet
Author: User

Overview of plug-in design (Android)

First, Module Partitioning

    1. Basic modules include: initialization interface, plug-in loading interface, plug-in update interface, and buried point interface.

A) Initialize the interface: perform some necessary initialization work.

b) Plug-in loading interface: Includes verification of plug-ins and loading plug-in work.

c) Plug-in Update interface: Update the specified plug-in with server-side communication.

    1. Marketing module: Relies on the basic module, realizes the concrete business logic.

interface Components Figure 1

Plug-in Activity Figure 2

SDK Load sequence Diagram 3

Second, Specific Design

    1. Plug-in information planning

Focus on the plug-in loading mechanism, updates, security protection and subsequent version compatibility issues, need to consider the point there, plug-in information to write the location, plug-in information field planning, field names and information encryption method.

1) plugin Information write location

Add a file to the jar including plug-in information

Write plug-in information into the ZIP file format

2) plugin information to prevent tampering

In asymmetric encryption, the server encrypts the plug-in information with the private key, and the client decrypts the public key

Field name

Field meaning

is optional

Pluginname

Plug-in Name

Whether

Pluginver

Plugin version

Whether

Targetlibver

The corresponding LIB version

Is

Mainly for the compatibility of plugins and Lib

Minlibver

Required Lib minimum version

Whether

Entry

Plug-in Entry point

Is

Follow-up if you implement the entry point configuration required for self-booting

DexMD5

Plugin for Dex MD5

Whether

Prevent Dex from being tampered with

Extra

Additional Information key value pairs

Is

    1. Plug-in verification process

Plugin Check Flowchart 4

    1. Plug-in loading process

See Figure 3

2. Plugin update process

Initiate a plug-in update request as soon as the SDK is tuned (it is recommended that updates be made in another process to prevent running logic problems, resulting in no updates). Request plug-in application of the basic information, plug-in information, so that the server can follow certain conditions, issued plug-ins (later can be added grayscale update).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.