From 35bd4f028956464ccc22c157d7bf0a39fa12d227 Mon Sep 17 00:00:00 2001 From: Alexander Danilov Date: Tue, 13 Feb 2024 10:39:53 +0600 Subject: [PATCH] Fix for new sign up from Niantic --- .../main/java/org/exarhteam/iitc_mobile/IITC_Mobile.java | 1 + .../org/exarhteam/iitc_mobile/IITC_WebViewClient.java | 7 ++++++- .../java/org/exarhteam/iitc_mobile/IITC_WebViewPopup.java | 8 +++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mobile/app/src/main/java/org/exarhteam/iitc_mobile/IITC_Mobile.java b/mobile/app/src/main/java/org/exarhteam/iitc_mobile/IITC_Mobile.java index 4ee731cb7..ef3201ca9 100644 --- a/mobile/app/src/main/java/org/exarhteam/iitc_mobile/IITC_Mobile.java +++ b/mobile/app/src/main/java/org/exarhteam/iitc_mobile/IITC_Mobile.java @@ -187,6 +187,7 @@ protected void onCreate(final Bundle savedInstanceState) { mAllowedHostnames.put("google.com", googleUA); mAllowedHostnames.put("youtube.com", googleUA); mAllowedHostnames.put("facebook.com", mDesktopUA); + mAllowedHostnames.put("signin.nianticlabs.com", mIITCDefaultUA); // enable progress bar above action bar // must be called BEFORE calling parent method diff --git a/mobile/app/src/main/java/org/exarhteam/iitc_mobile/IITC_WebViewClient.java b/mobile/app/src/main/java/org/exarhteam/iitc_mobile/IITC_WebViewClient.java index 50742f65a..d40a64b78 100644 --- a/mobile/app/src/main/java/org/exarhteam/iitc_mobile/IITC_WebViewClient.java +++ b/mobile/app/src/main/java/org/exarhteam/iitc_mobile/IITC_WebViewClient.java @@ -326,10 +326,15 @@ public boolean shouldOverrideUrlLoading(final WebView view, final String url) { } if (uriHost.startsWith("accounts.google.") || uriHost.startsWith("appengine.google.") || - uriHost.startsWith("accounts.youtube.")) { + uriHost.startsWith("accounts.youtube.") || + uriHost.startsWith("myaccount.google.")) { Log.d("Google login"); return false; } + if (uriHost.startsWith("signin.nianticlabs.")) { + Log.d("Niantic login"); + return false; + } if (mIitc.isInternalHostname(uriHost)) { Log.d("internal host"); return false; diff --git a/mobile/app/src/main/java/org/exarhteam/iitc_mobile/IITC_WebViewPopup.java b/mobile/app/src/main/java/org/exarhteam/iitc_mobile/IITC_WebViewPopup.java index 0c5f57fe5..0f967255e 100644 --- a/mobile/app/src/main/java/org/exarhteam/iitc_mobile/IITC_WebViewPopup.java +++ b/mobile/app/src/main/java/org/exarhteam/iitc_mobile/IITC_WebViewPopup.java @@ -96,11 +96,17 @@ public boolean shouldOverrideUrlLoading(final WebView view, final String url) { } if (uriHost.startsWith("accounts.google.") || uriHost.startsWith("appengine.google.") || - uriHost.startsWith("accounts.youtube.")) { + uriHost.startsWith("accounts.youtube.") || + uriHost.startsWith("myaccount.google.")) { Log.d("popup: Google login"); openDialogPopup(); return false; } + if (uriHost.startsWith("signin.nianticlabs.")) { + Log.d("popup: Niantic login"); + openDialogPopup(); + return false; + } if (mIitc.isInternalHostname(uriHost)) { Log.d("popup: internal host"); openDialogPopup();