22using System ;
33using System . IO ;
44using System . Windows ;
5- using ZenTimings . Encryption ;
65
76namespace ZenTimings
87{
98 [ Serializable ]
109 public sealed class AppSettings
1110 {
1211 public const int VersionMajor = 1 ;
13- public const int VersionMinor = 8 ;
12+ public const int VersionMinor = 9 ;
1413
1514 private static readonly string Filename = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "settings.xml" ) ;
16- private static readonly string EncryptedFilename = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "settings.enc" ) ;
15+ // private static readonly string EncryptedFilename = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "settings.enc");
1716 public const string AGESA_UNKNOWN = "Unknown" ;
1817
1918 private static AppSettings _instance = null ;
20- private readonly AesEncryption aesEncryption = new AesEncryption ( ) ;
19+ // private readonly AesEncryption aesEncryption = new AesEncryption();
2120
2221 private AppSettings ( ) { }
2322
@@ -54,10 +53,10 @@ public enum ScreenshotType : int
5453
5554 public AppSettings Create ( bool save = true )
5655 {
57- if ( File . Exists ( EncryptedFilename ) )
58- {
59- AgesaVersion = aesEncryption . DecryptStringInMemory ( EncryptedFilename ) ;
60- }
56+ // if (File.Exists(EncryptedFilename))
57+ // {
58+ // AgesaVersion = aesEncryption.DecryptStringInMemory(EncryptedFilename);
59+ // }
6160
6261 if ( save ) Save ( ) ;
6362
@@ -70,24 +69,25 @@ public AppSettings Load()
7069 {
7170 try
7271 {
73- var decryptedAgesa = String . Empty ;
74- if ( File . Exists ( EncryptedFilename ) )
75- {
76- try
77- {
78- decryptedAgesa = aesEncryption . DecryptStringInMemory ( EncryptedFilename ) ;
79- }
80- catch ( Exception ex )
81- {
82- Console . WriteLine ( ex . Message ) ;
83- }
84- }
72+ // var decryptedAgesa = String.Empty;
73+ // if (File.Exists(EncryptedFilename))
74+ // {
75+ // try
76+ // {
77+ // decryptedAgesa = aesEncryption.DecryptStringInMemory(EncryptedFilename);
78+ // }
79+ // catch (Exception ex)
80+ // {
81+ // Console.WriteLine(ex.Message);
82+ // }
83+ // }
8584
8685 if ( File . Exists ( Filename ) )
8786 {
88- var deserializedSettings = XmlUtils . DeserializeFromXml < AppSettings > ( Filename ) ;
89- deserializedSettings . AgesaVersion = decryptedAgesa ;
90- return deserializedSettings ;
87+ //var deserializedSettings = XmlUtils.DeserializeFromXml<AppSettings>(Filename);
88+ //deserializedSettings.AgesaVersion = decryptedAgesa;
89+ //return deserializedSettings;
90+ return XmlUtils . DeserializeFromXml < AppSettings > ( Filename ) ;
9191 }
9292 }
9393 catch ( Exception ex )
@@ -112,18 +112,18 @@ public void Save()
112112
113113 Version = new Version ( VersionMajor , VersionMinor ) . ToString ( ) ;
114114
115- if ( CpuSingleton . Instance ? . systemInfo != null )
116- {
117- MbName = CpuSingleton . Instance . systemInfo . MbName ;
118- BiosVersion = CpuSingleton . Instance . systemInfo . BiosVersion ;
119- SmuVersion = CpuSingleton . Instance . systemInfo . GetSmuVersionString ( ) ;
120- if ( ! string . IsNullOrEmpty ( CpuSingleton . Instance . systemInfo . AgesaVersion ) )
121- {
122- AgesaVersion = CpuSingleton . Instance . systemInfo . AgesaVersion ;
123- }
124- }
125-
126- File . WriteAllBytes ( EncryptedFilename , aesEncryption . EncryptString ( this . AgesaVersion ) ) ;
115+ // if (CpuSingleton.Instance?.systemInfo != null)
116+ // {
117+ // MbName = CpuSingleton.Instance.systemInfo.MbName;
118+ // BiosVersion = CpuSingleton.Instance.systemInfo.BiosVersion;
119+ // SmuVersion = CpuSingleton.Instance.systemInfo.GetSmuVersionString();
120+ // if (!string.IsNullOrEmpty(CpuSingleton.Instance.systemInfo.AgesaVersion))
121+ // {
122+ // AgesaVersion = CpuSingleton.Instance.systemInfo.AgesaVersion;
123+ // }
124+ // }
125+
126+ // File.WriteAllBytes(EncryptedFilename, aesEncryption.EncryptString(this.AgesaVersion));
127127 string xmlContent = XmlUtils . SerializeToXml < AppSettings > ( this ) ;
128128 File . WriteAllText ( Filename , xmlContent ) ;
129129 }
@@ -175,10 +175,10 @@ public void ChangeTheme()
175175 public double SysInfoWindowWidth { get ; set ; }
176176 public double SysInfoWindowHeight { get ; set ; }
177177 public string NotifiedChangelog { get ; set ; } = "" ;
178- public string MbName { get ; set ; } = "" ;
179- public string BiosVersion { get ; set ; } = "" ;
180- public string SmuVersion { get ; set ; } = "" ;
181- public string AgesaVersion { get ; set ; } = "" ;
178+ // public string MbName { get; set; } = "";
179+ // public string BiosVersion { get; set; } = "";
180+ // public string SmuVersion { get; set; } = "";
181+ // public string AgesaVersion { get; set; } = "";
182182 public bool SingleInstance { get ; set ; } = true ;
183183 }
184184}
0 commit comments