Skip to content

Commit

Permalink
refactor: introducing hadesFirm update
Browse files Browse the repository at this point in the history
  • Loading branch information
corsicanu committed Sep 5, 2021
1 parent f3b6b63 commit 559a7e8
Show file tree
Hide file tree
Showing 26 changed files with 66 additions and 59 deletions.
4 changes: 2 additions & 2 deletions AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
using System.Runtime.InteropServices;

[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SamFirm Reborn")]
[assembly: AssemblyProduct("hadesFirm Reborn")]
[assembly: AssemblyFileVersion("0.3.6.3")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCopyright("Copyright zxz0O0 © 2015 / Ivan Meler 2021")]
[assembly: AssemblyTitle("SamFirm Reborn")]
[assembly: AssemblyTitle("hadesFirm Reborn")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("f64041a3-90f5-4bee-a430-1c0f1d604eee")]
Expand Down
18 changes: 9 additions & 9 deletions CmdLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.IO;
using System.Threading;

namespace SamFirm
namespace hadesFirm
{
internal class CmdLine
{
Expand Down Expand Up @@ -50,7 +50,7 @@ private static int ProcessAction()

private static int DoDecrypt()
{
Logger.WriteLog("========== SamFirm Firmware Decrypter ==========\n", false);
Logger.WriteLog("========== hadesFirm Firmware Decrypter ==========\n", false);
Logger.WriteLog("Decrypting file " + CmdLine.file + "...", false);
CmdLine.CreateProgressbar();
if (CmdLine.file.EndsWith(".enc2"))
Expand All @@ -70,7 +70,7 @@ private static int DoDecrypt()

private static int DoCheck()
{
Logger.WriteLog("========== SamFirm Firmware Update Check ==========\n", false);
Logger.WriteLog("========== hadesFirm Firmware Update Check ==========\n", false);
Command.Firmware firmware;
if (string.IsNullOrEmpty(CmdLine.version))
{
Expand All @@ -85,7 +85,7 @@ private static int DoCheck()

private static int DoDownload()
{
Logger.WriteLog("========== SamFirm Firmware Downloader ==========\n", false);
Logger.WriteLog("========== hadesFirm Firmware Downloader ==========\n", false);
Command.Firmware fw;
if (string.IsNullOrEmpty(CmdLine.version))
{
Expand Down Expand Up @@ -185,12 +185,12 @@ private static void DisplayUsage()
{
Logger.WriteLog("Usage:\n", false);
Logger.WriteLog("Update check:", false);
Logger.WriteLog(" SamFirm.exe -c -model [device model] -region [region code]\n [-version [pda/csc/phone/data]] [-binary]", false);
Logger.WriteLog(" hadesFirm.exe -c -model [device model] -region [region code]\n [-version [pda/csc/phone/data]] [-binary]", false);
Logger.WriteLog("\nDecrypting:", false);
Logger.WriteLog(" SamFirm.exe -file [path-to-file.zip.enc2] -version [pda/csc/phone/data]", false);
Logger.WriteLog(" SamFirm.exe -file [path-to-file.zip.enc4] -version [pda/csc/phone/data] -logicValue [logicValue]", false);
Logger.WriteLog(" hadesFirm.exe -file [path-to-file.zip.enc2] -version [pda/csc/phone/data]", false);
Logger.WriteLog(" hadesFirm.exe -file [path-to-file.zip.enc4] -version [pda/csc/phone/data] -logicValue [logicValue]", false);
Logger.WriteLog("\nDownloading:", false);
Logger.WriteLog(" SamFirm.exe -model [device model] -region [region code]\n [-version [pda/csc/phone/data]] [-folder [output folder]]\n [-binary] [-autodecrypt]", false);
Logger.WriteLog(" hadesFirm.exe -model [device model] -region [region code]\n [-version [pda/csc/phone/data]] [-folder [output folder]]\n [-binary] [-autodecrypt]", false);
}

private static void SaveMeta(Command.Firmware fw)
Expand All @@ -201,7 +201,7 @@ private static void SaveMeta(Command.Firmware fw)
Directory.CreateDirectory(Path.GetDirectoryName(CmdLine.metafile));
using (TextWriter text = (TextWriter) File.CreateText(CmdLine.metafile))
{
text.WriteLine("[SamFirmData]");
text.WriteLine("[hadesFirmData]");
text.WriteLine("Model=" + fw.Model);
text.WriteLine("Devicename=" + fw.DisplayName);
text.WriteLine("Region=" + fw.Region);
Expand Down
2 changes: 1 addition & 1 deletion Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;

namespace SamFirm
namespace hadesFirm
{
internal class Command
{
Expand Down
2 changes: 1 addition & 1 deletion Crypto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Security.Cryptography;
using System.Text;

namespace SamFirm
namespace hadesFirm
{
internal class Crypto
{
Expand Down
2 changes: 1 addition & 1 deletion Error.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace SamFirm
namespace hadesFirm
{
public enum Error
{
Expand Down
2 changes: 1 addition & 1 deletion FWFetch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Net;
using System.Text.RegularExpressions;

namespace SamFirm
namespace hadesFirm
{
internal class FWFetch
{
Expand Down
6 changes: 3 additions & 3 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using System.Threading;
using System.Windows.Forms;

namespace SamFirm
namespace hadesFirm
{
public class Form1 : Form
{
Expand Down Expand Up @@ -84,7 +84,7 @@ private void Form1_Load(object sender, EventArgs e)
this.checkbox_autodecrypt.Checked = false;
this.tooltip_binary.SetToolTip((Control) this.binary_lbl, "Full firmware including PIT file");
this.tooltip_binary_box.SetToolTip((Control) this.binary_checkbox, "Full firmware including PIT file");
Logger.WriteLog("SamFirm v" + FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion, false);
Logger.WriteLog("hadesFirm v" + FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion, false);
ServicePointManager.ServerCertificateValidationCallback = (RemoteCertificateValidationCallback) ((senderX, certificate, chain, sslPolicyErrors) => true);
}

Expand Down Expand Up @@ -668,7 +668,7 @@ private void InitializeComponent()
this.Controls.Add((Control) this.log_textbox);
this.Icon = (Icon) componentResourceManager.GetObject("$this.Icon");
this.Name = nameof (Form1);
this.Text = "SamFirm";
this.Text = "hadesFirm";
this.FormClosing += new FormClosingEventHandler(this.Form1_Close);
this.Load += new EventHandler(this.Form1_Load);
this.groupBox1.ResumeLayout(false);
Expand Down
9 changes: 5 additions & 4 deletions Form1.resx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Imports.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Reflection;
using System.Runtime.InteropServices;

namespace SamFirm
namespace hadesFirm
{
internal class Imports
{
Expand Down
2 changes: 1 addition & 1 deletion KiesRequest.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Net;

namespace SamFirm
namespace hadesFirm
{
internal class KiesRequest : WebRequest
{
Expand Down
6 changes: 3 additions & 3 deletions Logger.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.IO;

namespace SamFirm
namespace hadesFirm
{
internal class Logger
{
Expand Down Expand Up @@ -62,8 +62,8 @@ public static void WriteLog(string str, bool raw = false)
public static void SaveLog()
{
string AppLocation = System.AppDomain.CurrentDomain.BaseDirectory;
string LogFile = AppLocation + "SamFirm.log";
string OldLogFile = AppLocation + "SamFirm.log.old";
string LogFile = AppLocation + "hadesFirm.log";
string OldLogFile = AppLocation + "hadesFirm.log.old";

if (string.IsNullOrEmpty(Logger.form.log_textbox.Text))
return;
Expand Down
2 changes: 1 addition & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Diagnostics;
using System.Windows.Forms;

namespace SamFirm
namespace hadesFirm
{
internal static class Program
{
Expand Down
12 changes: 6 additions & 6 deletions Properties/Resources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Resources;
using System.Runtime.CompilerServices;

namespace SamFirm.Properties
namespace hadesFirm.Properties
{
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[DebuggerNonUserCode]
Expand All @@ -24,9 +24,9 @@ internal static ResourceManager ResourceManager
{
get
{
if (object.ReferenceEquals((object) SamFirm.Properties.Resources.resourceMan, (object) null))
SamFirm.Properties.Resources.resourceMan = new ResourceManager("SamFirm.Properties.Resources", typeof (SamFirm.Properties.Resources).Assembly);
return SamFirm.Properties.Resources.resourceMan;
if (object.ReferenceEquals((object) hadesFirm.Properties.Resources.resourceMan, (object) null))
hadesFirm.Properties.Resources.resourceMan = new ResourceManager("hadesFirm.Properties.Resources", typeof (hadesFirm.Properties.Resources).Assembly);
return hadesFirm.Properties.Resources.resourceMan;
}
}

Expand All @@ -35,11 +35,11 @@ internal static CultureInfo Culture
{
get
{
return SamFirm.Properties.Resources.resourceCulture;
return hadesFirm.Properties.Resources.resourceCulture;
}
set
{
SamFirm.Properties.Resources.resourceCulture = value;
hadesFirm.Properties.Resources.resourceCulture = value;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Properties/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Configuration;
using System.Runtime.CompilerServices;

namespace SamFirm.Properties
namespace hadesFirm.Properties
{
[GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
[CompilerGenerated]
Expand Down
Binary file added Resources/$this.Icon.ico
Binary file not shown.
16 changes: 8 additions & 8 deletions Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.IO;
using System.Xml.Linq;

namespace SamFirm
namespace hadesFirm
{
internal class Settings
{
Expand All @@ -11,12 +11,12 @@ internal class Settings
public static string ReadSetting(string element)
{
string AppLocation = System.AppDomain.CurrentDomain.BaseDirectory;
string SettingFile = AppLocation + "SamFirm.xml";
string SettingFile = AppLocation + "hadesFirm.xml";
try
{
if (!File.Exists(SettingFile))
Settings.GenerateSettings();
return XDocument.Load(SettingFile).Element((XName) "SamFirm").Element((XName) element).Value;
return XDocument.Load(SettingFile).Element((XName) "hadesFirm").Element((XName) element).Value;
}
catch (Exception ex)
{
Expand All @@ -28,13 +28,13 @@ public static string ReadSetting(string element)
public static void SetSetting(string element, string value)
{
string AppLocation = System.AppDomain.CurrentDomain.BaseDirectory;
string SettingFile = AppLocation + "SamFirm.xml";
string SettingFile = AppLocation + "hadesFirm.xml";
if (!File.Exists(SettingFile))
Settings.GenerateSettings();
XDocument xdocument = XDocument.Load(SettingFile);
XElement xelement = xdocument.Element((XName) "SamFirm").Element((XName) element);
XElement xelement = xdocument.Element((XName) "hadesFirm").Element((XName) element);
if (xelement == null)
xdocument.Element((XName) "SamFirm").Add((object) new XElement((XName) element, (object) value));
xdocument.Element((XName) "hadesFirm").Add((object) new XElement((XName) element, (object) value));
else
xelement.Value = value;
xdocument.Save(SettingFile);
Expand All @@ -43,8 +43,8 @@ public static void SetSetting(string element, string value)
private static void GenerateSettings()
{
string AppLocation = System.AppDomain.CurrentDomain.BaseDirectory;
string SettingFile = AppLocation + "SamFirm.xml";
File.WriteAllText(SettingFile, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<SamFirm>\r\n <SaveFileDialog></SaveFileDialog>\r\n <AutoInfo>true</AutoInfo>\r\n\t<Region></Region>\r\n\t<Model></Model>\r\n\t<PDAVer></PDAVer>\r\n\t<CSCVer></CSCVer>\r\n\t<PHONEVer></PHONEVer>\r\n <BinaryNature></BinaryNature>\r\n <CheckCRC></CheckCRC>\r\n <AutoDecrypt></AutoDecrypt>\r\n</SamFirm>");
string SettingFile = AppLocation + "hadesFirm.xml";
File.WriteAllText(SettingFile, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<hadesFirm>\r\n <SaveFileDialog></SaveFileDialog>\r\n <AutoInfo>true</AutoInfo>\r\n\t<Region></Region>\r\n\t<Model></Model>\r\n\t<PDAVer></PDAVer>\r\n\t<CSCVer></CSCVer>\r\n\t<PHONEVer></PHONEVer>\r\n <BinaryNature></BinaryNature>\r\n <CheckCRC></CheckCRC>\r\n <AutoDecrypt></AutoDecrypt>\r\n</hadesFirm>");
}
}
}
2 changes: 1 addition & 1 deletion Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using System.Text;
using System.Threading;

namespace SamFirm
namespace hadesFirm
{
public static class Utility
{
Expand Down
2 changes: 1 addition & 1 deletion Web.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using System.Text.RegularExpressions;

namespace SamFirm
namespace hadesFirm
{
internal class Web
{
Expand Down
2 changes: 1 addition & 1 deletion WebRequestExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Linq;
using System.Net;

namespace SamFirm
namespace hadesFirm
{
public static class WebRequestExtension
{
Expand Down
6 changes: 3 additions & 3 deletions Xml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Xml.Linq;

namespace SamFirm
namespace hadesFirm
{
internal class Xml
{
Expand Down Expand Up @@ -53,7 +53,7 @@ public static string GetXmlBinaryInform(
string dataver,
bool BinaryNature = false)
{
XDocument xdocument = XDocument.Parse(SamFirm.Xml.LatestVer);
XDocument xdocument = XDocument.Parse(hadesFirm.Xml.LatestVer);
XElement xelement = xdocument.Element((XName) "FUSMsg").Element((XName) "FUSBody").Element((XName) "Put");
xelement.Element((XName) "DEVICE_MODEL_NAME").Element((XName) "Data").Value = model;
xelement.Element((XName) "DEVICE_LOCAL_CODE").Element((XName) "Data").Value = region;
Expand All @@ -73,7 +73,7 @@ public static string GetXmlBinaryInit(
string region,
string model_type)
{
XDocument xdocument = XDocument.Parse(SamFirm.Xml.BinaryInit);
XDocument xdocument = XDocument.Parse(hadesFirm.Xml.BinaryInit);
XElement xelement = xdocument.Element((XName) "FUSMsg").Element((XName) "FUSBody").Element((XName) "Put");
xelement.Element((XName) "BINARY_FILE_NAME").Element((XName) "Data").Value = file;
xelement.Element((XName) "BINARY_VERSION").Element((XName) "Data").Value = version;
Expand Down
Binary file added bident_uRA_icon.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions customMessageBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Drawing;
using System.Windows.Forms;

namespace SamFirm
namespace hadesFirm
{
public class customMessageBox : Form
{
Expand Down Expand Up @@ -105,7 +105,7 @@ private void InitializeComponent()
this.MaximumSize = new Size(387, 133);
this.MinimumSize = new Size(387, 133);
this.Name = nameof (customMessageBox);
this.Text = "SamFirm";
this.Text = "hadesFirm";
((ISupportInitialize) this.pictureBox1).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
Expand Down
9 changes: 5 additions & 4 deletions customMessageBox.resx

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions SamFirm.csproj → hadesFirm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{588C13FB-D8C3-423B-92D4-5F6B1731C37D}</ProjectGuid>
<OutputType>Exe</OutputType>
<AssemblyName>SamFirm</AssemblyName>
<AssemblyName>hadesFirm</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<RootNamespace>SamFirm</RootNamespace>
<RootNamespace>hadesFirm</RootNamespace>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
Expand All @@ -31,7 +31,7 @@
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup>
<StartupObject>SamFirm.Program</StartupObject>
<StartupObject>hadesFirm.Program</StartupObject>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -53,6 +53,9 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>bident_uRA_icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System.Windows.Forms" />
<Reference Include="System" />
Expand Down Expand Up @@ -109,8 +112,10 @@
</ItemGroup>
<ItemGroup>
<Content Include="AgentModule.dll" />
<Content Include="bident_uRA_icon.ico" />
<Content Include="CommonModule.dll" />
<Content Include="GlobalUtil.dll" />
<None Include="Resources\%24this.Icon.ico" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
Expand Down
Binary file renamed SamFirm.pdb → hadesFirm.pdb
Binary file not shown.
Loading

0 comments on commit 559a7e8

Please sign in to comment.