Main work:
- Add App Productflavor, the same set of code can be compiled out plugins and apps
- Carrying Launcherfragment with activity
- Resolve Package Dependency Issues
- Permission request (account permissions, CDE permissions)
- Handling issues caused by package name changes
- Add app Upgrade Features
- Related UI, experience design
Use activity to carry the portal fragment
- Add Entry Activity
- Set Launcherfragment view to Activity's Contentview (lower view level than add fragment & avoid fragment recovery and rebuild issues)
- Call Launcherfragment's life cycle function manually
- Implements the interface of the previous host activity and provides a key implementation
Resolve Package Dependency Issues
Plug-ins Reference some of launcher's classes and functions, and plug-ins don't have to compile those classes into Dex, they just need to be compiled, so there are a lot of jars that are provided.
As a standalone app, you need to compile those jars inside Dex.
Two questions were encountered:
- Jar class Conflicts
- After changing to compile mode, the problem of Jar class conflict was encountered. The previous jar settings were unreasonable, and multiple jars would contain the same classes, and if all compile in, it would be a conflict.
- Workaround: Unpack the jar, delete the Extra class, repackage the jar (Java jar package compression, unzip the usage guide https://www.cnblogs.com/javastack/p/8761248.html).
- The number of methods exceeds 64K (there is already confusion and redundancy of resources)
- Many of the jars were not compiled into Dex, and the number of methods was exceeded after changing to compile mode.
- Processing method:
- Clean up code (delete old unused function code and related jar)
- Minus the dependency on fresco (in the case of plug-ins, Freso is not compiled into Dex.) App session Fresco will introduce a lot of code and so, we do not use most of the functions of imageloader, can be removed fresco. Fresco will also introduce so, as a system app, must put so to System/lib, now has a system application to put so to system/lib, if we also use fresco, then must consider so the version of the problem, high cost, error prone).
Permission request (account permissions, CDE permissions)
Before the host has the permission to apply for an account, as the app run, you must apply for account privileges, such as application for whitelist, etc.
Handling issues caused by package name changes
The host has uniformly modified the plug-in's package name, and in the plug-in, all the standard API-acquired package names are hosted. After changing to app, these APS get the package name that is the plugin's own package name.
The change of package name involves: Directed broadcast, advertisement SDK's judgment on package name, other sub-function's judgment on package name
App Upgrade Features
Plug-in upgrade is managed by the host, after the app session, you need to consider the upgrade function. There are two ways to upgrade:
- Use the store's silent upgrade feature
- Add your own upgrade logic &ui. With the Upgrade SDK, you can quickly complete the upgrade logic.
Related UI, experience design
- Logo
- Start diagram
- Big background &loading Background map
- Multi-desktop plug-in case, the left button, the upper key, the right button has a corresponding function, such as cutting the desktop, call out the notification bar. App, you can redefine these keys.
Plugin Project App Description