@@ -19,25 +19,29 @@ Get Started
1919 - Your application's ` torrc ` file gets created for you based on what you have stored in
2020 [ TorServicePrefs] ( ./topl-service-base/io.matthewnelson.topl_service_base/-tor-service-prefs/index.md ) .
2121 If nothing is in ` TorServicePrefs ` for that particular setting, then it will fall back on
22- your static/default [ TorSettings] ( ./topl-core-base/io.matthewnelson.topl_core_base/-tor-settings/index.md )
22+ your static/default
23+ [ ApplicationDefaultTorSettings] ( ./topl-service-base/io.matthewnelson.topl_service_base/-application-default-tor-settings/index.md )
2324 that you supply upon initialization of ` TorServiceController.Builder ` .
2425 - ** Tor Binaries** :
2526 - I use The GuardianProject's <a href =" https://github.com/guardianproject/tor-android " target =" _blank " >tor-android</a >
26- project to build binaries, and provided them
27- <a href =" https://github.com/05nelsonm/TOPL-Android-TorBinary " target =" _blank " >here</a >. The
28- difference is in how they are packaged as a dependency, and the contents of what you are
29- importing as a dependency. I package them in the ` jniLibs ` directory so that the Android OS
30- will automatically install them into your application's ` /data/app/... ` directory, and include
31- no unnecessary classes or resources; just the binaries. Android API 29+ no longer supports
32- execution of executable files from your application's ` /data/data/ ` directory, and must now be
33- installed in the ` context.applicationInfo.nativeLibraryDir ` directory (aka, ` /data/app/... ` )
34- to execute.
27+ project to re-package and provide * only* the binaries, as that's all which is needed by
28+ TOPL-Android. As of version 0.4.4.0, the binaries are simply copied instead of being
29+ re-built (prior versions I was building, but build reproducability is problematic...) which can
30+ be verified by checking the sha256sums (see the repo's README for instructions on how to do that).
31+ - They can be found <a href =" https://github.com/05nelsonm/TOPL-Android-TorBinary " target =" _blank " >here</a >.
32+ - The only difference is the contents of what you are importing as a dependency. I package
33+ them in the ` jniLibs ` directory so that the Android OS will automatically extract them to
34+ your application's ` /data/app/... ` directory, and include no unnecessary classes or
35+ resources; just the binaries.
36+ - Android API 29+ no longer supports execution of executable files from your application's
37+ ` /data/data/ ` directory, and must now be installed in the
38+ ` context.applicationInfo.nativeLibraryDir ` directory (aka, ` /data/app/... ` ) to execute.
3539 - Nothing more is needed in terms of configuring initialization via the
36- ` TorServiceController.Builder ` , as files will be installed in the correct directory, and
37- named to match what ` topl-service ` looks for.
38- - If you wish to use GuardianProject's binaries , see
40+ ` TorServiceController.Builder.useCustomTorConfigFiles ` , as files will be installed in the
41+ correct directory, and named to match what ` topl-service ` looks for.
42+ - If you wish to use GuardianProject's dependency , see
3943 <a href =" https://github.com/guardianproject/tor-android " target =" _blank " >tor-android</a >.
40- - You'll need to use their ` NativeResouceInstaller ` to install the binaries.
44+ - You'll need to use their ` NativeResourceInstaller ` to install the binaries.
4145 - You'll need to also implement ` TorServiceController.Builder.useCustomTorConfigFiles `
4246 method when initializing ` topl-service ` and provide it with your own
4347 [ TorConfigFiles] ( ./topl-core-base/io.matthewnelson.topl_core_base/-tor-config-files/index.md ) .
@@ -59,18 +63,37 @@ Get Started
5963 implementation "io.matthewnelson.topl-android:topl-service:{{ topl_android.release }}"
6064 ```
6165
62- - Create a new class which extends [TorSettings ](./topl-core -base/io.matthewnelson.topl_core_base/ -tor-settings/index.md)
66+ - Create a new class which extends [ApplicationDefaultTorSettings ](./topl-service -base/io.matthewnelson.topl_service_base/-application-default -tor-settings/index.md)
6367 and apply your own default settings.
6468 - See the SampleApp's
65- <a href="https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/sampleapp/src/main/java/io/matthewnelson/sampleapp/topl_android/MyTorSettings.kt" target="_blank">MyTorSettings</a>
69+ <a href="https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/sampleapp/src/main/java/io/matthewnelson/sampleapp/topl_android/MyTorSettings.kt" target="_blank">MyTorSettings</a>
6670 class for help.
6771 - Also checkout the documentation in the `TorSettings` class for more of a breakdown and help.
72+
73+ - Optional: If you wish to receive broadcasts (TorState/NetworkState, Port Information, Logs, etc.),
74+ Create a new class which extends [TorServiceEventBroadcaster](./topl-service-base/io.matthewnelson.topl_service_base/-tor-service-event-broadcaster/index.md)
75+ and implement the abstract methods.
76+ - See the SampleApp's
77+ <a href="https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/sampleapp/src/main/java/io/matthewnelson/sampleapp/topl_android/MyEventBroadcaster.kt" target="_blank">MyEventBroadcaster</a>
78+ class for help.
79+ - Use the [TorServiceController.Builder.setEventBroadcaster](./topl-service/io.matthewnelson.topl_service/-tor-service-controller/-builder/set-event-broadcaster.md)
80+ and provide your implementation when initializing `topl-service`.
6881
6982 - In your Application class' `onCreate` implement, and customize as desired, the
7083 [TorServiceController.Builder](./topl-service/io.matthewnelson.topl_service/-tor-service-controller/-builder/index.md)
7184
7285 - Call APIs provided from
7386 [TorServiceController.Companion](./topl-service/io.matthewnelson.topl_service/-tor-service-controller/index.md)
87+
88+ ### Multi-Module projects
89+ - If you have a `tor` module in your project that extends the api's in `TorServiceController` to centralize
90+ control of `topl-service`, other modules depending on it need only import the `topl-service-base`
91+ module which provides all of the necessary public classes/abstractions.
92+
93+ - In your `tor` module's `build.gradle` file, add the following to the `dependencies` block:
94+ ```groovy
95+ api "io.matthewnelson.topl-android:topl-service-base:{{ topl_android.release }}"
96+ ```
7497
7598### Using the SNAPSHOT version of topl-service
7699
0 commit comments