项目作者: kapodamy

项目描述 :
MultiDex Offline
高级语言: Java
项目地址: git://github.com/kapodamy/multidex-offline.git
创建时间: 2019-11-17T17:24:48Z
项目社区:https://github.com/kapodamy/multidex-offline

开源协议:Apache License 2.0

下载


MultiDex Offline

A Context-less version of MultiDex Suport library, this modified version for those cases where the context is unknown (like in a xposed module).

Modified version based on 2.0.1 from androidx (tree 652081201e50f0766dcfd7c650ef91d417f48597).

  1. public class MultiDexOffline {
  2. public static void install(
  3. SharedPreferences prefs,
  4. ApplicationInfo applicationInfo,
  5. String filesDir,
  6. ClassLoader classLoader
  7. );
  8. }

Summary:

Patches the application context class loader in the desired app by appending extra dex files
loaded from the application apk. This method should be called once.

Parameters:

  • prefs where save preference and to get the current dex version
  • filesDir Application private storage path, normally obtained from Context.getFilesDir()
  • classLoader classloader to patch.
  • throws RuntimeException if an error occurred preventing the classloader extension.

Notes:

  • Please use MultiDexExtractor.PREFS_FILE for the prefences filename, inside of shared_prefs folder under private files app.
    Example /data/data/com.example.app/shared_prefs/multidex.version.
  • If the target app already has the MultiDex support library, will be installed anyway (cannot be detected)