Adding compiled libs and customizing the log message.

This commit is contained in:
Vitor Pamplona
2026-04-01 13:50:36 -04:00
parent bc24434f1c
commit 45f1d79410
3 changed files with 16 additions and 11 deletions
@@ -51,18 +51,23 @@ class TorService(
val status: StateFlow<TorServiceStatus> = _status.asStateFlow() val status: StateFlow<TorServiceStatus> = _status.asStateFlow()
init { init {
ArtiNative.setLogCallback( ArtiNative.setLogCallback { text ->
ArtiLogCallback { text -> Log.d("TorService") {
Log.d("TorService") { "Arti: $text" } val newLine = text.indexOf('\n')
if (newLine > 1) {
when { "Arti: ${text.substring(0, newLine)}"
text.contains("Sufficiently bootstrapped", ignoreCase = true) -> { } else {
_status.value = TorServiceStatus.Active(socksPort) "Arti: $text"
Log.d("TorService") { "Arti SOCKS proxy active on port $socksPort" }
}
} }
}, }
)
when {
text.contains("Sufficiently bootstrapped", ignoreCase = true) -> {
_status.value = TorServiceStatus.Active(socksPort)
Log.d("TorService") { "Arti SOCKS proxy active on port $socksPort" }
}
}
}
} }
/** /**
Binary file not shown.
Binary file not shown.