Skip to content

Commit

Permalink
adbwindow: arch checking
Browse files Browse the repository at this point in the history
  • Loading branch information
hariimurti committed Jun 6, 2020
1 parent 8325893 commit 9f2abfe
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ApkManager/AdbWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,20 @@ private async void ComboDevices_SelectionChanged(object sender, SelectionChanged
if (!string.IsNullOrWhiteSpace(address))
{
var device = await adb.GetDevice(address);
var supported = apk.SdkVersion <= device.Sdk;
var isArchSupported = apk.AbiList.Equals("any-cpu") || apk.Platforms.Contains(device.Arch) ||
(apk.AbiList.Equals("armeabi") && device.Arch.StartsWith("arm"));
var isSdkSupported = apk.SdkVersion <= device.Sdk;

txtDevice.Text = device.Name;
txtAndroid.Text = device.Android;
txtArch.Text = device.Arch;
txtArch.Foreground = isArchSupported ? txtArch.Foreground : Brushes.Red;
txtArch.ToolTip = isArchSupported ? null : "not compatible";
txtSdk.Text = device.Sdk.ToString();
txtSdk.Foreground = supported ? txtArch.Foreground : Brushes.Red;
txtSdk.Foreground = isSdkSupported ? txtArch.Foreground : Brushes.Red;
txtSdk.ToolTip = isSdkSupported ? null : "not compatible";
gbAction.IsEnabled = true;
btnMenuInstall.IsEnabled = supported;
btnMenuInstall.IsEnabled = isArchSupported && isSdkSupported;
}
}

Expand Down

0 comments on commit 9f2abfe

Please sign in to comment.