deeke-script-app 1.0.0

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.
Files changed (36) hide show
  1. package/.vscode/settings.json +9 -0
  2. package/@deekeScript/@type/Class/Rect.d.ts +14 -0
  3. package/@deekeScript/@type/Class/UiSelector.d.ts +192 -0
  4. package/@deekeScript/@type/README.md +19 -0
  5. package/@deekeScript/@type/interface/App.d.ts +93 -0
  6. package/@deekeScript/@type/interface/Console.d.ts +46 -0
  7. package/@deekeScript/@type/interface/DeekeScript.d.ts +9 -0
  8. package/@deekeScript/@type/interface/Device.d.ts +78 -0
  9. package/@deekeScript/@type/interface/Dialogs.d.ts +41 -0
  10. package/@deekeScript/@type/interface/Encrypt.d.ts +58 -0
  11. package/@deekeScript/@type/interface/Engines.d.ts +24 -0
  12. package/@deekeScript/@type/interface/FloatDialogs.d.ts +20 -0
  13. package/@deekeScript/@type/interface/Gesture.d.ts +54 -0
  14. package/@deekeScript/@type/interface/Http.d.ts +41 -0
  15. package/@deekeScript/@type/interface/Intent.d.ts +12 -0
  16. package/@deekeScript/@type/interface/Storage.d.ts +109 -0
  17. package/@deekeScript/@type/interface/System.d.ts +102 -0
  18. package/@deekeScript/@type/interface/UiObject.d.ts +223 -0
  19. package/README.md +35 -0
  20. package/deekeScript.json +2089 -0
  21. package/images/a.png +0 -0
  22. package/package.json +42 -0
  23. package/script/index.js +44 -0
  24. package/script/index.js.map +1 -0
  25. package/script/task/task.js +88 -0
  26. package/script/task/task.js.map +1 -0
  27. package/script/task/test.js +57 -0
  28. package/script/task/test.js.map +1 -0
  29. package/src/deekeScriptZipBuild +47 -0
  30. package/src/index.ts +1 -0
  31. package/src/task/code.js +4 -0
  32. package/src/task/task.ts +16 -0
  33. package/src/task/test.ts +14 -0
  34. package/test.js +169 -0
  35. package/tsconfig.json +107 -0
  36. package/webpack.config.js +56 -0
package/images/a.png ADDED
Binary file
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "deeke-script-app",
3
+ "version": "1.0.0",
4
+ "description": "DeekeScript应用",
5
+ "main": "src/index.ts",
6
+ "scripts": {
7
+ "build": "tsc",
8
+ "deekeScript-zip-build": "tsc && ts-node --esm src/deekeScriptZipBuild",
9
+ "dev": "tsc --watch",
10
+ "webpack-build": "webpack --mode production",
11
+ "deekeScript-zip-build-webpack": "webpack --mode production && ts-node --esm src/deekeScriptZipBuild"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/DeekeScript/deekeScript.git"
16
+ },
17
+ "keywords": [
18
+ "DeekeScript应用"
19
+ ],
20
+ "author": "jiangqiao",
21
+ "license": "ISC",
22
+ "bugs": {
23
+ "url": "https://github.com/DeekeScript/deekeScript/issues"
24
+ },
25
+ "homepage": "https://github.com/DeekeScript/deekeScript#readme",
26
+ "devDependencies": {
27
+ "@types/adm-zip": "^0.5.7",
28
+ "@types/node": "^22.13.9",
29
+ "file-loader": "^6.2.0",
30
+ "glob": "^11.0.0",
31
+ "terser-webpack-plugin": "^5.3.11",
32
+ "ts-loader": "^9.5.1",
33
+ "typescript": "^5.8.2",
34
+ "webpack": "^5.97.1",
35
+ "webpack-cli": "^6.0.1",
36
+ "webpack-dev-server": "^5.2.0",
37
+ "webpack-obfuscator": "^3.5.1"
38
+ },
39
+ "dependencies": {
40
+ "adm-zip": "^0.5.16"
41
+ }
42
+ }
@@ -0,0 +1,44 @@
1
+ function a0_0x3e94(_0x139366, _0x4b2b8f) {
2
+ var _0x478c4b = a0_0x478c();
3
+ return a0_0x3e94 = function (_0x3e9444, _0x41861c) {
4
+ _0x3e9444 = _0x3e9444 - 0x1e8;
5
+ var _0x31ab4d = _0x478c4b[_0x3e9444];
6
+ return _0x31ab4d;
7
+ }, a0_0x3e94(_0x139366, _0x4b2b8f);
8
+ }
9
+ function a0_0x478c() {
10
+ var _0x5396c2 = [
11
+ '82523NfvZkQ',
12
+ '2275874lCBmrf',
13
+ '1522700QLvFcI',
14
+ '396607QtJJCz',
15
+ '12ixRFbi',
16
+ '176gkgCMU',
17
+ '9iwtOWD',
18
+ '37425620jhyswB',
19
+ '11461545cVZeEv',
20
+ '919545CSGECb'
21
+ ];
22
+ a0_0x478c = function () {
23
+ return _0x5396c2;
24
+ };
25
+ return a0_0x478c();
26
+ }
27
+ (function (_0x1c8e05, _0x27a368) {
28
+ var _0x5e096e = a0_0x3e94, _0x40bbc7 = _0x1c8e05();
29
+ while (!![]) {
30
+ try {
31
+ var _0x1eae55 = parseInt(_0x5e096e(0x1ea)) / 0x1 + -parseInt(_0x5e096e(0x1e8)) / 0x2 + parseInt(_0x5e096e(0x1ed)) / 0x3 * (-parseInt(_0x5e096e(0x1e9)) / 0x4) + parseInt(_0x5e096e(0x1f0)) / 0x5 * (parseInt(_0x5e096e(0x1eb)) / 0x6) + -parseInt(_0x5e096e(0x1f1)) / 0x7 * (parseInt(_0x5e096e(0x1ec)) / 0x8) + -parseInt(_0x5e096e(0x1ef)) / 0x9 + parseInt(_0x5e096e(0x1ee)) / 0xa;
32
+ if (_0x1eae55 === _0x27a368)
33
+ break;
34
+ else
35
+ _0x40bbc7['push'](_0x40bbc7['shift']());
36
+ } catch (_0x1ac8a4) {
37
+ _0x40bbc7['push'](_0x40bbc7['shift']());
38
+ }
39
+ }
40
+ }(a0_0x478c, 0xa9792), ((() => {
41
+ 'use strict';
42
+ })()));
43
+ //# sourceMappingURL=index.js.map
44
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":["//这个文件不用编写代码"],"sourceRoot":"","file":"index.js"}
@@ -0,0 +1,88 @@
1
+ function a2_0x7afd(_0x4ce54a, _0x1c9112) {
2
+ var _0x1299b0 = a2_0x1299();
3
+ return a2_0x7afd = function (_0x7afd94, _0x2edfcc) {
4
+ _0x7afd94 = _0x7afd94 - 0xaf;
5
+ var _0x4e6d5f = _0x1299b0[_0x7afd94];
6
+ return _0x4e6d5f;
7
+ }, a2_0x7afd(_0x4ce54a, _0x1c9112);
8
+ }
9
+ (function (_0x406a69, _0x3a18f0) {
10
+ var _0x3b50c2 = a2_0x7afd, _0x4830a2 = _0x406a69();
11
+ while (!![]) {
12
+ try {
13
+ var _0x144450 = parseInt(_0x3b50c2(0xbc)) / 0x1 + parseInt(_0x3b50c2(0xb0)) / 0x2 * (parseInt(_0x3b50c2(0xbd)) / 0x3) + parseInt(_0x3b50c2(0xbe)) / 0x4 + -parseInt(_0x3b50c2(0xc1)) / 0x5 + parseInt(_0x3b50c2(0xb3)) / 0x6 * (-parseInt(_0x3b50c2(0xb2)) / 0x7) + parseInt(_0x3b50c2(0xb7)) / 0x8 * (parseInt(_0x3b50c2(0xb6)) / 0x9) + -parseInt(_0x3b50c2(0xc0)) / 0xa * (-parseInt(_0x3b50c2(0xaf)) / 0xb);
14
+ if (_0x144450 === _0x3a18f0)
15
+ break;
16
+ else
17
+ _0x4830a2['push'](_0x4830a2['shift']());
18
+ } catch (_0x2fb71b) {
19
+ _0x4830a2['push'](_0x4830a2['shift']());
20
+ }
21
+ }
22
+ }(a2_0x1299, 0x96ddc), ((() => {
23
+ 'use strict';
24
+ var _0x5e0212 = a2_0x7afd, _0x4bac00 = {
25
+ 'rnPqt': _0x5e0212(0xbb),
26
+ 'pzSnH': function (_0x4f37be, _0x998bfc) {
27
+ return _0x4f37be + _0x998bfc;
28
+ }
29
+ }, _0x31369d = _0x4bac00[_0x5e0212(0xb1)]['split']('|'), _0x460c53 = 0x0;
30
+ while (!![]) {
31
+ switch (_0x31369d[_0x460c53++]) {
32
+ case '0':
33
+ continue;
34
+ case '1':
35
+ console[_0x5e0212(0xba)](_0x164ef0[_0x5e0212(0xb4)](0x1));
36
+ continue;
37
+ case '2':
38
+ var _0x164ef0 = {
39
+ 'name': 0x1,
40
+ 'getName': function () {
41
+ var _0x1d1a3d = _0x5e0212;
42
+ return this[_0x1d1a3d(0xb8)];
43
+ },
44
+ 'setName': function (_0x511f14) {
45
+ var _0x385a79 = _0x5e0212, _0x1c47a1 = 0x2a;
46
+ return _0x1c47a1[_0x385a79(0xbf)](), this['name'];
47
+ }
48
+ };
49
+ continue;
50
+ case '3':
51
+ console[_0x5e0212(0xba)](_0x4bac00[_0x5e0212(0xb9)]('name\x20=\x20', _0x164ef0[_0x5e0212(0xb5)]()));
52
+ continue;
53
+ case '4':
54
+ console['log'](_0x164ef0[_0x5e0212(0xb4)](0x0));
55
+ continue;
56
+ }
57
+ break;
58
+ }
59
+ })()));
60
+ function a2_0x1299() {
61
+ var _0x340ca6 = [
62
+ 'getName',
63
+ '135HlUBTA',
64
+ '449304cfAFVX',
65
+ 'name',
66
+ 'pzSnH',
67
+ 'log',
68
+ '0|2|3|4|1',
69
+ '283198FmMeJx',
70
+ '645477XyENrA',
71
+ '431456qXRHXv',
72
+ 'foo',
73
+ '7278510enxfoH',
74
+ '1741555JpIvOc',
75
+ '11AdGTWi',
76
+ '2eGEFFB',
77
+ 'rnPqt',
78
+ '7Umddct',
79
+ '7261548oLLYav',
80
+ 'setName'
81
+ ];
82
+ a2_0x1299 = function () {
83
+ return _0x340ca6;
84
+ };
85
+ return a2_0x1299();
86
+ }
87
+ //# sourceMappingURL=task\task.js.map
88
+ //# sourceMappingURL=task\task.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack://my-first-deeke-script-app/./src/task/task.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAeA,OAAA,gBAAA,EAAY,SAAA,gBAAA,KAAA,CAAZ;;;YAfA,IAAI,SAAA,GAAK;AAAA,sBACL,KADK;AAAA,yBAEL,EAAO;;2BACI,oBAAA;iBAHN;AAAA,yBAML,EAAO,UAAC,SAAD;+CACC,SAAA;2BAEH,SAAA,gBAAA,KACM,WAAA;iBAVN;AAAA,aAAT;;;YAaA,OAAA,gBAAA,8CAAwB,SAAA,gBAAA,IAAxB;;;YACA,OAAA,MAAA,EAAY,SAAA,gBAAA,KAAA,CAAZ","sourcesContent":["let my = {\n name: 1,\n getName() {\n return this.name;\n },\n\n setName(name: number) {\n let x: any = 42;\n\n x.foo(); // 虽然 `x` 没有 `foo` 方法,但 TypeScript 不会报错\n return this.name;\n }\n}\nconsole.log(\"name = \" + my.getName());\nconsole.log(my.setName(0));\nconsole.log(my.setName(1));\n"],"sourceRoot":"","file":"task\\task.js"}
@@ -0,0 +1,57 @@
1
+ (function (_0x58a13a, _0x11fc67) {
2
+ var _0x3f2084 = a1_0x5a6f, _0x121118 = _0x58a13a();
3
+ while (!![]) {
4
+ try {
5
+ var _0x1719ae = parseInt(_0x3f2084(0x133)) / 0x1 + -parseInt(_0x3f2084(0x12c)) / 0x2 * (-parseInt(_0x3f2084(0x137)) / 0x3) + -parseInt(_0x3f2084(0x12d)) / 0x4 + -parseInt(_0x3f2084(0x134)) / 0x5 * (parseInt(_0x3f2084(0x132)) / 0x6) + -parseInt(_0x3f2084(0x12e)) / 0x7 + parseInt(_0x3f2084(0x135)) / 0x8 * (-parseInt(_0x3f2084(0x136)) / 0x9) + parseInt(_0x3f2084(0x131)) / 0xa;
6
+ if (_0x1719ae === _0x11fc67)
7
+ break;
8
+ else
9
+ _0x121118['push'](_0x121118['shift']());
10
+ } catch (_0x508b86) {
11
+ _0x121118['push'](_0x121118['shift']());
12
+ }
13
+ }
14
+ }(a1_0x232a, 0xbe141), ((() => {
15
+ 'use strict';
16
+ var _0xe0b354 = a1_0x5a6f;
17
+ var _0x53c4c8 = [
18
+ 0x1,
19
+ 0x2,
20
+ 0x3
21
+ ], _0x3cad47 = _0x53c4c8[-0x1];
22
+ function _0x9180b0() {
23
+ var _0x2433cb = a1_0x5a6f, _0x132e07 = {};
24
+ console[_0x2433cb(0x130)](_0x132e07[_0x2433cb(0x12f)]());
25
+ }
26
+ console[_0xe0b354(0x130)](_0x53c4c8), _0x9180b0();
27
+ })()));
28
+ function a1_0x5a6f(_0x2917b1, _0x132842) {
29
+ var _0x232ac6 = a1_0x232a();
30
+ return a1_0x5a6f = function (_0x5a6f59, _0x2cc407) {
31
+ _0x5a6f59 = _0x5a6f59 - 0x12c;
32
+ var _0x44865a = _0x232ac6[_0x5a6f59];
33
+ return _0x44865a;
34
+ }, a1_0x5a6f(_0x2917b1, _0x132842);
35
+ }
36
+ function a1_0x232a() {
37
+ var _0x486b0c = [
38
+ '2606324lQHXSm',
39
+ 'someMethod',
40
+ 'log',
41
+ '35764010SHvKDW',
42
+ '1669362dtMNsB',
43
+ '246118wvTlyh',
44
+ '25hlwUQP',
45
+ '8VfuXsq',
46
+ '10877337gnjRCJ',
47
+ '41802maRYma',
48
+ '78aFaMeJ',
49
+ '2461296OGgrYB'
50
+ ];
51
+ a1_0x232a = function () {
52
+ return _0x486b0c;
53
+ };
54
+ return a1_0x232a();
55
+ }
56
+ //# sourceMappingURL=task\test.js.map
57
+ //# sourceMappingURL=task\test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack://my-first-deeke-script-app/./src/task/test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAAA,IAAM,SAAA,GAAM;AAAA,eAAA;AAAA,eAAA;AAAA,eAAA;AAAA,SAAZ,EAGM,SAAA,GAAQ,SAAA,CAAI,IAAJ,CAHd;IAKA,SAAS,SAAT;mCACQ,SAAA,GAAW;QAEf,OAAA,iBAAA,EAAY,SAAA,iBAAA,GAAZ;;IAIJ,OAAA,iBAAA,EAAY,SAAZ,GACA,SAAA","sourcesContent":["const arr = [1, 2, 3];\r\n\r\n// 自动抛出 RangeError,因为数组索引越界 192.168.1.3:8088\r\nconst value = arr[-1]; // TypeScript 会提示 `undefined`,但是在运行时会引发错误\r\n\r\nfunction test() {\r\n let obj: any = {};\r\n // 访问 null 时,会触发 TypeError\r\n console.log(obj.someMethod()); // TypeError: Cannot read property 'someMethod' of null\r\n}\r\n\r\n\r\nconsole.log(arr);\r\ntest();\r\n"],"sourceRoot":"","file":"task\\test.js"}
@@ -0,0 +1,47 @@
1
+ const path = require('path'); // CommonJS 方式引入 path‌:ml-citation{ref="1,2" data="citationList"}
2
+ const fs = require('fs'); // 引入 fs 模块‌:ml-citation{ref="5" data="citationList"}
3
+ const AdmZip = require('adm-zip'); // 引入 adm-zip 库‌:ml-citation{ref="3,4" data="citationList"}
4
+
5
+ // 获取上层目录路径
6
+ const parentDir = path.join(__dirname, '..');
7
+ console.log('开始执行打包');
8
+
9
+ fs.unlink(path.join(parentDir, 'deekeScript.zip'), (err) => {
10
+ if (err) {
11
+ //没有文件
12
+ } else {
13
+ //console.log('deekeScript.zip文件已删除');
14
+ }
15
+ });
16
+
17
+ // 创建 zip 实例
18
+ const zip = new AdmZip();
19
+
20
+ // 递归添加文件并排除目录
21
+ function addFilesToZip(directory) {
22
+ const files = fs.readdirSync(directory);
23
+
24
+ files.forEach(file => {
25
+ const fullPath = path.join(directory, file);
26
+ const relativePath = path.relative(parentDir, fullPath);
27
+
28
+ // 排除 DeekeScript 和 node_modules 目录
29
+ if (relativePath.startsWith('src') || relativePath.startsWith('.vscode') || relativePath.startsWith('.git') || relativePath.startsWith('@deekeScript') || relativePath.startsWith('node_modules')) {
30
+ console.log('排除目录:' + relativePath);
31
+ return;
32
+ }
33
+
34
+ // 处理子目录或文件
35
+ if (fs.statSync(fullPath).isDirectory()) {
36
+ addFilesToZip(fullPath); // 递归处理子目录
37
+ } else {
38
+ zip.addLocalFile(fullPath, path.dirname(relativePath));
39
+ }
40
+ });
41
+ }
42
+
43
+ // 执行压缩
44
+ addFilesToZip(parentDir);
45
+ zip.writeZip(path.join(parentDir, 'deekeScript.zip'));
46
+
47
+ console.log('打包完成');
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ //这个文件不用编写代码
@@ -0,0 +1,4 @@
1
+
2
+
3
+ let b = new UiSelector();
4
+ b.myCustomMethod($1);
@@ -0,0 +1,16 @@
1
+ let my = {
2
+ name: 1,
3
+ getName() {
4
+ return this.name;
5
+ },
6
+
7
+ setName(name: number) {
8
+ let x: any = 42;
9
+
10
+ x.foo(); // 虽然 `x` 没有 `foo` 方法,但 TypeScript 不会报错
11
+ return this.name;
12
+ }
13
+ }
14
+ console.log("name = " + my.getName());
15
+ console.log(my.setName(0));
16
+ console.log(my.setName(1));
@@ -0,0 +1,14 @@
1
+ const arr = [1, 2, 3];
2
+
3
+ // 自动抛出 RangeError,因为数组索引越界 192.168.1.3:8088
4
+ const value = arr[-1]; // TypeScript 会提示 `undefined`,但是在运行时会引发错误
5
+
6
+ function test() {
7
+ let obj: any = {};
8
+ // 访问 null 时,会触发 TypeError
9
+ console.log(obj.someMethod()); // TypeError: Cannot read property 'someMethod' of null
10
+ }
11
+
12
+
13
+ console.log(arr);
14
+ test();
package/test.js ADDED
@@ -0,0 +1,169 @@
1
+ const Common = {
2
+ id(name) {
3
+ return UiSelector().id(this.fullId(name));
4
+ },
5
+
6
+ fullId(name) {
7
+ return this.package() + ':id/' + name;
8
+ },
9
+
10
+ package() {
11
+ return 'com.tencent.mm';
12
+ },
13
+
14
+ click(tag) {
15
+ return Gesture.click(tag.bounds().left + tag.bounds().width() * Math.random(), tag.bounds().top + tag.bounds().height() * Math.random());
16
+ },
17
+
18
+ sleep(mill, randMill) {
19
+ if (!randMill) {
20
+ randMill = mill / 2 * Math.random();
21
+ mill /= 2;
22
+ }
23
+
24
+ System.sleep(mill + randMill);
25
+ },
26
+
27
+ back(times) {
28
+ while (times-- > 0) {
29
+ Gesture.back();
30
+ System.sleep(500);
31
+ }
32
+ },
33
+
34
+ find(func) {
35
+ let i = 5;
36
+ while (i-- > 0) {
37
+ let res = func();
38
+ if (res) {
39
+ return res;
40
+ }
41
+ System.sleep(1000);//查找3次,每次都没有就休眠1秒钟
42
+ }
43
+ return undefined;
44
+ }
45
+ }
46
+
47
+ const task = {
48
+ run(name) {
49
+ const concat = Common.find(() => UiSelector().textContains('通讯录').filter(v => {
50
+ return v && v.id() == Common.fullId('icon_tv');
51
+ }).findOne());
52
+
53
+ console.log(concat);
54
+ if (!concat) {
55
+ throw new Error('找不到通讯录');
56
+ }
57
+
58
+ Common.click(concat);
59
+ System.sleep(1200);
60
+
61
+ const tag = Common.find(() => UiSelector().textContains('标签').filter(v => {
62
+ return v.id() == Common.fullId('n9');
63
+ }).findOne());
64
+ console.log(tag);
65
+ if (!tag) {
66
+ throw new Error('找不到标签');
67
+ }
68
+ Common.click(tag);
69
+ System.sleep(1200);
70
+
71
+ const myTag = Common.find(() => UiSelector().textContains(name).filter(v => {
72
+ return v.id() === Common.fullId('hs8');
73
+ }).findOne());
74
+ console.log(myTag);
75
+ if (!myTag) {
76
+ throw new Error('找不到标签:' + name);
77
+ }
78
+ Common.click(myTag);
79
+ System.sleep(1200);
80
+
81
+ let tags = UiSelector().textMatches('[\\s\\S]+').className('android.widget.TextView').filter(v => {
82
+ return v.id() === Common.fullId('kbq');
83
+ }).find();
84
+ if (tags.length == 0) {
85
+ console.log('没有记录')
86
+ return true;
87
+ }
88
+
89
+ for (let i in tags) {
90
+ Common.click(tags[i]);
91
+ Common.sleep(2000);
92
+
93
+ this.clickSendMsg();
94
+ this.sendMsg(msg);
95
+ }
96
+
97
+ return true;
98
+ },
99
+
100
+ clickSendMsg() {
101
+ let tags = Common.find(() => UiSelector().clickable(false).filter(v => {
102
+ return v.bounds().width() === v.bounds().height() && v.id() === Common.fullId('h5n');
103
+ }).find());
104
+
105
+ if (tags.length === 0) {
106
+ throw new Error('出错了,找不到发送消息按钮');
107
+ }
108
+ Common.click(tags[0]);
109
+ Common.sleep(2000);
110
+ },
111
+
112
+ sendMsg(msg) {
113
+ let ipt = Common.find(UiSelector().className('android.widget.EditText').filter(v => {
114
+ return v.id() === Common.fullId('bkk');
115
+ }).findOne());
116
+
117
+ if (!ipt) {
118
+ throw new Error('找不到输入框');
119
+ }
120
+
121
+ Common.click(ipt);
122
+ Common.sleep(2000);
123
+
124
+ ipt = Common.find(UiSelector().className('android.widget.EditText').filter(v => {
125
+ return v.id() === Common.fullId('bkk');
126
+ }).findOne());
127
+
128
+ if (!ipt) {
129
+ throw new Error('找不到输入框');
130
+ }
131
+
132
+ Gesture.back();
133
+ ipt.setText(msg);
134
+ Common.sleep(2000);
135
+
136
+ const send = Common.find(UiSelector().className('android.widget.Button').filter(v => {
137
+ return v.bounds().left > Device.width() * 0.8 && v.bounds().top > Device.height() * 0.8;
138
+ }).findOne());
139
+ if (!send) {
140
+ throw new Error('找不到发送按钮');
141
+ }
142
+
143
+ Common.click(send);
144
+ Common.sleep(2000);
145
+ Common.back(2);
146
+ }
147
+ }
148
+
149
+ let k = 3;
150
+ // while (k-- > 0) {
151
+ // try {
152
+ // App.launch(Common.package());//打开抖音
153
+ // Common.sleep(8000);
154
+ // if (task.run('嘀客', '😄 你好呀~')) {
155
+ // FloatDialogs.show('温馨提示', '执行完成');
156
+ // }
157
+ // } catch (e) {
158
+ // console.log(e);
159
+ // }
160
+ // }
161
+
162
+
163
+ // const concat = Common.find(() => UiSelector().textContains('通讯录').filter(v => {
164
+ // return true;
165
+ // }).findOne());
166
+
167
+ // console.log(concat);
168
+
169
+ console.log(UiSelector().textContains('标签').find());
package/tsconfig.json ADDED
@@ -0,0 +1,107 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig to read more about this file */
4
+ /* Projects */
5
+ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
6
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
7
+ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
8
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
9
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
10
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
11
+ /* Language and Environment */
12
+ "target": "ES5", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
13
+ "lib": ["ES5"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
14
+ // "jsx": "preserve", /* Specify what JSX code is generated. */
15
+ // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
16
+ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
17
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
18
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
19
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
20
+ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
21
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
22
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
23
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
24
+ /* Modules */
25
+ "module": "commonjs", /* Specify what module code is generated. */
26
+ "rootDir": "./src", /* Specify the root folder within your source files. */
27
+ // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
28
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
29
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
30
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
31
+ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
32
+ // "types": [], /* Specify type package names to be included without being referenced in a source file. */
33
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
34
+ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
35
+ // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
36
+ // "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */
37
+ // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
38
+ // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
39
+ // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
40
+ // "noUncheckedSideEffectImports": true, /* Check side effect imports. */
41
+ // "resolveJsonModule": true, /* Enable importing .json files. */
42
+ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
43
+ // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
44
+ /* JavaScript Support */
45
+ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
46
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
47
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
48
+ /* Emit */
49
+ // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
50
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
51
+ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
52
+ "sourceMap": true, /* Create source map files for emitted JavaScript files. */
53
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
54
+ // "noEmit": true, /* Disable emitting files from a compilation. */
55
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
56
+ "outDir": "./script", /* Specify an output folder for all emitted files. */
57
+ // "removeComments": true, /* Disable emitting comments. */
58
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
59
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
60
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
61
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
62
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
63
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
64
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
65
+ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
66
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
67
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
68
+ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
69
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
70
+ /* Interop Constraints */
71
+ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
72
+ // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
73
+ // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */
74
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
75
+ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
76
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
77
+ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
78
+ /* Type Checking */
79
+ "strict": true, /* Enable all strict type-checking options. */
80
+ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
81
+ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
82
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
83
+ // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
84
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
85
+ // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */
86
+ // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
87
+ // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
88
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
89
+ // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
90
+ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
91
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
92
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
93
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
94
+ // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
95
+ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
96
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
97
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
98
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
99
+ /* Completeness */
100
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
101
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
102
+ },
103
+
104
+ "exclude": [
105
+ "node_modules",
106
+ ]
107
+ }