Dan Ballard pushed to branch firefox-android-115.2.1-13.5-1 at The Tor Project / Applications / firefox-android
Commits: d483554e by Dan Ballard at 2024-06-11T12:38:20-07:00 fixup! Add Tor integration and UI
Bug 42632: Don't display builtin bridges in provide bridge popup; Also fix saving user provided bridges by splitting on \n instead of \r\n and prune empty lines
- - - - -
1 changed file:
- fenix/app/src/main/java/org/mozilla/fenix/tor/TorControllerGV.kt
Changes:
===================================== fenix/app/src/main/java/org/mozilla/fenix/tor/TorControllerGV.kt ===================================== @@ -157,12 +157,20 @@ class TorControllerGV( // with no bridge strings override var userProvidedBridges: String? get() { - return getTorSettings()?.bridgeBridgeStrings?.joinToString("\r\n") + return getTorSettings()?.let { + if (it.bridgesSource == BridgeSource.UserProvided) { + return getTorSettings()?.bridgeBridgeStrings?.joinToString("\n") + } + return "" + } } set(value) { getTorSettings()?.let { + Log.i(TAG, "setUserProvidedBridges: '$value'"); + // Hack: we don't have validation so lets do something quick and dirty (each line has a length) + val userProvidedLines: Array<String> = value?.split("\n")?.filter { it.length > 4 }?.toTypedArray() ?: arrayOf<String>() it.bridgesSource = BridgeSource.UserProvided - it.bridgeBridgeStrings = value?.split("\r\n")?.toTypedArray() ?: arrayOf<String>() + it.bridgeBridgeStrings = userProvidedLines getTorIntegration().setSettings(it, true, true) } }
View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/d483...
tbb-commits@lists.torproject.org