We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
PathClassLoader和DexClassLoader都是Android提供给我们的ClassLoader,都能加载dex 网上很多文章都说PathClassLoader只能加载已经被系统安装过的apk,DexClassLoader无此限制,然而我自己测试是都可以 根据art源码来看,两者都继承自BaseDexClassLoader,最终都会创建一个DexFile,不同点是一个关键的参数:optimizedDirectory,PathClassLoader为null,DexClassLoader则使用传递进来的 然后会根据optimizedDirectory判断对应的oat文件是否已经生成(null则使用/data/dalvik-cache/),如果有且该oat对应的dex正确则直接加载,否则触发dex2oat(就是这家伙耗了我们宝贵的时间!!),成功则用生成的oat,失败则走解释执行 ps:貌似Q版做了优化,不会再卡死在dex2oat里了 根据加载外部dex的实验,DexClassLoader会触发dex2oat,而PathClassLoader不会
Sorry, something went wrong.
8.0前DexClassLoader多了一个optimizedDirectory,用来存dex2oat的目录,8.0后被废弃,两个完全一样
PathClassLoader 加载系统中已安装的APK DEX JAR DexClassLoader 加载APK DEX JAR 可以从SD卡中加载未安装的apk 并指定存放DEX 路径
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: