Skip to content

Commit

Permalink
remove oem unlock. fix 16U bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Smirnoff committed Jun 28, 2021
1 parent 0de7403 commit 65362aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 4 additions & 7 deletions PotatoNV-next/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ private void ReadInfo()

if (factoryKey != null)
{
Log.Info($"Unlock key: {factoryKey}");
Log.Info($"Saved key: {factoryKey}");
}

var random = new Random(Guid.NewGuid().GetHashCode());

args.UnlockCode = factoryKey ?? new string(Enumerable.Repeat("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", 16)
args.UnlockCode = new string(Enumerable.Repeat("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", 16)
.Select(s => s[random.Next(s.Length)]).ToArray());
}

Expand Down Expand Up @@ -160,7 +160,7 @@ private void SetHWDogState(byte state)
private string ReadFactoryKey()
{
var res = fb.Command("getvar:nve:WVLOCK");
var match = Regex.Match(res.Payload, @"\w{16}");
var match = Regex.Match(res.Payload, @"[\w\d]{16}");

return match.Success ? match.Value : null;
}
Expand Down Expand Up @@ -213,16 +213,13 @@ private void Worker_DoWork(object sender, DoWorkEventArgs e)
ReadInfo();
WriteNVME();

Log.Info("Finalizing...");
LogResponse(fb.Command($"oem unlock {args.UnlockCode}"));

if (args.Reboot)
{
Log.Info("Rebooting...");
fb.Command("reboot");
}

Log.Info($"Bootloader unlock code: {args.UnlockCode}");
Log.Info($"New unlock code: {args.UnlockCode}");

fb.Disconnect();
}
Expand Down
4 changes: 2 additions & 2 deletions PotatoNV-next/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
ResourceDictionaryLocation.SourceAssembly
)]

[assembly: AssemblyVersion("2.2.0.0")]
[assembly: AssemblyFileVersion("2.2.0.0")]
[assembly: AssemblyVersion("2.2.1.0")]
[assembly: AssemblyFileVersion("2.2.1.0")]

0 comments on commit 65362aa

Please sign in to comment.