Skip to content

Commit

Permalink
fix(core.manager): API 26保留odex过程
Browse files Browse the repository at this point in the history
从AOSP源码和API 26虚拟机测试来看,DexClassLoader中new File的逻辑是API 27才去掉的。API 26的odex实际可能不生效。

fix Tencent#828
  • Loading branch information
shifujun committed Feb 25, 2022
1 parent 50678f5 commit 264369d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ public class ODexBloc {
private static ConcurrentHashMap<String, Object> sLocks = new ConcurrentHashMap<>();

/**
* DexClassLoader的optimizedDirectory参数从API 26起就无效了
* DexClassLoader的optimizedDirectory参数从API 27起就无效了
* 此方法统一判断这一特性是否生效
*
* @return <code>true</code>表示ODexBloc还有作用
*/
public static boolean isEffective() {
return Build.VERSION.SDK_INT < Build.VERSION_CODES.O;
return Build.VERSION.SDK_INT < Build.VERSION_CODES.O_MR1;
}

public static void oDexPlugin(File apkFile, File oDexDir, File copiedTagFile) throws InstallPluginException {
Expand Down

0 comments on commit 264369d

Please sign in to comment.