After my application is installed, how do I check whether the second DEX has been loaded?

Our application has three dexes in APK, which are built by gradle with multidex function

After installing the application,

>Is the main DEX and the second DEX loaded by the same loader? > How do I check if the second (classes2. DEX) and third have finished loading? Can I check the code dynamically? > Or can you introduce any relevant documents about the class (or DEX) loading process in Android? I'm not familiar with it

thank you.

resolvent:

I haven't delved into art code yet, but you can read what the multidex support library does for Dalvik here:

>Yes. All classes in agile are loaded by the same classloader. When your application is loaded, the multidex tool:

>Extract redundant DEX files from. APK and place them in their own. Zip files in the data directory (so that they cannot be distinguished from APK and classloader), > get classloader from the context of your application and add these new. Zip files to the list that classloader knows

The same classloader not only loads individual dexes, but also uses the same classloader without multidex to load them

>When your application loads, you should automatically set additional dexes. It is not easy to check this code, but you can verify it locally by checking the device log. > there are some Android docs about the architecture of art and Dalvik. However, there is nothing better than reading the source code:)

> ART > Dalvik

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>