Skip to content

Commit 65362aa

Browse files
author
Andrey Smirnoff
authored
remove oem unlock. fix 16U bug
1 parent 0de7403 commit 65362aa

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

PotatoNV-next/Core.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ private void ReadInfo()
104104

105105
if (factoryKey != null)
106106
{
107-
Log.Info($"Unlock key: {factoryKey}");
107+
Log.Info($"Saved key: {factoryKey}");
108108
}
109109

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

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

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

165165
return match.Success ? match.Value : null;
166166
}
@@ -213,16 +213,13 @@ private void Worker_DoWork(object sender, DoWorkEventArgs e)
213213
ReadInfo();
214214
WriteNVME();
215215

216-
Log.Info("Finalizing...");
217-
LogResponse(fb.Command($"oem unlock {args.UnlockCode}"));
218-
219216
if (args.Reboot)
220217
{
221218
Log.Info("Rebooting...");
222219
fb.Command("reboot");
223220
}
224221

225-
Log.Info($"Bootloader unlock code: {args.UnlockCode}");
222+
Log.Info($"New unlock code: {args.UnlockCode}");
226223

227224
fb.Disconnect();
228225
}

PotatoNV-next/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020
ResourceDictionaryLocation.SourceAssembly
2121
)]
2222

23-
[assembly: AssemblyVersion("2.2.0.0")]
24-
[assembly: AssemblyFileVersion("2.2.0.0")]
23+
[assembly: AssemblyVersion("2.2.1.0")]
24+
[assembly: AssemblyFileVersion("2.2.1.0")]

0 commit comments

Comments
 (0)