From ba145ba26fd6365b24fdfef22b75d454b1351574 Mon Sep 17 00:00:00 2001 From: wyf <494641114@qq.com> Date: Mon, 8 Dec 2025 15:45:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=8A=A8=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E4=BC=A0=E6=84=9F=E5=99=A8=E8=93=9D=E7=89=99=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/component/tool/cmd.dart | 21 +++++++++----- .../component/DeviceDataComponentWidget.dart | 28 +++++++++---------- lib/pages/main_bottom/mine_page.dart | 2 +- lib/pages/mh_page/test/WebviewTestModel.dart | 4 +-- 4 files changed, 30 insertions(+), 25 deletions(-) diff --git a/lib/component/tool/cmd.dart b/lib/component/tool/cmd.dart index 0cfac73..66b6099 100644 --- a/lib/component/tool/cmd.dart +++ b/lib/component/tool/cmd.dart @@ -10,6 +10,7 @@ import 'package:vbvs_app/common/util/DailyLogUtils.dart'; // wifi列表指令 getWifiList(THapp tHapp) async { try { + await openDlog(tHapp); print("wscan scan"); edm.EasyDartModule.logger.info("发送请求网络列表指令"); DailyLogUtils.writeLog("发送请求网络列表指令"); @@ -53,6 +54,7 @@ getWifiList(THapp tHapp) async { } getWifiStatus(THapp tHapp) async { + await openDlog(tHapp); edm.EasyDartModule.logger.info("发送请求设备网络状态指令"); DailyLogUtils.writeLog("发送请求设备网络状态指令"); var result = await tHapp.send( @@ -83,6 +85,7 @@ getWifiStatus(THapp tHapp) async { Future sendWifiSetting(wifiItem, String password, THapp tHapp) async { try { + await openDlog(tHapp); edm.EasyDartModule.logger.info("发送wifi配置指令"); DailyLogUtils.writeLog("发送wifi配置指令->"); // String cmd = "vtouch save update -a -i .wifi.sta.auth=${wifiItem['auth']} " @@ -119,6 +122,7 @@ getDeviceWifiStatus( int times, { bool link = false, }) async { + await openDlog(tHapp); DailyLogUtils.writeLog("发送请求设备已配置网络状态指令"); bool success = false; final now = DateTime.now(); @@ -203,6 +207,7 @@ getDeviceWifiStatus( //只有4g并且没有wifi Future getDeviceNetVersion(THapp tHapp, int times) async { + await openDlog(tHapp); edm.EasyDartModule.logger.info("发送请求设备的网络信息"); DailyLogUtils.writeLog("发送请求设备的网络信息"); print("ls /root/mnt"); @@ -240,6 +245,7 @@ Future getDeviceNetVersion(THapp tHapp, int times) async { /// 发送关闭blog日志与开启业务日志的指令 Future sendBlogAndDlogCommands(THapp tHapp) async { + await openDlog(tHapp); edm.EasyDartModule.logger.info("发送 blog disable 与 dlog on business 指令"); DailyLogUtils.writeLog("发送 blog disable 与 dlog on business 指令"); try { @@ -293,6 +299,7 @@ Future sendBlogAndDlogCommands(THapp tHapp) async { /// 执行 wscan close -> 延迟 1s -> wscan open Future sendCloseAndOpenWscanCommand(THapp tHapp) async { + await openDlog(tHapp); edm.EasyDartModule.logger.info("执行 wscan close -> wscan open 指令"); DailyLogUtils.writeLog("执行 wscan close -> wscan open 指令开始"); @@ -336,7 +343,6 @@ Future sendCloseAndOpenWscanCommand(THapp tHapp) async { } } - /// 查询设备内存状态(指令: free all) /// /// 示例返回: @@ -346,6 +352,7 @@ Future sendCloseAndOpenWscanCommand(THapp tHapp) async { /// 若匹配到“关键内存剩余:xxxx 字节”,其中 xxxx < 20000 返回 false, /// 否则返回 true。 Future queryMemory(THapp tHapp, {int times = 1}) async { + await openDlog(tHapp); edm.EasyDartModule.logger.info("发送查询内存状态指令 (free all)"); DailyLogUtils.writeLog("发送查询内存状态指令 (free all)"); @@ -358,8 +365,7 @@ Future queryMemory(THapp tHapp, {int times = 1}) async { final match = RegExp(r'关键内存剩余:(\d+)\s*字节').firstMatch(log); if (match != null) { final freeValue = int.tryParse(match.group(1) ?? "0") ?? 0; - edm.EasyDartModule.logger - .info("提取到关键内存剩余: $freeValue 字节"); + edm.EasyDartModule.logger.info("提取到关键内存剩余: $freeValue 字节"); DailyLogUtils.writeLog("提取到关键内存剩余: $freeValue 字节"); // 判断内存是否充足 @@ -375,8 +381,7 @@ Future queryMemory(THapp tHapp, {int times = 1}) async { // result 就是 send 内部设置的 ss.result if (result is bool) { - edm.EasyDartModule.logger - .info("内存检测结果 -> ${result ? "充足" : "不足"}"); + edm.EasyDartModule.logger.info("内存检测结果 -> ${result ? "充足" : "不足"}"); DailyLogUtils.writeLog("内存检测结果 -> ${result ? "充足" : "不足"}"); return result; } @@ -391,12 +396,12 @@ Future queryMemory(THapp tHapp, {int times = 1}) async { } } - /// 重启设备指令 /// /// 发送 "reboot" 命令,若响应中包含 reboot / restart / ok / success 等关键字 /// 视为执行成功,返回 true;否则返回 false。 Future rebootDevice(THapp tHapp) async { + await openDlog(tHapp); edm.EasyDartModule.logger.info("发送设备重启指令 (reboot)"); DailyLogUtils.writeLog("发送设备重启指令 (reboot)"); @@ -440,4 +445,6 @@ Future rebootDevice(THapp tHapp) async { } } - +openDlog(THapp tHapp) async { + await tHapp.send("dlog on hal"); +} diff --git a/lib/pages/device/component/DeviceDataComponentWidget.dart b/lib/pages/device/component/DeviceDataComponentWidget.dart index a4e0433..49814b6 100644 --- a/lib/pages/device/component/DeviceDataComponentWidget.dart +++ b/lib/pages/device/component/DeviceDataComponentWidget.dart @@ -358,21 +358,19 @@ class _DeviceDataComponentWidgetState extends State { // WIFI 配置 —— 单独判断 if (hasBasePermission || hasWifiPermission) { - if (hasWifiPermission) { - items.add( - _buildMenuItem( - text: "WIFI配置".tr, - onTap: () { - setState(() { - _isPopupOpen = false; - }); - _popupEntry?.remove(); - _popupEntry = null; - dealWifi(widget.device); - }, - ), - ); - } + items.add( + _buildMenuItem( + text: "WIFI配置".tr, + onTap: () { + setState(() { + _isPopupOpen = false; + }); + _popupEntry?.remove(); + _popupEntry = null; + dealWifi(widget.device); + }, + ), + ); // 下面这些 **只受 hasBasePermission 影响** if (hasBasePermission) { diff --git a/lib/pages/main_bottom/mine_page.dart b/lib/pages/main_bottom/mine_page.dart index ab6561c..1ab8b12 100644 --- a/lib/pages/main_bottom/mine_page.dart +++ b/lib/pages/main_bottom/mine_page.dart @@ -690,7 +690,7 @@ class _MinePageState extends State { mainAxisSize: MainAxisSize.max, children: [ Text( - 'V1.0.2512.03', + 'V1.0.2512.08', style: TextStyle( fontFamily: 'Inter', // color: Color(0xFFD9E3EB), diff --git a/lib/pages/mh_page/test/WebviewTestModel.dart b/lib/pages/mh_page/test/WebviewTestModel.dart index 3b10530..cfa2f8e 100644 --- a/lib/pages/mh_page/test/WebviewTestModel.dart +++ b/lib/pages/mh_page/test/WebviewTestModel.dart @@ -44,8 +44,8 @@ class WebviewTestController extends GetControllerEx { web = WebviewHelper( isheadless: false, jsbridge: buildsdk( - // father: this, - // clientId: '494641114', + father: this, + clientId: '494641114', // clientId: '123', // dbgserverUrl: 'ws://192.168.1.2:9001', ),