assistsx-js 0.0.2027 → 0.0.2029

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.
@@ -0,0 +1,45 @@
1
+ /**
2
+ * 应用信息实体类
3
+ */
4
+ export declare class AppInfo {
5
+ /**
6
+ * 是否为系统应用
7
+ */
8
+ isSystem: boolean;
9
+ /**
10
+ * 最低SDK版本
11
+ */
12
+ minSdkVersion: number;
13
+ /**
14
+ * 应用名称
15
+ */
16
+ name: string;
17
+ /**
18
+ * 应用包名
19
+ */
20
+ packageName: string;
21
+ /**
22
+ * 目标SDK版本
23
+ */
24
+ targetSdkVersion: number;
25
+ /**
26
+ * 版本号
27
+ */
28
+ versionCode: number;
29
+ /**
30
+ * 版本名称
31
+ */
32
+ versionName: string;
33
+ constructor(isSystem?: boolean, minSdkVersion?: number, name?: string, packageName?: string, targetSdkVersion?: number, versionCode?: number, versionName?: string);
34
+ /**
35
+ * 从JSON对象创建AppInfo实例
36
+ * @param data JSON对象
37
+ * @returns AppInfo实例
38
+ */
39
+ static fromJSON(data: any): AppInfo;
40
+ /**
41
+ * 转换为JSON对象
42
+ * @returns JSON对象
43
+ */
44
+ toJSON(): any;
45
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * 应用信息实体类
3
+ */
4
+ export class AppInfo {
5
+ constructor(isSystem = false, minSdkVersion = 0, name = "", packageName = "", targetSdkVersion = 0, versionCode = 0, versionName = "") {
6
+ this.isSystem = isSystem;
7
+ this.minSdkVersion = minSdkVersion;
8
+ this.name = name;
9
+ this.packageName = packageName;
10
+ this.targetSdkVersion = targetSdkVersion;
11
+ this.versionCode = versionCode;
12
+ this.versionName = versionName;
13
+ }
14
+ /**
15
+ * 从JSON对象创建AppInfo实例
16
+ * @param data JSON对象
17
+ * @returns AppInfo实例
18
+ */
19
+ static fromJSON(data) {
20
+ var _a, _b, _c, _d, _e, _f, _g;
21
+ return new AppInfo((_a = data.isSystem) !== null && _a !== void 0 ? _a : false, (_b = data.minSdkVersion) !== null && _b !== void 0 ? _b : 0, (_c = data.name) !== null && _c !== void 0 ? _c : "", (_d = data.packageName) !== null && _d !== void 0 ? _d : "", (_e = data.targetSdkVersion) !== null && _e !== void 0 ? _e : 0, (_f = data.versionCode) !== null && _f !== void 0 ? _f : 0, (_g = data.versionName) !== null && _g !== void 0 ? _g : "");
22
+ }
23
+ /**
24
+ * 转换为JSON对象
25
+ * @returns JSON对象
26
+ */
27
+ toJSON() {
28
+ return {
29
+ isSystem: this.isSystem,
30
+ minSdkVersion: this.minSdkVersion,
31
+ name: this.name,
32
+ packageName: this.packageName,
33
+ targetSdkVersion: this.targetSdkVersion,
34
+ versionCode: this.versionCode,
35
+ versionName: this.versionName,
36
+ };
37
+ }
38
+ }
@@ -6,6 +6,8 @@ import { Node } from "./Node";
6
6
  import { CallResponse } from "./CallResponse";
7
7
  import { Bounds } from "./Bounds";
8
8
  import { AccessibilityEventFilter } from "AccessibilityEventFilter";
9
+ import { AppInfo } from "./AppInfo";
10
+ import { DeviceInfo } from "./DeviceInfo";
9
11
  /**
10
12
  * 无障碍事件数据结构
11
13
  */
@@ -399,11 +401,11 @@ export declare class AssistsX {
399
401
  longPressDuration?: number;
400
402
  timeout?: number;
401
403
  }): Promise<boolean>;
402
- static getAppInfo(packageName: string, timeout?: number): Promise<any>;
404
+ static getAppInfo(packageName: string, timeout?: number): Promise<AppInfo>;
403
405
  static getUniqueDeviceId(): any;
404
406
  static getAndroidID(): any;
405
407
  static getMacAddress(timeout?: number): Promise<any>;
406
- static getDeviceInfo(timeout?: number): Promise<any>;
408
+ static getDeviceInfo(timeout?: number): Promise<DeviceInfo>;
407
409
  static getNetworkType(timeout?: number): Promise<any>;
408
410
  static setAccessibilityEventFilters(value: AccessibilityEventFilter[]): Promise<any>;
409
411
  static addAccessibilityEventFilter(value: AccessibilityEventFilter): Promise<any>;
package/dist/AssistsX.js CHANGED
@@ -7,6 +7,8 @@ import { CallMethod } from "./CallMethod";
7
7
  import { CallResponse } from "./CallResponse";
8
8
  import { Bounds } from "./Bounds";
9
9
  import { decodeBase64UTF8, generateUUID } from "./Utils";
10
+ import { AppInfo } from "./AppInfo";
11
+ import { DeviceInfo } from "./DeviceInfo";
10
12
  // 回调函数存储对象
11
13
  export const callbacks = new Map();
12
14
  // 无障碍事件监听器存储
@@ -581,7 +583,7 @@ export class AssistsX {
581
583
  args: { packageName },
582
584
  timeout,
583
585
  });
584
- return response.getDataOrDefault({});
586
+ return AppInfo.fromJSON(response.getDataOrDefault({}));
585
587
  }
586
588
  static getUniqueDeviceId() {
587
589
  const response = this.call(CallMethod.getUniqueDeviceId);
@@ -601,7 +603,7 @@ export class AssistsX {
601
603
  const response = await this.asyncCall(CallMethod.getDeviceInfo, {
602
604
  timeout,
603
605
  });
604
- return response.getDataOrDefault({});
606
+ return DeviceInfo.fromJSON(response.getDataOrDefault({}));
605
607
  }
606
608
  static async getNetworkType(timeout) {
607
609
  const response = await this.asyncCall(CallMethod.getNetworkType, {
@@ -4,6 +4,8 @@
4
4
  */
5
5
  import { Node } from "./Node";
6
6
  import { Bounds } from "./Bounds";
7
+ import { AppInfo } from "./AppInfo";
8
+ import { DeviceInfo } from "./DeviceInfo";
7
9
  import { WebFloatingWindowOptions } from "./AssistsX";
8
10
  export declare class AssistsXAsync {
9
11
  /**
@@ -354,11 +356,11 @@ export declare class AssistsXAsync {
354
356
  longPressDuration?: number;
355
357
  timeout?: number;
356
358
  }): Promise<boolean>;
357
- static getAppInfo(packageName: string, timeout?: number): Promise<any>;
359
+ static getAppInfo(packageName: string, timeout?: number): Promise<AppInfo>;
358
360
  static getUniqueDeviceId(timeout?: number): Promise<any>;
359
361
  static getAndroidID(timeout?: number): Promise<any>;
360
362
  static getMacAddress(timeout?: number): Promise<any>;
361
- static getDeviceInfo(timeout?: number): Promise<any>;
363
+ static getDeviceInfo(timeout?: number): Promise<DeviceInfo>;
362
364
  /**
363
365
  * 获取屏幕尺寸
364
366
  * @param timeout 超时时间(秒),默认30秒
@@ -7,6 +7,8 @@ import { CallMethod } from "./CallMethod";
7
7
  import { CallResponse } from "./CallResponse";
8
8
  import { Bounds } from "./Bounds";
9
9
  import { generateUUID } from "./Utils";
10
+ import { AppInfo } from "./AppInfo";
11
+ import { DeviceInfo } from "./DeviceInfo";
10
12
  import { callbacks, } from "./AssistsX";
11
13
  export class AssistsXAsync {
12
14
  /**
@@ -577,7 +579,7 @@ export class AssistsXAsync {
577
579
  args: { packageName },
578
580
  timeout,
579
581
  });
580
- return response.getDataOrDefault({});
582
+ return AppInfo.fromJSON(response.getDataOrDefault({}));
581
583
  }
582
584
  static async getUniqueDeviceId(timeout) {
583
585
  const response = await this.asyncCall(CallMethod.getUniqueDeviceId, {
@@ -599,7 +601,7 @@ export class AssistsXAsync {
599
601
  const response = await this.asyncCall(CallMethod.getDeviceInfo, {
600
602
  timeout,
601
603
  });
602
- return response.getDataOrDefault({});
604
+ return DeviceInfo.fromJSON(response.getDataOrDefault({}));
603
605
  }
604
606
  /**
605
607
  * 获取屏幕尺寸
@@ -0,0 +1,69 @@
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
+ }
@@ -0,0 +1,50 @@
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
+ }
package/dist/index.d.ts CHANGED
@@ -12,3 +12,5 @@ export * from "./NodeAsync";
12
12
  export * from "./AssistsXAsync";
13
13
  export * from "./StepAsync";
14
14
  export * from "./AccessibilityEventFilter";
15
+ export * from "./AppInfo";
16
+ export * from "./DeviceInfo";
package/dist/index.js CHANGED
@@ -12,3 +12,5 @@ export * from "./NodeAsync";
12
12
  export * from "./AssistsXAsync";
13
13
  export * from "./StepAsync";
14
14
  export * from "./AccessibilityEventFilter";
15
+ export * from "./AppInfo";
16
+ export * from "./DeviceInfo";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assistsx-js",
3
- "version": "0.0.2027",
3
+ "version": "0.0.2029",
4
4
  "description": "assistsx-js自动化开发SDK",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
package/src/AppInfo.ts ADDED
@@ -0,0 +1,90 @@
1
+ /**
2
+ * 应用信息实体类
3
+ */
4
+ export class AppInfo {
5
+ /**
6
+ * 是否为系统应用
7
+ */
8
+ isSystem: boolean;
9
+
10
+ /**
11
+ * 最低SDK版本
12
+ */
13
+ minSdkVersion: number;
14
+
15
+ /**
16
+ * 应用名称
17
+ */
18
+ name: string;
19
+
20
+ /**
21
+ * 应用包名
22
+ */
23
+ packageName: string;
24
+
25
+ /**
26
+ * 目标SDK版本
27
+ */
28
+ targetSdkVersion: number;
29
+
30
+ /**
31
+ * 版本号
32
+ */
33
+ versionCode: number;
34
+
35
+ /**
36
+ * 版本名称
37
+ */
38
+ versionName: string;
39
+
40
+ constructor(
41
+ isSystem: boolean = false,
42
+ minSdkVersion: number = 0,
43
+ name: string = "",
44
+ packageName: string = "",
45
+ targetSdkVersion: number = 0,
46
+ versionCode: number = 0,
47
+ versionName: string = ""
48
+ ) {
49
+ this.isSystem = isSystem;
50
+ this.minSdkVersion = minSdkVersion;
51
+ this.name = name;
52
+ this.packageName = packageName;
53
+ this.targetSdkVersion = targetSdkVersion;
54
+ this.versionCode = versionCode;
55
+ this.versionName = versionName;
56
+ }
57
+
58
+ /**
59
+ * 从JSON对象创建AppInfo实例
60
+ * @param data JSON对象
61
+ * @returns AppInfo实例
62
+ */
63
+ static fromJSON(data: any): AppInfo {
64
+ return new AppInfo(
65
+ data.isSystem ?? false,
66
+ data.minSdkVersion ?? 0,
67
+ data.name ?? "",
68
+ data.packageName ?? "",
69
+ data.targetSdkVersion ?? 0,
70
+ data.versionCode ?? 0,
71
+ data.versionName ?? ""
72
+ );
73
+ }
74
+
75
+ /**
76
+ * 转换为JSON对象
77
+ * @returns JSON对象
78
+ */
79
+ toJSON(): any {
80
+ return {
81
+ isSystem: this.isSystem,
82
+ minSdkVersion: this.minSdkVersion,
83
+ name: this.name,
84
+ packageName: this.packageName,
85
+ targetSdkVersion: this.targetSdkVersion,
86
+ versionCode: this.versionCode,
87
+ versionName: this.versionName,
88
+ };
89
+ }
90
+ }
package/src/AssistsX.ts CHANGED
@@ -8,6 +8,8 @@ import { CallResponse } from "./CallResponse";
8
8
  import { Bounds } from "./Bounds";
9
9
  import { decodeBase64UTF8, generateUUID } from "./Utils";
10
10
  import { AccessibilityEventFilter } from "AccessibilityEventFilter";
11
+ import { AppInfo } from "./AppInfo";
12
+ import { DeviceInfo } from "./DeviceInfo";
11
13
 
12
14
  /**
13
15
  * 无障碍事件数据结构
@@ -850,12 +852,12 @@ export class AssistsX {
850
852
  public static async getAppInfo(
851
853
  packageName: string,
852
854
  timeout?: number
853
- ): Promise<any> {
855
+ ): Promise<AppInfo> {
854
856
  const response = await this.asyncCall(CallMethod.getAppInfo, {
855
857
  args: { packageName },
856
858
  timeout,
857
859
  });
858
- return response.getDataOrDefault({});
860
+ return AppInfo.fromJSON(response.getDataOrDefault({}));
859
861
  }
860
862
  public static getUniqueDeviceId(): any {
861
863
  const response = this.call(CallMethod.getUniqueDeviceId);
@@ -871,11 +873,11 @@ export class AssistsX {
871
873
  });
872
874
  return response.getDataOrDefault({});
873
875
  }
874
- public static async getDeviceInfo(timeout?: number): Promise<any> {
876
+ public static async getDeviceInfo(timeout?: number): Promise<DeviceInfo> {
875
877
  const response = await this.asyncCall(CallMethod.getDeviceInfo, {
876
878
  timeout,
877
879
  });
878
- return response.getDataOrDefault({});
880
+ return DeviceInfo.fromJSON(response.getDataOrDefault({}));
879
881
  }
880
882
  public static async getNetworkType(timeout?: number): Promise<any> {
881
883
  const response = await this.asyncCall(CallMethod.getNetworkType, {
@@ -7,6 +7,8 @@ import { CallMethod } from "./CallMethod";
7
7
  import { CallResponse } from "./CallResponse";
8
8
  import { Bounds } from "./Bounds";
9
9
  import { generateUUID } from "./Utils";
10
+ import { AppInfo } from "./AppInfo";
11
+ import { DeviceInfo } from "./DeviceInfo";
10
12
  import {
11
13
  AssistsX,
12
14
  callbacks,
@@ -843,12 +845,12 @@ export class AssistsXAsync {
843
845
  public static async getAppInfo(
844
846
  packageName: string,
845
847
  timeout?: number
846
- ): Promise<any> {
848
+ ): Promise<AppInfo> {
847
849
  const response = await this.asyncCall(CallMethod.getAppInfo, {
848
850
  args: { packageName },
849
851
  timeout,
850
852
  });
851
- return response.getDataOrDefault({});
853
+ return AppInfo.fromJSON(response.getDataOrDefault({}));
852
854
  }
853
855
  public static async getUniqueDeviceId(timeout?: number): Promise<any> {
854
856
  const response = await this.asyncCall(CallMethod.getUniqueDeviceId, {
@@ -866,11 +868,11 @@ export class AssistsXAsync {
866
868
  });
867
869
  return response.getDataOrDefault({});
868
870
  }
869
- public static async getDeviceInfo(timeout?: number): Promise<any> {
871
+ public static async getDeviceInfo(timeout?: number): Promise<DeviceInfo> {
870
872
  const response = await this.asyncCall(CallMethod.getDeviceInfo, {
871
873
  timeout,
872
874
  });
873
- return response.getDataOrDefault({});
875
+ return DeviceInfo.fromJSON(response.getDataOrDefault({}));
874
876
  }
875
877
 
876
878
  /**
@@ -0,0 +1,144 @@
1
+ /**
2
+ * 设备信息实体类
3
+ */
4
+ export class DeviceInfo {
5
+ /**
6
+ * 设备唯一标识
7
+ */
8
+ uniqueDeviceId: string;
9
+
10
+ /**
11
+ * Android ID
12
+ */
13
+ androidID: string;
14
+
15
+ /**
16
+ * MAC地址
17
+ */
18
+ macAddress: string;
19
+
20
+ /**
21
+ * 是否已Root
22
+ */
23
+ isDeviceRooted: boolean;
24
+
25
+ /**
26
+ * 制造商
27
+ */
28
+ manufacturer: string;
29
+
30
+ /**
31
+ * 设备型号
32
+ */
33
+ model: string;
34
+
35
+ /**
36
+ * SDK版本号
37
+ */
38
+ sdkVersionCode: number;
39
+
40
+ /**
41
+ * SDK版本名称
42
+ */
43
+ sdkVersionName: string;
44
+
45
+ /**
46
+ * ABI列表
47
+ */
48
+ abiList: string[];
49
+
50
+ /**
51
+ * 是否启用ADB调试
52
+ */
53
+ isAdbEnabled: boolean;
54
+
55
+ /**
56
+ * 是否启用开发者选项
57
+ */
58
+ isDevelopmentSettingsEnabled: boolean;
59
+
60
+ /**
61
+ * 是否为模拟器
62
+ */
63
+ isEmulator: boolean;
64
+
65
+ /**
66
+ * 是否为平板
67
+ */
68
+ isTablet: boolean;
69
+
70
+ constructor(
71
+ uniqueDeviceId: string = "",
72
+ androidID: string = "",
73
+ macAddress: string = "",
74
+ isDeviceRooted: boolean = false,
75
+ manufacturer: string = "",
76
+ model: string = "",
77
+ sdkVersionCode: number = 0,
78
+ sdkVersionName: string = "",
79
+ abiList: string[] = [],
80
+ isAdbEnabled: boolean = false,
81
+ isDevelopmentSettingsEnabled: boolean = false,
82
+ isEmulator: boolean = false,
83
+ isTablet: boolean = false
84
+ ) {
85
+ this.uniqueDeviceId = uniqueDeviceId;
86
+ this.androidID = androidID;
87
+ this.macAddress = macAddress;
88
+ this.isDeviceRooted = isDeviceRooted;
89
+ this.manufacturer = manufacturer;
90
+ this.model = model;
91
+ this.sdkVersionCode = sdkVersionCode;
92
+ this.sdkVersionName = sdkVersionName;
93
+ this.abiList = abiList;
94
+ this.isAdbEnabled = isAdbEnabled;
95
+ this.isDevelopmentSettingsEnabled = isDevelopmentSettingsEnabled;
96
+ this.isEmulator = isEmulator;
97
+ this.isTablet = isTablet;
98
+ }
99
+
100
+ /**
101
+ * 从JSON对象创建DeviceInfo实例
102
+ * @param data JSON对象
103
+ * @returns DeviceInfo实例
104
+ */
105
+ static fromJSON(data: any): DeviceInfo {
106
+ return new DeviceInfo(
107
+ data.uniqueDeviceId ?? "",
108
+ data.androidID ?? "",
109
+ data.macAddress ?? "",
110
+ data.isDeviceRooted ?? false,
111
+ data.manufacturer ?? "",
112
+ data.model ?? "",
113
+ data.sdkVersionCode ?? 0,
114
+ data.sdkVersionName ?? "",
115
+ data.abiList ?? [],
116
+ data.isAdbEnabled ?? false,
117
+ data.isDevelopmentSettingsEnabled ?? false,
118
+ data.isEmulator ?? false,
119
+ data.isTablet ?? false
120
+ );
121
+ }
122
+
123
+ /**
124
+ * 转换为JSON对象
125
+ * @returns JSON对象
126
+ */
127
+ toJSON(): any {
128
+ return {
129
+ uniqueDeviceId: this.uniqueDeviceId,
130
+ androidID: this.androidID,
131
+ macAddress: this.macAddress,
132
+ isDeviceRooted: this.isDeviceRooted,
133
+ manufacturer: this.manufacturer,
134
+ model: this.model,
135
+ sdkVersionCode: this.sdkVersionCode,
136
+ sdkVersionName: this.sdkVersionName,
137
+ abiList: this.abiList,
138
+ isAdbEnabled: this.isAdbEnabled,
139
+ isDevelopmentSettingsEnabled: this.isDevelopmentSettingsEnabled,
140
+ isEmulator: this.isEmulator,
141
+ isTablet: this.isTablet,
142
+ };
143
+ }
144
+ }
package/src/index.ts CHANGED
@@ -12,3 +12,5 @@ export * from "./NodeAsync";
12
12
  export * from "./AssistsXAsync";
13
13
  export * from "./StepAsync";
14
14
  export * from "./AccessibilityEventFilter";
15
+ export * from "./AppInfo";
16
+ export * from "./DeviceInfo";