Skip to content

Commit

Permalink
v0.1.21更新
Browse files Browse the repository at this point in the history
  • Loading branch information
wherewhere committed Dec 28, 2022
1 parent 11f14a6 commit 565314f
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 14 deletions.
2 changes: 1 addition & 1 deletion APKInstaller/APKInstaller/APKInstaller.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<TargetPlatformMaxVersion>10.0.22621.0</TargetPlatformMaxVersion>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<UseWinUI>True</UseWinUI>
<VersionPrefix>0.1.20</VersionPrefix>
<VersionPrefix>0.1.21</VersionPrefix>
</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion APKInstaller/APKInstaller/Helpers/AddressHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static async Task ConnectHyperV()
}
}

public static async Task<IEnumerable<string>> ConnectHyperVAsync()
public static async Task<List<string>> ConnectHyperVAsync()
{
AdbClient AdbClient = new();
List<string> addresses = await GetAddressID("00-15-5d");
Expand Down
3 changes: 1 addition & 2 deletions APKInstaller/APKInstaller/Helpers/UIHelper.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using AAPTForNet.Models;
using AdvancedSharpAdbClient;
using AdvancedSharpAdbClient;
using APKInstaller.Pages;
using CommunityToolkit.WinUI;
using Microsoft.UI.Dispatching;
Expand Down
2 changes: 1 addition & 1 deletion APKInstaller/APKInstaller/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Identity
Name="18184wherewhere.AndroidAppInstaller"
Publisher="CN=2C3A37C0-35FC-4839-B08C-751C1C1AFBF5"
Version="0.1.20.0" />
Version="0.1.21.0" />

<Properties>
<DisplayName>APK 安装程序</DisplayName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,16 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
if (SettingsViewModel.Caches != null)
{
Provider = SettingsViewModel.Caches;
if (AdbServer.Instance.GetStatus().IsRunning)
{
Provider.DeviceList = new AdbClient().GetDevices();
}
}
else
{
Provider = new SettingsViewModel(this);
if (Provider.UpdateDate == DateTime.MinValue) { Provider.CheckUpdate(); }
if (AdbServer.Instance.GetStatus().IsRunning)
{
ADBHelper.Monitor.DeviceChanged += Provider.OnDeviceChanged;
Provider.DeviceList = new AdbClient().GetDevices();
}
}
if (AdbServer.Instance.GetStatus().IsRunning)
{
ADBHelper.Monitor.DeviceChanged += Provider.OnDeviceChanged;
Provider.DeviceList = new AdbClient().GetDevices();
}
DataContext = Provider;
Provider.GetADBVersion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
Expand Down Expand Up @@ -460,6 +461,24 @@ public void ChooseDevice()
public async void ConnectDevice(string ip)
{
ConnectingDevice = true;
IAdbServer ADBServer = AdbServer.Instance;
if (!ADBServer.GetStatus().IsRunning)
{
try
{
_ = await Task.Run(() => ADBServer.StartServer(ADBPath, restartServerIfNewer: false));
ADBHelper.Monitor.DeviceChanged += OnDeviceChanged;
}
catch (Exception ex)
{
SettingsHelper.LogManager.GetLogger(nameof(SettingsViewModel)).Warn(ex.ExceptionToMessage(), ex);
ConnectInfoSeverity = InfoBarSeverity.Warning;
ConnectInfoTitle = ResourceLoader.GetForViewIndependentUse("InstallPage").GetString("ADBMissing");
ConnectInfoIsOpen = true;
ConnectingDevice = false;
return;
}
}
string results = (await new AdbClient().Connect(ip)).TrimStart();
if (results.ToLowerInvariant().StartsWith("connected to"))
{
Expand Down

0 comments on commit 565314f

Please sign in to comment.