获取电视机基础信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
http://192.168.8.31:6095/request?action=isalive


{
"status": 0,
"msg": "success",
"data": {
"devicename": "E",
"ip": "192.168.8.31:6095",
"feature": [
"power"
],
"url": [
"http://bilibili.kankanews.com/video/av\\d+/",
"http://www.bilibili.tv/video/av\\d+/"
],
"platform": 699,
"build": 3354,
"version": 16777510
}
}

获取电视机安装的APP

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
http://192.168.8.31:6095/controller?action=getinstalledapp&count=999&changeIcon=1


{
"status": 0,
"msg": "success",
"data": {
"AppInfo": [
{
"PackageName": "com.mitv.alarmcenter",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.mitv.alarmcenter0.png",
"AppName": "定时提醒",
"Order": 1
},
{
"PackageName": "com.dangbei.lerad.videoposter",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.dangbei.lerad.videoposter0.png",
"AppName": "当贝播放器",
"Order": 2
},
{
"PackageName": "com.qisyun.sunday.cxyp",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.qisyun.sunday.cxyp0.png",
"AppName": "创享云屏",
"Order": 3
},
{
"PackageName": "com.baidu.netdisk.tv",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.baidu.netdisk.tv0.png",
"AppName": "百度网盘",
"Order": 4
},
{
"PackageName": "com.xiaomi.tweather",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.xiaomi.tweather0.png",
"AppName": "天气",
"Order": 5
},
{
"PackageName": "com.duokan.videodaily",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.duokan.videodaily0.png",
"AppName": "视频头条",
"Order": 6
},
{
"PackageName": "com.xiaomi.mitv.handbook",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.xiaomi.mitv.handbook0.png",
"AppName": "玩机手册",
"Order": 7
},
{
"PackageName": "com.mitv.tvhome",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.mitv.tvhome0.png",
"AppName": "桌面",
"Order": 8
},
{
"PackageName": "com.xiaomi.mitv.tvmanager",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.xiaomi.mitv.tvmanager0.png",
"AppName": "电视管家",
"Order": 9
},
{
"PackageName": "com.xiaomi.mitv.calendar",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.xiaomi.mitv.calendar0.png",
"AppName": "日历",
"Order": 10
},
{
"PackageName": "com.xiaomi.voicecontrol",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.xiaomi.voicecontrol0.png",
"AppName": "小爱同学",
"Order": 11
},
{
"PackageName": "com.mitv.gallery",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.mitv.gallery0.png",
"AppName": "相册",
"Order": 12
},
{
"PackageName": "com.xiaomi.mitv.settings",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.xiaomi.mitv.settings0.png",
"AppName": "电视设置",
"Order": 13
},
{
"PackageName": "com.xiaomi.tv.gallery",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.xiaomi.tv.gallery0.png",
"AppName": "时尚画报",
"Order": 14
},
{
"PackageName": "com.xiaomi.mitv.smartshare",
"IconURL": "http://192.168.8.31:6095/request?action=getResource&name=com.xiaomi.mitv.smartshare0.png",
"AppName": "无线投屏",
"Order": 15
}
]
}
}

浏览器远程启动电视APP

1
2
3
4
5
6
7
http://192.168.8.31:6095/controller?action=startapp&type=packagename&packagename=com.xiaomi.tweather

{
"status": 0,
"msg": "success",
"data": null
}

通过浏览器实现按键输入

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
http://192.168.8.31:6095/controller?action=keyevent&keycode=enter

{
"status": 0,
"msg": "success",
"data": {}
}


keycode 功能
power 设备开关
up 控制光标上
down 控制光标下
left 控制光标左
right 控制光标右
enter 确认键
home 返回桌面
back 回退键
menu 打开菜单
volumeup 增加音量
volumedown 减小音量

电视机信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
shell@xmen:/ $ free
total used free shared buffers
Mem: 1703063552 1636855808 66207744 0 63692800
-/+ buffers/cache: 1573163008 129900544
Swap: 524283904 19439616 504844288
shell@xmen:/ $ cat /proc/cpuinfo
Processor : AArch64 Processor rev 4 (aarch64)
processor : 0
processor : 1
processor : 2
processor : 3
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 wp half thumb fastmult vfp edsp neon vfpv3 tlsi vfpv4 idiva idivt
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

Hardware : Amlogic
Serial : 230c0200e8748f53c4354026985ac903
shell@xmen:/ $

电视端设置

设置-账号与安全-允许安装未知来源的应用-允许ADB调试。

设置-关于-产品型号-遥控连续按5下OK键-开启开发者模式。

设置-关于-网络信息-查看电视机IPv4网络IP。

电脑端操作

1
https://github.com/Genymobile/scrcpy
1
C:\Users\Administrator>adb connect 192.168.8.31
1
2
3
4
5
6
7
8
9
10
C:\Users\Administrator>adb device
List of devices attached
192.168.8.31:5555 unauthorized

E:\>adb install .\ESFileExplorer-cn.apk
Performing Push Install
adb: error: failed to get feature set: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.

电视机端,遥控器操作,确认OK。

1
2
3
4
5
6
7
8
9
10
11
E:\>adb devices
List of devices attached
192.168.8.31:5555 device


E:\>adb install .\ESFileExplorer-cn.apk
Performing Push Install
.\ESFileExplorer-cn.apk: 1 file pushed, 0 skipped. 0.4 MB/s (43862869 bytes in 107.818s)
pkg: /data/local/tmp/ESFileExplorer-cn.apk
电视机端,遥控器操作,确认OK。
Success

电脑端传文件到电视机,文件名不含中文。

1
2
E:\>adb push .\CA.png /storage/3ED8CA53D8CA08DB
.\CA.png: 1 file pushed, 0 skipped. 10.4 MB/s (106863 bytes in 0.010s)

查看小米电视安卓版本

1
adb shell getprop ro.build.version.release

远程关闭“文档管理”

1
C:\Users\Administrator>adb shell am force-stop com.xiaomi.mitv.mediaexplorer

远程开启小米电视资源管理器(打开默认选中”视频“)

1
2
 C:\Users\Administrator>adb shell am start -n com.xiaomi.mitv.mediaexplorer/.NewScraperMainEntryActivity
Starting: Intent { cmp=com.xiaomi.mitv.mediaexplorer/.NewScraperMainEntryActivity }

远程开启“文档管理”应用中的“远程管理”功能(此功能通过SwiFTP 3.3.14实现,需要root权限)

1
2
3
adb root

adb shell am startservice -n com.xiaomi.mitv.mediaexplorer/com.xiaomi.mitv.media.ftp.FtpServerService

远程查看电视机U盘等外设

1
2
3
4
5
6
7
C:\Users\Administrator>adb shell ls /storage/
09BA-0F01
3ED8CA53D8CA08DB
emulated
self

adb shell ls /storage/3ED8CA53D8CA08DB

远程打开电视机U视频播放(不循环)

1
2
3
C:\Users\Administrator>adb shell am start -a android.intent.action.VIEW -d file:///storage/3ED8CA53D8CA08DB/2023年9月8日新闻.mp4 -n com.mitv.mivideoplayer/com.mitv.videoplayer.VideoPlayerActivity

Starting: Intent { act=android.intent.action.VIEW dat=file:///storage/3ED8CA53D8CA08DB/2023年9月8日新闻.mp4 cmp=com.mitv.mivideoplayer/com.mitv.videoplayer.VideoPlayerActivity }
0%