Skip to content

Commit

Permalink
1.9.10 修复监听器失效/Schema子参数/THREADS阻塞/Dollar全局变量污染/保险任务/findViewByTag/配置…
Browse files Browse the repository at this point in the history
…工具列表排序/获取排行榜好友列表/能量球点击间隔配置 启动工具深度代码重构
  • Loading branch information
SuperMonster003 committed Dec 31, 2019
1 parent 715addc commit 482c729
Showing 12 changed files with 2,543 additions and 2,117 deletions.
3,213 changes: 1,832 additions & 1,381 deletions Ant_Forest_Launcher.js

Large diffs are not rendered by default.

1,079 changes: 549 additions & 530 deletions Ant_Forest_Settings.js

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions Modules/EXT_APP.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let _$und = o => typeof o === "undefined";
let _$func = f => typeof f === "function";
let _$$und = o => typeof o === "undefined";
let _$$func = f => typeof f === "function";

let Intent = android.content.Intent;
let parseIntentFlag = function (flag) {
@@ -9,18 +9,18 @@ let parseIntentFlag = function (flag) {
return flag;
};

if (_$und(app.launch)) {
app.launch = app.launchPackage;
if (_$$und(app.launch)) {
app.launch = pkg => app.launchPackage(pkg);
}
if (!_$func(app.parseUri)) {
if (!_$$func(app.parseUri)) {
app.parseUri = function (uri) {
if (uri.startsWith("file://")) {
return app.getUriForFile(uri);
}
return android.net.Uri.parse(uri);
};
}
if (!_$func(app.getUriForFile)) {
if (!_$$func(app.getUriForFile)) {
app.getUriForFile = function (path) {
if (path.startsWith("file://")) {
path = path.substring(7);
@@ -33,7 +33,7 @@ if (!_$func(app.getUriForFile)) {
app.fileProviderAuthority, file);
};
}
if (!_$func(app.intent)) {
if (!_$$func(app.intent)) {
app.intent = function (i) {
let intent = new Intent();
if (i.className && i.packageName) {
@@ -82,7 +82,7 @@ if (!_$func(app.intent)) {
return intent;
};
}
if (!_$func(app.startActivity)) {
if (!_$$func(app.startActivity)) {
app.startActivity = function (i) {
if (typeof (i) == "string") {
if (runtime.getProperty("class." + i)) {
@@ -105,7 +105,7 @@ if (!_$func(app.startActivity)) {

};
}
if (!_$func(app.intentToShell)) {
if (!_$$func(app.intentToShell)) {
app.intentToShell = function (i) {
let cmd = "";

6 changes: 3 additions & 3 deletions Modules/EXT_DEVICE.js
Original file line number Diff line number Diff line change
@@ -42,13 +42,13 @@ module.exports = Object.assign({

// updated: Dec 3, 2019
function debugInfo(msg, info_flag, forcible_flag) {
global["$flag"] = global["$flag"] || {};
let $flag = global["$flag"];
global["$$flag"] = global["$$flag"] || {};
let $$flag = global["$$flag"];

let _showSplitLine = typeof showSplitLine === "undefined" ? showSplitLineRaw : showSplitLine;
let _messageAction = typeof messageAction === "undefined" ? messageActionRaw : messageAction;

let global_flag = $flag.debug_info_avail;
let global_flag = $$flag.debug_info_avail;
if (!global_flag && !forcible_flag) return;
if (global_flag === false || forcible_flag === false) return;

48 changes: 26 additions & 22 deletions Modules/EXT_GLOBAL_OBJ.js
Original file line number Diff line number Diff line change
@@ -139,6 +139,8 @@ let ext = {
};

Object.assign(global, {
$$1: x => x === 1,
$$2: x => x === 2,
$$num: function (x) {
// do not use arrow function here
let _isNum = a => classof(a, "Number");
@@ -190,11 +192,9 @@ let ext = {
// introduced since ES6
$$sym: x => classof(x, "Symbol"),
// primitive (contains 6 types with Symbol)
get $$prim() {
return (x) => {
return this.$$num(x) || this.$$str(x) || this.$$bool(x)
|| this.$$nul(x) || this.$$und(x) || this.$$sym(x);
};
$$prim: function (x) {
return this.$$num(x) || this.$$str(x) || this.$$bool(x)
|| this.$$nul(x) || this.$$und(x) || this.$$sym(x);
},
$$func: x => classof(x, "Function"),
// `Array.isArray(x);` fine or not ?
@@ -210,26 +210,30 @@ let ext = {
$$date: x => classof(x, "Date"),
$$regexp: x => classof(x, "RegExp"),
$$rex: x => classof(x, "RegExp"),
get $$nulOrUnd() {
return function (x) {
this.$$nul(x) || this.$$und(x)
}.bind(this);
$$nulOrUnd: function (x) {
return this.$$nul(x) || this.$$und(x);
},
$$fin: x => isFinite(x),
$$inf: x => !isFinite(x),
$$nan: x => isNaN(x),
get $$posNum() {
return x => this.$$num(x) && x > 0;
$$posNum: function (x) {
return this.$$num(x) && x > 0;
},
$$noPosNum: function (x) {
return this.$$num(x) && x <= 0;
},
$$natNum: function (x) {
return this.$$zehNum(x) && x >= 0;
},
get $$natNum() {
return x => this.$$zehNum(x) && x >= 0;
$$negNum: function (x) {
return this.$$num(x) && x < 0;
},
get $$negNum() {
return x => this.$$num(x) && x < 0;
$$noNegNum: function (x) {
return this.$$num(x) && x >= 0;
},
// `Number.isInteger(x)` since ES6
get $$zehNum() {
return x => this.$$num(x) && (x | 0) === x;
$$zehNum: function (x) {
return this.$$num(x) && (x | 0) === x;
},
$$0: x => x === 0,
// `!~x` is also cool
@@ -245,12 +249,12 @@ let ext = {
},
// `classof(x, "JavaObject");` also fine
__isJvo__: x => !!x["getClass"],
get _checkJvoType() {
return (x, rex) => this.__isJvo__(x) && !!x.toString().match(rex);
_checkJvoType: function (x, rex) {
return this.__isJvo__(x) && !!x.toString().match(rex);
},
get _checkJvoClass() {
let _classMatch = (x, rex) => x.getClass().toString().match(rex);
return (x, rex) => this.__isJvo__(x) && _classMatch(x, rex);
_checkJvoClass: function (x, rex) {
let _classMatch = (x, rex) => x["getClass"].toString().match(rex);
return this.__isJvo__(x) && _classMatch(x, rex);
},
get $$jvo() {
return {
20 changes: 10 additions & 10 deletions Modules/EXT_IMAGES.js
Original file line number Diff line number Diff line change
@@ -57,12 +57,12 @@ module.exports = Object.assign({
* @return {boolean}
*/
function _permitCapt(params) {
let _$und = x => typeof x === "undefined";
let _$isJvo = x => x && !!x["getClass"];
let _$$und = x => typeof x === "undefined";
let _$$isJvo = x => x && !!x["getClass"];
let _key = "_$_request_screen_capture";
let _fg = global[_key];

if (_$isJvo(_fg)) {
if (_$$isJvo(_fg)) {
if (_fg) return true;
_fg.incrementAndGet();
} else {
@@ -79,9 +79,9 @@ function _permitCapt(params) {
let _clickAction = typeof clickAction === "undefined" ? clickActionRaw : clickAction;
let _restartThisEngine = typeof restartThisEngine === "undefined" ? restartThisEngineRaw : restartThisEngine;
let _getSelector = typeof getSelector === "undefined" ? getSelectorRaw : getSelector;
let _$sel = _getSelector();
let _$$sel = _getSelector();

if (_$und(_par.restart_this_engine_flag)) {
if (_$$und(_par.restart_this_engine_flag)) {
_par.restart_this_engine_flag = true;
} else {
let _self = _par.restart_this_engine_flag;
@@ -97,9 +97,9 @@ function _permitCapt(params) {
_debugInfo("已开启弹窗监测线程");
let _thread_prompt = threads.start(function () {
let _kw_remember = id("com.android.systemui:id/remember");
let _sel_remember = () => _$sel.pickup(_kw_remember);
let _sel_remember = () => _$$sel.pickup(_kw_remember);
let _rex_sure = /START NOW||/;
let _sel_sure = type => _$sel.pickup(_rex_sure, type);
let _sel_sure = type => _$$sel.pickup(_rex_sure, type);

if (_waitForAction(_sel_sure, 5000)) {
if (_waitForAction(_sel_remember, 1000)) {
@@ -126,9 +126,9 @@ function _permitCapt(params) {
_thread_prompt.interrupt();
return _debugInfo("截图权限申请结果: " + _req_result);
}
if (typeof $flag !== "undefined") {
if (!$flag.debug_info_avail) {
$flag.debug_info_avail = true;
if (typeof $$flag !== "undefined") {
if (!$$flag.debug_info_avail) {
$$flag.debug_info_avail = true;
_debugInfo("开发者测试模式已自动开启", 3);
}
}
2 changes: 1 addition & 1 deletion Modules/MODULE_DEFAULT_CONFIG.js
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ module.exports = {
account_log_back_in_max_continuous_times: 3, // with this value, switching back will not always happen infinitely
main_account_info: {}, // stores information of the "main account" user
max_own_forest_balls_ready_time: 800, // 200 <= x <= 2000, safe: 500; max check time for ant forest homepage balls being ready
energy_balls_click_interval: 30, // 10 <= x <= 150; as the saying goes, "Haste makes waste"
balls_click_interval: 120, // 10 <= x <= 500; as the saying goes, "Haste makes waste"
homepage_monitor_switch: true, // set true value if you need continuously check your own energy balls
homepage_monitor_threshold: 2, // 1 <= x <= 3; continuously check your own energy balls if min countdown is within threshold
homepage_background_monitor_switch: false, // return to homepage and monitor if own energy min countdown is less than some threshold
Loading

0 comments on commit 482c729

Please sign in to comment.