diff --git a/apprepodbmgr.Core/Context.cs b/apprepodbmgr.Core/Context.cs index c9938b3..3084e18 100644 --- a/apprepodbmgr.Core/Context.cs +++ b/apprepodbmgr.Core/Context.cs @@ -37,29 +37,29 @@ namespace apprepodbmgr.Core { public delegate void UnarChangeStatusDelegate(); - public static List Files; - public static List Folders; - public static List Symlinks; + public static List Files; + public static List Folders; + public static List Symlinks; public static Dictionary Hashes; - public static Dictionary FoldersDict; - public static Dictionary SymlinksDict; - public static string Path; - public static DbEntry DbInfo; - public static bool UnarUsable; - public static string TmpFolder; - public static long NoFilesInArchive; - public static string ArchiveFormat; - public static Process UnarProcess; - public static bool UnzipWithUnAr; - public static string SelectedFile; - public static OpticalDiscType WorkingDisc; - public static BlockMediaType WorkingDisk; - public static CICMMetadataType Metadata; - public static bool UserExtracting; - public static bool UsableDotNetZip; - public static string ClamdVersion; - public static bool VirusTotalEnabled; - public static event UnarChangeStatusDelegate UnarChangeStatus; + public static Dictionary FoldersDict; + public static Dictionary SymlinksDict; + public static string Path; + public static DbEntry DbInfo; + public static bool UnarUsable; + public static string TmpFolder; + public static long NoFilesInArchive; + public static string ArchiveFormat; + public static Process UnarProcess; + public static bool UnzipWithUnAr; + public static string SelectedFile; + public static OpticalDiscType WorkingDisc; + public static BlockMediaType WorkingDisk; + public static CICMMetadataType Metadata; + public static bool UserExtracting; + public static bool UsableDotNetZip; + public static string ClamdVersion; + public static bool VirusTotalEnabled; + public static event UnarChangeStatusDelegate UnarChangeStatus; public static void CheckUnar() { diff --git a/apprepodbmgr.Core/DBOps.cs b/apprepodbmgr.Core/DBOps.cs index 95a1d70..7e62113 100644 --- a/apprepodbmgr.Core/DBOps.cs +++ b/apprepodbmgr.Core/DBOps.cs @@ -889,10 +889,10 @@ namespace apprepodbmgr.Core dbcmd.Transaction = trans; dbcmd.CommandText = - $"DROP TABLE IF EXISTS `app_{id}_symlinks`;\n\n" + - $"CREATE TABLE IF NOT EXISTS `app_{id}_symlinks` (\n" + - " `path` VARCHAR(8192) PRIMARY KEY,\n" + - " `target` VARCHAR(8192) NOT NULL);\n\n" + + $"DROP TABLE IF EXISTS `app_{id}_symlinks`;\n\n" + + $"CREATE TABLE IF NOT EXISTS `app_{id}_symlinks` (\n" + + " `path` VARCHAR(8192) PRIMARY KEY,\n" + + " `target` VARCHAR(8192) NOT NULL);\n\n" + $"CREATE UNIQUE INDEX `app_{id}_symlinks_path_UNIQUE` ON `app_{id}_symlinks` (`path` ASC);\n\n" + $"CREATE INDEX `app_{id}_symlinks_target_idx` ON `app_{id}_symlinks` (`target` ASC);"; diff --git a/apprepodbmgr.Core/DetectImageFormat.cs b/apprepodbmgr.Core/DetectImageFormat.cs index 6f3768f..c6dff5e 100644 --- a/apprepodbmgr.Core/DetectImageFormat.cs +++ b/apprepodbmgr.Core/DetectImageFormat.cs @@ -60,7 +60,7 @@ namespace apprepodbmgr.Core } #pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body catch { } - #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body + #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body // Check only RAW plugin if(imageFormat != null) return imageFormat; @@ -77,7 +77,7 @@ namespace apprepodbmgr.Core } #pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body catch { } - #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body + #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body // Still not recognized diff --git a/apprepodbmgr.Core/DetectOS.cs b/apprepodbmgr.Core/DetectOS.cs index 6f16846..f21157c 100644 --- a/apprepodbmgr.Core/DetectOS.cs +++ b/apprepodbmgr.Core/DetectOS.cs @@ -64,7 +64,7 @@ namespace DiscImageChef.Interop { #if __ANDROID__ return PlatformID.Android; - #else + #else return PlatformID.Linux; #endif } diff --git a/apprepodbmgr.Core/Properties/AssemblyInfo.cs b/apprepodbmgr.Core/Properties/AssemblyInfo.cs index f56add9..4fd532e 100644 --- a/apprepodbmgr.Core/Properties/AssemblyInfo.cs +++ b/apprepodbmgr.Core/Properties/AssemblyInfo.cs @@ -25,8 +25,8 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // + using System.Reflection; -using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. @@ -50,4 +50,4 @@ using System.Runtime.CompilerServices; // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] +//[assembly: AssemblyKeyFile("")] \ No newline at end of file diff --git a/apprepodbmgr.Core/Workers/Compression.cs b/apprepodbmgr.Core/Workers/Compression.cs index ac85142..9f770bb 100644 --- a/apprepodbmgr.Core/Workers/Compression.cs +++ b/apprepodbmgr.Core/Workers/Compression.cs @@ -173,7 +173,7 @@ namespace apprepodbmgr.Core break; } - long totalSize = 0, currentSize = 0; + long totalSize = 0, currentSize = 0; foreach(KeyValuePair file in Context.Hashes) totalSize += file.Value.Length; #if DEBUG diff --git a/apprepodbmgr.Core/Workers/Database.cs b/apprepodbmgr.Core/Workers/Database.cs index edbe61d..cff7abf 100644 --- a/apprepodbmgr.Core/Workers/Database.cs +++ b/apprepodbmgr.Core/Workers/Database.cs @@ -111,7 +111,7 @@ namespace apprepodbmgr.Core UpdateProgress?.Invoke(null, "Checking files in database", counter, Context.Hashes.Count); AddFileForApp?.Invoke(kvp.Key, kvp.Value.Sha256, dbCore.DbOps.ExistsFile(kvp.Value.Sha256), - kvp.Value.Crack); + kvp.Value.Crack); if(dbCore.DbOps.ExistsFile(kvp.Value.Sha256)) { @@ -246,7 +246,8 @@ namespace apprepodbmgr.Core counter = 0; foreach(KeyValuePair kvp in Context.Hashes) { - UpdateProgress?.Invoke(null, "Adding files to application in database", counter, Context.Hashes.Count); + UpdateProgress?.Invoke(null, "Adding files to application in database", counter, + Context.Hashes.Count); dbCore.DbOps.AddFileToApp(kvp.Value, Context.DbInfo.Id); diff --git a/apprepodbmgr.Core/Workers/Delegates.cs b/apprepodbmgr.Core/Workers/Delegates.cs index b0daa36..549911f 100644 --- a/apprepodbmgr.Core/Workers/Delegates.cs +++ b/apprepodbmgr.Core/Workers/Delegates.cs @@ -32,14 +32,14 @@ namespace apprepodbmgr.Core { public static partial class Workers { + public delegate void AddAppDelegate(DbEntry os); + public delegate void AddFileDelegate(DbFile file); public delegate void AddFileForAppDelegate(string filename, string hash, bool known, bool isCrack); public delegate void AddFilesDelegate(List file); - public delegate void AddAppDelegate(DbEntry os); - public delegate void FailedDelegate(string text); public delegate void FinishedWithoutErrorDelegate(); @@ -57,8 +57,8 @@ namespace apprepodbmgr.Core public static event FailedDelegate Failed; public static event FinishedWithoutErrorDelegate Finished; public static event FinishedWithTextDelegate FinishedWithText; - public static event AddFileForAppDelegate AddFileForApp; - public static event AddAppDelegate AddApp; + public static event AddFileForAppDelegate AddFileForApp; + public static event AddAppDelegate AddApp; public static event AddFileDelegate AddFile; public static event AddFilesDelegate AddFiles; public static event ScanFinishedDelegate ScanFinished; diff --git a/apprepodbmgr.Eto.Desktop/Program.cs b/apprepodbmgr.Eto.Desktop/Program.cs index c9659fa..6f4e00a 100644 --- a/apprepodbmgr.Eto.Desktop/Program.cs +++ b/apprepodbmgr.Eto.Desktop/Program.cs @@ -25,6 +25,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // + using System; using apprepodbmgr.Core; using Eto; @@ -41,14 +42,14 @@ namespace apprepodbmgr.Eto.Desktop Context.CheckUnar(); if(Settings.Current.UseAntivirus) { - if(Settings.Current.UseClamd) - Workers.InitClamd(); + if(Settings.Current.UseClamd) Workers.InitClamd(); if(Settings.Current.UseVirusTotal) Context.VirusTotalEnabled = Workers.InitVirusTotal(Settings.Current.VirusTotalKey); } + Context.UsableDotNetZip = !Platform.Detect.IsMac && !Platform.Detect.IsIos; new Application(Platform.Detect).Run(new frmMain()); } } -} +} \ No newline at end of file diff --git a/apprepodbmgr.Eto.Desktop/Properties/AssemblyInfo.cs b/apprepodbmgr.Eto.Desktop/Properties/AssemblyInfo.cs index 754a709..ecb0d54 100644 --- a/apprepodbmgr.Eto.Desktop/Properties/AssemblyInfo.cs +++ b/apprepodbmgr.Eto.Desktop/Properties/AssemblyInfo.cs @@ -25,8 +25,8 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // + using System.Reflection; -using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. @@ -50,4 +50,4 @@ using System.Runtime.CompilerServices; // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] +//[assembly: AssemblyKeyFile("")] \ No newline at end of file diff --git a/apprepodbmgr.Eto/Properties/AssemblyInfo.cs b/apprepodbmgr.Eto/Properties/AssemblyInfo.cs index 587a685..a1f4ab4 100644 --- a/apprepodbmgr.Eto/Properties/AssemblyInfo.cs +++ b/apprepodbmgr.Eto/Properties/AssemblyInfo.cs @@ -25,8 +25,8 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // + using System.Reflection; -using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. @@ -50,4 +50,4 @@ using System.Runtime.CompilerServices; // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] +//[assembly: AssemblyKeyFile("")] \ No newline at end of file diff --git a/apprepodbmgr.Eto/dlgAdd.xeto.cs b/apprepodbmgr.Eto/dlgAdd.xeto.cs index 32883b5..3d06d35 100644 --- a/apprepodbmgr.Eto/dlgAdd.xeto.cs +++ b/apprepodbmgr.Eto/dlgAdd.xeto.cs @@ -46,18 +46,19 @@ namespace apprepodbmgr.Eto { public delegate void OnAddedAppDelegate(DbEntry app); - ObservableCollection fileView; - int knownFiles; ObservableCollection appView; - bool stopped; - Thread thdAddFiles; - Thread thdCheckFiles; - Thread thdExtractArchive; - Thread thdFindFiles; - Thread thdHashFiles; - Thread thdOpenArchive; - Thread thdPackFiles; - Thread thdRemoveTemp; + + ObservableCollection fileView; + int knownFiles; + bool stopped; + Thread thdAddFiles; + Thread thdCheckFiles; + Thread thdExtractArchive; + Thread thdFindFiles; + Thread thdHashFiles; + Thread thdOpenArchive; + Thread thdPackFiles; + Thread thdRemoveTemp; public dlgAdd() { @@ -293,8 +294,8 @@ namespace apprepodbmgr.Eto Workers.Finished += ChkFilesFinished; Workers.UpdateProgress += UpdateProgress; Workers.UpdateProgress2 += UpdateProgress2; - Workers.AddFileForApp += AddFile; - Workers.AddApp += AddApp; + Workers.AddFileForApp += AddFile; + Workers.AddApp += AddApp; thdCheckFiles.Start(); }); } @@ -312,8 +313,8 @@ namespace apprepodbmgr.Eto Workers.Finished -= ChkFilesFinished; Workers.UpdateProgress -= UpdateProgress; Workers.UpdateProgress2 -= UpdateProgress2; - Workers.AddFileForApp -= AddFile; - Workers.AddApp -= AddApp; + Workers.AddFileForApp -= AddFile; + Workers.AddApp -= AddApp; thdCheckFiles?.Abort(); thdHashFiles = null; fileView?.Clear(); @@ -332,8 +333,8 @@ namespace apprepodbmgr.Eto Workers.Finished -= ChkFilesFinished; Workers.UpdateProgress -= UpdateProgress; Workers.UpdateProgress2 -= UpdateProgress2; - Workers.AddFileForApp -= AddFile; - Workers.AddApp -= AddApp; + Workers.AddFileForApp -= AddFile; + Workers.AddApp -= AddApp; thdCheckFiles?.Abort(); @@ -560,8 +561,8 @@ namespace apprepodbmgr.Eto { stopped = true; - Workers.AddFileForApp -= AddFile; - Workers.AddApp -= AddApp; + Workers.AddFileForApp -= AddFile; + Workers.AddApp -= AddApp; Workers.Failed -= AddFilesToDbFailed; Workers.Failed -= ChkFilesFailed; Workers.Failed -= ExtractArchiveFailed; diff --git a/apprepodbmgr.Eto/frmMain.xeto.cs b/apprepodbmgr.Eto/frmMain.xeto.cs index 3de2cb2..7844eba 100644 --- a/apprepodbmgr.Eto/frmMain.xeto.cs +++ b/apprepodbmgr.Eto/frmMain.xeto.cs @@ -39,17 +39,17 @@ namespace apprepodbmgr.Eto { public class frmMain : Form { - int infectedFiles; - ObservableCollection lstFiles; + int infectedFiles; ObservableCollection lstApps; + ObservableCollection lstFiles; DbFile outIter; bool populatingFiles; bool scanningFiles; Thread thdCleanFiles; Thread thdCompressTo; - Thread thdPopulateFiles; Thread thdPopulateApps; + Thread thdPopulateFiles; Thread thdSaveAs; Thread thdScanFile; @@ -209,7 +209,7 @@ namespace apprepodbmgr.Eto Workers.Failed += LoadAppsFailed; Workers.Finished += LoadAppsFinished; Workers.UpdateProgress += UpdateProgress; - Workers.AddApp += AddApp; + Workers.AddApp += AddApp; Workers.AddFile += AddFile; Workers.AddFiles += AddFiles; thdPopulateApps = new Thread(Workers.GetAllApps); @@ -242,22 +242,22 @@ namespace apprepodbmgr.Eto Workers.Failed -= LoadAppsFailed; Workers.Finished -= LoadAppsFinished; Workers.UpdateProgress -= UpdateProgress; - Workers.AddApp -= AddApp; + Workers.AddApp -= AddApp; if(thdPopulateApps != null) { thdPopulateApps.Abort(); thdPopulateApps = null; } - lblProgress.Visible = false; - prgProgress.Visible = false; - treeApps.Enabled = true; - btnAdd.Visible = true; - btnRemove.Visible = true; - btnCompress.Visible = Context.UsableDotNetZip; - btnSave.Visible = true; - btnHelp.Enabled = true; - btnSettings.Enabled = true; + lblProgress.Visible = false; + prgProgress.Visible = false; + treeApps.Enabled = true; + btnAdd.Visible = true; + btnRemove.Visible = true; + btnCompress.Visible = Context.UsableDotNetZip; + btnSave.Visible = true; + btnHelp.Enabled = true; + btnSettings.Enabled = true; lblAppStatus.Visible = true; lblAppStatus.Text = $"{lstApps.Count} applications"; }); @@ -326,7 +326,7 @@ namespace apprepodbmgr.Eto protected void OnBtnAddClicked(object sender, EventArgs e) { - dlgAdd dlgAdd = new dlgAdd(); + dlgAdd dlgAdd = new dlgAdd(); dlgAdd.OnAddedApp += app => { lstApps.Add(new DBEntryForEto(app)); }; dlgAdd.ShowModal(this); } @@ -459,7 +459,7 @@ namespace apprepodbmgr.Eto protected void OnBtnStopClicked(object sender, EventArgs e) { - Workers.AddApp -= AddApp; + Workers.AddApp -= AddApp; Workers.Failed -= CompressToFailed; Workers.Failed -= LoadAppsFailed; Workers.Failed -= SaveAsFailed;