From bc77e8b5891a2a5573c97aad0132fe765c70b011 Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Mon, 21 Oct 2024 08:56:11 +0200 Subject: [PATCH] Fixes --- WPinternals/Models/Lumia/UEFI/Flash/LumiaFlashAppModel.cs | 8 ++++++++ WPinternals/ViewModels/LumiaUnlockBootViewModel.cs | 1 - WPinternals/ViewModels/LumiaUnlockBootloaderViewModel.cs | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/WPinternals/Models/Lumia/UEFI/Flash/LumiaFlashAppModel.cs b/WPinternals/Models/Lumia/UEFI/Flash/LumiaFlashAppModel.cs index 4bec86e..accaa24 100644 --- a/WPinternals/Models/Lumia/UEFI/Flash/LumiaFlashAppModel.cs +++ b/WPinternals/Models/Lumia/UEFI/Flash/LumiaFlashAppModel.cs @@ -779,6 +779,14 @@ namespace WPinternals.Models.UEFIApps.Flash ExecuteRawMethod(Request); } + // Erases MODEM_FS1 and MODEM_FS2, and restores MODEM_FSG to MODEM_FS1 + internal void DoFactoryReset() + { + byte[] Request = new byte[4]; + ByteOperations.WriteAsciiString(Request, 0, FactoryResetSignature); + ExecuteRawMethod(Request); + } + internal void EndAsyncFlash() { byte[] Request = new byte[7]; diff --git a/WPinternals/ViewModels/LumiaUnlockBootViewModel.cs b/WPinternals/ViewModels/LumiaUnlockBootViewModel.cs index 7b128a1..f2f927e 100644 --- a/WPinternals/ViewModels/LumiaUnlockBootViewModel.cs +++ b/WPinternals/ViewModels/LumiaUnlockBootViewModel.cs @@ -261,7 +261,6 @@ namespace WPinternals await StorePaths(); bool AlreadyUnlocked = false; - LumiaFlashAppModel FlashModel = (LumiaFlashAppModel)PhoneNotifier.CurrentModel; MachineState OriginalState = State; State = MachineState.LumiaGetGPT; // Stop handling arrival notifications in this screen diff --git a/WPinternals/ViewModels/LumiaUnlockBootloaderViewModel.cs b/WPinternals/ViewModels/LumiaUnlockBootloaderViewModel.cs index 8df17a5..4cecebf 100644 --- a/WPinternals/ViewModels/LumiaUnlockBootloaderViewModel.cs +++ b/WPinternals/ViewModels/LumiaUnlockBootloaderViewModel.cs @@ -60,7 +60,7 @@ namespace WPinternals if (ModernFlashApp) { - FlashModel.SwitchToFlashAppContext(); + FlashModel.SwitchToBootManagerContext(); } else {