newEnvironment

fun newEnvironment(instanceConfig: C, loader: (File) -> ResourceLoader.Tor): TorRuntime.Environment(source)
fun newEnvironment(instanceConfig: C, loader: (File) -> ResourceLoader.Tor, block: ThisBlock<TorRuntime.Environment.BuilderScope>): TorRuntime.Environment(source)

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

NOTE: TorRuntime.Environment.BuilderScope.serviceFactoryLoader is set automatically and tor will run inside an android.app.Service.

Directories (emulators & devices):

  • workDirectory: app_torservice

  • cacheDirectory: cache/torservice

Directories (android unit tests where testUseBuildDirectory = false):

  • workDirectory: {system temp}/kmp_tor_android_test/torservice/work

  • cacheDirectory: {system temp}/kmp_tor_android_test/torservice/cache

Directories (android unit tests where testUseBuildDirectory = true):

  • workDirectory: {module}/build/kmp_tor_android_test/torservice/work

  • cacheDirectory: {module}/build/kmp_tor_android_test/torservice/cache

Throws

If instanceConfig fails validation checks (emulators & devices only).

IllegalArgumentException

if instanceConfig is invalid.


fun newEnvironment(dirName: String, instanceConfig: C, loader: (File) -> ResourceLoader.Tor): TorRuntime.Environment(source)
fun newEnvironment(dirName: String, instanceConfig: C, loader: (File) -> ResourceLoader.Tor, block: ThisBlock<TorRuntime.Environment.BuilderScope>): TorRuntime.Environment(source)

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

NOTE: TorRuntime.Environment.BuilderScope.serviceFactoryLoader is set automatically and tor will run inside an android.app.Service.

Directories (emulators & devices):

Directories (android unit tests where testUseBuildDirectory = false):

  • workDirectory: {system temp}/kmp_tor_android_test/dirName/work

  • cacheDirectory: {system temp}/kmp_tor_android_test/dirName/cache

Directories (android unit tests where testUseBuildDirectory = true):

  • workDirectory: {module}/build/kmp_tor_android_test/dirName/work

  • cacheDirectory: {module}/build/kmp_tor_android_test/dirName/cache

Throws

If instanceConfig fails validation checks (emulators & devices only).

IllegalArgumentException

if instanceConfig is invalid or dirName is an absolute file path (starts with /).