Dan Ballard pushed to branch tor-browser-128.8.0esr-14.5-1 at The Tor Project / Applications / Tor Browser
Commits: 496a888f by clairehurst at 2025-03-07T04:03:11+00:00 fixup! TB 40041 [android]: Implement Tor Network Settings
tor-browser#43329 [Android] Remove remaining traces of the old Bootstrap
- - - - - 8bb1b960 by clairehurst at 2025-03-07T04:03:11+00:00 fixup! TB 41878: [android] Add standalone Tor Bootstrap
tor-browser#43329 [Android] Remove remaining traces of the old Bootstrap
# Conflicts: # mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt
- - - - -
3 changed files:
- mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt - − mobile/android/fenix/app/src/main/java/org/mozilla/fenix/tor/TorBootstrapStatus.kt - mobile/android/fenix/app/src/main/res/navigation/nav_graph.xml
Changes:
===================================== mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt ===================================== @@ -158,8 +158,6 @@ import org.mozilla.fenix.search.toolbar.SearchSelectorMenu import org.mozilla.fenix.tabstray.Page import org.mozilla.fenix.tabstray.TabsTrayAccessPoint import org.mozilla.fenix.theme.FirefoxTheme -import org.mozilla.fenix.tor.TorBootstrapFragmentDirections -import org.mozilla.fenix.tor.TorBootstrapStatus import org.mozilla.fenix.tor.TorConnectionAssistViewModel import org.mozilla.fenix.utils.Settings.Companion.TOP_SITES_PROVIDER_MAX_THRESHOLD import org.mozilla.fenix.utils.allowUndo @@ -262,7 +260,6 @@ class HomeFragment : Fragment(), UserInteractionHandler { private val bottomToolbarContainerIntegration = ViewBoundFeatureWrapper<BottomToolbarContainerIntegration>()
private lateinit var savedLoginsLauncher: ActivityResultLauncher<Intent> - private lateinit var torBootstrapStatus: TorBootstrapStatus
override fun onCreate(savedInstanceState: Bundle?) { // DO NOT ADD ANYTHING ABOVE THIS getProfilerTime CALL! @@ -295,12 +292,6 @@ class HomeFragment : Fragment(), UserInteractionHandler { val activity = activity as HomeActivity val components = requireComponents
- torBootstrapStatus = TorBootstrapStatus( - !BuildConfig.DISABLE_TOR, - components.torController, - ::dispatchModeChanges - ) - val currentWallpaperName = requireContext().settings().currentWallpaperName applyWallpaper( wallpaperName = currentWallpaperName, @@ -1037,7 +1028,6 @@ class HomeFragment : Fragment(), UserInteractionHandler { override fun onStop() { dismissRecommendPrivateBrowsingShortcut() super.onStop() - torBootstrapStatus.unregisterTorListener() }
override fun onStart() { @@ -1090,15 +1080,6 @@ class HomeFragment : Fragment(), UserInteractionHandler { } }
- private fun dispatchModeChanges(isBootstrapping: Boolean) { - if (isBootstrapping) { - val directions = - TorBootstrapFragmentDirections - .actionStartupTorbootstrap() - findNavController().navigate(directions) - } - } - @VisibleForTesting internal fun removeCollectionWithUndo(tabCollection: TabCollection) { val snackbarMessage = getString(R.string.snackbar_collection_deleted) @@ -1122,7 +1103,6 @@ class HomeFragment : Fragment(), UserInteractionHandler {
override fun onResume() { super.onResume() - torBootstrapStatus.registerTorListener() if (browsingModeManager.mode == BrowsingMode.Private) { activity?.window?.setBackgroundDrawableResource(R.drawable.private_home_background_gradient) }
===================================== mobile/android/fenix/app/src/main/java/org/mozilla/fenix/tor/TorBootstrapStatus.kt deleted ===================================== @@ -1,45 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -package org.mozilla.fenix.tor - -@SuppressWarnings("LongParameterList", "TooManyFunctions") -class TorBootstrapStatus( - private val shouldStartTor: Boolean, - private val torController: TorController, - private val dispatchModeChanges: (isShouldBootstrap: Boolean) -> Unit - ) : TorEvents { - - init { - torController.registerTorListener(this) - } - - fun isBootstrapping() = (shouldStartTor && !torController.isBootstrapped) - - - @SuppressWarnings("EmptyFunctionBlock") - override fun onTorConnecting() { - } - - override fun onTorConnected() { - dispatchModeChanges(isBootstrapping()) - } - - override fun onTorStopped() { - dispatchModeChanges(isBootstrapping()) - } - - @SuppressWarnings("EmptyFunctionBlock") - override fun onTorStatusUpdate(entry: String?, status: String?, progress: Double?) { - } - - fun unregisterTorListener() { - torController.unregisterTorListener(this) - } - - fun registerTorListener() { - torController.registerTorListener(this) - } - -}
===================================== mobile/android/fenix/app/src/main/res/navigation/nav_graph.xml ===================================== @@ -15,12 +15,6 @@ app:popUpTo="@id/startupFragment" app:popUpToInclusive="true" />
- <action - android:id="@+id/action_startup_torbootstrap" - app:destination="@id/torbootstrapFragment" - app:popUpTo="@id/startupFragment" - app:popUpToInclusive="true" /> - <action android:id="@+id/action_startup_tor_connection_assist" app:destination="@+id/torConnectionAssistFragment" @@ -248,25 +242,6 @@ app:popExitAnim="@anim/slide_out_right" /> </fragment>
- <fragment - android:id="@+id/torbootstrapFragment" - android:name="org.mozilla.fenix.tor.TorBootstrapFragment" - tools:layout="@layout/fragment_home"> - - <action - android:id="@+id/action_home" - app:destination="@id/homeFragment" - app:popUpTo="@id/torbootstrapFragment" - app:popUpToInclusive="true" /> - <action - android:id="@+id/action_torbootstrapFragment_to_SettingsFragment" - app:destination="@id/settingsFragment" - app:enterAnim="@anim/slide_in_right" - app:exitAnim="@anim/slide_out_left" - app:popEnterAnim="@anim/slide_in_left" - app:popExitAnim="@anim/slide_out_right" /> - </fragment> - <fragment android:id="@+id/torConnectionAssistFragment" android:name="org.mozilla.fenix.tor.TorConnectionAssistFragment"
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/e68b047...
tbb-commits@lists.torproject.org