forked from TonyJiangWJ/Ant-Forest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa4cac1
commit f338b7f
Showing
18 changed files
with
97 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,6 @@ ExternalUnlockDevice.js | |
*.txt | ||
*.txt.* | ||
*.db | ||
logs/ | ||
logs/ | ||
unit/小米运动刷步数.js | ||
lib/FakeWalkDataUtil.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* 代理runtime中的方法,目前针对loadDex进行优化 | ||
* @param {ScriptRuntime} __global__ | ||
* @returns | ||
*/ | ||
module.exports = function (__global__) { | ||
|
||
/** | ||
* 代理loadDex,相同路径的dex文件不再重复加载 | ||
* 使用: | ||
* require('./lib/Runtimes')(global) | ||
* checkAndLoadDex(pathToDexFile) | ||
* 当检测到当前脚本未加载过此文件则执行加载,如果已加载则跳过加载 | ||
* @returns | ||
*/ | ||
function delegateLoadDex() { | ||
if (__global__.delegated_loadDex) { | ||
console.warn('loadDex已经代理') | ||
return | ||
} | ||
__global__.loadedDex = {} | ||
console.info('代理runtime.loadDex') | ||
let checkAndLoadDex = function (filePath) { | ||
console.verbose('准备校验文件是否加载', filePath) | ||
let fullPath = files.path(filePath) | ||
if (__global__.loadedDex[fullPath]) { | ||
console.log(fullPath, '已加载') | ||
return true | ||
} | ||
console.verbose('未加载', filePath) | ||
__global__.loadedDex[fullPath] = true | ||
runtime.loadDex(filePath) | ||
} | ||
// 挂载到全局 | ||
__global__['checkAndLoadDex'] = checkAndLoadDex | ||
__global__.delegated_loadDex = true | ||
} | ||
|
||
// 执行代理 | ||
delegateLoadDex() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters