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...
}
Content copied to clipboard
See also
Inheritors
Types
Link copied to clipboard
Link copied to clipboard
class Foreground<C : AbstractTorServiceUI.Config, F : TorServiceUI.Factory<C, *, *>> : TorServiceConfig
An instance of TorServiceConfig which indicates to TorService that it should start itself as a Foreground Service.
Functions
Link copied to clipboard
fun newEnvironment(loader: (File) -> ResourceLoader.Tor, block: ThisBlock<TorRuntime.Environment.BuilderScope>): 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.