assistsx-js 0.1.41 → 0.2.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.
- package/README.md +32 -0
- package/dist/index.cjs +7957 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +4231 -0
- package/dist/index.d.ts +4231 -30
- package/dist/index.global.js +46 -0
- package/dist/index.global.js.map +1 -0
- package/dist/index.js +7879 -30
- package/dist/index.js.map +1 -0
- package/package.json +11 -5
- package/src/{AssistsXAsync.ts → assistsx-async.ts} +8 -8
- package/src/{AssistsX.ts → assistsx.ts} +8 -8
- package/src/barutils/bar-utils.ts +3 -3
- package/src/filesystem/fileio/file-io.ts +2 -2
- package/src/filesystem/fileutils/file-utils.ts +2 -2
- package/src/filesystem/path.ts +2 -2
- package/src/floatingwindow/float.ts +4 -4
- package/src/gallery/gallery.ts +2 -2
- package/src/global.d.ts +6 -1
- package/src/imageutils/image-utils.ts +2 -2
- package/src/ime/ime.ts +2 -2
- package/src/index.ts +21 -20
- package/src/log/log-call-method.ts +28 -0
- package/src/log/log.ts +445 -0
- package/src/mlkit/mlkit.ts +3 -3
- package/src/network/http.ts +2 -2
- package/src/{NodeAsync.ts → node-async.ts} +5 -5
- package/src/{Node.ts → node.ts} +5 -5
- package/src/{StepAsync.ts → step-async.ts} +8 -8
- package/src/{Step.ts → step.ts} +7 -7
- package/dist/AccessibilityEventFilter.d.ts +0 -105
- package/dist/AccessibilityEventFilter.js +0 -89
- package/dist/AppInfo.d.ts +0 -45
- package/dist/AppInfo.js +0 -38
- package/dist/AssistsX.d.ts +0 -484
- package/dist/AssistsX.js +0 -828
- package/dist/AssistsXAsync.d.ts +0 -532
- package/dist/AssistsXAsync.js +0 -874
- package/dist/Bounds.d.ts +0 -48
- package/dist/Bounds.js +0 -68
- package/dist/CallMethod.d.ts +0 -69
- package/dist/CallMethod.js +0 -71
- package/dist/CallResponse.d.ts +0 -10
- package/dist/CallResponse.js +0 -28
- package/dist/DeviceInfo.d.ts +0 -69
- package/dist/DeviceInfo.js +0 -50
- package/dist/Node.d.ts +0 -334
- package/dist/Node.js +0 -369
- package/dist/NodeAsync.d.ts +0 -213
- package/dist/NodeAsync.js +0 -313
- package/dist/NodeClassValue.d.ts +0 -15
- package/dist/NodeClassValue.js +0 -15
- package/dist/Step.d.ts +0 -355
- package/dist/Step.js +0 -689
- package/dist/StepAsync.d.ts +0 -162
- package/dist/StepAsync.js +0 -264
- package/dist/StepError.d.ts +0 -35
- package/dist/StepError.js +0 -26
- package/dist/StepStateStore.d.ts +0 -14
- package/dist/StepStateStore.js +0 -37
- package/dist/Utils.d.ts +0 -3
- package/dist/Utils.js +0 -20
- package/dist/WindowFlags.d.ts +0 -75
- package/dist/WindowFlags.js +0 -97
- package/dist/barutils/BarUtilsCallMethod.d.ts +0 -24
- package/dist/barutils/BarUtilsCallMethod.js +0 -26
- package/dist/barutils/bar-utils.d.ts +0 -41
- package/dist/barutils/bar-utils.js +0 -205
- package/dist/filesystem/fileio/file-io.d.ts +0 -101
- package/dist/filesystem/fileio/file-io.js +0 -235
- package/dist/filesystem/fileutils/file-utils.d.ts +0 -242
- package/dist/filesystem/fileutils/file-utils.js +0 -493
- package/dist/filesystem/path.d.ts +0 -252
- package/dist/filesystem/path.js +0 -589
- package/dist/floatingwindow/FloatCallMethod.d.ts +0 -19
- package/dist/floatingwindow/FloatCallMethod.js +0 -18
- package/dist/floatingwindow/float.d.ts +0 -29
- package/dist/floatingwindow/float.js +0 -149
- package/dist/gallery/gallery.d.ts +0 -60
- package/dist/gallery/gallery.js +0 -142
- package/dist/imageutils/image-utils.d.ts +0 -442
- package/dist/imageutils/image-utils.js +0 -543
- package/dist/ime/ime.d.ts +0 -80
- package/dist/ime/ime.js +0 -141
- package/dist/mlkit/MlkitCallMethod.d.ts +0 -27
- package/dist/mlkit/MlkitCallMethod.js +0 -26
- package/dist/mlkit/mlkit.d.ts +0 -86
- package/dist/mlkit/mlkit.js +0 -169
- package/dist/network/http.d.ts +0 -127
- package/dist/network/http.js +0 -202
- /package/src/{AccessibilityEventFilter.ts → accessibility-event-filter.ts} +0 -0
- /package/src/{AppInfo.ts → app-info.ts} +0 -0
- /package/src/barutils/{BarUtilsCallMethod.ts → bar-utils-call-method.ts} +0 -0
- /package/src/{Bounds.ts → bounds.ts} +0 -0
- /package/src/{CallMethod.ts → call-method.ts} +0 -0
- /package/src/{CallResponse.ts → call-response.ts} +0 -0
- /package/src/{DeviceInfo.ts → device-info.ts} +0 -0
- /package/src/floatingwindow/{FloatCallMethod.ts → float-call-method.ts} +0 -0
- /package/src/mlkit/{MlkitCallMethod.ts → mlkit-call-method.ts} +0 -0
- /package/src/{NodeClassValue.ts → node-class-value.ts} +0 -0
- /package/src/{StepError.ts → step-error.ts} +0 -0
- /package/src/{StepStateStore.ts → step-state-store.ts} +0 -0
- /package/src/{Utils.ts → utils.ts} +0 -0
- /package/src/{WindowFlags.ts → window-flags.ts} +0 -0
package/dist/Bounds.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export declare class Bounds {
|
|
2
|
-
readonly left: number;
|
|
3
|
-
readonly top: number;
|
|
4
|
-
readonly right: number;
|
|
5
|
-
readonly bottom: number;
|
|
6
|
-
readonly width: number;
|
|
7
|
-
readonly height: number;
|
|
8
|
-
readonly centerX: number;
|
|
9
|
-
readonly centerY: number;
|
|
10
|
-
readonly exactCenterX: number;
|
|
11
|
-
readonly exactCenterY: number;
|
|
12
|
-
readonly isEmpty: boolean;
|
|
13
|
-
constructor(left: number, top: number, right: number, bottom: number, width: number, height: number, centerX: number, centerY: number, exactCenterX: number, exactCenterY: number, isEmpty: boolean);
|
|
14
|
-
/**
|
|
15
|
-
* 判断该 Bounds 是否在屏幕内(满足基本几何有效性)
|
|
16
|
-
* @returns {boolean}
|
|
17
|
-
*/
|
|
18
|
-
isInScreen(): boolean;
|
|
19
|
-
static from(data: {
|
|
20
|
-
left: number;
|
|
21
|
-
top: number;
|
|
22
|
-
right: number;
|
|
23
|
-
bottom: number;
|
|
24
|
-
width: number;
|
|
25
|
-
height: number;
|
|
26
|
-
centerX: number;
|
|
27
|
-
centerY: number;
|
|
28
|
-
exactCenterX: number;
|
|
29
|
-
exactCenterY: number;
|
|
30
|
-
isEmpty: boolean;
|
|
31
|
-
}): Bounds;
|
|
32
|
-
static fromJSON(json: string): Bounds;
|
|
33
|
-
static fromData(data: any): Bounds;
|
|
34
|
-
toJSON(): {
|
|
35
|
-
left: number;
|
|
36
|
-
top: number;
|
|
37
|
-
right: number;
|
|
38
|
-
bottom: number;
|
|
39
|
-
width: number;
|
|
40
|
-
height: number;
|
|
41
|
-
centerX: number;
|
|
42
|
-
centerY: number;
|
|
43
|
-
exactCenterX: number;
|
|
44
|
-
exactCenterY: number;
|
|
45
|
-
isEmpty: boolean;
|
|
46
|
-
};
|
|
47
|
-
clone(): Bounds;
|
|
48
|
-
}
|
package/dist/Bounds.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
// Bounds 类,对应 Kotlin 的 data class
|
|
2
|
-
export class Bounds {
|
|
3
|
-
// 构造函数
|
|
4
|
-
constructor(left, top, right, bottom, width, height, centerX, centerY, exactCenterX, exactCenterY, isEmpty) {
|
|
5
|
-
this.left = left;
|
|
6
|
-
this.top = top;
|
|
7
|
-
this.right = right;
|
|
8
|
-
this.bottom = bottom;
|
|
9
|
-
this.width = width;
|
|
10
|
-
this.height = height;
|
|
11
|
-
this.centerX = centerX;
|
|
12
|
-
this.centerY = centerY;
|
|
13
|
-
this.exactCenterX = exactCenterX;
|
|
14
|
-
this.exactCenterY = exactCenterY;
|
|
15
|
-
this.isEmpty = isEmpty;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* 判断该 Bounds 是否在屏幕内(满足基本几何有效性)
|
|
19
|
-
* @returns {boolean}
|
|
20
|
-
*/
|
|
21
|
-
isInScreen() {
|
|
22
|
-
return this.centerX > 0 &&
|
|
23
|
-
this.centerY > 0 &&
|
|
24
|
-
this.height > 0 &&
|
|
25
|
-
this.width > 0;
|
|
26
|
-
}
|
|
27
|
-
// 从普通对象创建 Bounds 实例
|
|
28
|
-
static from(data) {
|
|
29
|
-
return new Bounds(data.left, data.top, data.right, data.bottom, data.width, data.height, data.centerX, data.centerY, data.exactCenterX, data.exactCenterY, data.isEmpty);
|
|
30
|
-
}
|
|
31
|
-
// 从 JSON 字符串创建实例
|
|
32
|
-
static fromJSON(json) {
|
|
33
|
-
const data = JSON.parse(json);
|
|
34
|
-
return Bounds.from(data);
|
|
35
|
-
}
|
|
36
|
-
static fromData(data) {
|
|
37
|
-
// 如果 data 为 null 或 undefined,返回一个空的 Bounds
|
|
38
|
-
if (data == null) {
|
|
39
|
-
return new Bounds(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true);
|
|
40
|
-
}
|
|
41
|
-
// 如果 data 不是对象类型,抛出详细异常
|
|
42
|
-
if (typeof data !== "object" || Array.isArray(data)) {
|
|
43
|
-
throw new Error(`Bounds.fromData: Expected object, but got ${typeof data}. ` +
|
|
44
|
-
`Value: ${JSON.stringify(data)}`);
|
|
45
|
-
}
|
|
46
|
-
return new Bounds(data.left, data.top, data.right, data.bottom, data.width, data.height, data.centerX, data.centerY, data.exactCenterX, data.exactCenterY, data.isEmpty);
|
|
47
|
-
}
|
|
48
|
-
// 转换为普通对象
|
|
49
|
-
toJSON() {
|
|
50
|
-
return {
|
|
51
|
-
left: this.left,
|
|
52
|
-
top: this.top,
|
|
53
|
-
right: this.right,
|
|
54
|
-
bottom: this.bottom,
|
|
55
|
-
width: this.width,
|
|
56
|
-
height: this.height,
|
|
57
|
-
centerX: this.centerX,
|
|
58
|
-
centerY: this.centerY,
|
|
59
|
-
exactCenterX: this.exactCenterX,
|
|
60
|
-
exactCenterY: this.exactCenterY,
|
|
61
|
-
isEmpty: this.isEmpty,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
// 克隆方法
|
|
65
|
-
clone() {
|
|
66
|
-
return new Bounds(this.left, this.top, this.right, this.bottom, this.width, this.height, this.centerX, this.centerY, this.exactCenterX, this.exactCenterY, this.isEmpty);
|
|
67
|
-
}
|
|
68
|
-
}
|
package/dist/CallMethod.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
export declare const CallMethod: {
|
|
2
|
-
readonly takeScreenshot: "takeScreenshot";
|
|
3
|
-
readonly takeScreenshotSave: "takeScreenshotSave";
|
|
4
|
-
readonly takeScreenshotToFile: "takeScreenshotToFile";
|
|
5
|
-
readonly overlayToast: "overlayToast";
|
|
6
|
-
readonly setNodeText: "setNodeText";
|
|
7
|
-
readonly findByTags: "findByTags";
|
|
8
|
-
readonly findById: "findById";
|
|
9
|
-
readonly findByText: "findByText";
|
|
10
|
-
readonly findByTextAllMatch: "findByTextAllMatch";
|
|
11
|
-
readonly containsText: "containsText";
|
|
12
|
-
readonly getAllText: "getAllText";
|
|
13
|
-
readonly findFirstParentByTags: "findFirstParentByTags";
|
|
14
|
-
readonly getAllNodes: "getAllNodes";
|
|
15
|
-
readonly getNodes: "getNodes";
|
|
16
|
-
readonly findFirstParentClickable: "findFirstParentClickable";
|
|
17
|
-
readonly getChildren: "getChildren";
|
|
18
|
-
readonly getBoundsInScreen: "getBoundsInScreen";
|
|
19
|
-
readonly isVisible: "isVisible";
|
|
20
|
-
readonly click: "click";
|
|
21
|
-
readonly longClick: "longClick";
|
|
22
|
-
readonly back: "back";
|
|
23
|
-
readonly home: "home";
|
|
24
|
-
readonly notifications: "notifications";
|
|
25
|
-
readonly recentApps: "recentApps";
|
|
26
|
-
readonly paste: "paste";
|
|
27
|
-
readonly focus: "focus";
|
|
28
|
-
readonly selectionText: "selectionText";
|
|
29
|
-
readonly scrollForward: "scrollForward";
|
|
30
|
-
readonly launchApp: "launchApp";
|
|
31
|
-
readonly getPackageName: "getPackageName";
|
|
32
|
-
readonly getScreenSize: "getScreenSize";
|
|
33
|
-
readonly getAppScreenSize: "getAppScreenSize";
|
|
34
|
-
readonly scrollBackward: "scrollBackward";
|
|
35
|
-
readonly setOverlayFlags: "setOverlayFlags";
|
|
36
|
-
readonly scanQR: "scanQR";
|
|
37
|
-
readonly loadWebViewOverlay: "loadWebViewOverlay";
|
|
38
|
-
readonly closeOverlay: "closeOverlay";
|
|
39
|
-
readonly recognizeTextInScreenshot: "recognizeTextInScreenshot";
|
|
40
|
-
readonly clickByGesture: "clickByGesture";
|
|
41
|
-
readonly clickNodeByGesture: "clickNodeByGesture";
|
|
42
|
-
readonly doubleClickNodeByGesture: "doubleClickNodeByGesture";
|
|
43
|
-
readonly performLinearGesture: "performLinearGesture";
|
|
44
|
-
readonly longPressGestureAutoPaste: "longPressGestureAutoPaste";
|
|
45
|
-
readonly getAppInfo: "getAppInfo";
|
|
46
|
-
readonly getMacAddress: "getMacAddress";
|
|
47
|
-
readonly getAndroidID: "getAndroidID";
|
|
48
|
-
readonly getUniqueDeviceId: "getUniqueDeviceId";
|
|
49
|
-
readonly addAccessibilityEventFilter: "addAccessibilityEventFilter";
|
|
50
|
-
readonly setAccessibilityEventFilters: "setAccessibilityEventFilters";
|
|
51
|
-
readonly httpRequest: "httpRequest";
|
|
52
|
-
readonly getDeviceInfo: "getDeviceInfo";
|
|
53
|
-
readonly getNetworkType: "getNetworkType";
|
|
54
|
-
readonly isAppInstalled: "isAppInstalled";
|
|
55
|
-
readonly getClipboardLatestText: "getClipboardLatestText";
|
|
56
|
-
readonly getClipboardText: "getClipboardText";
|
|
57
|
-
readonly openUrlInBrowser: "openUrlInBrowser";
|
|
58
|
-
readonly keepScreenOn: "keepScreenOn";
|
|
59
|
-
readonly clearKeepScreenOn: "clearKeepScreenOn";
|
|
60
|
-
readonly download: "download";
|
|
61
|
-
readonly audioPlayFromFile: "audioPlayFromFile";
|
|
62
|
-
readonly audioStop: "audioStop";
|
|
63
|
-
readonly audioPlayRingtone: "audioPlayRingtone";
|
|
64
|
-
readonly audioStopRingtone: "audioStopRingtone";
|
|
65
|
-
readonly addContact: "addContact";
|
|
66
|
-
readonly getAllContacts: "getAllContacts";
|
|
67
|
-
readonly saveRootNodeTreeJson: "saveRootNodeTreeJson";
|
|
68
|
-
};
|
|
69
|
-
export type CallMethodType = (typeof CallMethod)[keyof typeof CallMethod];
|
package/dist/CallMethod.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
// CallMethod 常量对象
|
|
2
|
-
export const CallMethod = {
|
|
3
|
-
takeScreenshot: "takeScreenshot",
|
|
4
|
-
takeScreenshotSave: "takeScreenshotSave",
|
|
5
|
-
takeScreenshotToFile: "takeScreenshotToFile",
|
|
6
|
-
overlayToast: "overlayToast",
|
|
7
|
-
setNodeText: "setNodeText",
|
|
8
|
-
findByTags: "findByTags",
|
|
9
|
-
findById: "findById",
|
|
10
|
-
findByText: "findByText",
|
|
11
|
-
findByTextAllMatch: "findByTextAllMatch",
|
|
12
|
-
containsText: "containsText",
|
|
13
|
-
getAllText: "getAllText",
|
|
14
|
-
findFirstParentByTags: "findFirstParentByTags",
|
|
15
|
-
getAllNodes: "getAllNodes",
|
|
16
|
-
getNodes: "getNodes",
|
|
17
|
-
findFirstParentClickable: "findFirstParentClickable",
|
|
18
|
-
getChildren: "getChildren",
|
|
19
|
-
getBoundsInScreen: "getBoundsInScreen",
|
|
20
|
-
isVisible: "isVisible",
|
|
21
|
-
click: "click",
|
|
22
|
-
longClick: "longClick",
|
|
23
|
-
back: "back",
|
|
24
|
-
home: "home",
|
|
25
|
-
notifications: "notifications",
|
|
26
|
-
recentApps: "recentApps",
|
|
27
|
-
paste: "paste",
|
|
28
|
-
focus: "focus",
|
|
29
|
-
selectionText: "selectionText",
|
|
30
|
-
scrollForward: "scrollForward",
|
|
31
|
-
launchApp: "launchApp",
|
|
32
|
-
getPackageName: "getPackageName",
|
|
33
|
-
getScreenSize: "getScreenSize",
|
|
34
|
-
getAppScreenSize: "getAppScreenSize",
|
|
35
|
-
scrollBackward: "scrollBackward",
|
|
36
|
-
setOverlayFlags: "setOverlayFlags",
|
|
37
|
-
scanQR: "scanQR",
|
|
38
|
-
loadWebViewOverlay: "loadWebViewOverlay",
|
|
39
|
-
closeOverlay: "closeOverlay",
|
|
40
|
-
recognizeTextInScreenshot: "recognizeTextInScreenshot",
|
|
41
|
-
clickByGesture: "clickByGesture",
|
|
42
|
-
clickNodeByGesture: "clickNodeByGesture",
|
|
43
|
-
doubleClickNodeByGesture: "doubleClickNodeByGesture",
|
|
44
|
-
performLinearGesture: "performLinearGesture",
|
|
45
|
-
longPressGestureAutoPaste: "longPressGestureAutoPaste",
|
|
46
|
-
getAppInfo: "getAppInfo",
|
|
47
|
-
getMacAddress: "getMacAddress",
|
|
48
|
-
getAndroidID: "getAndroidID",
|
|
49
|
-
getUniqueDeviceId: "getUniqueDeviceId",
|
|
50
|
-
addAccessibilityEventFilter: "addAccessibilityEventFilter",
|
|
51
|
-
setAccessibilityEventFilters: "setAccessibilityEventFilters",
|
|
52
|
-
httpRequest: "httpRequest",
|
|
53
|
-
getDeviceInfo: "getDeviceInfo",
|
|
54
|
-
getNetworkType: "getNetworkType",
|
|
55
|
-
isAppInstalled: "isAppInstalled",
|
|
56
|
-
getClipboardLatestText: "getClipboardLatestText",
|
|
57
|
-
getClipboardText: "getClipboardText",
|
|
58
|
-
openUrlInBrowser: "openUrlInBrowser",
|
|
59
|
-
keepScreenOn: "keepScreenOn",
|
|
60
|
-
clearKeepScreenOn: "clearKeepScreenOn",
|
|
61
|
-
download: "download",
|
|
62
|
-
audioPlayFromFile: "audioPlayFromFile",
|
|
63
|
-
audioStop: "audioStop",
|
|
64
|
-
audioPlayRingtone: "audioPlayRingtone",
|
|
65
|
-
audioStopRingtone: "audioStopRingtone",
|
|
66
|
-
// 通讯录相关方法
|
|
67
|
-
addContact: "addContact",
|
|
68
|
-
getAllContacts: "getAllContacts",
|
|
69
|
-
// 节点树相关方法
|
|
70
|
-
saveRootNodeTreeJson: "saveRootNodeTreeJson",
|
|
71
|
-
};
|
package/dist/CallResponse.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare class CallResponse {
|
|
2
|
-
readonly code: number;
|
|
3
|
-
readonly data: any | null;
|
|
4
|
-
readonly callbackId: string | null;
|
|
5
|
-
constructor(code: number, data: any | null, callbackId: string | null);
|
|
6
|
-
isSuccess(): boolean;
|
|
7
|
-
getData(): any | null;
|
|
8
|
-
getDataOrNull(): any | null;
|
|
9
|
-
getDataOrDefault(defaultValue: any): any;
|
|
10
|
-
}
|
package/dist/CallResponse.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// CallResponse 泛型类
|
|
2
|
-
export class CallResponse {
|
|
3
|
-
constructor(code, data, callbackId) {
|
|
4
|
-
this.code = code;
|
|
5
|
-
this.data = data;
|
|
6
|
-
this.callbackId = callbackId;
|
|
7
|
-
}
|
|
8
|
-
// 判断是否成功
|
|
9
|
-
isSuccess() {
|
|
10
|
-
return this.code === 0;
|
|
11
|
-
}
|
|
12
|
-
// 获取数据,如果数据为空则抛出错误
|
|
13
|
-
getData() {
|
|
14
|
-
if (this.data === null) {
|
|
15
|
-
throw new Error('Data is null');
|
|
16
|
-
}
|
|
17
|
-
return this.data;
|
|
18
|
-
}
|
|
19
|
-
// 获取数据,如果数据为空则返回默认值
|
|
20
|
-
getDataOrNull() {
|
|
21
|
-
return this.data;
|
|
22
|
-
}
|
|
23
|
-
// 获取数据,如果数据为空则返回默认值
|
|
24
|
-
getDataOrDefault(defaultValue) {
|
|
25
|
-
var _a;
|
|
26
|
-
return (_a = this.data) !== null && _a !== void 0 ? _a : defaultValue;
|
|
27
|
-
}
|
|
28
|
-
}
|
package/dist/DeviceInfo.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 设备信息实体类
|
|
3
|
-
*/
|
|
4
|
-
export declare class DeviceInfo {
|
|
5
|
-
/**
|
|
6
|
-
* 设备唯一标识
|
|
7
|
-
*/
|
|
8
|
-
uniqueDeviceId: string;
|
|
9
|
-
/**
|
|
10
|
-
* Android ID
|
|
11
|
-
*/
|
|
12
|
-
androidID: string;
|
|
13
|
-
/**
|
|
14
|
-
* MAC地址
|
|
15
|
-
*/
|
|
16
|
-
macAddress: string;
|
|
17
|
-
/**
|
|
18
|
-
* 是否已Root
|
|
19
|
-
*/
|
|
20
|
-
isDeviceRooted: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* 制造商
|
|
23
|
-
*/
|
|
24
|
-
manufacturer: string;
|
|
25
|
-
/**
|
|
26
|
-
* 设备型号
|
|
27
|
-
*/
|
|
28
|
-
model: string;
|
|
29
|
-
/**
|
|
30
|
-
* SDK版本号
|
|
31
|
-
*/
|
|
32
|
-
sdkVersionCode: number;
|
|
33
|
-
/**
|
|
34
|
-
* SDK版本名称
|
|
35
|
-
*/
|
|
36
|
-
sdkVersionName: string;
|
|
37
|
-
/**
|
|
38
|
-
* ABI列表
|
|
39
|
-
*/
|
|
40
|
-
abiList: string[];
|
|
41
|
-
/**
|
|
42
|
-
* 是否启用ADB调试
|
|
43
|
-
*/
|
|
44
|
-
isAdbEnabled: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* 是否启用开发者选项
|
|
47
|
-
*/
|
|
48
|
-
isDevelopmentSettingsEnabled: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* 是否为模拟器
|
|
51
|
-
*/
|
|
52
|
-
isEmulator: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* 是否为平板
|
|
55
|
-
*/
|
|
56
|
-
isTablet: boolean;
|
|
57
|
-
constructor(uniqueDeviceId?: string, androidID?: string, macAddress?: string, isDeviceRooted?: boolean, manufacturer?: string, model?: string, sdkVersionCode?: number, sdkVersionName?: string, abiList?: string[], isAdbEnabled?: boolean, isDevelopmentSettingsEnabled?: boolean, isEmulator?: boolean, isTablet?: boolean);
|
|
58
|
-
/**
|
|
59
|
-
* 从JSON对象创建DeviceInfo实例
|
|
60
|
-
* @param data JSON对象
|
|
61
|
-
* @returns DeviceInfo实例
|
|
62
|
-
*/
|
|
63
|
-
static fromJSON(data: any): DeviceInfo;
|
|
64
|
-
/**
|
|
65
|
-
* 转换为JSON对象
|
|
66
|
-
* @returns JSON对象
|
|
67
|
-
*/
|
|
68
|
-
toJSON(): any;
|
|
69
|
-
}
|
package/dist/DeviceInfo.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 设备信息实体类
|
|
3
|
-
*/
|
|
4
|
-
export class DeviceInfo {
|
|
5
|
-
constructor(uniqueDeviceId = "", androidID = "", macAddress = "", isDeviceRooted = false, manufacturer = "", model = "", sdkVersionCode = 0, sdkVersionName = "", abiList = [], isAdbEnabled = false, isDevelopmentSettingsEnabled = false, isEmulator = false, isTablet = false) {
|
|
6
|
-
this.uniqueDeviceId = uniqueDeviceId;
|
|
7
|
-
this.androidID = androidID;
|
|
8
|
-
this.macAddress = macAddress;
|
|
9
|
-
this.isDeviceRooted = isDeviceRooted;
|
|
10
|
-
this.manufacturer = manufacturer;
|
|
11
|
-
this.model = model;
|
|
12
|
-
this.sdkVersionCode = sdkVersionCode;
|
|
13
|
-
this.sdkVersionName = sdkVersionName;
|
|
14
|
-
this.abiList = abiList;
|
|
15
|
-
this.isAdbEnabled = isAdbEnabled;
|
|
16
|
-
this.isDevelopmentSettingsEnabled = isDevelopmentSettingsEnabled;
|
|
17
|
-
this.isEmulator = isEmulator;
|
|
18
|
-
this.isTablet = isTablet;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* 从JSON对象创建DeviceInfo实例
|
|
22
|
-
* @param data JSON对象
|
|
23
|
-
* @returns DeviceInfo实例
|
|
24
|
-
*/
|
|
25
|
-
static fromJSON(data) {
|
|
26
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
27
|
-
return new DeviceInfo((_a = data.uniqueDeviceId) !== null && _a !== void 0 ? _a : "", (_b = data.androidID) !== null && _b !== void 0 ? _b : "", (_c = data.macAddress) !== null && _c !== void 0 ? _c : "", (_d = data.isDeviceRooted) !== null && _d !== void 0 ? _d : false, (_e = data.manufacturer) !== null && _e !== void 0 ? _e : "", (_f = data.model) !== null && _f !== void 0 ? _f : "", (_g = data.sdkVersionCode) !== null && _g !== void 0 ? _g : 0, (_h = data.sdkVersionName) !== null && _h !== void 0 ? _h : "", (_j = data.abiList) !== null && _j !== void 0 ? _j : [], (_k = data.isAdbEnabled) !== null && _k !== void 0 ? _k : false, (_l = data.isDevelopmentSettingsEnabled) !== null && _l !== void 0 ? _l : false, (_m = data.isEmulator) !== null && _m !== void 0 ? _m : false, (_o = data.isTablet) !== null && _o !== void 0 ? _o : false);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* 转换为JSON对象
|
|
31
|
-
* @returns JSON对象
|
|
32
|
-
*/
|
|
33
|
-
toJSON() {
|
|
34
|
-
return {
|
|
35
|
-
uniqueDeviceId: this.uniqueDeviceId,
|
|
36
|
-
androidID: this.androidID,
|
|
37
|
-
macAddress: this.macAddress,
|
|
38
|
-
isDeviceRooted: this.isDeviceRooted,
|
|
39
|
-
manufacturer: this.manufacturer,
|
|
40
|
-
model: this.model,
|
|
41
|
-
sdkVersionCode: this.sdkVersionCode,
|
|
42
|
-
sdkVersionName: this.sdkVersionName,
|
|
43
|
-
abiList: this.abiList,
|
|
44
|
-
isAdbEnabled: this.isAdbEnabled,
|
|
45
|
-
isDevelopmentSettingsEnabled: this.isDevelopmentSettingsEnabled,
|
|
46
|
-
isEmulator: this.isEmulator,
|
|
47
|
-
isTablet: this.isTablet,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
}
|