Skip to content

Commit

Permalink
Upgrade Tor to 0.4.8.13
Browse files Browse the repository at this point in the history
  • Loading branch information
grote committed Jan 3, 2025
1 parent 121125f commit 217d2fc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
11 changes: 5 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,13 @@ dependencies {
kapt "com.google.dagger:hilt-compiler:$hilt_version"

// Tor
implementation "org.briarproject:onionwrapper-android:0.1.0"
tor 'org.briarproject:tor-android:0.4.8.9-1'
tor 'org.briarproject:obfs4proxy-android:0.0.14-tor2'
tor 'org.briarproject:snowflake-android:2.9.1'
implementation 'org.briarproject:moat-api:0.2'
implementation "org.briarproject:onionwrapper-android:0.1.2"
tor 'org.briarproject:tor-android:0.4.8.13'
tor 'org.briarproject:lyrebird-android:0.5.0-2'
implementation 'org.briarproject:moat-api:0.3'
implementation 'com.squareup.okhttp3:okhttp:4.12.0'

def ktor_version = '2.3.5'
def ktor_version = '2.3.13'
implementation "io.ktor:ktor-server-core:$ktor_version"
implementation "io.ktor:ktor-server-netty:$ktor_version"
implementation "io.ktor:ktor-server-pebble:$ktor_version"
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/java/org/onionshare/android/tor/MoatApiFactory.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import org.briarproject.moat.MoatApi
import java.io.File

fun interface MoatApiFactory {
fun createMoatApi(obfs4Executable: File, obfs4Dir: File): MoatApi
fun createMoatApi(lyrebirdExecutable: File, lyrebirdDir: File): MoatApi
}

object DefaultMoatApiFactory : MoatApiFactory {
private const val MOAT_URL = "https://onion.azureedge.net/"
private const val MOAT_FRONT = "ajax.aspnetcdn.com"
private const val MOAT_URL = "https://1723079976.rsc.cdn77.org/"
private const val MOAT_FRONT = "www.phpmyadmin.net"

override fun createMoatApi(obfs4Executable: File, obfs4Dir: File): MoatApi {
return MoatApi(obfs4Executable, obfs4Dir, MOAT_URL, MOAT_FRONT)
override fun createMoatApi(lyrebirdExecutable: File, lyrebirdDir: File): MoatApi {
return MoatApi(lyrebirdExecutable, lyrebirdDir, MOAT_URL, MOAT_FRONT)
}
}
4 changes: 2 additions & 2 deletions app/src/main/java/org/onionshare/android/tor/TorManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ class TorManager(

private fun getBridgesFromMoat(): List<String> {
val moat = moatApiFactory.createMoatApi(
obfs4Executable = tor.obfs4ExecutableFile,
obfs4Dir = app.getDir("state", MODE_PRIVATE)
lyrebirdExecutable = tor.lyrebirdExecutableFile,
lyrebirdDir = app.getDir("state", MODE_PRIVATE)
)
val bridges = moat.get().let {
// if response was empty, try it again with what we think the country should be
Expand Down
6 changes: 3 additions & 3 deletions app/src/test/java/org/onionshare/android/TorManagerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TorManagerTest {

private val torManager: TorManager

private val obfs4ExecutableFile = File("/usr/bin/echo")
private val lyrebirdExecutableFile = File("/usr/bin/echo")
private val stateDir = File("/tmp")
private val moatApi: MoatApi = mockk()

Expand Down Expand Up @@ -106,9 +106,9 @@ class TorManagerTest {
every { tor.enableNetwork(true) } just Runs

// moat doesn't return bridges
every { tor.obfs4ExecutableFile } returns obfs4ExecutableFile
every { tor.lyrebirdExecutableFile } returns lyrebirdExecutableFile
every { app.getDir("state", 0) } returns stateDir
every { moatApiFactory.createMoatApi(obfs4ExecutableFile, stateDir) } returns moatApi
every { moatApiFactory.createMoatApi(lyrebirdExecutableFile, stateDir) } returns moatApi
every { moatApi.get() } returns emptyList()
every { locationUtils.currentCountry } returns "br"
every { moatApi.getWithCountry("br") } returns emptyList()
Expand Down

0 comments on commit 217d2fc

Please sign in to comment.