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:
Gus
2019-07-26 17:15:20 +02:00
parent b062efab52
commit 5dae1da560
58 changed files with 5522 additions and 66864 deletions
+31 -18
View File
@@ -18,46 +18,59 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
namespace WPinternals
{
internal class NokiaModeMassStorageViewModel : ContextViewModel
{
private NokiaPhoneModel CurrentModel;
private MassStorage CurrentModel;
private Action<PhoneInterfaces?> RequestModeSwitch;
internal NokiaModeMassStorageViewModel(NokiaPhoneModel CurrentModel)
internal NokiaModeMassStorageViewModel(NokiaPhoneModel CurrentModel, Action<PhoneInterfaces?> RequestModeSwitch)
: base()
{
this.CurrentModel = CurrentModel;
this.CurrentModel = (MassStorage)CurrentModel;
this.RequestModeSwitch = RequestModeSwitch;
}
internal void RebootTo(string Mode)
private bool _SupportsReboot = false;
public bool SupportsReboot
{
string DeviceMode;
get
{
return _SupportsReboot;
}
set
{
_SupportsReboot = value;
OnPropertyChanged("SupportsReboot");
}
}
internal override void EvaluateViewState()
{
if (IsActive)
SupportsReboot = CurrentModel.DoesDeviceSupportReboot();
}
public void RebootTo(string Mode)
{
switch (Mode)
{
case "Flash":
DeviceMode = "Flash";
LogFile.Log("Reboot to Flash");
case "Normal":
RequestModeSwitch(PhoneInterfaces.Lumia_Normal);
break;
case "Label":
DeviceMode = "Test";
LogFile.Log("Reboot to Label");
RequestModeSwitch(PhoneInterfaces.Lumia_Label);
break;
case "MassStorage":
DeviceMode = "Flash"; // TODO: implement folow-up
LogFile.Log("Reboot to Mass Storage");
case "Flash":
RequestModeSwitch(PhoneInterfaces.Lumia_Flash);
break;
default:
return;
}
Dictionary<string, object> Params = new Dictionary<string, object>();
Params.Add("DeviceMode", DeviceMode);
Params.Add("ResetMethod", "HwReset");
CurrentModel.ExecuteJsonMethodAsync("SetDeviceMode", Params);
}
}
}