diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/tor/TorService.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/tor/TorService.kt index 2fc8f8b25..70f30901e 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/tor/TorService.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/tor/TorService.kt @@ -51,18 +51,23 @@ class TorService( val status: StateFlow = _status.asStateFlow() init { - ArtiNative.setLogCallback( - ArtiLogCallback { text -> - Log.d("TorService") { "Arti: $text" } - - when { - text.contains("Sufficiently bootstrapped", ignoreCase = true) -> { - _status.value = TorServiceStatus.Active(socksPort) - Log.d("TorService") { "Arti SOCKS proxy active on port $socksPort" } - } + ArtiNative.setLogCallback { text -> + Log.d("TorService") { + val newLine = text.indexOf('\n') + if (newLine > 1) { + "Arti: ${text.substring(0, newLine)}" + } else { + "Arti: $text" } - }, - ) + } + + when { + text.contains("Sufficiently bootstrapped", ignoreCase = true) -> { + _status.value = TorServiceStatus.Active(socksPort) + Log.d("TorService") { "Arti SOCKS proxy active on port $socksPort" } + } + } + } } /** diff --git a/amethyst/src/main/jniLibs/arm64-v8a/libarti_android.so b/amethyst/src/main/jniLibs/arm64-v8a/libarti_android.so new file mode 100755 index 000000000..8fc5ef333 Binary files /dev/null and b/amethyst/src/main/jniLibs/arm64-v8a/libarti_android.so differ diff --git a/amethyst/src/main/jniLibs/x86_64/libarti_android.so b/amethyst/src/main/jniLibs/x86_64/libarti_android.so new file mode 100755 index 000000000..3ee9f24e9 Binary files /dev/null and b/amethyst/src/main/jniLibs/x86_64/libarti_android.so differ