TorServiceConfig

Configuration info for producing TorRuntime.ServiceFactory to run tor within an android.app.Service.

NOTE: Only one TorServiceConfig instance can be instantiated. Successive invocations of Foreground.Companion.Builder or Companion.Builder will return the already created singleton instance.

e.g. (A Background Service)

val config = TorServiceConfig.Builder {
    // configure...
}

val environment = config.newEnvironment { resourceDir ->
    // Assuming use of `kmp-tor-resource` dependency, for example
    // the `exec` type.
    ResourceLoaderTorExec.getOrCreate(resourceDir)
}

val runtime = TorRuntime.Builder(environment) {
    // configure...
}

See also

Inheritors

Types

Link copied to clipboard
open class BuilderScope
Link copied to clipboard
object Companion
Link copied to clipboard

An instance of TorServiceConfig which indicates to TorService that it should start itself as a Foreground Service.

Link copied to clipboard
protected object UTIL

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun newEnvironment(loader: (File) -> ResourceLoader.Tor): TorRuntime.Environment
fun newEnvironment(dirName: String, loader: (File) -> ResourceLoader.Tor): TorRuntime.Environment
fun newEnvironment(dirName: String, loader: (File) -> ResourceLoader.Tor, block: ThisBlock<TorRuntime.Environment.BuilderScope>): TorRuntime.Environment

Android implementation which creates the TorRuntime.Environment using the provided TorServiceConfig.