Author: Yangzhou

This article mainly introduces some new things (SUan) in the process of alipay Android terminal embracing AndroidX. Through the article, we can learn the following content:

  • What are the differences/difficulties in upgrading alipay to AndroidX?
  • Migrate AndroidX works well with Android Studio.
  • How do APK products fit into AndroidX?

background

The Support extension library died at 28 (the last official release) after Android Support was rebranded in 2018. AndroidX has been widely accepted by the community, many well-known frameworks have launched AndroidX adaptation version, the major App manufacturers also follow up AndroidX upgrade.

It is irresponsible to say that the absence of AndroidX will in the long run lead to a disconnect from the Android community components, which will not be able to enjoy the maintenance of components and make it difficult to integrate new components such as Paging 3.0, CameraX 1.0.0, Hilt 1.0.0, AppSearch 1.0.0, Not to mention upstart Jetpack Compose.

AndroidX industry situation

AndroidX is the successor to Support, carrying over the functionality of the original Support 28 and iterating out more extension libraries.

By looking at the top 50 apps in one market and analyzing the AndroidX fit of these apks, we found that 70% of the top 50 apps in the target group are AndroidX fit (the list is not authoritative, so don’t worry too much about ranking):

Application number Adapter AndroidX The percentage
50 35 70%

App Treasure List: Category page – App home page

AndroidX is still relatively good for apps in the industry. Although 70% of the samples are suitable, the rest also have 30%, and they are all top apps.

At this point, you might be asking: Why are there so many apps yet to be adapted?

“Technical debt” is often mentioned in software development, which means that every major system change is a test for developers. Specific to each independent App, differences in architecture, business research and development mode, component use appeal, and saturation of RESEARCH and development will all form resistance to upgrade.

So, alipay App, which will also face the above resistance, meets AndroidX, what kind of “spark” will rub out?

Wallet with AndroidX

In order to make the huge alipay App smoothly put on the robe of AndroidX, we need to design a technical solution that can be flexible and adaptable to many businesses. For businesses with willingness and appeal, deep source adaptation; We will try our best to provide solutions for those businesses that are temporarily “not allowed by strength”.

AndroidX adaptation point

AndroidX, through the analysis of the scheme, we know that the main processing of the following content:

  1. Java/Class source code, a variety of support classes, package replacement
  2. XML layout, replacing the support component name
  3. Build. Gradle, modify the dependency GAV
  4. Proguard, obfuscation rule substitution
  5. Pom dependency, dependency handling

Current status of Wallet architecture

Ant’s Android developers are very familiar with the construction system of Alipay, and there are some differences with the original. Let’s do a quick abstraction here so that non-ant Android developers can quickly get the big picture.

In terms of the construction of the project, we can draw two pictures, which I named as “traditional Android development” and “Alipay Android Development”. There is no discussion of Android plugins (which are almost endemic in China).

PS: There is no AAB launch plan for Google Play in August 2012. Interested students can imagine the big picture.

Comparing the two figures, the main difference lies in the difference built with AGP. MPaas is also an output of the commercialization of wallet system at present. Relying on deep build customization, combined with the runtime framework of the wallet, we fully realize the parallel development and dynamic delivery capabilities of the business. If I had to describe it in a few simple words, I would say it like this:

  • Business isolation = Bundle
  • Build separation = mPaas+Bundle
  • Product aggregation, dynamic publishing = mPaas+Portal+Bundle

This system has many advantages. Predecessors plant trees and descendants enjoy the shade, but it also needs to bear the pain points and pits left after deep customization.

Now that you know about AndroidX adaptation and wallet development patterns, you can probably guess the first problem with AndroidX adaptation: adaptation requires Java source code or Class bytecode modifications, and wallet services are isolated via APK, with almost no aars.

Resistance and power

On the alipay side, for Android development, we have benchmarking native development, including r&d efficiency, compiler chain alignment and so on.

Some of our obstacles to upgrading AndroidX include:

  • Support class library widely used, API compatibility challenges;
  • Many cross-team modules, the change is “100 regiment battle”;
  • [Fixed] The official upgrade mechanism does not apply and does not apply to wallet construction.
  • Layout dynamic container, conflict exists.

There’s plenty of motivation (in no particular order) :

  • Android Support is no longer maintained.
  • AndroidX community integration improved;
  • Modern Android development is based on AndroidX;
  • There is a demand for use in business.

After many times of communication and adjustment, the following points of our research plan should be guaranteed:

  • As few related parties as possible;
  • Compatibility ability;
  • Less invasive;
  • Pluggable fit.

You can’t require all business development to source for AndroidX at the same time, otherwise you might ask yourself: who am I? Where I am? What am I going to do?

Is it realistic to find someone to work with a module that has a history of few iterations, such as a module that hasn’t changed since 16 years ago?

From the standpoint of business development, adaptation should not be more complex than official solutions, and try to achieve no perceptual adaptation. Similar to Andoird, it provides switches that facilitate selective processing of services.

Wallet adaptation implementation

Here is an earlier drawing of the flow and stuck points for AndroidX in the build.

Class to replace

Java/Class code handling is targeted at the source code project and AAR, the wallet bundle is APK, and inside is compiled DEX and binary XML. In class replacement, we modified the mappings in the support replacement set to dex one by one by parsing the dex file structure.

Replace XML

XML in APK is binary plain; it is not a text file and has its own format. This format is simply called Chunk. We find the XML node where it is stored, replace the corresponding value of the node with the support set, and save it as binary XML after modification.

Bundle to replace

Combined with the previous two steps, a new APK is obtained. Replace the bundle/ devBundle dependency in Dependency.

product

When we adapt to an occupation, its products change.

After the modification is complete, we will output a TXT report for developers to check and use. Here is an example:

OLD: /Users/█████/work/android-phone-█████-git/build/build/outputs/apk/debug/█████-build-debug.apk
NEW: /Users/█████/work/android-phone-█████-git/build/build/bundle-cache/█████-build-debug.apk

class count: 53
xml count: 1

=================
====   DEX   ====
=================

* com/alipay/android/█████/█████/█████ (3)
* com/alipay/android/█████/██████████$█████ (3)
* com/alipay/mobile/██████████/███/██████████$12 (9)
* com/alipay/mobile/█████/█/█████ (45)
* com/alipay/mobile/██/██/█████$██████████ (28)
* com/alipay/mobile/█/███/███████████████ (3)
* com/alipay/android/█████/█████/███████ (3)
* com/alipay/mobile/██████/█/██████$████ (9)
* com/alipay/mobile/███/███/█████████ (13)
* com/alipay/android/███/██/█████ (20)
* com/alipay/mobile/███/█/████$█████ (9)
* com/alipay/android/███/█████████$█████ (12)
* com/alipay/mobile/██/█/██████████████ (27)
* com/alipay/mobile/█/███/███████████████ (3)
* com/alipay/mobile/██/██/█████/████████ (9)
* com/alipay/android/██/█/██████████████████ (6)
* com/alipay/mobile/█/███/███████████████ (3)
* com/alipay/android/█████/███/██████ (23)
* com/alipay/android/██/██/████████████ (30)
* com/huawei/android/█████/████████$███████████ (2880)
* com/alipay/android/████/██████$14 (4)
* com/alipay/android/█████/██/█████████ (41)
* com/alipay/android/████/████/██████████████████ (129)
* com/alipay/android/████/████████████ (22)
* com/alipay/android/████████/███████/█████████████████ (3)
* com/alipay/mobile/████/██████/███████/█████████████████████████ (3)
* com/alipay/android/████████/████/███████████████ (18)
* com/alipay/mobile/████████/███/████████████████████████ (27)
* com/alipay/android/████████/██████████████████$21 (17)
* com/alipay/mobile/██████/██████/████████████████████████████████$██████████████████████ (6)
* com/alipay/android/████████/██████████████████$22 (8)
* com/alipay/mobile/████████/███/██████████████████$5 (9)
* com/alipay/android/████████/██████████████████$20 (6)
* com/alipay/android/████████/████/█████████████ (23)
* com/alipay/mobile/██████/██████/██████████████████████████$4 (3)
* com/alipay/mobile/██████/██████/████████████████████████████████$████████████████████ (38)
* com/alipay/mobile/██████/██████/██████████████████████████$2 (4)
* com/alipay/mobile/██████/██████/██████████████████████████$8 (6)
* com/alipay/android/████████/██████████████████ (293)
* com/alipay/mobile/██████/██████/██████████████████████████$6 (3)
* com/alipay/mobile/██████/██████/█████████/███████████████$5 (9)
* com/alipay/android/████/████████████$1$1 (11)
* com/alipay/mobile/██████/██████/████████████████████████████████ (87)
* com/alipay/android/████████/█████/██████████████████████ (7)
* com/alipay/android/████████/tab/█████████████████$2 (4)
* com/alipay/android/████████/tab/█████████████████$1 (4)
* com/alipay/mobile/██████/██████/████████████████████████████████$2$1 (7)
* com/alipay/android/████/████████████$1 (5)
* com/alipay/android/████████/████/███████████████$████████████████████$1$1 (9)
* com/alipay/mobile/████████/███/████████████$5 (9)
* com/alipay/mobile/████/████████/█████████████████████ (2)
* com/alipay/mobile/████████/███/████████████████████████$4 (9)
* com/alipay/mobile/██████/██████/██████████████████████████ (306)

Reference detail:
* com/alipay/android/████████/█████/█████████████████████ (3)
    | android/support/annotation/NonNull -> androidx/annotation/NonNull (3)

* com/alipay/android/████████/██████████████████$█████████████ (3)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (3)

* com/alipay/mobile/████████/███/████████████$12 (9)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (9)

* com/alipay/mobile/████████/███/████████████ (45)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (45)

* com/alipay/mobile/██████/██████/██████████████████████████$LoginActivityOnWindowsFocusChangeReceiver (28)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (9)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (19)

* com/alipay/mobile/████/██████/█████████████████████████ (3)
    | android/support/annotation/NonNull -> androidx/annotation/NonNull (3)

* com/alipay/android/████████/███████/████████████ (3)
    | android/support/annotation/Nullable -> androidx/annotation/Nullable (3)

* com/alipay/mobile/████████/███/████████████$█████████████ (9)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (9)

* com/alipay/mobile/██████/██████/██████████████████████ (13)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (10)
    | android/support/annotation/NonNull -> androidx/annotation/NonNull (3)

* com/alipay/android/████████/████/████████████████████████ (20)
    | android/support/v4/app/FragmentPagerAdapter -> androidx/fragment/app/FragmentPagerAdapter (3)
    | android/support/v4/app/FragmentManager -> androidx/fragment/app/FragmentManager (11)
    | android/support/v4/app/Fragment -> androidx/fragment/app/Fragment (6)

* com/alipay/mobile/████████/███/████████████████████████$█████████████ (9)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (9)

* com/alipay/android/████████/██████████████████$TabChangeTimeRunnable (12)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (12)

* com/alipay/mobile/████████/███/██████████████████ (27)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (27)

* com/alipay/mobile/base/config/ConfigServiceLmacSyncCallback (3)
    | android/support/annotation/NonNull -> androidx/annotation/NonNull (3)

* com/alipay/mobile/██████/██████/█████████/███████████████ (9)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (9)

* com/alipay/android/████████/████/█████████████████████████████████████████ (6)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (6)

* com/alipay/mobile/█████/█████/████████████████████ (3)
    | android/support/annotation/NonNull -> androidx/annotation/NonNull (3)

* com/alipay/android/████████/████/███████████████ (23)
    | android/support/v4/app/Fragment -> androidx/fragment/app/Fragment (7)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (16)

* com/alipay/android/████████/████/████████████████████ (30)
    | android/support/v4/view/ViewPager -> androidx/viewpager/widget/ViewPager (18)
    | android/support/v4/app/FragmentManager -> androidx/fragment/app/FragmentManager (7)
    | android/support/v4/view/PagerAdapter -> androidx/viewpager/widget/PagerAdapter (5)

* com/huawei/android/██████████/███████████████$████████████████████ (2880)
    | android/support/v4/view/ViewPager -> androidx/viewpager/widget/ViewPager (277)
    | android/support/v4/app/FragmentManager -> androidx/fragment/app/FragmentManager (166)
    | android/support/v4/app/Fragment -> androidx/fragment/app/Fragment (270)
    | android/support/v4/view/PagerAdapter -> androidx/viewpager/widget/PagerAdapter (92)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (1018)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (542)
    | android/support/v4/view/ViewPager$OnPageChangeListener -> androidx/viewpager/widget/ViewPager$OnPageChangeListener (105)
    | android/support/v4/app/FragmentTransaction -> androidx/fragment/app/FragmentTransaction (144)
    | android/support/v4/util/ArrayMap -> androidx/collection/ArrayMap (106)
    | android/support/v4/app/FragmentPagerAdapter -> androidx/fragment/app/FragmentPagerAdapter (52)
    | android/support/v4/content/ContextCompat -> androidx/core/content/ContextCompat (48)
    | android/support/annotation/Nullable -> androidx/annotation/Nullable (26)
    | android/support/annotation/NonNull -> androidx/annotation/NonNull (34)

* com/alipay/android/████████/██████████████████$14 (4)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (4)

* com/alipay/android/████████/tab/█████████████████ (41)
    | android/support/v4/util/ArrayMap -> androidx/collection/ArrayMap (41)

* com/alipay/android/████████/████/██████████████████ (129)
    | android/support/v4/view/ViewPager -> androidx/viewpager/widget/ViewPager (69)
    | android/support/v4/view/ViewPager$OnPageChangeListener -> androidx/viewpager/widget/ViewPager$OnPageChangeListener (39)
    | android/support/v4/view/PagerAdapter -> androidx/viewpager/widget/PagerAdapter (21)

* com/alipay/android/████/████████████ (22)
    | android/support/v4/app/Fragment -> androidx/fragment/app/Fragment (5)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (14)
    | android/support/annotation/Nullable -> androidx/annotation/Nullable (3)

* com/alipay/android/████████/███████/█████████████████ (3)
    | android/support/annotation/Nullable -> androidx/annotation/Nullable (3)

* com/alipay/mobile/████/██████/███████/█████████████████████████ (3)
    | android/support/annotation/NonNull -> androidx/annotation/NonNull (3)

* com/alipay/android/████████/████/███████████████ (18)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (18)

* com/alipay/mobile/████████/███/████████████████████████ (27)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (27)

* com/alipay/android/████████/██████████████████$21 (17)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (17)

* com/alipay/mobile/██████/██████/████████████████████████████████$██████████████████████ (6)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (6)

* com/alipay/android/████████/██████████████████$22 (8)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (8)

* com/alipay/mobile/████████/███/██████████████████$5 (9)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (9)

* com/alipay/android/████████/██████████████████$20 (6)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (6)

* com/alipay/android/████████/████/█████████████ (23)
    | android/support/v4/view/ViewPager$OnPageChangeListener -> androidx/viewpager/widget/ViewPager$OnPageChangeListener (7)
    | android/support/v4/view/ViewPager -> androidx/viewpager/widget/ViewPager (16)

* com/alipay/mobile/██████/██████/██████████████████████████$4 (3)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (3)

* com/alipay/mobile/██████/██████/████████████████████████████████$████████████████████ (38)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (29)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (9)

* com/alipay/mobile/██████/██████/██████████████████████████$2 (4)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (4)

* com/alipay/mobile/██████/██████/██████████████████████████$8 (6)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (6)

* com/alipay/android/████████/██████████████████ (293)
    | android/support/v4/app/Fragment -> androidx/fragment/app/Fragment (23)
    | android/support/v4/util/ArrayMap -> androidx/collection/ArrayMap (3)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (184)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (77)
    | android/support/annotation/Nullable -> androidx/annotation/Nullable (6)

* com/alipay/mobile/██████/██████/██████████████████████████$6 (3)
    | android/support/annotation/Nullable -> androidx/annotation/Nullable (3)

* com/alipay/mobile/██████/██████/█████████/███████████████$5 (9)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (9)

* com/alipay/android/████/████████████$1$1 (11)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (11)

* com/alipay/mobile/██████/██████/████████████████████████████████ (87)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (69)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (18)

* com/alipay/android/████████/█████/██████████████████████ (7)
    | android/support/annotation/NonNull -> androidx/annotation/NonNull (7)

* com/alipay/android/████████/tab/█████████████████$2 (4)
    | android/support/v4/util/ArrayMap -> androidx/collection/ArrayMap (4)

* com/alipay/android/████████/tab/█████████████████$1 (4)
    | android/support/v4/util/ArrayMap -> androidx/collection/ArrayMap (4)

* com/alipay/mobile/██████/██████/████████████████████████████████$2$1 (7)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (7)

* com/alipay/android/████/████████████$1 (5)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (5)

* com/alipay/android/████████/████/███████████████$████████████████████$1$1 (9)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (9)

* com/alipay/mobile/████████/███/████████████$5 (9)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (9)

* com/alipay/mobile/████/████████/█████████████████████ (2)
    | android/support/v4/content/ContextCompat -> androidx/core/content/ContextCompat (2)

* com/alipay/mobile/████████/███/████████████████████████$4 (9)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (9)

* com/alipay/mobile/██████/██████/██████████████████████████ (306)
    | android/support/v4/app/FragmentActivity -> androidx/fragment/app/FragmentActivity (202)
    | android/support/v4/content/LocalBroadcastManager -> androidx/localbroadcastmanager/content/LocalBroadcastManager (22)
    | android/support/v4/app/FragmentManager -> androidx/fragment/app/FragmentManager (36)
    | android/support/v4/app/FragmentTransaction -> androidx/fragment/app/FragmentTransaction (38)
    | android/support/v4/app/Fragment -> androidx/fragment/app/Fragment (8)

=================
====   XML   ====
=================

* res/layout/███████████████.xml (1)

Reference detail:
* res/layout/███████████████.xml (1)
    | android.support.v4.view.ViewPager -> androidx.viewpager.widget.ViewPager
Copy the code

Based on apk’s ability to adapt to androidx, we package it as a separate jar project that can be integrated into the Gradle Plugin or published as a command line tool. The following describes how to use the command line:

Bx - input = SRC/test/resources / █ █ █ █ █. The apk - output = build/intermediateCopy the code
user % bx --help ___ __ _ ___ __ / | ____ ____/ /________ (_)___/ / |/ / / /| | / __ / __ / ___/ __ / / __ /| / / ___ |/  / / / /_/ / / / /_/ / / /_/ // | /_/ |_/_/ /_/__,_/_/ ____/_/__,_//_/|_| Translate apk to compat with AndroidX dependency. Usage: bx [OPTIONS] [ARGS]... Options: --help Displays help information --input ApK path to be processed, for example: --input=input.apk --output Product directory after processing, for example: --output=output-dir --clean Cleans intermediate products, Example: --clean=true --verbose Prints debug logs, Example: --verbose=true --jetify uses jetify processing, Example: --jetifye=trueCopy the code

Build a platform package, depending on the package type, need to compile engineering modules, plug-in logic such as coverage staking, etc., are different. Therefore, different types of builds take different time. Androidx’s incremental time is mainly derived from the volume of centralized escaped modules. With the increase of the number of independent adaptive modules, the centralized time will gradually decrease. According to data collection and analysis, the consumption time of a full escape is relatively stable at present. The ultimate ideal is to build the total package with little additional time.

After applying BX to the wallet build plug-in, bulk bundle compatibility can be done based on the Portal baseline. After the compatibility capability is enabled, the overall build time increases, and the incremental time can be gradually reduced through continuous optimization.

Native adaptation

Google itself provides an adaptation to AAR, which can be used directly. There are three ways to use the scheme:

  • One is through AS’s Migrtate AndroidX, which requires AGP version 3.2.0 or higher;
  • The second is to execute the JAR application independently, on the command line, regardless of context.
  • The third is the source code transformation, referring to the internal implementation of AGP, to linkage Jetify module.
./jetifier-standalone -i <source-library> -o <output-library>
Copy the code

For an introduction to Jetify, here’s an excerpt from the documentation:

Jetifier migrates Java, XML, POM, and ProGuard references to the Android.support.* package and changes them to point to the corresponding AndroidX.* package.

Since the ProGuard wildcard of Android.support.* does not always map directly to androidX.* packages, Jetifier generates all eligible alternatives.

If a type in the Android.support.* package does not come from any of the support library artifacts, Jetifier migrates the type as long as there is a mapping associated with the type. However, there is no guarantee that this migration will work, as there may not be enough generic mapping rules to cover all custom types.

The tool can even be executed in reverse, swapping androidx artifacts for supportg artifacts. If you’re interested, try the -r parameter.

In AS, we enable the Gradle parameter configuration to activate the Jetify mechanism, which preprocesses dependency and compiles an AAR that relies on the Support extension library to the AndroidX version.

android.useAndroidX=true
android.enableJetifier=true
Copy the code

For code implementation, Gradle’s Artifact Transform mechanism is used to disassemble dependent AAR files. Related to the source code can refer to: com. Android. Build. Gradle. Internal. Dependency. JetifyTransform

The transform will eventually call the aforementioned Jetify tool, which Google has made a separate Maven dependency:

Androidx. Jetifier: jetifier – core: 1.0.0 – beta10

Developer.android.com/jetpack/and…

subsequent

At present, alipay App has completed most of the business adaptation work, and some of the invasive use of Support extension library, such as reflection instantiation View needs business adaptation. The gray scale of the scheme is also continuing to advance.

In addition to AndroidX, we are also promoting the implementation of Kotlin, Java8 and other wallet construction systems. We expect that after the completion of AndroidX upgrade of wallet, the whole business can be closer to the original and modern Android development.

Welcome to AndroidX friends who are also actively embracing AndroidX, leave a message together and discuss the experience/lessons of adapting AndroidX.

Follow us every week for 3 mobile technology practices & dry goods for you to think about!