Skip to content

Commit

Permalink
unfinihsed OTA tool
Browse files Browse the repository at this point in the history
  • Loading branch information
openshwprojects committed Feb 14, 2025
1 parent 339f0dc commit 757c510
Show file tree
Hide file tree
Showing 4 changed files with 264 additions and 27 deletions.
4 changes: 4 additions & 0 deletions BK7231Flasher/BK7231Flasher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,10 @@ bool getBus()
{
if(tr % 10 == 0)
{
//serial.RtsEnable = true;
// Thread.Sleep(10);
// serial.RtsEnable = false;
// OBK commandline reboot
serial.WriteLine("reboot");
}
for (int l = 0; l < loops && !bOk; l++)
Expand Down
20 changes: 2 additions & 18 deletions BK7231Flasher/FormDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ void doDownloadInternal() {
setState("Downloading main Releases page...", Color.Transparent);
Thread.Sleep(200);
addLog("Target platform: " + bkType);
ServicePointManager.ServerCertificateValidationCallback += ValidateRemoteCertificate;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolTypeExtensions.Tls11 | SecurityProtocolTypeExtensions.Tls12;// | SecurityProtocolType.Ssl3;


WebClient webClient = new WebClient();
webClient.DownloadProgressChanged += (s, e) =>
{
Expand All @@ -88,8 +88,6 @@ void doDownloadInternal() {
webClient.DownloadFileCompleted += (s, e) =>
{
};
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolTypeExtensions.Tls11 | SecurityProtocolTypeExtensions.Tls12;// | SecurityProtocolType.Ssl3;
webClient.Headers.Add("user-agent", "request");
addLog("Will request page: " + list_url);
string contents = webClient.DownloadString(list_url);
Expand Down Expand Up @@ -168,19 +166,5 @@ string pickQuotedString(string buffer, int at)
}
return buffer.Substring(start, end - start);
}
private static bool ValidateRemoteCertificate(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error)
{
// If the certificate is a valid, signed certificate, return true.
if (error == System.Net.Security.SslPolicyErrors.None)
{
return true;
}

Console.WriteLine("X509Certificate [{0}] Policy Error: '{1}'",
cert.Subject,
error.ToString());

return false;
}
}
}
162 changes: 153 additions & 9 deletions BK7231Flasher/FormMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 757c510

Please sign in to comment.