Dan Ballard pushed to branch firefox-android-115.2.1-13.5-1 at The Tor Project / Applications / firefox-android
Commits: 1e87b6c6 by clairehurst at 2024-02-01T16:51:58+00:00 Bug 42195: Fix "Whats new URL"
- - - - -
5 changed files:
- fenix/app/src/main/java/org/mozilla/fenix/home/HomeMenuView.kt - fenix/app/src/main/java/org/mozilla/fenix/settings/SupportUtils.kt - fenix/app/src/main/java/org/mozilla/fenix/settings/about/AboutFragment.kt - fenix/app/src/test/java/org/mozilla/fenix/home/HomeMenuViewTest.kt - fenix/app/src/test/java/org/mozilla/fenix/settings/SupportUtilsTest.kt
Changes:
===================================== fenix/app/src/main/java/org/mozilla/fenix/home/HomeMenuView.kt ===================================== @@ -170,7 +170,7 @@ class HomeMenuView( Events.whatsNewTapped.record(NoExtras())
homeActivity.openToBrowserAndLoad( - searchTermOrURL = SupportUtils.WHATS_NEW_URL, + searchTermOrURL = SupportUtils.getTorWhatsNewUrl(), newTab = true, from = BrowserDirection.FromHome, )
===================================== fenix/app/src/main/java/org/mozilla/fenix/settings/SupportUtils.kt ===================================== @@ -38,7 +38,7 @@ object SupportUtils { const val MEITUAN_URL = "https://tb.j5k6.com/6ZSOp" const val GOOGLE_US_URL = "https://www.google.com/webhp?client=firefox-b-1-m&channel=ts" const val GOOGLE_XX_URL = "https://www.google.com/webhp?client=firefox-b-m&channel=ts" - const val WHATS_NEW_URL = "https://www.torproject.org/releases/" +// const val WHATS_NEW_URL = "https://www.torproject.org/releases/" const val DONATE_URL = "https://donate.torproject.org/" const val TB_MANUAL_URL = "https://tb-manual.torproject.org/mobile-tor"
@@ -100,6 +100,12 @@ object SupportUtils { return TB_MANUAL_URL }
+ fun getTorWhatsNewUrl(): String { + val alpha = if (BuildConfig.VERSION_NAME.contains('a')) "alpha-" else "" + val versionNumberNoDecimals = BuildConfig.VERSION_NAME.split('.').joinToString("") + return "https://blog.torproject.org/new-$%7Balpha%7Drelease-tor-browser-$%7BversionN..." + } + fun getMozillaPageUrl(page: MozillaPage, locale: Locale = Locale.getDefault()): String { val path = page.path val langTag = getLanguageTag(locale)
===================================== fenix/app/src/main/java/org/mozilla/fenix/settings/about/AboutFragment.kt ===================================== @@ -135,7 +135,7 @@ class AboutFragment : Fragment(), AboutPageListener { AboutPageItem( AboutItem.ExternalLink( WHATS_NEW, - SupportUtils.WHATS_NEW_URL, + SupportUtils.getTorWhatsNewUrl(), ), getString(R.string.about_whats_new, getString(R.string.app_name)), ),
===================================== fenix/app/src/test/java/org/mozilla/fenix/home/HomeMenuViewTest.kt ===================================== @@ -207,7 +207,7 @@ class HomeMenuViewTest { WhatsNew.userViewedWhatsNew(testContext)
homeActivity.openToBrowserAndLoad( - searchTermOrURL = SupportUtils.WHATS_NEW_URL, + searchTermOrURL = SupportUtils.getTorWhatsNewUrl(), newTab = true, from = BrowserDirection.FromHome, )
===================================== fenix/app/src/test/java/org/mozilla/fenix/settings/SupportUtilsTest.kt ===================================== @@ -25,10 +25,10 @@ class SupportUtilsTest { "https://support.mozilla.org/1/mobile/20/Android/fr/tracking-protection-firef...", SupportUtils.getSumoURLForTopic(mockContext("2 0"), SupportUtils.SumoTopic.TRACKING_PROTECTION, Locale("fr")), ) - assertEquals( - "https://www.mozilla.org/firefox/android/notes", - SupportUtils.WHATS_NEW_URL, - ) +// assertEquals( +// "https://www.mozilla.org/firefox/android/notes", +// SupportUtils.WHATS_NEW_URL, +// ) }
@Test @@ -63,7 +63,7 @@ class SupportUtilsTest { ) assertEquals( "https://www.torproject.org/releases/", - SupportUtils.WHATS_NEW_URL + SupportUtils.getTorWhatsNewUrl() ) }
View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/1e87...