Skip to content

Commit 3fdcd19

Browse files
author
ranpeng
committed
v2.1.2
1 parent 9c4c1bb commit 3fdcd19

File tree

4 files changed

+128
-17
lines changed

4 files changed

+128
-17
lines changed

changelog.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
### [2.1.2](https://github.com/tencentyun/cloudgame-js-sdk/releases/tag/v2.1.2)@2025.07.30
2+
3+
**新增**
4+
5+
- 新增 Operator 接口
6+
7+
**变更**
8+
9+
- idleThreshold 逻辑调整
10+
- 云手机本地输入法调整
11+
12+
113
### [2.1.1](https://github.com/tencentyun/cloudgame-js-sdk/releases/tag/v2.1.1)@2025.07.10
214

315
**新增**

dist/tcg-sdk/androidInstance.d.ts

Lines changed: 98 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ export interface InstanceProperties {
2525
LanguageInfo: { Language: string; Country: string };
2626
LocaleInfo: { Timezone: string };
2727
ProxyInfo: { Enabled: boolean; Protocol: string; Host: string; Port: number; User: string; Password: string };
28-
SIMInfo: { State: number; PhoneNumber: string; IMSI: string; ICCID: string };
28+
SIMInfo: {
29+
State: number; // sim 状态。 1:未插入 sim 卡 5:sim 卡已就绪
30+
PhoneNumber: string; // 暂不可用
31+
IMSI: string; // 暂不可用
32+
ICCID: string; // 暂不可用
33+
};
2934
ExtraProperties: { Key: string; Value: string }[];
3035
}
3136

@@ -119,6 +124,22 @@ interface DescribeAppInstallBlackListResponse extends BatchTaskResponse {
119124
};
120125
}
121126

127+
interface GetNavVisibleStatusResponse extends BatchTaskResponse {
128+
[InstanceId: string]: {
129+
Code: number;
130+
Msg: string;
131+
Visible: boolean;
132+
};
133+
}
134+
135+
interface GetSystemMusicVolumeResponse extends BatchTaskResponse {
136+
[InstanceId: string]: {
137+
Code: number;
138+
Msg: string;
139+
Volume: number;
140+
};
141+
}
142+
122143
/**
123144
* TCGSDK - AndroidInstance 子模块相关方法
124145
*
@@ -270,6 +291,8 @@ export interface AndroidInstance {
270291
/**
271292
* 上传文件到实例
272293
*
294+
* *默认上传到 /sdcard/Download 目录下,可使用 path 指定上传目录(仅支持/sdcard/ 下目录)*
295+
*
273296
* @function
274297
* @param {Object} params
275298
* @param {string} params.instanceId - 实例 Id
@@ -278,14 +301,33 @@ export interface AndroidInstance {
278301
* @param {string} params.files.path - path
279302
*
280303
* @example
281-
* AndroidInstance.upload({instanceId: 'cai-xxx1', files: [{file: file1, path: '/sdcard/xxx/'}, {file: file2, path: '/sdcard/xxx/']});
304+
* AndroidInstance.upload({instanceId: 'cai-xxx1', files: [{file: file1, path: '/sdcard/xxx/'}, {file: file2, path: '/sdcard/xxx/'}]});
282305
*
283306
*/
284307
upload({ instanceId, files }: { instanceId: string; files: { file: File; path?: string }[] }): Promise<{
285308
Code: number;
286309
Message: string;
287310
FileStatus: { CloudPath: string; FileName: string }[] | null;
288311
}>;
312+
/**
313+
* 上传文件到实例
314+
*
315+
* *默认上传到 /data/media/0/DCIM 目录下*
316+
*
317+
* @function
318+
* @param {Object} params
319+
* @param {string} params.instanceId - 实例 Id
320+
* @param {Object[]} params.files - Files
321+
* @param {File} params.files.file - file
322+
*
323+
* @example
324+
* AndroidInstance.uploadMedia({instanceId: 'cai-xxx1', files: [{file: file1}, {file: file2}]});
325+
*
326+
*/
327+
uploadMedia({ instanceId, files }: { instanceId: string; files: { file: File }[] }): Promise<{
328+
Code: number;
329+
Message: string;
330+
}>;
289331
/**
290332
* 获取实例下载地址
291333
*
@@ -299,6 +341,21 @@ export interface AndroidInstance {
299341
*
300342
*/
301343
getInstanceDownloadAddress({ instanceId, path }: { instanceId: string; path: string }): { address: string };
344+
/**
345+
* 获取实例 Logcat 下载地址
346+
*
347+
* @function
348+
* @param {Object} params
349+
* @param {string} params.instanceId - 实例 Id
350+
* @param {string} [params.recentDays] - 最近多少天 0 表示所有日志
351+
*
352+
* @example
353+
* const {address} = AndroidInstance.getInstanceDownloadLogcatAddress({instanceId: 'cai-xxx1', recentDays: 3});
354+
*
355+
*/
356+
getInstanceDownloadLogcatAddress({ instanceId, recentDays }: { instanceId: string; recentDays: number }): {
357+
address: string;
358+
};
302359
/**
303360
* **聚焦输入框时**快速发送内容,不粘贴到剪贴版
304361
*
@@ -368,7 +425,7 @@ export interface AndroidInstance {
368425
[InstanceId: string]: { Width: number; Height: number; DPI?: number };
369426
}): Promise<BatchTaskResponse>;
370427
/**
371-
* 往设备粘贴文本
428+
* 粘贴文本
372429
*
373430
* @function
374431
* @param {Object} params - key 为 instanceId
@@ -436,7 +493,7 @@ export interface AndroidInstance {
436493
*/
437494
sendTransMessage(params: { [InstanceId: string]: { PackageName: string; Msg: string } }): Promise<BatchTaskResponse>;
438495
/**
439-
* 批量查询实例属性接口
496+
* 查询实例属性
440497
*
441498
* @function
442499
* @param {Object} params - key 为 instanceId
@@ -526,7 +583,7 @@ export interface AndroidInstance {
526583
**/
527584
modifyInstanceProperties(params: { [InstanceId: string]: Partial<InstanceProperties> }): Promise<BatchTaskResponse>;
528585
/**
529-
* 已安装第三方应用功能
586+
* 查询已安装第三方应用
530587
*
531588
* @function
532589
* @param {Object} params - key 为 instanceId
@@ -717,7 +774,7 @@ export interface AndroidInstance {
717774
*/
718775
displayCameraImage(params: { [InstanceId: string]: { FilePath: string } }): Promise<BatchTaskResponse>;
719776
/**
720-
* 增加后台应用保活应用
777+
* 增加后台保活应用
721778
*
722779
* @function
723780
* @param {Object} params - key 为 instanceId
@@ -731,7 +788,7 @@ export interface AndroidInstance {
731788
*/
732789
addKeepAliveList(params: { [InstanceId: string]: { AppList: string[] } }): Promise<BatchTaskResponse>;
733790
/**
734-
* 移除后台应用保活应用
791+
* 移除后台保活应用
735792
*
736793
* @function
737794
* @param {Object} params - key 为 instanceId
@@ -745,7 +802,7 @@ export interface AndroidInstance {
745802
*/
746803
removeKeepAliveList(params: { [InstanceId: string]: { AppList: string[] } }): Promise<BatchTaskResponse>;
747804
/**
748-
* 覆盖设置后台应用保活应用
805+
* 覆盖设置后台保活应用
749806
*
750807
* @function
751808
* @param {Object} params - key 为 instanceId
@@ -759,7 +816,7 @@ export interface AndroidInstance {
759816
*/
760817
setKeepAliveList(params: { [InstanceId: string]: { AppList: string[] } }): Promise<BatchTaskResponse>;
761818
/**
762-
* 查询当前后台应用保活列表
819+
* 查询后台保活应用
763820
*
764821
* @function
765822
* @param {Object} params - key 为 instanceId
@@ -772,7 +829,7 @@ export interface AndroidInstance {
772829
*/
773830
describeKeepAliveList(params: { [InstanceId: string]: {} }): Promise<DescribeKeepAliveListResponse>;
774831
/**
775-
* 清空后台应用保活列表
832+
* 清空后台保活应用
776833
*
777834
* @function
778835
* @param {Object} params - key 为 instanceId
@@ -852,7 +909,7 @@ export interface AndroidInstance {
852909
*/
853910
moveAppBackground(params: { [InstanceId: string]: {} }): Promise<BatchTaskResponse>;
854911
/**
855-
* 新增应用安装黑名单列表
912+
* 新增应用安装黑名单
856913
*
857914
* *新增时如果应用已安装,会进行卸载*
858915
*
@@ -868,7 +925,7 @@ export interface AndroidInstance {
868925
*/
869926
addAppInstallBlackList(params: { [InstanceId: string]: { AppList: string[] } }): Promise<BatchTaskResponse>;
870927
/**
871-
* 移除应用安装黑名单列表
928+
* 移除应用安装黑名单
872929
*
873930
* @function
874931
* @param {Object} params - key 为 instanceId
@@ -882,7 +939,7 @@ export interface AndroidInstance {
882939
*/
883940
removeAppInstallBlackList(params: { [InstanceId: string]: { AppList: string[] } }): Promise<BatchTaskResponse>;
884941
/**
885-
* 覆盖应用安装黑名单列表
942+
* 覆盖应用安装黑名单
886943
*
887944
* @function
888945
* @param {Object} params - key 为 instanceId
@@ -896,7 +953,7 @@ export interface AndroidInstance {
896953
*/
897954
setAppInstallBlackList(params: { [InstanceId: string]: { AppList: string[] } }): Promise<BatchTaskResponse>;
898955
/**
899-
* 查询应用安装黑名单列表
956+
* 查询应用安装黑名单
900957
*
901958
* @function
902959
* @param {Object} params - key 为 instanceId
@@ -909,7 +966,7 @@ export interface AndroidInstance {
909966
*/
910967
describeAppInstallBlackList(params: { [InstanceId: string]: {} }): Promise<DescribeAppInstallBlackListResponse>;
911968
/**
912-
* 清空应用安装黑名单列表
969+
* 清空应用安装黑名单
913970
*
914971
* @function
915972
* @param {Object} params - key 为 instanceId
@@ -921,4 +978,30 @@ export interface AndroidInstance {
921978
* AndroidInstance.clearAppInstallBlackList({'cai-xxx1': {}});
922979
*/
923980
clearAppInstallBlackList(params: { [InstanceId: string]: {} }): Promise<BatchTaskResponse>;
981+
/**
982+
* 获取系统导航栏显示状态
983+
*
984+
* @function
985+
* @param {Object} params - key 为 instanceId
986+
* @param {string} params.key - 设备 instanceId
987+
* @param {Object} params.value - value
988+
*
989+
*
990+
* @example
991+
* AndroidInstance.getNavVisibleStatus({'cai-xxx1': {}});
992+
*/
993+
getNavVisibleStatus(params: { [InstanceId: string]: {} }): Promise<GetNavVisibleStatusResponse>;
994+
/**
995+
* 获取系统媒体音量大小
996+
*
997+
* @function
998+
* @param {Object} params - key 为 instanceId
999+
* @param {string} params.key - 设备 instanceId
1000+
* @param {Object} params.value - value
1001+
*
1002+
*
1003+
* @example
1004+
* AndroidInstance.getSystemMusicVolume({'cai-xxx1': {}});
1005+
*/
1006+
getSystemMusicVolume(params: { [InstanceId: string]: {} }): Promise<GetSystemMusicVolumeResponse>;
9241007
}

dist/tcg-sdk/index.d.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,8 @@ export type OnAndroidInstanceEventResponse =
501501
| OnAndroidInstanceTransMessageResponse
502502
| OnAndroidInstanceSystemUSageResponse
503503
| OnAndroidInstanceClipboardEventResponse
504-
| OnAndroidInstanceNotificationEventResponse;
504+
| OnAndroidInstanceNotificationEventResponse
505+
| OnAndroidInstanceSystemStatusResponse;
505506

506507
export type OnAndroidInstanceTransMessageResponse = {
507508
type: 'trans_message';
@@ -537,6 +538,20 @@ export type OnAndroidInstanceNotificationEventResponse = {
537538
};
538539
};
539540

541+
export type OnAndroidInstanceSystemStatusResponse = {
542+
type: 'system_status';
543+
data: {
544+
/**
545+
* 导航栏状态
546+
*/
547+
nav_visible: boolean;
548+
/**
549+
* 音量 [0 - 100]
550+
*/
551+
music_volume: number;
552+
};
553+
};
554+
540555
/**
541556
* 直播推流相关
542557
*/
@@ -1482,6 +1497,7 @@ export interface InitConfig {
14821497
* | system_usage | Object<{cpu_usage: number; mem_usage: number; gpu_usage: number;}> |
14831498
* | clipboard_event | Object<{text: string; writeText?: boolean}> <table><tr><th>text</th><th>string</th></tr><tr><th>writeText</th><th>boolean 是否已写入剪切板</th></tr></table> |
14841499
* | notification_event | Object<{package_name: string; title: string; text: string;}> |
1500+
* | system_status | Object<{ nav_visible: boolean; music_volume: number;}> |
14851501
*
14861502
*/
14871503
onAndroidInstanceEvent?: (response: OnAndroidInstanceEventResponse) => void;

dist/tcg-sdk/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)