Skip to content

Commit

Permalink
2.0.5 - 修复解锁功能参数默认值丢失 优化配置工具参数文件
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperMonster003 committed Mar 16, 2021
1 parent 257f27c commit c5e7fe5
Show file tree
Hide file tree
Showing 15 changed files with 305 additions and 3,381 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@

[comment]: <> (Version history only shows last 3 versions)

# v2.0.5
###### 2021/03/16
* `修复` 解锁功能配置参数无法获取默认值的问题 _[`issue #444`](https://github.com/SuperMonster003/Ant-Forest/issues/444)_
* `修复` 排行榜可点击样本位于屏幕底部区域时可能出现的点击偏移问题 _[`issue #443`](https://github.com/SuperMonster003/Ant-Forest/issues/443)_
* `优化` 运行提示对话框放弃任务时增加不再提示选项 _[`issue #445`](https://github.com/SuperMonster003/Ant-Forest/issues/445)_
* `优化` 清除配置工具参数文件中混入的非必要参数数据

# v2.0.4
###### 2021/03/15
* `修复` 好友森林动态列表首次展开后无法继续展开的问题 _[`issue #436`](https://github.com/SuperMonster003/Ant-Forest/issues/436)_
Expand All @@ -135,14 +142,6 @@
* `优化` 好友森林动态列表增加展开结果判断以增加展开成功率 _[`issue #436`](https://github.com/SuperMonster003/Ant-Forest/issues/436)_
* `优化` storage模块在高版本系统解析JSON时可自动修复乱码行

# v2.0.2
###### 2021/02/11
* `修复` 配置工具及Floaty结果的自动更新功能无效的问题
* `修复` 排行榜页面列表结尾的好友可能被跳过检查的问题
* `修复` 配置工具从列表选择应用时的数据筛选错误
* `修复` 高版本安卓设备可能无法判断系统应用的问题
* `优化` 增加主账户头像本地样本尺寸检测以防止尺寸越界

##### 更多版本历史可参阅
* [CHANGELOG-2.md](https://github.com/SuperMonster003/Ant-Forest/blob/master/documents/CHANGELOG-2.md) ( 2.x 版本 )
* [CHANGELOG-1.md](https://github.com/SuperMonster003/Ant-Forest/blob/master/documents/CHANGELOG-1.md) ( 1.x 版本 )
Expand Down
35 changes: 23 additions & 12 deletions ant-forest-launcher.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Alipay ant forest intelligent collection script launcher
* @since Mar 15, 2021
* @version 2.0.4
* @since Mar 16, 2021
* @version 2.0.5
* @author SuperMonster003
* @see https://github.com/SuperMonster003/Ant-Forest
*/
Expand Down Expand Up @@ -3880,7 +3880,7 @@ let $$init = {
return debugInfo(['跳过"运行前提示"', '>屏幕未亮起']);
}
if (!$$unlk.is_init_unlocked) {
return debugInfo(['跳过"运行前提示"', '>设备未解锁']);
return debugInfo(['跳过"运行前提示"', '>设备未锁定']);
}
}
return true;
Expand Down Expand Up @@ -3953,6 +3953,17 @@ let $$init = {
.show();
},
onNegative(d) {
let _quitNow = () => {
d.dismiss();
$$app.monitor.insurance.interrupt().remove();
// language=JS
messageAction('`放弃${$$app.task_name}任务`'.ts, 1, 1, 0, 2);
exit();
};

if (!$$cfg.prompt_before_running_quit_confirm) {
return _quitNow();
}
dialogsx.builds((() => {
// language=JS
let _z = '`当前未设置任何${$$app.task_name}定时任务\n\n`'.ts;
Expand All @@ -3961,15 +3972,15 @@ let $$init = {
.filter(task => task.id !== $$app.monitor.insurance.id).length
? [['提示', 'default'], [_q, 'default']]
: [['注意', 'caution'], [_z + _q, 'warn']];
return [_title, _cnt, 0, 'B', ['确认放弃任务', 'caution'], 1];
return [_title, _cnt, 0, 'B', ['确认放弃任务', 'caution'], 1, 1];
})()).on('negative', (ds) => {
dialogsx.dismiss(ds);
}).on('positive', (ds) => {
dialogsx.dismiss(ds, d);
$$app.monitor.insurance.interrupt().remove();
// language=JS
messageAction('`放弃${$$app.task_name}任务`'.ts, 1, 1, 0, 2);
exit();
dialogsx.dismiss(ds);
$$sto.af_cfg.put('config', {
prompt_before_running_quit_confirm: !ds.isPromptCheckBoxChecked(),
});
_quitNow();
}).show();
},
onPositive(d) {
Expand Down Expand Up @@ -5137,7 +5148,7 @@ let $$af = {
let _x = cX(0.896);
let _y = cYx(0.09);
let _w = _capt.getWidth() - _x;
let _h = _capt.getHeight() - _y;
let _h = Math.min(_capt.getHeight(), uH) - _y;
let _clip = images.clip(_capt, _x, _y, _w, _h);
let _res = imagesx.matchTemplate(_clip, 'ic_fetch', {
max_results: 15,
Expand All @@ -5150,9 +5161,9 @@ let $$af = {

return _res.points.reverse().map((pt) => ({
icon_y: pt.y + _y,
item_y: Number(Math.min(pt.y + _y + cYx(16), uH)),
item_y: pt.y + _y + cYx(12),
act_desc: String(this.act_desc),
}));
})).filter(o => o.item_y < uH);
}

/**
Expand Down
27 changes: 24 additions & 3 deletions ant-forest-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2918,17 +2918,18 @@ let $$init = {
}).show();

let _thd = threadsx.start(function () {
let _set_range = '设置范围';
while (1) {
if (_diag.getSelectedIndex() === 1) {
if (_diag.getActionButton('positive') === dialogsx._text._btn.K) {
_diag.setActionButton('positive', '设置范围');
_diag.setActionButton('positive', _set_range);
_diag.setActionButton('neutral', null);
_posFunc = _posSetRange;
}
} else {
if (_diag.getActionButton('positive') === '设置范围') {
if (_diag.getActionButton('positive') === _set_range) {
_diag.setActionButton('positive', dialogsx._text._btn.K);
_diag.setActionButton('neutral', 'R');
_diag.setActionButton('neutral', dialogsx._text._btn.R);
_posFunc = _posDefault;
}
}
Expand Down Expand Up @@ -3438,6 +3439,7 @@ let $$init = {
},
config() {
let sess_cfg_mixed = deepCloneObject($$cfg.ses);
excludeProjectBackup();
writeUnlockStorage();
writeBlacklist();
$$sto.af_cfg.put('config', sess_cfg_mixed); // only 'cfg' reserved now (without unlock, blacklist, etc)
Expand All @@ -3446,6 +3448,10 @@ let $$init = {

// tool function(s) //

function excludeProjectBackup() {
delete sess_cfg_mixed.project_backup_info;
}

function writeUnlockStorage() {
let ori_config = deepCloneObject($$sto.def.unlock);
let tmp_config = {};
Expand All @@ -3458,6 +3464,7 @@ let $$init = {
$$sto.unlock.put('config', Object.assign(
{}, $$sto.unlock.get('config', {}), tmp_config)
);
delete sess_cfg_mixed.unlock;
}

function writeBlacklist() {
Expand Down Expand Up @@ -5534,6 +5541,20 @@ $$view.page.new('消息提示', 'message_showing_page', (t) => {
view.setHintText(this.map[($$cfg.ses[this.config_conj] || $$sto.def.af[this.config_conj]).toString()]);
},
}))
.add('checkbox_switch', new Layout('放弃任务时显示放弃提示', {
default_state: true,
config_conj: 'prompt_before_running_quit_confirm',
listeners: {
_checkbox_switch: {
check(state) {
$$save.session(this.config_conj, !!state);
},
},
},
updateOpr(view) {
view['_checkbox_switch'].setChecked(!!$$cfg.ses[this.config_conj]);
},
}))
.add('checkbox_switch', new Layout('息屏或上锁启动时自动跳过', {
default_state: true,
config_conj: 'prompt_before_running_auto_skip',
Expand Down
7 changes: 7 additions & 0 deletions documents/CHANGELOG-2.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
******
### 版本历史 - 2.x
******
# v2.0.5
###### 2021/03/16
* `修复` 解锁功能配置参数无法获取默认值的问题 _[`issue #444`](https://github.com/SuperMonster003/Ant-Forest/issues/444)_
* `修复` 排行榜可点击样本位于屏幕底部区域时可能出现的点击偏移问题 _[`issue #443`](https://github.com/SuperMonster003/Ant-Forest/issues/443)_
* `优化` 运行提示对话框放弃任务时增加不再提示选项 _[`issue #445`](https://github.com/SuperMonster003/Ant-Forest/issues/445)_
* `优化` 清除配置工具参数文件中混入的非必要参数数据

# v2.0.4
###### 2021/03/15
* `修复` 好友森林动态列表首次展开后无法继续展开的问题 _[`issue #436`](https://github.com/SuperMonster003/Ant-Forest/issues/436)_
Expand Down
Loading

0 comments on commit c5e7fe5

Please sign in to comment.