mirror of
https://github.com/ReneLergner/WPinternals.git
synced 2026-06-14 03:16:40 +10:00
Code update
- WPinternals is now a .NET Core 3.0 application - Implemented new unlock process for Spec A devices - Updated logic for unlocking Spec B devices - Implemented MMOS support for Spec B devices - Implemented battery status in Flash Mode - Implemented Fuse configuration information in Flash Mode - Implemented Reboot from mass storage for Spec A and some Spec B devices - Implemented shutdown from flash mode (preliminary) - Fixed label mode support for Spec B
This commit is contained in:
@@ -75,7 +75,10 @@ namespace WPinternals
|
||||
bool HasNewBootloader = HasNewBootloaderFromMassStorage();
|
||||
string EFIESPPath = HasNewBootloader ? null : ((MassStorage)PhoneNotifier.CurrentModel).Drive + @"\EFIESP\";
|
||||
string MainOSPath = ((MassStorage)PhoneNotifier.CurrentModel).Drive + @"\";
|
||||
StartPatch(EFIESPPath, MainOSPath, HasNewBootloader);
|
||||
|
||||
bool HasV11Patches = HasV11PatchesFromMassStorage();
|
||||
|
||||
StartPatch(EFIESPPath, MainOSPath, HasNewBootloader, HasV11Patches);
|
||||
}
|
||||
catch (Exception Ex)
|
||||
{
|
||||
@@ -88,12 +91,12 @@ namespace WPinternals
|
||||
|
||||
internal void DoUnlockImage(string EFIESPMountPoint, string MainOSMountPoint)
|
||||
{
|
||||
StartPatch(EFIESPMountPoint, MainOSMountPoint, false); // Unlock image is only supported for Lumia's with bootloader Spec A. Due to complexity of Spec B bootloader hack, it cannot be applied on a mounted image.
|
||||
StartPatch(EFIESPMountPoint, MainOSMountPoint, false, false); // Unlock image is only supported for Lumia's with bootloader Spec A. Due to complexity of Spec B bootloader hack, it cannot be applied on a mounted image.
|
||||
}
|
||||
|
||||
// Magic!
|
||||
// Apply patches for Root Access
|
||||
private void StartPatch(string EFIESP, string MainOS, bool HasNewBootloader)
|
||||
private void StartPatch(string EFIESP, string MainOS, bool HasNewBootloader, bool HasV11Patches)
|
||||
{
|
||||
IsSwitchingInterface = false;
|
||||
new Thread(() =>
|
||||
@@ -105,7 +108,7 @@ namespace WPinternals
|
||||
|
||||
bool Result = false;
|
||||
|
||||
if (EFIESP != null)
|
||||
if (EFIESP != null && !HasV11Patches)
|
||||
{
|
||||
if (DoUnlock)
|
||||
ActivateSubContext(new BusyViewModel("Enable Root Access on EFIESP..."));
|
||||
@@ -239,5 +242,18 @@ namespace WPinternals
|
||||
Phone.CloseVolume();
|
||||
return Result;
|
||||
}
|
||||
|
||||
private bool HasV11PatchesFromMassStorage()
|
||||
{
|
||||
bool Result = false;
|
||||
MassStorage Phone = (MassStorage)PhoneNotifier.CurrentModel;
|
||||
Phone.OpenVolume(false);
|
||||
byte[] GPTBuffer = Phone.ReadSectors(1, 33);
|
||||
GPT GPT = new WPinternals.GPT(GPTBuffer);
|
||||
Partition Partition = GPT.GetPartition("BACKUP_BS_NV");
|
||||
Result = Partition != null;
|
||||
Phone.CloseVolume();
|
||||
return Result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user