Skip to content

Commit

Permalink
HOTFIX V28F
Browse files Browse the repository at this point in the history
  • Loading branch information
werasik2aa committed Jan 9, 2024
1 parent c737a2c commit 5e5a15b
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 126 deletions.
2 changes: 1 addition & 1 deletion HuaweiUnlock/LangProc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace HuaweiUnlocker
{
public static class LangProc
{
public const string APP_VERSION = "27F";
public const string APP_VERSION = "28F";
public static TextBox LOGGBOX;
public static string log, loge, newline = Environment.NewLine, PrevFolder = "c:\\";
private static StreamWriter se = new StreamWriter("log.txt");
Expand Down
2 changes: 1 addition & 1 deletion HuaweiUnlock/TOOLS/Fastboot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private FastbootStatus GetStatus(string header)
return FastbootStatus.Unknown;
}
}
public bool Connect(int waittime = 0)
public bool Connect(int waittime = 100)
{
if (waittime == 0) waittime = DefaultTimeoutWait;
if (device != null) Disconnect();
Expand Down
22 changes: 9 additions & 13 deletions HuaweiUnlock/TOOLS/HISI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class HISI
public delegate void RunWorkerCompletedHandler();
public event RunWorkerCompletedHandler RunWorkerCompleted;

private Fastboot fb;
private Fastboot fb = new Fastboot();
public string BSN = "NaN";
public string BNUM = "NaN";
public string AVER = "NaN";
Expand Down Expand Up @@ -60,7 +60,7 @@ public void FlashBootloader(Bootloader bootloader, string port)

flasher.Close();
}
public bool ReadInfo(int waittime = 0)
public bool ReadInfo(int waittime = 100)
{
if (fb.Connect(waittime))
{
Expand Down Expand Up @@ -190,14 +190,14 @@ public string ReadFactoryKey()
var res = fb.Command("getvar:nve:WVLOCK");
var match = Regex.Match(res.Payload, @"[\w\d]{16}");

return match.Success ? match.Value : null;
return match.Success ? match.Value : "NaN";
}
public string ReadFactoryKeyMethod2()
{
var res = fb.Command("getvar:nve:USRKEY");
var match = Regex.Match(res.Payload, @"[\w\d]{16}");

return match.Success ? match.Value : null;
return match.Success ? match.Value : "NaN";
}
public string ReadIndentifier()
{
Expand Down Expand Up @@ -249,7 +249,7 @@ public string WriteBOOTLOADERKEY(string key)
}
public string UnlockSec_Method2()
{
if(fb.Connect())
if(IsDeviceConnected())
{
var res = fb.Command("oem sec_unlock");
LOG(0, res.Payload);
Expand All @@ -263,13 +263,9 @@ public bool IsDeviceConnected()
}
public string Reboot()
{
if (fb.Connect())
{
var res = fb.Command("reboot");
LOG(0, res.Payload);
return res.Payload;
}
return "NaN";
var res = fb.Command("reboot");
LOG(0, res.Payload);
return res.Payload;
}
public void WriteKirinBootloader(Bootloader d, string port)
{
Expand All @@ -296,7 +292,7 @@ public void StartUnlockPRCS(bool frp, string key, Bootloader d, string port)
FlashBootloader(d, port);

LOG(0, "[Fastboot] ", "CheckCon");
if (ReadInfo())
if (fb.Connect())
{
if (!frp)
{
Expand Down
Loading

0 comments on commit 5e5a15b

Please sign in to comment.