当前位置:网站首页>Code open source design and implementation ideas
Code open source design and implementation ideas
2022-07-30 04:31:00 【Nimrod__】
I. Background
Some customers have secondary development requirements for the project, and need to customize the function extension development of the existing APK.
In order to meet the needs of its secondary development, it is necessary to partially open the source code.
The principle for open source is mainly the principle of least known.
Mainly need to complete several goals:
1. Only open source relevant codes related to UI, and not open source other parts of the code.
2. For files that are not open sourced, document descriptions should be provided to explain related functions and related interfaces.
3. Finally, a source code file package that can be compiled and modified by the customer is formed and sent to the customer for use.
Second, design goals
1. Open source the project code to customers and provide a source code file.
2. The open source files only involve UI, not specific logic.
3. The source files that are open-sourced to customers must be compilable and run normally.
4. It is required to modify the code as little as possible in this open source process.
Three, detailed implementation plan and implementation ideas
Because the corresponding modular decoupling process has been done in the early stage of the project, this project is completed on the basis of the decoupling of the modular coupling relationship.
The basic solution is:
1. Open source the code that involves the UI lib and needs to be open sourced to the user for secondary development. This part of the code is retained according to the original file structure.
2. For the lib package not related to UI packaged into arr package and imported, keep the source code of this part, and obfuscate the logic code to avoid security problems at the code level.
3. Finally, a package of compliable and modifiable source code files that the user hides without revealing the part is formed and sent to the customer for use.
Basic ideas and steps
Current project block diagram:
Step 1: Determine the parts that need open source and those that don't (about 0.5 days)
Open source divides the components into two parts:
1. No need for open source parts:
- The processing of the data logic of the basic components and the gate-lib part, as well as some underlying hardware control logic, has nothing to do with the UI, so there is no need to open source it.
- Back-end interaction related lib: related to back-end interaction, this part is recommended to be reserved, exposure may have certain security problems, no need to open source.
2. Open source parts are required:
- Registration-related lib: It involves the UI interface related to user registration. When the customer needs to modify some face acquisition logic, the user can modify it, and it needs to be open sourced to the customer.
- Setting related modules lib: All scenarios involving apk system settings are easily involved in secondary development by customers, related to UI, and need to be open sourced to customers.
- Collection-related lib: related to face collection. If users have scene requirements for face collection and need to use it, they need to open source to customers.
- Platform UI-related lib: The main interface UI is related, and the key scenarios for customers to modify need to be open sourced to customers.
- app-lib: where the overall entrance of the app is located and needs to be open sourced to customers.
In general, according to the principle of least knowledge, this open source will only open source the part related to UI and open source modified by customers to customers.The rest are selected as arr packages for import.
Step 2: Package the parts that do not need open source into arr packages
1. Use the gradlecompiler plugin that comes with Android Studio to generate aar files, and at the same time obfuscate the aar package to avoid code-level security issues.
2. Import the arr package into the app directory, and reference the related functions in the app directory.
3. Repeat this step continuously to complete all libs that need to be packaged into aar packages.
Step 3: Form a new code project file with the packaged arr package and the code that needs to be open sourced.
Combine the packaged aar file and the open source code file, delete the packaged aar file lib, and form a new, runnable code file project.
Step 4: Self-test whether the package can be compiled and run normally.
Compile the project and check if it is normal.
After the compilation is completed, run the APK to test whether the main process is normal, simulate the customer's secondary development scenario, and whether it can meet the customer's needs.
Step 5: Write the necessary interface documents and explanation documents.
The related interfaces of the open source part to the non-open source part need to be supplemented with an interface document. The secondary development of the open source part requires a secondary development document
Step 6: Combine code source files and related documents and send to customer
边栏推荐
- [MRCTF2020]Hello_ misc
- 精品MySQL面试题,备战八月99%必问!过不了面试算我的
- Unity beginner 5 cameras follow, border control and simple particle control (2 d)
- Azure 开发者新闻快讯丨开发者7月大事记一览
- 图像视角矫正之透视变换矩阵(单应矩阵)/findHomography 与 getPerspectiveTransformd的区别
- Usage of exists in sql
- New LaaS protocol Elephant Swap provides ePLATO with sustainable premium space
- Charles 替换 接口响应信息
- Detailed transport layer
- Go 学习笔记(84)— Go 项目目录结构
猜你喜欢

Arrays and Structures

SSM框架简单介绍

Discourse 自定义头部链接(Custom Header Links)

WEB penetration of information collection

山西省第二届网络安全技能大赛(企业组)部分赛题WP(七)

unity初学5 摄像机跟随,边界控制以及简单的粒子控制(2d)

Shanxi group (enterprises) in the second network security skills competition part problem WP (7)

05全局配置文件application.properties详解
![Advanced [C] array to participate in the function pointer](/img/00/67dd77463670c8ebd5d004dbe12549.jpg)
Advanced [C] array to participate in the function pointer

Pytorch framework learning record 3 - the use of Transform
随机推荐
Simple experiment with BGP
The underlying mechanism of the function
海外多家权威媒体热议波场TRON:为互联网去中心化奠定基础
The 2nd Shanxi Province Network Security Skills Competition (Enterprise Group) Partial WP (10)
小程序 wx.miniProgram.navigateTo 跳转地址不能是tabbar地址
山西省第二届网络安全技能大赛(企业组)部分赛题WP(九)
labelme的使用技巧
Reverse Analysis Practice 2
Unity3D Application模拟进入前后台及暂停
Notes on "The Law of Construction"---Chapter 10 Typical Users and Scenarios
phpoffice edit excel document
使用EFR32作为Zigbee/Thread的sniffer的用法
MYSQL 唯一约束
Pytorch framework learning record 4 - the use of datasets (torchvision.dataset)
2.6 Merge Sort
【Redis高手修炼之路】Jedis——Jedis的基本使用
High Concurrency Framework Disruptor
Usage of exists in sql
【 notes 】 the beauty of the software engineering - column 31 | software testing are responsible for the quality of products?
我的Go+语言初体验——祝福留言小系统,让她也可以感受到你的祝福