-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
21 changed files
with
4,779 additions
and
12 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
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,32 @@ | ||
var { default_config, config, storage_name: _storage_name } = require('../config.js')(runtime, global) | ||
let args = engines.myEngine().execArgv | ||
let storageConfig = storages.create(_storage_name) | ||
|
||
|
||
function readHMAccount() { | ||
let counti = 0 | ||
if (args.HMAccountText) { | ||
var text = args.HMAccountText | ||
let HMAccountlist = text.split('\n'); | ||
for (var i = 0; i < HMAccountlist.length; i++) { | ||
var t = HMAccountlist[i].split('----'); | ||
if (t[1] && t[0]) { | ||
if (config.huami_account_lists.map(v => v.username).indexOf(t[0].replace(/\r/g, '')) < 0) { | ||
config.huami_account_lists.push({ username: t[0].replace(/\r/g, ''), password: t[1].replace(/\r/g, '') }); | ||
counti++ | ||
} | ||
} | ||
} | ||
} else { | ||
toastLog('未输入账号文本!') | ||
} | ||
if (counti > 0) { | ||
storageConfig.put("huami_account_lists", config.huami_account_lists) | ||
toastLog("成功导入小米运动账号:" + counti + '个') | ||
} else { | ||
toastLog("所有账号已保存或账号文本为空!") | ||
} | ||
} | ||
|
||
readHMAccount() | ||
|
Oops, something went wrong.