summaryrefslogtreecommitdiff
path: root/chromium-norar.patch
blob: 1b25f5d777c95561eb037c0231ea5ca00280a86a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
diff -up chromium-122.0.6261.29/chrome/browser/safe_browsing/download_protection/file_analyzer.cc.nounrar chromium-122.0.6261.29/chrome/browser/safe_browsing/download_protection/file_analyzer.cc
--- chromium-122.0.6261.29/chrome/browser/safe_browsing/download_protection/file_analyzer.cc.nounrar	2024-02-07 19:49:25.000000000 +0100
+++ chromium-122.0.6261.29/chrome/browser/safe_browsing/download_protection/file_analyzer.cc	2024-02-11 18:55:29.964450604 +0100
@@ -79,8 +79,6 @@ void FileAnalyzer::Start(const base::Fil
 
   if (inspection_type == DownloadFileType::ZIP) {
     StartExtractZipFeatures();
-  } else if (inspection_type == DownloadFileType::RAR) {
-    StartExtractRarFeatures();
 #if BUILDFLAG(IS_MAC)
   } else if (inspection_type == DownloadFileType::DMG) {
     StartExtractDmgFeatures();
diff -up chromium-122.0.6261.29/chrome/common/safe_browsing/BUILD.gn.nounrar chromium-122.0.6261.29/chrome/common/safe_browsing/BUILD.gn
--- chromium-122.0.6261.29/chrome/common/safe_browsing/BUILD.gn.nounrar	2024-02-07 19:49:27.000000000 +0100
+++ chromium-122.0.6261.29/chrome/common/safe_browsing/BUILD.gn	2024-02-11 18:55:29.965450629 +0100
@@ -143,7 +143,6 @@ source_set("safe_browsing") {
       "//components/safe_browsing/content/common:file_type_policies",
       "//components/safe_browsing/core/common",
       "//third_party/lzma_sdk/google:seven_zip_reader",
-      "//third_party/unrar:unrar",
     ]
 
     public_deps = [
diff -up chromium-122.0.6261.29/chrome/services/file_util/safe_archive_analyzer.cc.nounrar chromium-122.0.6261.29/chrome/services/file_util/safe_archive_analyzer.cc
--- chromium-122.0.6261.29/chrome/services/file_util/safe_archive_analyzer.cc.nounrar	2024-02-07 19:49:27.000000000 +0100
+++ chromium-122.0.6261.29/chrome/services/file_util/safe_archive_analyzer.cc	2024-02-11 23:49:25.061324007 +0100
@@ -74,6 +74,7 @@ void SafeArchiveAnalyzer::AnalyzeRarFile
     const std::optional<std::string>& password,
     mojo::PendingRemote<chrome::mojom::TemporaryFileGetter> temp_file_getter,
     AnalyzeRarFileCallback callback) {
+#if 0
   DCHECK(rar_file.IsValid());
   temp_file_getter_.Bind(std::move(temp_file_getter));
   callback_ = std::move(callback);
@@ -90,6 +91,9 @@ void SafeArchiveAnalyzer::AnalyzeRarFile
                         /*password=*/password,
                         std::move(analysis_finished_callback),
                         std::move(temp_file_getter_callback), &results_);
+#else
+  NOTREACHED();
+#endif
 }
 
 void SafeArchiveAnalyzer::AnalyzeSevenZipFile(
diff -up chromium-122.0.6261.29/chrome/services/file_util/safe_archive_analyzer.h.nounrar chromium-122.0.6261.29/chrome/services/file_util/safe_archive_analyzer.h
--- chromium-122.0.6261.29/chrome/services/file_util/safe_archive_analyzer.h.nounrar	2024-02-07 19:49:27.000000000 +0100
+++ chromium-122.0.6261.29/chrome/services/file_util/safe_archive_analyzer.h	2024-02-11 18:55:29.966450653 +0100
@@ -9,7 +9,6 @@
 
 #include "chrome/common/safe_browsing/archive_analyzer_results.h"
 #include "chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom.h"
-#include "chrome/utility/safe_browsing/rar_analyzer.h"
 #include "chrome/utility/safe_browsing/seven_zip_analyzer.h"
 #include "chrome/utility/safe_browsing/zip_analyzer.h"
 #include "mojo/public/cpp/bindings/remote.h"
@@ -67,7 +66,6 @@ class SafeArchiveAnalyzer : public chrom
   void Timeout();
 
   safe_browsing::ZipAnalyzer zip_analyzer_;
-  safe_browsing::RarAnalyzer rar_analyzer_;
   safe_browsing::SevenZipAnalyzer seven_zip_analyzer_;
 #if BUILDFLAG(IS_MAC)
   safe_browsing::dmg::DMGAnalyzer dmg_analyzer_;
Index: chromium-118.0.5993.18/chrome/utility/safe_browsing/BUILD.gn
===================================================================
--- chromium-118.0.5993.18.orig/chrome/utility/safe_browsing/BUILD.gn
+++ chromium-118.0.5993.18/chrome/utility/safe_browsing/BUILD.gn
@@ -31,8 +31,6 @@ source_set("safe_browsing") {
     sources = [
       "archive_analyzer.cc",
       "archive_analyzer.h",
-      "rar_analyzer.cc",
-      "rar_analyzer.h",
       "seven_zip_analyzer.cc",
       "seven_zip_analyzer.h",
       "zip_analyzer.cc",
@@ -55,7 +53,6 @@ source_set("safe_browsing") {
       "//components/safe_browsing/content/common:file_type_policies",
       "//components/safe_browsing/core/common",
       "//third_party/lzma_sdk/google:seven_zip_reader",
-      "//third_party/unrar:unrar",
       "//third_party/zlib",
     ]
 
Index: chromium-118.0.5993.18/chrome/utility/safe_browsing/archive_analyzer.cc
===================================================================
--- chromium-118.0.5993.18.orig/chrome/utility/safe_browsing/archive_analyzer.cc
+++ chromium-118.0.5993.18/chrome/utility/safe_browsing/archive_analyzer.cc
@@ -8,7 +8,6 @@
 #include "build/build_config.h"
 #include "build/buildflag.h"
 #include "chrome/common/safe_browsing/archive_analyzer_results.h"
-#include "chrome/utility/safe_browsing/rar_analyzer.h"
 #include "chrome/utility/safe_browsing/seven_zip_analyzer.h"
 #include "chrome/utility/safe_browsing/zip_analyzer.h"
 #include "components/safe_browsing/content/common/proto/download_file_types.pb.h"
@@ -23,9 +22,7 @@ namespace safe_browsing {
 // static
 std::unique_ptr<ArchiveAnalyzer> ArchiveAnalyzer::CreateForArchiveType(
     DownloadFileType_InspectionType file_type) {
-  if (file_type == DownloadFileType::RAR) {
-    return std::make_unique<RarAnalyzer>();
-  } else if (file_type == DownloadFileType::ZIP) {
+  if (file_type == DownloadFileType::ZIP) {
     return std::make_unique<ZipAnalyzer>();
   } else if (file_type == DownloadFileType::SEVEN_ZIP) {
     return std::make_unique<SevenZipAnalyzer>();