Remove .NET Framework 4.6.2/4.7.2 (#24)

* Remove < .NET 4.8, general cleanup

* Abstract

* Tango

* Banner

* Scan no more

* Common

* Application

* Access

* Filter-feeder

* Graffiti

* Paint-over

* Law and Order

* XOR-o

* Unused staircase

* Maybe

* Maybe not

* Delete this

* The word is "no"

* Emit

* Improper

* Aye aye

* Fence

* Barrier

* Monkey

* Pail

* Lines
This commit is contained in:
Matt Nadareski
2020-07-15 09:41:59 -07:00
committed by GitHub
parent 1a718a3915
commit 4e406604c2
82 changed files with 8975 additions and 11172 deletions

View File

@@ -31,19 +31,21 @@ namespace SabreTools.Library.DatItems
[JsonProperty("md5")]
public string MD5
{
get { return _md5.IsNullOrWhiteSpace() ? null : Utilities.ByteArrayToString(_md5); }
set { _md5 = Utilities.StringToByteArray(value); }
get { return _md5.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_md5); }
set { _md5 = Utilities.StringToByteArray(Sanitizer.CleanMD5(value)); }
}
#if NET_FRAMEWORK
/// <summary>
/// Data RIPEMD160 hash
/// </summary>
[JsonProperty("ripemd160")]
public string RIPEMD160
{
get { return _ripemd160.IsNullOrWhiteSpace() ? null : Utilities.ByteArrayToString(_ripemd160); }
set { _ripemd160 = Utilities.StringToByteArray(value); }
get { return _ripemd160.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_ripemd160); }
set { _ripemd160 = Utilities.StringToByteArray(Sanitizer.CleanRIPEMD160(value)); }
}
#endif
/// <summary>
/// Data SHA-1 hash
@@ -51,8 +53,8 @@ namespace SabreTools.Library.DatItems
[JsonProperty("sha1")]
public string SHA1
{
get { return _sha1.IsNullOrWhiteSpace() ? null : Utilities.ByteArrayToString(_sha1); }
set { _sha1 = Utilities.StringToByteArray(value); }
get { return _sha1.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_sha1); }
set { _sha1 = Utilities.StringToByteArray(Sanitizer.CleanSHA1(value)); }
}
/// <summary>
@@ -61,8 +63,8 @@ namespace SabreTools.Library.DatItems
[JsonProperty("sha256")]
public string SHA256
{
get { return _sha256.IsNullOrWhiteSpace() ? null : Utilities.ByteArrayToString(_sha256); }
set { _sha256 = Utilities.StringToByteArray(value); }
get { return _sha256.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_sha256); }
set { _sha256 = Utilities.StringToByteArray(Sanitizer.CleanSHA256(value)); }
}
/// <summary>
@@ -71,8 +73,8 @@ namespace SabreTools.Library.DatItems
[JsonProperty("sha384")]
public string SHA384
{
get { return _sha384.IsNullOrWhiteSpace() ? null : Utilities.ByteArrayToString(_sha384); }
set { _sha384 = Utilities.StringToByteArray(value); }
get { return _sha384.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_sha384); }
set { _sha384 = Utilities.StringToByteArray(Sanitizer.CleanSHA384(value)); }
}
/// <summary>
@@ -81,8 +83,8 @@ namespace SabreTools.Library.DatItems
[JsonProperty("sha512")]
public string SHA512
{
get { return _sha512.IsNullOrWhiteSpace() ? null : Utilities.ByteArrayToString(_sha512); }
set { _sha512 = Utilities.StringToByteArray(value); }
get { return _sha512.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_sha512); }
set { _sha512 = Utilities.StringToByteArray(Sanitizer.CleanSHA512(value)); }
}
/// <summary>
@@ -144,7 +146,9 @@ namespace SabreTools.Library.DatItems
{
this.Name = baseFile.Filename;
_md5 = baseFile.MD5;
#if NET_FRAMEWORK
_ripemd160 = baseFile.RIPEMD160;
#endif
_sha1 = baseFile.SHA1;
_sha256 = baseFile.SHA256;
_sha384 = baseFile.SHA384;
@@ -191,10 +195,8 @@ namespace SabreTools.Library.DatItems
Devices = this.Devices,
MachineType = this.MachineType,
SystemID = this.SystemID,
System = this.System,
SourceID = this.SourceID,
Source = this.Source,
IndexId = this.IndexId,
IndexSource = this.IndexSource,
_md5 = this._md5,
_ripemd160 = this._ripemd160,
@@ -220,7 +222,9 @@ namespace SabreTools.Library.DatItems
CRC = null,
MD5 = this.MD5,
#if NET_FRAMEWORK
RIPEMD160 = this.RIPEMD160,
#endif
SHA1 = this.SHA1,
SHA256 = this.SHA256,
SHA384 = this.SHA384,
@@ -256,10 +260,8 @@ namespace SabreTools.Library.DatItems
AreaName = this.AreaName,
AreaSize = this.AreaSize,
SystemID = this.SystemID,
System = this.System,
SourceID = this.SourceID,
Source = this.Source,
IndexId = this.IndexId,
IndexSource = this.IndexSource,
Remove = this.Remove,
};
@@ -284,34 +286,34 @@ namespace SabreTools.Library.DatItems
// If all hashes are empty but they're both nodump and the names match, then they're dupes
if ((this.ItemStatus == ItemStatus.Nodump && newOther.ItemStatus == ItemStatus.Nodump)
&& (this.Name == newOther.Name)
&& (this._md5.IsNullOrWhiteSpace() && newOther._md5.IsNullOrWhiteSpace())
&& (this._ripemd160.IsNullOrWhiteSpace() && newOther._ripemd160.IsNullOrWhiteSpace())
&& (this._sha1.IsNullOrWhiteSpace() && newOther._sha1.IsNullOrWhiteSpace())
&& (this._sha256.IsNullOrWhiteSpace() && newOther._sha256.IsNullOrWhiteSpace())
&& (this._sha384.IsNullOrWhiteSpace() && newOther._sha384.IsNullOrWhiteSpace())
&& (this._sha512.IsNullOrWhiteSpace() && newOther._sha512.IsNullOrWhiteSpace()))
&& (this._md5.IsNullOrEmpty() && newOther._md5.IsNullOrEmpty())
&& (this._ripemd160.IsNullOrEmpty() && newOther._ripemd160.IsNullOrEmpty())
&& (this._sha1.IsNullOrEmpty() && newOther._sha1.IsNullOrEmpty())
&& (this._sha256.IsNullOrEmpty() && newOther._sha256.IsNullOrEmpty())
&& (this._sha384.IsNullOrEmpty() && newOther._sha384.IsNullOrEmpty())
&& (this._sha512.IsNullOrEmpty() && newOther._sha512.IsNullOrEmpty()))
{
dupefound = true;
}
// If we can determine that the disks have no non-empty hashes in common, we return false
else if ((this._md5.IsNullOrWhiteSpace() || newOther._md5.IsNullOrWhiteSpace())
&& (this._ripemd160.IsNullOrWhiteSpace() || newOther._ripemd160.IsNullOrWhiteSpace())
&& (this._sha1.IsNullOrWhiteSpace() || newOther._sha1.IsNullOrWhiteSpace())
&& (this._sha256.IsNullOrWhiteSpace() || newOther._sha256.IsNullOrWhiteSpace())
&& (this._sha384.IsNullOrWhiteSpace() || newOther._sha384.IsNullOrWhiteSpace())
&& (this._sha512.IsNullOrWhiteSpace() || newOther._sha512.IsNullOrWhiteSpace()))
else if ((this._md5.IsNullOrEmpty() || newOther._md5.IsNullOrEmpty())
&& (this._ripemd160.IsNullOrEmpty() || newOther._ripemd160.IsNullOrEmpty())
&& (this._sha1.IsNullOrEmpty() || newOther._sha1.IsNullOrEmpty())
&& (this._sha256.IsNullOrEmpty() || newOther._sha256.IsNullOrEmpty())
&& (this._sha384.IsNullOrEmpty() || newOther._sha384.IsNullOrEmpty())
&& (this._sha512.IsNullOrEmpty() || newOther._sha512.IsNullOrEmpty()))
{
dupefound = false;
}
// Otherwise if we get a partial match
else if (((this._md5.IsNullOrWhiteSpace() || newOther._md5.IsNullOrWhiteSpace()) || Enumerable.SequenceEqual(this._md5, newOther._md5))
&& ((this._ripemd160.IsNullOrWhiteSpace() || newOther._ripemd160.IsNullOrWhiteSpace()) || Enumerable.SequenceEqual(this._ripemd160, newOther._ripemd160))
&& ((this._sha1.IsNullOrWhiteSpace() || newOther._sha1.IsNullOrWhiteSpace()) || Enumerable.SequenceEqual(this._sha1, newOther._sha1))
&& ((this._sha256.IsNullOrWhiteSpace() || newOther._sha256.IsNullOrWhiteSpace()) || Enumerable.SequenceEqual(this._sha256, newOther._sha256))
&& ((this._sha384.IsNullOrWhiteSpace() || newOther._sha384.IsNullOrWhiteSpace()) || Enumerable.SequenceEqual(this._sha384, newOther._sha384))
&& ((this._sha512.IsNullOrWhiteSpace() || newOther._sha512.IsNullOrWhiteSpace()) || Enumerable.SequenceEqual(this._sha512, newOther._sha512)))
else if (((this._md5.IsNullOrEmpty() || newOther._md5.IsNullOrEmpty()) || Enumerable.SequenceEqual(this._md5, newOther._md5))
&& ((this._ripemd160.IsNullOrEmpty() || newOther._ripemd160.IsNullOrEmpty()) || Enumerable.SequenceEqual(this._ripemd160, newOther._ripemd160))
&& ((this._sha1.IsNullOrEmpty() || newOther._sha1.IsNullOrEmpty()) || Enumerable.SequenceEqual(this._sha1, newOther._sha1))
&& ((this._sha256.IsNullOrEmpty() || newOther._sha256.IsNullOrEmpty()) || Enumerable.SequenceEqual(this._sha256, newOther._sha256))
&& ((this._sha384.IsNullOrEmpty() || newOther._sha384.IsNullOrEmpty()) || Enumerable.SequenceEqual(this._sha384, newOther._sha384))
&& ((this._sha512.IsNullOrEmpty() || newOther._sha512.IsNullOrEmpty()) || Enumerable.SequenceEqual(this._sha512, newOther._sha512)))
{
dupefound = true;
}