deadmoon 3 лет назад
Родитель
Сommit
4247741078

+ 69 - 0
Optimizer/CleanHelper.cs

@@ -80,6 +80,30 @@ namespace Optimizer
             Path.Combine(ProfileAppDataLocal, "Microsoft\\Edge\\User Data\\Default\\Service Worker\\Database"),
         };
 
+        // BRAVE FOLDERS
+        static string braveFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "AppData\\Local\\BraveSoftware\\Brave-Browser\\User Data");
+        static string[] braveUserDataCacheDirs = { "Default\\Cache", "Default\\Code Cache\\", "Default\\GPUCache\\", "ShaderCache", "Default\\Service Worker\\CacheStorage\\", "Default\\Service Worker\\ScriptCache\\", "GrShaderCache\\GPUCache\\", "Default\\File System\\", "Default\\JumpListIconsMostVisited\\", "Default\\JumpListIconsRecentClosed\\", "Default\\Service Worker\\Database" };
+        static string bravePasswordsDir = Path.Combine(ProfileAppDataLocal, "BraveSoftware\\Brave-Browser\\User Data\\Default\\Login Data");
+        static string[] braveSessionDirs =
+        {
+            Path.Combine(ProfileAppDataLocal, "BraveSoftware\\Brave-Browser\\User Data\\Default\\Sessions"),
+            Path.Combine(ProfileAppDataLocal, "BraveSoftware\\Brave-Browser\\User Data\\Default\\Session Storage"),
+            Path.Combine(ProfileAppDataLocal, "BraveSoftware\\Brave-Browser\\User Data\\Default\\Extension State"),
+        };
+        static string[] braveCookiesDirs =
+        {
+            Path.Combine(ProfileAppDataLocal, "BraveSoftware\\Brave-Browser\\User Data\\Default\\IndexedDB"),
+            Path.Combine(ProfileAppDataLocal, "BraveSoftware\\Brave-Browser\\User Data\\Default\\Cookies"),
+            Path.Combine(ProfileAppDataLocal, "BraveSoftware\\Brave-Browser\\User Data\\Default\\Cookies-journal")
+        };
+        static string[] braveHistoryDirs =
+        {
+            Path.Combine(ProfileAppDataLocal, "BraveSoftware\\Brave-Browser\\User Data\\Default\\History"),
+            Path.Combine(ProfileAppDataLocal, "BraveSoftware\\Brave-Browser\\User Data\\Default\\History Provider Cache"),
+            Path.Combine(ProfileAppDataLocal, "BraveSoftware\\Brave-Browser\\User Data\\Default\\History-journal")
+        };
+
+
         internal static List<string> PreviewCleanList = new List<string>();
 
         internal static ByteSize PreviewSizeToBeFreed = new ByteSize(0);
@@ -275,6 +299,51 @@ namespace Optimizer
             }
         }
 
+        internal static void PreviewBraveClean(bool cache, bool cookies, bool searchHistory, bool session, bool passwords)
+        {
+            if (cache)
+            {
+                foreach (string x in braveUserDataCacheDirs)
+                {
+                    PreviewFolder(Path.Combine(braveFolder, x));
+                    PreviewSizeToBeFreed += CalculateSize(Path.Combine(braveFolder, x));
+                }
+            }
+
+            if (session)
+            {
+                foreach (string x in braveSessionDirs)
+                {
+                    PreviewFolder(x);
+                    PreviewSizeToBeFreed += CalculateSize(x);
+                }
+            }
+
+            if (cookies)
+            {
+                foreach (string x in braveCookiesDirs)
+                {
+                    PreviewFolder(x);
+                    PreviewSizeToBeFreed += CalculateSize(x);
+                }
+            }
+
+            if (searchHistory)
+            {
+                foreach (string x in braveHistoryDirs)
+                {
+                    PreviewFolder(x);
+                    PreviewSizeToBeFreed += CalculateSize(x);
+                }
+            }
+
+            if (passwords)
+            {
+                PreviewFolder(bravePasswordsDir);
+                PreviewSizeToBeFreed += CalculateSize(bravePasswordsDir);
+            }
+        }
+
         internal static void PreviewChromeClean(bool cache, bool cookies, bool searchHistory, bool session, bool passwords)
         {
             if (cache)

+ 119 - 7
Optimizer/Forms/MainForm.Designer.cs

@@ -165,6 +165,13 @@ namespace Optimizer
             this.cleanDriveB = new System.Windows.Forms.Button();
             this.lblFootprint = new System.Windows.Forms.Label();
             this.panel1 = new System.Windows.Forms.Panel();
+            this.bravePasswords = new Optimizer.MoonCheck();
+            this.braveSession = new Optimizer.MoonCheck();
+            this.braveHistory = new Optimizer.MoonCheck();
+            this.braveCookies = new Optimizer.MoonCheck();
+            this.braveCache = new Optimizer.MoonCheck();
+            this.label9 = new System.Windows.Forms.Label();
+            this.pictureBox4 = new System.Windows.Forms.PictureBox();
             this.label8 = new System.Windows.Forms.Label();
             this.pictureBox2 = new System.Windows.Forms.PictureBox();
             this.edgeSession = new Optimizer.MoonCheck();
@@ -404,6 +411,7 @@ namespace Optimizer
             this.panel14.SuspendLayout();
             this.panel13.SuspendLayout();
             this.panel1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox11)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox10)).BeginInit();
@@ -1884,7 +1892,7 @@ namespace Optimizer
             this.groupSoundVideo.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
             this.groupSoundVideo.Location = new System.Drawing.Point(749, 64);
             this.groupSoundVideo.Name = "groupSoundVideo";
-            this.groupSoundVideo.Size = new System.Drawing.Size(227, 421);
+            this.groupSoundVideo.Size = new System.Drawing.Size(227, 591);
             this.groupSoundVideo.TabIndex = 166;
             // 
             // lblInternet
@@ -1908,7 +1916,7 @@ namespace Optimizer
             this.groupCoding.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
             this.groupCoding.Location = new System.Drawing.Point(517, 64);
             this.groupCoding.Name = "groupCoding";
-            this.groupCoding.Size = new System.Drawing.Size(226, 421);
+            this.groupCoding.Size = new System.Drawing.Size(226, 591);
             this.groupCoding.TabIndex = 165;
             // 
             // groupInternet
@@ -1919,7 +1927,7 @@ namespace Optimizer
             this.groupInternet.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
             this.groupInternet.Location = new System.Drawing.Point(265, 64);
             this.groupInternet.Name = "groupInternet";
-            this.groupInternet.Size = new System.Drawing.Size(246, 421);
+            this.groupInternet.Size = new System.Drawing.Size(246, 591);
             this.groupInternet.TabIndex = 164;
             // 
             // panel10
@@ -2161,7 +2169,7 @@ namespace Optimizer
             this.groupSystemTools.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
             this.groupSystemTools.Location = new System.Drawing.Point(13, 64);
             this.groupSystemTools.Name = "groupSystemTools";
-            this.groupSystemTools.Size = new System.Drawing.Size(246, 421);
+            this.groupSystemTools.Size = new System.Drawing.Size(246, 591);
             this.groupSystemTools.TabIndex = 162;
             // 
             // cleanerTab
@@ -2301,7 +2309,15 @@ namespace Optimizer
             // 
             // panel1
             // 
+            this.panel1.AutoScroll = true;
             this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.panel1.Controls.Add(this.bravePasswords);
+            this.panel1.Controls.Add(this.braveSession);
+            this.panel1.Controls.Add(this.braveHistory);
+            this.panel1.Controls.Add(this.braveCookies);
+            this.panel1.Controls.Add(this.braveCache);
+            this.panel1.Controls.Add(this.label9);
+            this.panel1.Controls.Add(this.pictureBox4);
             this.panel1.Controls.Add(this.label8);
             this.panel1.Controls.Add(this.pictureBox2);
             this.panel1.Controls.Add(this.edgeSession);
@@ -2336,6 +2352,94 @@ namespace Optimizer
             this.panel1.Size = new System.Drawing.Size(219, 606);
             this.panel1.TabIndex = 47;
             // 
+            // bravePasswords
+            // 
+            this.bravePasswords.AutoSize = true;
+            this.bravePasswords.Font = new System.Drawing.Font("Segoe UI Semibold", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.bravePasswords.ForeColor = System.Drawing.Color.White;
+            this.bravePasswords.Location = new System.Drawing.Point(9, 676);
+            this.bravePasswords.Margin = new System.Windows.Forms.Padding(2);
+            this.bravePasswords.Name = "bravePasswords";
+            this.bravePasswords.Size = new System.Drawing.Size(93, 23);
+            this.bravePasswords.TabIndex = 78;
+            this.bravePasswords.Text = "Passwords";
+            this.bravePasswords.UseVisualStyleBackColor = true;
+            // 
+            // braveSession
+            // 
+            this.braveSession.AutoSize = true;
+            this.braveSession.Font = new System.Drawing.Font("Segoe UI Semibold", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.braveSession.ForeColor = System.Drawing.Color.White;
+            this.braveSession.Location = new System.Drawing.Point(9, 649);
+            this.braveSession.Margin = new System.Windows.Forms.Padding(2);
+            this.braveSession.Name = "braveSession";
+            this.braveSession.Size = new System.Drawing.Size(75, 23);
+            this.braveSession.TabIndex = 77;
+            this.braveSession.Text = "Session";
+            this.braveSession.UseVisualStyleBackColor = true;
+            // 
+            // braveHistory
+            // 
+            this.braveHistory.AutoSize = true;
+            this.braveHistory.Font = new System.Drawing.Font("Segoe UI Semibold", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.braveHistory.ForeColor = System.Drawing.Color.White;
+            this.braveHistory.Location = new System.Drawing.Point(9, 622);
+            this.braveHistory.Margin = new System.Windows.Forms.Padding(2);
+            this.braveHistory.Name = "braveHistory";
+            this.braveHistory.Size = new System.Drawing.Size(74, 23);
+            this.braveHistory.TabIndex = 76;
+            this.braveHistory.Text = "History";
+            this.braveHistory.UseVisualStyleBackColor = true;
+            // 
+            // braveCookies
+            // 
+            this.braveCookies.AutoSize = true;
+            this.braveCookies.Font = new System.Drawing.Font("Segoe UI Semibold", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.braveCookies.ForeColor = System.Drawing.Color.White;
+            this.braveCookies.Location = new System.Drawing.Point(9, 595);
+            this.braveCookies.Margin = new System.Windows.Forms.Padding(2);
+            this.braveCookies.Name = "braveCookies";
+            this.braveCookies.Size = new System.Drawing.Size(77, 23);
+            this.braveCookies.TabIndex = 75;
+            this.braveCookies.Text = "Cookies";
+            this.braveCookies.UseVisualStyleBackColor = true;
+            // 
+            // braveCache
+            // 
+            this.braveCache.AutoSize = true;
+            this.braveCache.Font = new System.Drawing.Font("Segoe UI Semibold", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.braveCache.ForeColor = System.Drawing.Color.White;
+            this.braveCache.Location = new System.Drawing.Point(9, 568);
+            this.braveCache.Margin = new System.Windows.Forms.Padding(2);
+            this.braveCache.Name = "braveCache";
+            this.braveCache.Size = new System.Drawing.Size(66, 23);
+            this.braveCache.TabIndex = 74;
+            this.braveCache.Text = "Cache";
+            this.braveCache.UseVisualStyleBackColor = true;
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Font = new System.Drawing.Font("Segoe UI Semibold", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label9.ForeColor = System.Drawing.Color.DarkGray;
+            this.label9.Location = new System.Drawing.Point(30, 543);
+            this.label9.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(107, 20);
+            this.label9.TabIndex = 73;
+            this.label9.Tag = "";
+            this.label9.Text = "Brave Browser";
+            // 
+            // pictureBox4
+            // 
+            this.pictureBox4.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox4.Image")));
+            this.pictureBox4.Location = new System.Drawing.Point(7, 542);
+            this.pictureBox4.Name = "pictureBox4";
+            this.pictureBox4.Size = new System.Drawing.Size(20, 20);
+            this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
+            this.pictureBox4.TabIndex = 72;
+            this.pictureBox4.TabStop = false;
+            // 
             // label8
             // 
             this.label8.AutoSize = true;
@@ -2416,7 +2520,7 @@ namespace Optimizer
             this.IECache.AutoSize = true;
             this.IECache.Font = new System.Drawing.Font("Segoe UI Semibold", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.IECache.ForeColor = System.Drawing.Color.White;
-            this.IECache.Location = new System.Drawing.Point(10, 569);
+            this.IECache.Location = new System.Drawing.Point(10, 725);
             this.IECache.Margin = new System.Windows.Forms.Padding(2);
             this.IECache.Name = "IECache";
             this.IECache.Size = new System.Drawing.Size(66, 23);
@@ -2546,7 +2650,7 @@ namespace Optimizer
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("Segoe UI Semibold", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.label6.ForeColor = System.Drawing.Color.DarkGray;
-            this.label6.Location = new System.Drawing.Point(33, 545);
+            this.label6.Location = new System.Drawing.Point(33, 701);
             this.label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(125, 20);
@@ -2593,7 +2697,7 @@ namespace Optimizer
             // pictureBox10
             // 
             this.pictureBox10.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox10.Image")));
-            this.pictureBox10.Location = new System.Drawing.Point(10, 544);
+            this.pictureBox10.Location = new System.Drawing.Point(9, 700);
             this.pictureBox10.Name = "pictureBox10";
             this.pictureBox10.Size = new System.Drawing.Size(20, 20);
             this.pictureBox10.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
@@ -5440,6 +5544,7 @@ namespace Optimizer
             this.panel13.PerformLayout();
             this.panel1.ResumeLayout(false);
             this.panel1.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox11)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox10)).EndInit();
@@ -5849,6 +5954,13 @@ namespace Optimizer
         private ToggleCard SSB;
         private ToggleCard STB;
         private ToggleCard WAB;
+        private Label label9;
+        private PictureBox pictureBox4;
+        private MoonCheck bravePasswords;
+        private MoonCheck braveSession;
+        private MoonCheck braveHistory;
+        private MoonCheck braveCookies;
+        private MoonCheck braveCache;
     }
 }
 

+ 1 - 0
Optimizer/Forms/MainForm.cs

@@ -1897,6 +1897,7 @@ namespace Optimizer
                 CleanHelper.PreviewChromeClean(chromeCache.Checked, chromeCookies.Checked, chromeHistory.Checked, chromeSession.Checked, chromePws.Checked);
                 CleanHelper.PreviewFireFoxClean(firefoxCache.Checked, firefoxCookies.Checked, firefoxHistory.Checked);
                 CleanHelper.PreviewEdgeClean(edgeCache.Checked, edgeCookies.Checked, edgeHistory.Checked, edgeSession.Checked);
+                CleanHelper.PreviewBraveClean(braveCache.Checked, braveCookies.Checked, braveHistory.Checked, braveSession.Checked, bravePasswords.Checked);
                 if (IECache.Checked) CleanHelper.PreviewInternetExplorerCache();
             }
             catch (Exception ex)

+ 25 - 1
Optimizer/Forms/MainForm.resx

@@ -141,6 +141,30 @@
         bxL3sceReHrs9kjcxx5H4umx2yNxH3sciafHbo/EfexxJJ4euz0S97HHkXh67PZI3MceR+LpsdsjcR97
         HImnx26PxH3scSSeHrs9Evexx5F4euz2SNzHHm8yMi128yYjfexxBan3GLbgzFLrcWzJmaXWc9iiM0qd
         MWzhmaTGfmz5zHL2YrFYLH7mcnkHBniDBBEQJcMAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="pictureBox4.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
+        DgAACw4BQL7hQQAABDBJREFUOE91lGtMXFUQx4fXFmXbhd0FFop9hJZCa60Rqs0ij1rosrDsloVS66NG
+        A5s2tiSlKtpCKIlt+AC2qYCABLQklMT4+KCx9oux0SbWGBONVBNjQlHbgkUM2H3cc+/fuWcvlar9J7M7
+        d86c351z5pxL/6fijRbybbNT6SYLrbSapGXZonbQlUGnAusoUJZuZN9NMUTPFWZS31MbaOZ0Ic0PlNBs
+        TxFNdTtp6rVH+b+QprqctNBfTJGRUh4rlrn7S7IMgKGEuBidRXsfchAGygmDZYTeEtJ6tgL9hcCAE+jN
+        j9qgExrHxOsFUHtKgSEX55fLuTojPpZ/THE6luhMxWoS3aW0cMIJ0b0d4p1mKH01UPp3Q3z2hjTp9/l5
+        7IjMWTjphNpZhDMVayTDpAN15aYk0lxLASmdxaQcXg/x1QfQgNu2qKUx8eW7UJpzEHm5AH8eyKPs5GUG
+        jTVSnEpo3UrBwBqI4ebohInPoYy1Q1wchxYJsQXZPwfl3HEoE19Ec4YPI9iwCmjKxVDJkiaN1dxPWlMe
+        hRvWQZ2fBVQhIerV7xEZfhHq9KS0yNuvQP3lBzkGVZW54cB6aIG1GPNuNGiscU82ac/n5oV32yA+Gogu
+        iyfoUq4yQH/W/akfZUwfkxV+2IdwvY2BG/DWvnKDxup62EZaIJuCdekQlSZe6gloSpgtgshIG8T5YbYR
+        6esxLRKGcrYDijsBIb8NOPAgjteVGTSW6z4z4eksBmZA89shthOUy+ehaRrUyQkoBx9h28b+FRkTlz+W
+        OVptGsLeZIRfKEPRliVLTklMoNkaB6kMFB4LlPosqH9My+XpUkZflbYodfY6lLpMiOpkqLvs+OmIDxar
+        NQqLl78xdKHERtiTkR+qToFwJUJcGIU68ysi411Qho5K0311egrKJ2chdiYizC/X9qzEe40eSYmP5eO9
+        zDiMrXxvtfp0CnpSoFaaIXYkINxaA3HzmlEXV/b7bwgf8/FYPNSq5Qi5zUDjFjS5iyTDFM+3hG+elDM1
+        kVCbRiGvTSZLqHs5lDePQtX4iHBnlf4WjpnlmKpvjese/PWSB/mbciUjNsaA6TKbEui620rC75Ag1cP7
+        U2WBcHKD2uul6b6MVVuhue7F/BM5+KZj/2BSktmgGFq8gu87eR/rUmnO6+AqGFq1Aqpe8WNxUWNf8IvA
+        lc35MnDjZCOGnvXKuUtq++dhsy2JZjx2hqYPztWuQoT3U9PBeqO8XFXlCoCbcWNvLq51PINvj+2jnLRk
+        OfcOoK7FQI59BX1axp+yWhuF/JkI+dK5WgZVJHFXrZg8tBM/97Zh9NCTtNoehd1Vt98Sl0Atm200V2Wl
+        4C7HlVs+B24+noPv2htw6VTb1wF3qZHIc/5T2r+kHyXjE0k71qZRsMpCt/yZdLGvE5fGh6mi4AE5pnf0
+        jq5KEf0N4g3TdAJflbsAAAAASUVORK5CYII=
 </value>
   </data>
   <data name="pictureBox2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@@ -715,7 +739,7 @@ any application only by typing your desired keyword.</value>
         AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
         LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
         ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAC0
-        GgAAAk1TRnQBSQFMAgEBCQEAATgBBwE4AQcBIAEAASABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAGA
+        GgAAAk1TRnQBSQFMAgEBCQEAAUgBBwFIAQcBIAEAASABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAGA
         AwABYAMAAQEBAAEgBgABwP8A/wD/AP8A/wD/AP8A/wAeAANHAYB0//8AiQADRwGAdP//AIkAAyoBQANH
         AYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANH
         AYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGA/wD/AP8A

+ 1 - 1
README.md

@@ -38,7 +38,7 @@ Depending on your version of Windows, Optimizer will also allow you to perform s
 * Define custom commands for run dialog
 * Silent run support using a configuration file
 
-### ⬇️ Downloads: ###
+### ⬇️ All downloads: ###
 https://github.com/hellzerg/optimizer/releases
 
 ### 🖼️ Screenshots: ###