diff --git a/UotanToolbox/Common/Global.cs b/UotanToolbox/Common/Global.cs index 2a6cac89..a402d9c6 100644 --- a/UotanToolbox/Common/Global.cs +++ b/UotanToolbox/Common/Global.cs @@ -26,6 +26,7 @@ internal class Global public static string emmcrom = ""; //工具箱版本 public static string currentVersion = "3.0.0"; + public static string BinVersion; } public class BootInfo { diff --git a/UotanToolbox/Common/StringHelper.cs b/UotanToolbox/Common/StringHelper.cs index ad8b71be..74cf333d 100644 --- a/UotanToolbox/Common/StringHelper.cs +++ b/UotanToolbox/Common/StringHelper.cs @@ -3,9 +3,11 @@ using System; using System.IO; using System.Linq; +using System.Threading.Tasks; using System.Text; using System.Text.RegularExpressions; using UotanToolbox.Features.Components; +using static System.Net.Mime.MediaTypeNames; namespace UotanToolbox.Common { @@ -229,6 +231,47 @@ public static int GetDPI(string wm, string dp) int dpi = Onlynum(wh[0]) * 160 / Onlynum(dp); return dpi; } + public static async Task GetBinVersion() + { + string sevenzip_version, adb_info, fb_info, file_info; + try + { + string sevenzip_info = await CallExternalProgram.SevenZip("--version"); + Regex regex = new Regex(@"Copyright \(c\) (\d{4}-\d{4}) Igor Pavlov : (\d{4}-\d{2}-\d{2})"); + Match match = regex.Match(sevenzip_info); + sevenzip_version = "7za: " + match.Value + "\n"; + } + catch + { + sevenzip_version = null; + } + try + { + adb_info = await CallExternalProgram.ADB("version"); + } + catch + { + adb_info = null; + } + try + { + fb_info = await CallExternalProgram.ADB("--version"); + } + catch + { + fb_info = null; + } + try + { + file_info = await CallExternalProgram.File("-v"); + } + catch + { + file_info = null; + } + + return "7za: "+sevenzip_version +"Android Debug Bridge: " +adb_info+ "Fastboot: "+fb_info + "File: "+file_info; + } public static string Partno(string parttable, string findpart)//分区号 { diff --git a/UotanToolbox/Features/Home/HomeViewModel.cs b/UotanToolbox/Features/Home/HomeViewModel.cs index 86c98f82..ffd83cda 100644 --- a/UotanToolbox/Features/Home/HomeViewModel.cs +++ b/UotanToolbox/Features/Home/HomeViewModel.cs @@ -75,6 +75,8 @@ await Dispatcher.UIThread.InvokeAsync(async () => Process.GetCurrentProcess().Kill(); }); } + Global.BinVersion = await StringHelper.GetBinVersion(); + } public async Task GetDevicesList() diff --git a/UotanToolbox/Features/Settings/SettingsView.axaml b/UotanToolbox/Features/Settings/SettingsView.axaml index 35364c39..06acd325 100644 --- a/UotanToolbox/Features/Settings/SettingsView.axaml +++ b/UotanToolbox/Features/Settings/SettingsView.axaml @@ -258,17 +258,17 @@ - 7Zip (download from https://www.7-zip.org/download.html) - Android-Platform-Tools (from AOSP) + Android-Platform-Tools (from AOSP) Avalonia (Avalonia™ is a registered trademark of AvaloniaUI OÜ.) File (cross compiled from Github repo https://github.com/file/file) MagiskBoot of unix (from Github repo https://github.com/ookiineko/magiskboot_build) + MiSans (from )https://hyperos.mi.com/font MagiskBoot of win (from Github repo https://github.com/affggh/Magisk_patcher) QCNTool (from Github repo https://github.com/MindowsToolBox/QCNTool) QMSL_MSVC10R.dll (from QPST) Suki UI (modified from Github repo https://github.com/kikipoulet/SukiUI) - + BinVersion: