Skip to content
This repository was archived by the owner on Dec 18, 2022. It is now read-only.

Commit 0b4ede4

Browse files
committed
Prepare 2.0.1 release
1 parent 868667a commit 0b4ede4

33 files changed

Lines changed: 80 additions & 65 deletions

docs/changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
# Change Log
22

3+
## Version 2.0.1 (2020-10-18)
4+
- Deprecates the `ServiceNotification.Builder.setActivityToBeOpenedOnTap` method in favor of using
5+
the new `ServiceNotification.Builder.setContentIntentData` to mitigate multiple activities from
6+
being opened.
7+
38
## Version 2.0.0 (2020-10-18)
49
- Adds support for Version 3 Hidden Service Client Authentication
510
- The `V3ClientAuthManager` class can be obtained from `TorServiceController.getV3ClientAuthManager`
611
after Builder initialization, which facilitates easily adding private keys to Tor's `ClientAuthDir`.
712
- Adds better support for multi-module projects by moving `topl-service`'s public
813
classes/abstractions to a separate module, `topl-service-base`.
14+
- TorService now broadcasts as a `NOTICE` via the EventBroadcasters when onTaskRemoved occurred,
15+
instead of being broadcast as `DEBUG` (which required TorSettings.hasDebugLogs to be set to true).
16+
- Can now listen for it in the implementing application's `TorServiceEventBroadcaster`.
917
- See [Migrations](./migration.md) for details on how to migrate from `1.0.0` to `2.0.0`
1018

1119
## Version 1.0.0-beta02 (2020-10-08)

docs/topl-service/io.matthewnelson.topl_service.notification/-service-notification/-builder/-init-.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@ in order to properly shut down Tor and clean up w/o being killed by the OS.
1919
channelID = "TOPL-Android Demo",
2020
notificationID = 615
2121
)
22-
.setActivityToBeOpenedOnTap(
23-
clazz = MainActivity::class.java,
24-
intentExtrasKey = null,
25-
intentExtras = null,
26-
intentRequestCode = null
27-
)
22+
// Only needed if you are passing a bundle, or changing request code to something other than 0
23+
.setContentIntentData(bundle = null, requestCode = 21)
24+
2825
.setImageTorNetworkingEnabled(drawableRes = R.drawable.tor_stat_network_enabled)
2926
.setImageTorNetworkingDisabled(drawableRes = R.drawable.tor_stat_network_disabled)
3027
.setImageTorDataTransfer(drawableRes = R.drawable.tor_stat_network_dataxfer)

docs/topl-service/io.matthewnelson.topl_service.notification/-service-notification/-builder/enable-tor-restart-button.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# enableTorRestartButton
44

5-
`@JvmOverloads fun enableTorRestartButton(enable: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = true): Builder` [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-service/src/main/java/io/matthewnelson/topl_service/notification/ServiceNotification.kt#L300)
5+
`@JvmOverloads fun enableTorRestartButton(enable: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = true): Builder` [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-service/src/main/java/io/matthewnelson/topl_service/notification/ServiceNotification.kt#L327)
66

77
Disabled by Default
88

docs/topl-service/io.matthewnelson.topl_service.notification/-service-notification/-builder/enable-tor-stop-button.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# enableTorStopButton
44

5-
`@JvmOverloads fun enableTorStopButton(enable: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = true): Builder` [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-service/src/main/java/io/matthewnelson/topl_service/notification/ServiceNotification.kt#L317)
5+
`@JvmOverloads fun enableTorStopButton(enable: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = true): Builder` [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-service/src/main/java/io/matthewnelson/topl_service/notification/ServiceNotification.kt#L344)
66

77
Disabled by Default
88

docs/topl-service/io.matthewnelson.topl_service.notification/-service-notification/-builder/index.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Builder
44

5-
`class Builder` [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-service/src/main/java/io/matthewnelson/topl_service/notification/ServiceNotification.kt#L144)
5+
`class Builder` [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-service/src/main/java/io/matthewnelson/topl_service/notification/ServiceNotification.kt#L146)
66

77
Where you get to customize how your notification will look and function.
88

@@ -19,12 +19,9 @@ in order to properly shut down Tor and clean up w/o being killed by the OS.
1919
channelID = "TOPL-Android Demo",
2020
notificationID = 615
2121
)
22-
.setActivityToBeOpenedOnTap(
23-
clazz = MainActivity::class.java,
24-
intentExtrasKey = null,
25-
intentExtras = null,
26-
intentRequestCode = null
27-
)
22+
// Only needed if you are passing a bundle, or changing request code to something other than 0
23+
.setContentIntentData(bundle = null, requestCode = 21)
24+
2825
.setImageTorNetworkingEnabled(drawableRes = R.drawable.tor_stat_network_enabled)
2926
.setImageTorNetworkingDisabled(drawableRes = R.drawable.tor_stat_network_disabled)
3027
.setImageTorDataTransfer(drawableRes = R.drawable.tor_stat_network_dataxfer)
@@ -63,7 +60,8 @@ in order to properly shut down Tor and clean up w/o being killed by the OS.
6360
|---|---|
6461
| [enableTorRestartButton](enable-tor-restart-button.md) | Disabled by Default`fun enableTorRestartButton(enable: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = true): Builder` |
6562
| [enableTorStopButton](enable-tor-stop-button.md) | Disabled by Default`fun enableTorStopButton(enable: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = true): Builder` |
66-
| [setActivityToBeOpenedOnTap](set-activity-to-be-opened-on-tap.md) | Define the Activity to be opened when your user taps TorService's notification.`fun setActivityToBeOpenedOnTap(clazz: `[`Class`](https://docs.oracle.com/javase/6/docs/api/java/lang/Class.html)`<*>, intentExtrasKey: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?, intentExtras: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?, intentRequestCode: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`?): Builder` |
63+
| [setActivityToBeOpenedOnTap](set-activity-to-be-opened-on-tap.md) | Define the Activity to be opened when your user taps TorService's notification.`fun ~~setActivityToBeOpenedOnTap~~(clazz: `[`Class`](https://docs.oracle.com/javase/6/docs/api/java/lang/Class.html)`<*>, intentExtrasKey: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?, intentExtras: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?, intentRequestCode: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`?): Builder` |
64+
| [setContentIntentData](set-content-intent-data.md) | Default notification behaviour is to use the launch intent for your application from Package Manager when a user taps the notification. Electing this method allows for adding a request code and bundle to the PendingIntent.`fun setContentIntentData(bundle: `[`Bundle`](https://developer.android.com/reference/android/os/Bundle.html)`?, requestCode: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`?): Builder` |
6765
| [setCustomColor](set-custom-color.md) | Defaults to [R.color.tor_service_white](#)`fun setCustomColor(colorRes: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): Builder` |
6866
| [setImageTorDataTransfer](set-image-tor-data-transfer.md) | Defaults to Orbot/TorBrowser's icon [R.drawable.tor_stat_network_dataxfer](#).`fun setImageTorDataTransfer(drawableRes: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): Builder` |
6967
| [setImageTorErrors](set-image-tor-errors.md) | Defaults to Orbot/TorBrowser's icon [R.drawable.tor_stat_notifyerr](#).`fun setImageTorErrors(drawableRes: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): Builder` |

docs/topl-service/io.matthewnelson.topl_service.notification/-service-notification/-builder/set-activity-to-be-opened-on-tap.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
# setActivityToBeOpenedOnTap
44

5-
`fun setActivityToBeOpenedOnTap(clazz: `[`Class`](https://docs.oracle.com/javase/6/docs/api/java/lang/Class.html)`<*>, intentExtrasKey: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?, intentExtras: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?, intentRequestCode: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`?): Builder` [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-service/src/main/java/io/matthewnelson/topl_service/notification/ServiceNotification.kt#L180)
5+
`fun ~~setActivityToBeOpenedOnTap~~(clazz: `[`Class`](https://docs.oracle.com/javase/6/docs/api/java/lang/Class.html)`<*>, intentExtrasKey: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?, intentExtras: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?, intentRequestCode: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`?): Builder` [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-service/src/main/java/io/matthewnelson/topl_service/notification/ServiceNotification.kt#L182)
6+
**Deprecated:** Default behavior of user tapping notification now uses your application's launcher intent from package manager to mitigate launching of multiple activities.
67

78
Define the Activity to be opened when your user taps TorService's notification.
89

@@ -16,15 +17,4 @@ See [Builder](index.md) for code samples.
1617

1718
`intentExtras` - ? The extras that will be sent in the PendingIntent.
1819

19-
`intentRequestCode` -
20-
21-
? The request code - Defaults to 0 if not set.
22-
23-
24-
25-
TODO:
26-
27-
28-
* Include an optional Bundle? to be set for creating the pending intent.
29-
* Think about overriding and providing another option to rotate the ContentIntent
30-
to open up/resume current activity?
20+
`intentRequestCode` - ? The request code - Defaults to 0 if not set.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[topl-service](../../../index.md) / [io.matthewnelson.topl_service.notification](../../index.md) / [ServiceNotification](../index.md) / [Builder](index.md) / [setContentIntentData](./set-content-intent-data.md)
2+
3+
# setContentIntentData
4+
5+
`fun setContentIntentData(bundle: `[`Bundle`](https://developer.android.com/reference/android/os/Bundle.html)`?, requestCode: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`?): Builder` [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-service/src/main/java/io/matthewnelson/topl_service/notification/ServiceNotification.kt#L211)
6+
7+
Default notification behaviour is to use the launch intent for your application
8+
from Package Manager when a user taps the notification. Electing this method allows
9+
for adding a request code and bundle to the PendingIntent.
10+
11+
**NOTE:** electing [setActivityToBeOpenedOnTap](set-activity-to-be-opened-on-tap.md) method behaviour takes precedent until
12+
it is removed in a future release.
13+
14+
**NOTE:** If you do not elect this method or [setActivityToBeOpenedOnTap](set-activity-to-be-opened-on-tap.md) in your
15+
[Builder](index.md), the notification's content intent is still set with a default [requestCode](set-content-intent-data.md#io.matthewnelson.topl_service.notification.ServiceNotification.Builder$setContentIntentData(android.os.Bundle, kotlin.Int)/requestCode)
16+
value of 0 and null bundle.
17+
18+
### Parameters
19+
20+
`bundle` - Bundle to be sent to the Launch Activity
21+
22+
`requestCode` - Request Code to be used when launching the Activity

docs/topl-service/io.matthewnelson.topl_service.notification/-service-notification/-builder/set-custom-color.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# setCustomColor
44

5-
`fun setCustomColor(@ColorRes colorRes: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): Builder` [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-service/src/main/java/io/matthewnelson/topl_service/notification/ServiceNotification.kt#L266)
5+
`fun setCustomColor(@ColorRes colorRes: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): Builder` [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-service/src/main/java/io/matthewnelson/topl_service/notification/ServiceNotification.kt#L293)
66

77
Defaults to [R.color.tor_service_white](#)
88

docs/topl-service/io.matthewnelson.topl_service.notification/-service-notification/-builder/set-image-tor-data-transfer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# setImageTorDataTransfer
44

5-
`fun setImageTorDataTransfer(@DrawableRes drawableRes: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): Builder` [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-service/src/main/java/io/matthewnelson/topl_service/notification/ServiceNotification.kt#L235)
5+
`fun setImageTorDataTransfer(@DrawableRes drawableRes: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): Builder` [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-service/src/main/java/io/matthewnelson/topl_service/notification/ServiceNotification.kt#L262)
66

77
Defaults to Orbot/TorBrowser's icon [R.drawable.tor_stat_network_dataxfer](#).
88

docs/topl-service/io.matthewnelson.topl_service.notification/-service-notification/-builder/set-image-tor-errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# setImageTorErrors
44

5-
`fun setImageTorErrors(@DrawableRes drawableRes: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): Builder` [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-service/src/main/java/io/matthewnelson/topl_service/notification/ServiceNotification.kt#L250)
5+
`fun setImageTorErrors(@DrawableRes drawableRes: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): Builder` [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-service/src/main/java/io/matthewnelson/topl_service/notification/ServiceNotification.kt#L277)
66

77
Defaults to Orbot/TorBrowser's icon [R.drawable.tor_stat_notifyerr](#).
88

0 commit comments

Comments
 (0)