Skip to content

Conversation

cundong
Copy link
Contributor

@cundong cundong commented Sep 12, 2017

Adapter to Android O's All-Of-the-Time Compilation

@jiongxuan
Copy link
Contributor

jiongxuan commented Sep 13, 2017

如刚才讨论所述。建议做些修改:

  1. 需考虑到插件卸载、升级、同版本覆盖的情况(详细见PluginManagerServer.uninstall和update等)
  2. 针对getDexParentDir,建议直接返回/data/data/xxx/app_p_a/oat/arm64这样的目录,其中arm64可能需要通过listFiles来遍历寻找
  3. 由于listFiles可能会消耗一些性能(虽然文件少的话可能消耗也少),建议在“内存”中缓存mDexDir路径

以上操作务必只针对Android O及以上,O以下的走原来的逻辑,无任何变化,以减少影响

以上,辛苦 @cundong 继续精进。加油!

Copy link
Contributor

@jiongxuan jiongxuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

辛苦啦

File f = getDexFile();
// 文件存在,且大小不为 0 时,才返回 true。
return f.exists() && FileUtils.sizeOf(f) > 0;
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N_MR1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

此处建议保持和原来一致,重点修改getDexFile和getDexParentDir

其中,针对getDexParentDir,建议直接返回/data/data/xxx/app_p_a/oat/arm64这样的目录,其中arm64可能需要通过listFiles来遍历寻找

Copy link
Contributor

@jiongxuan jiongxuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

非常好,没啥问题了。

@jiongxuan jiongxuan merged commit f3db164 into Qihoo360:dev Sep 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants