Enhancements

- Improved error messages
- Added shutdown functionality from mass stoage
- Fixed an issue where 9006 would incorrectly be used for rebooting from mass storage
- Added support for gathering security information from older flash apps
- Added a new indicator in the empty view when a phone in bootloader mode is detected
- Fixed an issue where interrupting the bootloader may fail
- Added more checks to some functions
- Started to work on a bootloader view
- Fixed an issue where x50 phones in label mode would not get detected once being disconnected
- Added logging for Qualcomm Emergency Charging mode
- General bug fixes
This commit is contained in:
Gus
2019-12-28 09:39:02 +01:00
parent fa896b7c39
commit 81145ed0e9
30 changed files with 921 additions and 159 deletions
+53 -6
View File
@@ -19,6 +19,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
@@ -32,12 +33,39 @@ namespace WPinternals
/// </summary>
public partial class Empty : UserControl
{
static PhoneNotifierViewModel PhoneNotifier;
static SynchronizationContext UIContext;
// Dependency injection is not possible here, because this ViewModel is used in a Style.
public Empty()
{
InitializeComponent();
InterruptBoot = App.InterruptBoot;
UIContext = SynchronizationContext.Current;
// Setting these properties in XAML results in an error. Why?
GifImage.GifSource = @"/aerobusy.gif";
GifImage.AutoStart = true;
Loaded += Empty_Loaded;
Unloaded += Empty_Unloaded;
}
private void Empty_Unloaded(object sender, RoutedEventArgs e)
{
PhoneNotifier.NewDeviceArrived -= PhoneNotifier_NewDeviceArrived;
}
private void Empty_Loaded(object sender, RoutedEventArgs e)
{
// Find the phone notifier
DependencyObject obj = (DependencyObject)sender;
while (!(obj is MainWindow))
obj = VisualTreeHelper.GetParent(obj);
PhoneNotifier = ((MainViewModel)(((MainWindow)obj).DataContext)).PhoneNotifier;
PhoneNotifier.NewDeviceArrived += PhoneNotifier_NewDeviceArrived;
}
private void HandleHyperlinkClick(object sender, RoutedEventArgs args)
@@ -81,12 +109,6 @@ namespace WPinternals
if ((bool)e.NewValue)
{
// Find the phone notifier
DependencyObject obj = d;
while (!(obj is MainWindow))
obj = VisualTreeHelper.GetParent(obj);
PhoneNotifierViewModel PhoneNotifier = ((MainViewModel)(((MainWindow)obj).DataContext)).PhoneNotifier;
if (PhoneNotifier.CurrentInterface == PhoneInterfaces.Lumia_Bootloader)
{
App.InterruptBoot = false;
@@ -95,5 +117,30 @@ namespace WPinternals
}
}
}
internal void PhoneNotifier_NewDeviceArrived(ArrivalEventArgs Args)
{
if (App.InterruptBoot && Args.NewInterface == PhoneInterfaces.Lumia_Bootloader)
{
App.InterruptBoot = false;
LogFile.Log("Found Lumia BootMgr and user forced to interrupt the boot process. Force to Flash-mode.");
Task.Run(() => SwitchModeViewModel.SwitchTo(PhoneNotifier, PhoneInterfaces.Lumia_Flash));
}
UIContext.Send(s =>
{
if (!App.InterruptBoot && Args.NewInterface == PhoneInterfaces.Lumia_Bootloader)
{
StatusText.Content = "Phone is booting...";
GifImage.Visibility = Visibility.Visible;
}
if (!App.InterruptBoot && Args.NewInterface != PhoneInterfaces.Lumia_Bootloader)
{
StatusText.Content = "Waiting for connection with phone...";
GifImage.Visibility = Visibility.Collapsed;
}
}, null);
}
}
}