DexClassLoaderConfig

用于配置 DexClassLoader.

Author

M8Test, [email protected], https://m8test.com

Functions

Link copied to clipboard
abstract fun addClassFilter(filter: (className: String) -> Boolean)

添加一个类过滤器, 可以添加多个, 只有所有的 filter 都返回true, 该类才会通过当前的 DexClassLoader 加载.

Link copied to clipboard
abstract fun addParentClassFilter(filter: (className: String) -> Boolean)

添加一个父类过滤器, 可以添加多个, 只有所有的 filter 都返回true, 该类才会通过父类加载器加载.

Link copied to clipboard
abstract fun setDexPath(dexPath: String)

设置类和资源文件列表, 必须设置.

Link copied to clipboard
abstract fun setLibrarySearchPath(librarySearchPath: String)

设置原生库目录列表.

Link copied to clipboard
abstract fun setOptimizedDirectory(optimizedDirectory: String)

指定一个目录, 用于存储优化后的DEX文件(odex文件).

Link copied to clipboard
abstract fun setParent(parent: ClassLoader)

设置父类加载器, 可以不设置.

Link copied to clipboard
abstract fun setPriority(priority: Int)

设置类加载器优先级.