Skip to content

Commit

Permalink
add binversion show
Browse files Browse the repository at this point in the history
  • Loading branch information
13584452567 committed Jul 24, 2024
1 parent ec2478e commit b253470
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 3 deletions.
1 change: 1 addition & 0 deletions UotanToolbox/Common/Global.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
43 changes: 43 additions & 0 deletions UotanToolbox/Common/StringHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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<string> 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)//分区号
{
Expand Down
2 changes: 2 additions & 0 deletions UotanToolbox/Features/Home/HomeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ await Dispatcher.UIThread.InvokeAsync(async () =>
Process.GetCurrentProcess().Kill();
});
}
Global.BinVersion = await StringHelper.GetBinVersion();

}

public async Task<bool> GetDevicesList()
Expand Down
6 changes: 3 additions & 3 deletions UotanToolbox/Features/Settings/SettingsView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,17 +258,17 @@
<DockPanel>
<StackPanel Orientation="Vertical">
<TextBlock Text="{x:Static assets:Resources.Settings_DisplayedProjects}" />

<TextBlock>7Zip (download from https://www.7-zip.org/download.html)</TextBlock>
<TextBlock>Android-Platform-Tools (from AOSP)</TextBlock>
<TextBlock>Android-Platform-Tools (from AOSP)</TextBlock>
<TextBlock>Avalonia (Avalonia™ is a registered trademark of AvaloniaUI OÜ.)</TextBlock>
<TextBlock>File (cross compiled from Github repo https://github.com/file/file)</TextBlock>
<TextBlock>MagiskBoot of unix (from Github repo https://github.com/ookiineko/magiskboot_build)</TextBlock>
<TextBlock>MiSans (from )https://hyperos.mi.com/font</TextBlock>
<TextBlock>MagiskBoot of win (from Github repo https://github.com/affggh/Magisk_patcher)</TextBlock>
<TextBlock>QCNTool (from Github repo https://github.com/MindowsToolBox/QCNTool)</TextBlock>
<TextBlock>QMSL_MSVC10R.dll (from QPST)</TextBlock>
<TextBlock>Suki UI (modified from Github repo https://github.com/kikipoulet/SukiUI)</TextBlock>

<TextBlock>BinVersion:</TextBlock>
</StackPanel>
</DockPanel>
</controls:GlassCard>
Expand Down

0 comments on commit b253470

Please sign in to comment.