mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-17 10:00:44 +08:00
fix: 强制替换adb报错
之后再加个吐司通知弹一下
This commit is contained in:
@@ -2703,12 +2703,28 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
const string UnzipDir = "adb";
|
||||
const string NewAdb = UnzipDir + "/platform-tools/adb.exe";
|
||||
|
||||
if (Directory.Exists(UnzipDir))
|
||||
try
|
||||
{
|
||||
Directory.Delete(UnzipDir, true);
|
||||
if (Directory.Exists(UnzipDir))
|
||||
{
|
||||
Directory.Delete(UnzipDir, true);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex.ToString() + "; already replace");
|
||||
return;
|
||||
}
|
||||
|
||||
ZipFile.ExtractToDirectory(GoogleAdbFilename, UnzipDir);
|
||||
try
|
||||
{
|
||||
ZipFile.ExtractToDirectory(GoogleAdbFilename, UnzipDir);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
bool replaced = false;
|
||||
if (AdbPath != NewAdb && File.Exists(AdbPath))
|
||||
|
||||
Reference in New Issue
Block a user