Adding compiled libs and customizing the log message.
This commit is contained in:
@@ -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" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user