Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60899106 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Browser: add password manager fixes

parent 3c46d824
Loading
Loading
Loading
Loading
Loading
+175 −0
Original line number Diff line number Diff line
From: uazo <uazo@users.noreply.github.com>
Date: Tue, 14 Mar 2023 15:59:38 +0000
Subject: Disable privacy issues in password manager

Need: Add-cromite-flags-support.patch
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
---
 chrome/android/java/AndroidManifest.xml                  | 9 ---------
 .../password_store_android_backend_bridge_helper_impl.cc | 1 +
 .../android/password_store_android_local_backend.cc      | 2 +-
 .../generated_password_leak_detection_pref.cc            | 3 +--
 .../password_receiver_service_factory.cc                 | 2 +-
 .../password_manager/password_sender_service_factory.cc  | 2 +-
 .../affiliations/core/browser/affiliation_backend.cc     | 1 +
 .../core/browser/affiliation_service_impl.cc             | 4 ++++
 components/affiliations/core/browser/facet_manager.cc    | 4 ++++
 .../leak_detection/leak_detection_check_factory_impl.cc  | 5 +++++
 .../browser/leak_detection/leak_detection_check_impl.cc  | 3 +--
 .../Disable-privacy-issues-in-password-manager.inc       | 1 +
 12 files changed, 21 insertions(+), 16 deletions(-)
 create mode 100644 cromite_flags/components/password_manager/core/browser/features/password_features_cc/Disable-privacy-issues-in-password-manager.inc

diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -459,15 +459,6 @@ by a child template that "extends" this file.
             </intent-filter>
         </receiver>
 
-        <!-- Phishing Protection related -->
-        <receiver android:name="org.chromium.chrome.browser.safe_browsing.PasswordProtectionBroadcastReceiver"
-        android:exported="true"
-        android:permission="com.google.android.gms.permission.INTERNAL_BROADCAST">
-            <intent-filter>
-                <action android:name="com.android.chrome.safe_browsing.LOGIN" />
-            </intent-filter>
-        </receiver>
-
         <!-- Upgrade related -->
         <receiver android:name="org.chromium.chrome.browser.upgrade.PackageReplacedBroadcastReceiver"
             android:exported="false">
diff --git a/chrome/browser/password_manager/android/password_store_android_backend_bridge_helper_impl.cc b/chrome/browser/password_manager/android/password_store_android_backend_bridge_helper_impl.cc
--- a/chrome/browser/password_manager/android/password_store_android_backend_bridge_helper_impl.cc
+++ b/chrome/browser/password_manager/android/password_store_android_backend_bridge_helper_impl.cc
@@ -102,6 +102,7 @@ bool PasswordStoreAndroidBackendBridgeHelperImpl::
 
 bool PasswordStoreAndroidBackendBridgeHelperImpl::
     CanUseGetAllLoginsWithBrandingInfoAPI() {
+  if ((true)) return false;
   base::android::BuildInfo* info = base::android::BuildInfo::GetInstance();
   int current_gms_core_version;
   if (!base::StringToInt(info->gms_version_code(), &current_gms_core_version)) {
diff --git a/chrome/browser/password_manager/android/password_store_android_local_backend.cc b/chrome/browser/password_manager/android/password_store_android_local_backend.cc
--- a/chrome/browser/password_manager/android/password_store_android_local_backend.cc
+++ b/chrome/browser/password_manager/android/password_store_android_local_backend.cc
@@ -37,7 +37,7 @@ PasswordStoreAndroidLocalBackend::PasswordStoreAndroidLocalBackend(
   // AccountBackend doesn't call `DisableSource` when sync is turned off.
   // This is why we have to explicitly call it here whenever local GMSCore is
   // created.
-  password_affiliation_adapter.DisableSource();
+  if ((true)) password_affiliation_adapter.DisableSource();
 }
 
 PasswordStoreAndroidLocalBackend::~PasswordStoreAndroidLocalBackend() = default;
diff --git a/chrome/browser/password_manager/generated_password_leak_detection_pref.cc b/chrome/browser/password_manager/generated_password_leak_detection_pref.cc
--- a/chrome/browser/password_manager/generated_password_leak_detection_pref.cc
+++ b/chrome/browser/password_manager/generated_password_leak_detection_pref.cc
@@ -20,8 +20,7 @@ namespace {
 
 // Returns whether the user can use the leak detection feature.
 bool IsUserAllowedToUseLeakDetection(Profile* profile) {
-  return !profile->IsGuestSession() &&
-         IdentityManagerFactory::GetForProfileIfExists(profile);
+  return false;
 }
 
 // Returns whether the effective value of the Safe Browsing preferences for
diff --git a/chrome/browser/password_manager/password_receiver_service_factory.cc b/chrome/browser/password_manager/password_receiver_service_factory.cc
--- a/chrome/browser/password_manager/password_receiver_service_factory.cc
+++ b/chrome/browser/password_manager/password_receiver_service_factory.cc
@@ -55,7 +55,7 @@ PasswordReceiverServiceFactory::BuildServiceInstanceForBrowserContext(
     content::BrowserContext* context) const {
 // Password receiving on Android is handled in GMSCore, and hence no service
 // should be instantiated.
-#if BUILDFLAG(IS_ANDROID)
+#if true
   return nullptr;
 #else
 
diff --git a/chrome/browser/password_manager/password_sender_service_factory.cc b/chrome/browser/password_manager/password_sender_service_factory.cc
--- a/chrome/browser/password_manager/password_sender_service_factory.cc
+++ b/chrome/browser/password_manager/password_sender_service_factory.cc
@@ -50,7 +50,7 @@ PasswordSenderServiceFactory::BuildServiceInstanceForBrowserContext(
     content::BrowserContext* context) const {
 // Password sending on Android is handled in GMSCore, and hence no service
 // should be instantiated.
-#if BUILDFLAG(IS_ANDROID)
+#if true
   return nullptr;
 #else
 
diff --git a/components/affiliations/core/browser/affiliation_backend.cc b/components/affiliations/core/browser/affiliation_backend.cc
--- a/components/affiliations/core/browser/affiliation_backend.cc
+++ b/components/affiliations/core/browser/affiliation_backend.cc
@@ -399,6 +399,7 @@ void AffiliationBackend::OnMalformedResponse(
 }
 
 bool AffiliationBackend::OnCanSendNetworkRequest() {
+  if ((true)) return false;
   DCHECK(!fetcher_);
   std::vector<FacetURI> requested_facet_uris;
   for (const auto& facet_manager_pair : facet_managers_) {
diff --git a/components/affiliations/core/browser/affiliation_service_impl.cc b/components/affiliations/core/browser/affiliation_service_impl.cc
--- a/components/affiliations/core/browser/affiliation_service_impl.cc
+++ b/components/affiliations/core/browser/affiliation_service_impl.cc
@@ -128,6 +128,10 @@ void AffiliationServiceImpl::Shutdown() {
 void AffiliationServiceImpl::PrefetchChangePasswordURLs(
     const std::vector<GURL>& urls,
     base::OnceClosure callback) {
+  if ((true)) {
+    std::move(callback).Run();
+    return;
+  }
   std::vector<FacetURI> facets;
   std::vector<url::SchemeHostPort> tuple_origins;
   for (const auto& url : urls) {
diff --git a/components/affiliations/core/browser/facet_manager.cc b/components/affiliations/core/browser/facet_manager.cc
--- a/components/affiliations/core/browser/facet_manager.cc
+++ b/components/affiliations/core/browser/facet_manager.cc
@@ -117,6 +117,10 @@ void FacetManager::GetAffiliationsAndBranding(
   RequestInfo request_info;
   request_info.callback = std::move(callback);
   request_info.callback_task_runner = callback_task_runner;
+  if ((true)) {
+    ServeRequestWithFailure(std::move(request_info));
+    return;
+  }
   if (IsCachedDataFresh()) {
     AffiliatedFacetsWithUpdateTime affiliation;
     if (!backend_->ReadAffiliationsAndBrandingFromDatabase(facet_uri_,
diff --git a/components/password_manager/core/browser/leak_detection/leak_detection_check_factory_impl.cc b/components/password_manager/core/browser/leak_detection/leak_detection_check_factory_impl.cc
--- a/components/password_manager/core/browser/leak_detection/leak_detection_check_factory_impl.cc
+++ b/components/password_manager/core/browser/leak_detection/leak_detection_check_factory_impl.cc
@@ -41,6 +41,11 @@ LeakDetectionCheckFactoryImpl::TryCreateLeakCheck(
     version_info::Channel channel) const {
   CHECK(identity_manager);
 
+  if ((true)) {
+    delegate->OnError(LeakDetectionError::kNotSignIn);
+    return nullptr;
+  }
+
   return std::make_unique<LeakDetectionCheckImpl>(
       delegate, identity_manager, std::move(url_loader_factory),
       GetAPIKey(LeakDetectionCheckImpl::HasAccountForRequest(identity_manager),
diff --git a/components/password_manager/core/browser/leak_detection/leak_detection_check_impl.cc b/components/password_manager/core/browser/leak_detection/leak_detection_check_impl.cc
--- a/components/password_manager/core/browser/leak_detection/leak_detection_check_impl.cc
+++ b/components/password_manager/core/browser/leak_detection/leak_detection_check_impl.cc
@@ -192,8 +192,7 @@ bool LeakDetectionCheckImpl::HasAccountForRequest(
     const signin::IdentityManager* identity_manager) {
   // On desktop HasPrimaryAccount(signin::ConsentLevel::kSignin) will
   // always return something if the user is signed in.
-  return identity_manager &&
-         identity_manager->HasPrimaryAccount(signin::ConsentLevel::kSignin);
+  return false;
 }
 
 void LeakDetectionCheckImpl::Start(LeakDetectionInitiator initiator,
diff --git a/cromite_flags/components/password_manager/core/browser/features/password_features_cc/Disable-privacy-issues-in-password-manager.inc b/cromite_flags/components/password_manager/core/browser/features/password_features_cc/Disable-privacy-issues-in-password-manager.inc
new file mode 100644
--- /dev/null
+++ b/cromite_flags/components/password_manager/core/browser/features/password_features_cc/Disable-privacy-issues-in-password-manager.inc
@@ -0,0 +1 @@
+SET_CROMITE_FEATURE_ENABLED(kFillOnAccountSelect);
--
+73 −0
Original line number Diff line number Diff line
From: uazo <uazo@users.noreply.github.com>
Date: Wed, 30 Sep 2020 07:40:01 +0000
Subject: Restore chrome password store

License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
---
 chrome/browser/resources/password_manager/user_utils_mixin.ts | 4 ++--
 chrome/browser/ui/android/strings/android_chrome_strings.grd  | 2 +-
 components/password_manager/core/browser/buildflags.gni       | 2 +-
 components/sync/base/features.cc                              | 1 +
 .../password_features_cc/Restore-chrome-password-store.inc    | 1 +
 5 files changed, 6 insertions(+), 4 deletions(-)
 create mode 100644 cromite_flags/components/password_manager/core/browser/features/password_features_cc/Restore-chrome-password-store.inc

diff --git a/chrome/browser/resources/password_manager/user_utils_mixin.ts b/chrome/browser/resources/password_manager/user_utils_mixin.ts
--- a/chrome/browser/resources/password_manager/user_utils_mixin.ts
+++ b/chrome/browser/resources/password_manager/user_utils_mixin.ts
@@ -129,11 +129,11 @@ export const UserUtilMixin = dedupingMixin(
         }
 
         private computeIsEligibleForAccountStorage_(): boolean {
-          return !!this.syncInfo_ && this.syncInfo_.isEligibleForAccountStorage;
+          return !!this.syncInfo_ && !!this.syncInfo_.isEligibleForAccountStorage;
         }
 
         private computeIsSyncingPasswords_(): boolean {
-          return !!this.syncInfo_ && this.syncInfo_.isSyncingPasswords;
+          return !!this.syncInfo_ && !!this.syncInfo_.isSyncingPasswords;
         }
 
         private computeAccountEmail_(): string {
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -714,7 +714,7 @@ For more settings that use data to improve your Chrome experience, go to <ph nam
         Passwords
       </message>
       <message name="IDS_PASSWORD_MANAGER_SETTINGS_TITLE" desc="Title for the settings menu item leading to the Password Manager UI surface. This allows users to e.g. manage their saved passwords, toggle saving and auto-sign-in on/off, etc. [CHAR_LIMIT=32]">
-        Google Password Manager
+        Password Manager
       </message>
       <message name="IDS_PASSWORD_SAVING_ON_BY_ADMINISTRATOR" desc="Subtitle for the settings menu item leading to the Password Manager UI surface, shown when the device administrator set saving passwords to enabled.">
         Password saving is turned on by your administrator
diff --git a/components/password_manager/core/browser/buildflags.gni b/components/password_manager/core/browser/buildflags.gni
--- a/components/password_manager/core/browser/buildflags.gni
+++ b/components/password_manager/core/browser/buildflags.gni
@@ -9,7 +9,7 @@ declare_args() {
   # The legacy password store backend is supported on android but usually disabled
   # in favor of a downstream implementation. Important: the support for this flag
   # is planned to be removed in November 2024.
-  use_login_database_as_backend = !is_android
+  use_login_database_as_backend = true
 }
 
 # Drawables from the downstream clank/ repository are
diff --git a/components/sync/base/features.cc b/components/sync/base/features.cc
--- a/components/sync/base/features.cc
+++ b/components/sync/base/features.cc
@@ -91,6 +91,7 @@ BASE_FEATURE(kEnablePasswordsAccountStorageForNonSyncingUsers,
              base::FEATURE_ENABLED_BY_DEFAULT
 #endif
 );
+SET_CROMITE_FEATURE_DISABLED(kEnablePasswordsAccountStorageForNonSyncingUsers);
 
 BASE_FEATURE(kSyncEnableContactInfoDataTypeForDasherUsers,
              "SyncEnableContactInfoDataTypeForDasherUsers",
diff --git a/cromite_flags/components/password_manager/core/browser/features/password_features_cc/Restore-chrome-password-store.inc b/cromite_flags/components/password_manager/core/browser/features/password_features_cc/Restore-chrome-password-store.inc
new file mode 100644
--- /dev/null
+++ b/cromite_flags/components/password_manager/core/browser/features/password_features_cc/Restore-chrome-password-store.inc
@@ -0,0 +1 @@
+SET_CROMITE_FEATURE_ENABLED(kSkipUndecryptablePasswords);
--
+2 −0
Original line number Diff line number Diff line
@@ -181,6 +181,8 @@ Timezone-customization.patch
AudioBuffer-AnalyserNode-fp-mitigations.patch
Disable-Feeback-Collector.patch
Fix-chromium-build-bugs.patch
Disable-privacy-issues-in-password-manager.patch
Restore-chrome-password-store.patch

eyeo-beta-118.0.5993.48-base.patch
eyeo-beta-118.0.5993.48-chrome_integration.patch