deeke-script-app 1.7.4 → 1.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@deekeScript/@type/interface/Access.d.ts +37 -0
- package/@deekeScript/@type/interface/Encrypt.d.ts +2 -2
- package/@deekeScript/@type/interface/FloatDialogs.d.ts +6 -0
- package/@deekeScript/@type/interface/KeyBoards.d.ts +27 -0
- package/@deekeScript/@type/interface/System.d.ts +6 -0
- package/@deekeScript/@type/interface/UiObject.d.ts +10 -5
- package/package.json +1 -1
- package/script/index.js +0 -1
- package/script/task/douyin_zan.js +30 -81
- package/script/task/dy.js +6 -13
- package/script/task/dyApp.js +4 -4
- package/script/task/dyCity.js +1 -1
- package/script/task/tool.js +7 -16
|
@@ -99,6 +99,43 @@ interface access {
|
|
|
99
99
|
* @return true 如果权限被永久拒绝
|
|
100
100
|
*/
|
|
101
101
|
public isMediaPermissionPermanentlyDenied(): boolean;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* 检查是否有文件存储权限(适配Android 8及以上版本)
|
|
105
|
+
*
|
|
106
|
+
* 权限说明:
|
|
107
|
+
* - Android 11+: 检查 MANAGE_EXTERNAL_STORAGE 权限(需要用户手动在设置中开启)
|
|
108
|
+
* - Android 8-10: 检查 READ_EXTERNAL_STORAGE 和 WRITE_EXTERNAL_STORAGE 权限
|
|
109
|
+
*
|
|
110
|
+
* @return true 如果有权限
|
|
111
|
+
*/
|
|
112
|
+
public hasStoragePermission(): boolean;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* 申请文件存储权限(适配Android 8及以上版本)
|
|
116
|
+
*
|
|
117
|
+
* 权限说明:
|
|
118
|
+
* - Android 11+: 引导用户去设置页面手动开启 MANAGE_EXTERNAL_STORAGE 权限
|
|
119
|
+
* - Android 8-10: 请求 READ_EXTERNAL_STORAGE 和 WRITE_EXTERNAL_STORAGE 权限
|
|
120
|
+
*
|
|
121
|
+
* 注意:这是异步操作,不会阻塞
|
|
122
|
+
* 如果用户禁用了权限,需要调用 isStoragePermissionPermanentlyDenied() 检查是否被永久拒绝
|
|
123
|
+
*/
|
|
124
|
+
public requestStoragePermission(): void;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* 检查文件存储权限是否被永久拒绝(用户选择了"不再询问"或禁用了权限)
|
|
128
|
+
*
|
|
129
|
+
* 权限说明:
|
|
130
|
+
* - Android 11+: 检查 MANAGE_EXTERNAL_STORAGE 权限状态
|
|
131
|
+
* - Android 8-10: 检查 READ_EXTERNAL_STORAGE 和 WRITE_EXTERNAL_STORAGE 是否被永久拒绝
|
|
132
|
+
*
|
|
133
|
+
* 如果返回true,说明用户之前拒绝过权限并选择了"不再询问",
|
|
134
|
+
* 或者用户禁用了权限,系统不会再弹出权限对话框,需要引导用户去设置页面手动开启
|
|
135
|
+
*
|
|
136
|
+
* @return true 如果权限被永久拒绝或禁用
|
|
137
|
+
*/
|
|
138
|
+
public isStoragePermissionPermanentlyDenied(): boolean;
|
|
102
139
|
}
|
|
103
140
|
|
|
104
141
|
export { };
|
|
@@ -44,7 +44,7 @@ interface Encrypt {
|
|
|
44
44
|
* @param iv
|
|
45
45
|
* @param input
|
|
46
46
|
*/
|
|
47
|
-
public
|
|
47
|
+
public aesCbcEncode(key: string, iv: string, input: string): string;
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* aescbc解密
|
|
@@ -52,7 +52,7 @@ interface Encrypt {
|
|
|
52
52
|
* @param iv
|
|
53
53
|
* @param input
|
|
54
54
|
*/
|
|
55
|
-
public
|
|
55
|
+
public aesCbcDecode(key: string, iv: string, input: string): string;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
export { };
|
|
@@ -22,6 +22,33 @@ interface KeyBoards {
|
|
|
22
22
|
* 删除文本框最后一个字符
|
|
23
23
|
*/
|
|
24
24
|
public delete():boolean;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 隐藏键盘
|
|
28
|
+
*/
|
|
29
|
+
public hide(): boolean;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 发送按键事件,支持各种按键
|
|
33
|
+
* 注意:输入法只能发送文本输入相关的按键,系统级按键(如HOME、BACK、POWER等)无法通过输入法发送
|
|
34
|
+
* @param key 按键代码,可以是字符串(如 "ENTER")或数字(如 KeyBoards.KEYCODE.ENTER)
|
|
35
|
+
*/
|
|
36
|
+
public pressKey(key: string | number): boolean;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 发送Enter键(回车键)
|
|
40
|
+
*/
|
|
41
|
+
public pressEnter(): boolean;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 发送Tab键(制表符)
|
|
45
|
+
*/
|
|
46
|
+
public pressTab(): boolean;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 发送空格键
|
|
50
|
+
*/
|
|
51
|
+
public pressSpace(): boolean;
|
|
25
52
|
}
|
|
26
53
|
|
|
27
54
|
export { };
|
|
@@ -109,6 +109,12 @@ interface System {
|
|
|
109
109
|
* @param mode 快速模式mode为fast,非快速模式为!fast
|
|
110
110
|
*/
|
|
111
111
|
public setAccessibilityMode(mode: string): void;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* 设置屏幕是否保持常亮
|
|
115
|
+
* @param keepOn 是否保持屏幕常亮
|
|
116
|
+
*/
|
|
117
|
+
public setKeepScreenOn(keepOn: boolean): void;
|
|
112
118
|
}
|
|
113
119
|
|
|
114
120
|
export { };
|
|
@@ -41,6 +41,11 @@ declare global {
|
|
|
41
41
|
*/
|
|
42
42
|
public cut(): boolean;
|
|
43
43
|
|
|
44
|
+
/**
|
|
45
|
+
* 粘贴内容到文本框
|
|
46
|
+
*/
|
|
47
|
+
public paste(): boolean;
|
|
48
|
+
|
|
44
49
|
/**
|
|
45
50
|
* 让控件获取焦点
|
|
46
51
|
*/
|
|
@@ -110,11 +115,6 @@ declare global {
|
|
|
110
115
|
*/
|
|
111
116
|
public parent(): UiObject;
|
|
112
117
|
|
|
113
|
-
/**
|
|
114
|
-
* 获取控件的层级
|
|
115
|
-
*/
|
|
116
|
-
public depth(): number;
|
|
117
|
-
|
|
118
118
|
/**
|
|
119
119
|
* 获取控件的绘制顺序
|
|
120
120
|
*/
|
|
@@ -192,6 +192,11 @@ declare global {
|
|
|
192
192
|
* 获取控件的包名
|
|
193
193
|
*/
|
|
194
194
|
public getPackageName(): string;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* 获取控件的提示文本
|
|
198
|
+
*/
|
|
199
|
+
public getHintText(): string;
|
|
195
200
|
}
|
|
196
201
|
}
|
|
197
202
|
export { };
|
package/package.json
CHANGED
package/script/index.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//这个文件不用编写代码
|
|
@@ -1,89 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Log.log(arguments);
|
|
5
|
-
console.log(arguments);
|
|
1
|
+
let e = {
|
|
2
|
+
log() {
|
|
3
|
+
Log.log(arguments), console.log(arguments);
|
|
6
4
|
},
|
|
7
5
|
comment() {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
console.log(
|
|
11
|
-
Gesture.click(
|
|
12
|
-
console.log(
|
|
13
|
-
System.sleep(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
console.log(inputTag);
|
|
17
|
-
Gesture.click(inputTag.bounds().left + Math.random() * inputTag.bounds().width(), inputTag.bounds().centerY());
|
|
18
|
-
console.log('开始输入评论');
|
|
19
|
-
System.sleep(500);
|
|
20
|
-
|
|
21
|
-
let iptTag = UiSelector().className('android.widget.EditText').editable(true).findOne();
|
|
22
|
-
console.log(iptTag);
|
|
23
|
-
Log.log(iptTag);
|
|
24
|
-
iptTag.setText('太棒了');
|
|
25
|
-
System.sleep(500);
|
|
26
|
-
|
|
27
|
-
let sendTag = UiSelector().id('com.ss.android.ugc.aweme:id/dqq').text('发送').findOne();
|
|
28
|
-
console.log(sendTag);
|
|
29
|
-
|
|
30
|
-
Gesture.click(sendTag.bounds().centerX(), sendTag.bounds().centerY());
|
|
31
|
-
System.sleep(500);
|
|
32
|
-
Gesture.back();
|
|
33
|
-
System.sleep(500);
|
|
6
|
+
var e = UiSelector().id("com.ss.android.ugc.aweme:id/comment_container").isVisibleToUser(!0).findOne(), e = (console.log(e),
|
|
7
|
+
Gesture.click(e.bounds().left + Math.random() * e.bounds().width(), e.bounds().centerY()),
|
|
8
|
+
console.log("打开评论窗口"), System.sleep(1200), UiSelector().className("android.widget.EditText").editable(!0).findOne()), e = (console.log(e),
|
|
9
|
+
Gesture.click(e.bounds().left + Math.random() * e.bounds().width(), e.bounds().centerY()),
|
|
10
|
+
console.log("开始输入评论"), System.sleep(500), UiSelector().className("android.widget.EditText").editable(!0).findOne()), e = (console.log(e),
|
|
11
|
+
Log.log(e), e.setText("太棒了"), System.sleep(500), UiSelector().id("com.ss.android.ugc.aweme:id/dqq").text("发送").findOne());
|
|
12
|
+
console.log(e), Gesture.click(e.bounds().centerX(), e.bounds().centerY()),
|
|
13
|
+
System.sleep(500), Gesture.back(), System.sleep(500);
|
|
34
14
|
},
|
|
35
|
-
|
|
36
15
|
backHome() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (homeTag) {
|
|
43
|
-
console.log('在首页');
|
|
44
|
-
}
|
|
45
|
-
Gesture.back();
|
|
46
|
-
console.log('返回');
|
|
47
|
-
System.sleep(1000);
|
|
48
|
-
} while (!homeTag && --backMaxCount >= 0);
|
|
16
|
+
var e;
|
|
17
|
+
console.log("开始返回主页");
|
|
18
|
+
let o = 5;
|
|
19
|
+
for (;(e = UiSelector().id("com.ss.android.ugc.aweme:id/x_t").isVisibleToUser(!0).findOne()) && console.log("在首页"),
|
|
20
|
+
Gesture.back(), console.log("返回"), System.sleep(1e3), !e && 0 <= --o; );
|
|
49
21
|
},
|
|
50
|
-
|
|
51
22
|
run() {
|
|
52
|
-
console.log(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
let tag = UiSelector().id('com.ss.android.ugc.aweme:id/fd9').isVisibleToUser(true).findOne();
|
|
64
|
-
console.log('点赞tag', tag);
|
|
65
|
-
Gesture.click(tag.bounds().left + Math.random() * tag.bounds().width(), tag.bounds().centerY());
|
|
66
|
-
System.sleep(1000);
|
|
67
|
-
console.log('点赞完成');
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (--commentCount >= 0) {
|
|
71
|
-
this.comment();
|
|
72
|
-
System.sleep(1000);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
let tag = UiSelector().id('com.ss.android.ugc.aweme:id/viewpager').desc('视频').scrollable(true).findOne();
|
|
77
|
-
tag.scrollForward();
|
|
78
|
-
System.sleep(3000);
|
|
79
|
-
} catch (e) {
|
|
80
|
-
console.log(e);
|
|
81
|
-
this.backHome();
|
|
82
|
-
}
|
|
23
|
+
console.log("开始进入应用"), App.launch("com.ss.android.ugc.aweme"), System.sleep(2e3);
|
|
24
|
+
let e = Storage.getInteger("task_douyin_zan_count"), o = Storage.getInteger("task_douyin_zan_comment");
|
|
25
|
+
for (console.log("配置:" + e + " 赞," + o + " 评论"); 0 < e || 0 < o; ) try {
|
|
26
|
+
var s;
|
|
27
|
+
console.log("zanCount: " + e + " commentCount: " + o), 0 <= --e && (s = UiSelector().id("com.ss.android.ugc.aweme:id/fd9").isVisibleToUser(!0).findOne(),
|
|
28
|
+
console.log("点赞tag", s), Gesture.click(s.bounds().left + Math.random() * s.bounds().width(), s.bounds().centerY()),
|
|
29
|
+
System.sleep(1e3), console.log("点赞完成")), 0 <= --o && (this.comment(),
|
|
30
|
+
System.sleep(1e3)), UiSelector().id("com.ss.android.ugc.aweme:id/viewpager").desc("视频").scrollable(!0).findOne().scrollForward(),
|
|
31
|
+
System.sleep(3e3);
|
|
32
|
+
} catch (e) {
|
|
33
|
+
console.log(e), this.backHome();
|
|
83
34
|
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
86
37
|
|
|
87
|
-
Log.setFile("douyin_zan.js.log");
|
|
88
|
-
newTask.run();
|
|
89
|
-
FloatDialogs.show('抖音任务完成');
|
|
38
|
+
Log.setFile("douyin_zan.js.log"), e.run(), FloatDialogs.show("抖音任务完成");
|
package/script/task/dy.js
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
let
|
|
1
|
+
let e = require("./dyApp"), o = UiSelector().id("name").findOne(), r = {
|
|
2
|
+
toker_view_video_keywords: Storage.get("toker_view_video_keywords"),
|
|
3
|
+
toker_view_video_second: Storage.getInteger("toker_view_video_second"),
|
|
4
|
+
toker_run_sex: Storage.getArray("toker_run_sex")
|
|
5
|
+
};
|
|
2
6
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// console.log(tag.click());
|
|
6
|
-
let config = {
|
|
7
|
-
toker_view_video_keywords: Storage.get('toker_view_video_keywords'),
|
|
8
|
-
toker_view_video_second: Storage.getInteger('toker_view_video_second'),
|
|
9
|
-
toker_run_sex: Storage.getArray('toker_run_sex'),
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
console.log(config, dyApp.getName());//获取json文件中的配置参数
|
|
13
|
-
|
|
14
|
-
FloatDialogs.show('提示', '请编写业务代码');
|
|
7
|
+
console.log(r, e.getName()), FloatDialogs.show("提示", "请编写业务代码");
|
package/script/task/dyApp.js
CHANGED
package/script/task/dyCity.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
FloatDialogs.show(
|
|
1
|
+
FloatDialogs.show("提示", "请编写业务代码");
|
package/script/task/tool.js
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
let
|
|
2
|
-
intoApp() {
|
|
3
|
-
|
|
4
|
-
},
|
|
5
|
-
|
|
6
|
-
backApp() {
|
|
7
|
-
//退出当前App
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
task(){
|
|
11
|
-
//任务代码
|
|
12
|
-
},
|
|
13
|
-
|
|
1
|
+
let a = {
|
|
2
|
+
intoApp() {},
|
|
3
|
+
backApp() {},
|
|
4
|
+
task() {},
|
|
14
5
|
run() {
|
|
15
|
-
FloatDialogs.show(
|
|
6
|
+
FloatDialogs.show("提示", "请编写业务代码");
|
|
16
7
|
}
|
|
17
|
-
}
|
|
8
|
+
};
|
|
18
9
|
|
|
19
|
-
|
|
10
|
+
a.run();
|