Skip to content

Commit

Permalink
修复部分设备Mac地址获取不到(失败),文件管理文件路径问题
Browse files Browse the repository at this point in the history
  • Loading branch information
EaniaHuui committed Aug 1, 2022
1 parent 06b99cd commit 4714521
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/page/feature_page/feature_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -456,13 +456,24 @@ class FeatureViewModel extends BaseViewModel with PackageHelpMixin {

/// 查看设备Mac地址
Future<void> getDeviceMac() async {
// 感谢简书网友:北京朝阳区精神病院院长 的分享BUG以及优化方案。
// 查看设备Mac地址
// 提供两种获取 设备Mac方法
// adb shell ip address show wlan0 | grep "link/ether" | awk '{printf $2}'
// adb -s deviceId shell "ip addr show wlan0 | grep 'link/ether '| cut -d' ' -f6"
var result = await execAdb([
'-s',
deviceId,
'shell',
'cat',
'/sys/class/net/wlan0/address',
"ip addr show wlan0 | grep 'link/ether '| cut -d' ' -f6",
]);
// var result = await execAdb([
// '-s',
// deviceId,
// 'shell',
// 'cat',
// '/sys/class/net/wlan0/address',
// ]);
showResultDialog(
content: result != null && result.exitCode == 0 ? result.stdout : "获取失败",
);
Expand Down
6 changes: 6 additions & 0 deletions lib/page/flie_manager/file_manager_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ class FileManagerViewModel extends BaseViewModel {
typeLinkFile,
Icons.attach_file,
));
} else if (value.endsWith("*")) {
files.add(FileModel(
value.substring(0, value.length - 1),
typeFile,
Icons.insert_drive_file,
));
} else {
files.add(FileModel(
value,
Expand Down

0 comments on commit 4714521

Please sign in to comment.