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

Commit ed6d7e1

Browse files
committed
Merge branch 'release_2.1.0'
2 parents 77c2e31 + 0d8e384 commit ed6d7e1

247 files changed

Lines changed: 1014 additions & 249 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/changelog.md

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

3+
## Version 2.1.0 (2021-01-30)
4+
- New Features Added:
5+
- `topl-service:TorService` Lifecycle Events are now broadcast to `TorServiceEventBroadcaster`
6+
- `topl-service-base:ServiceExecutionHooks` have been implemented such that library users can
7+
leverage suspension functions at key points of `TorService`'s operation, and allow for synchronous
8+
code execution.
9+
- Moved `topl-service:ServiceActionName` String definitions to `topl-service-base` to expose them
10+
such that library users can utilize them in their implementation of `TorServiceEventBroadcaster`
11+
- Bug Fixes:
12+
- Kotlin internal visibility modifier is public from Java code.
13+
See Issue <a href="https://github.com/05nelsonm/TorOnionProxyLibrary-Android/issues/100" target="_blank">100</a>
14+
- Duplicate v3 Client Authentication files were inhibiting Tor from starting properly.
15+
See Issue <a href="https://github.com/05nelsonm/TorOnionProxyLibrary-Android/issues/105" target="_blank">105</a>
16+
- Tor notice messages were modified between 0.4.4.0 and 0.4.5.4-rc, which caused
17+
`topl-service:ServiceEventBroadcaster`'s notice message filter to miss broadcasting of ports.
18+
See Issue <a href="https://github.com/05nelsonm/TorOnionProxyLibrary-Android/issues/110" target="_blank">110</a>
19+
- Dependencies were bumped to latest stable releases.
20+
321
## Version 2.0.2 (2020-10-19)
422
- Bug Fix: Notifications not showing on API 25 and below [12abbf7](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/commit/12abbf7faec781cb2c9b0a9babf3fe0e3d6cb352)
523
- Deprecates `ServiceNotification.Builder.setContentIntentData` in favor of

docs/roadmap.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@
1010
:material-checkbox-blank-outline: Pass-through commands to the TorControlConnection
1111
:material-checkbox-blank-outline: Transport Plugin support
1212
:material-checkbox-blank-outline: v3 Hidden Service Creation
13-
:material-checkbox-blank-outline: Settings/Debug Activity (so devs don't have to create one if they don't wish to)
1413

1514
[back](index.md)

docs/topl-core-base/io.matthewnelson.topl_core_base/-event-broadcaster/-init-.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ See [BaseConsts.BroadcastType](../-base-consts/-broadcast-type/index.md)s
2222
*
2323
* @param [torService] [BaseService] for context.
2424
* */
25-
internal class ServiceEventBroadcaster(private val torService: BaseService): EventBroadcaster() {
25+
internal class ServiceEventBroadcaster private constructor(
26+
private val torService: BaseService
27+
): EventBroadcaster() {
28+
29+
companion object {
30+
@JvmSynthetic
31+
fun instantiate(torService: BaseService): ServiceEventBroadcaster =
32+
ServiceEventBroadcaster(torService)
33+
}
2634

2735
private val scopeMain: CoroutineScope
2836
get() = torService.getScopeMain()
@@ -180,28 +188,28 @@ internal class ServiceEventBroadcaster(private val torService: BaseService): Eve
180188
}
181189
// Dns Port
182190
// NOTICE|OnionProxyManager|Opened DNS listener on 127.0.0.1:5400
183-
msg.contains("Opened DNS listener on ") -> {
191+
msg.contains("Opened DNS listener ") -> {
184192
dnsPort = getPortFromMsg(msg)
185193
if (isBootstrappingComplete())
186194
updateAppEventBroadcasterWithPortInfo()
187195
}
188196
// Http Tunnel Port
189197
// NOTICE|BaseEventListener|Opened HTTP tunnel listener on 127.0.0.1:8118
190-
msg.contains("Opened HTTP tunnel listener on ") -> {
198+
msg.contains("Opened HTTP tunnel listener ") -> {
191199
httpTunnelPort = getPortFromMsg(msg)
192200
if (isBootstrappingComplete())
193201
updateAppEventBroadcasterWithPortInfo()
194202
}
195203
// Socks Port
196204
// NOTICE|BaseEventListener|Opened Socks listener on 127.0.0.1:9050
197-
msg.contains("Opened Socks listener on ") -> {
205+
msg.contains("Opened Socks listener ") -> {
198206
socksPort = getPortFromMsg(msg)
199207
if (isBootstrappingComplete())
200208
updateAppEventBroadcasterWithPortInfo()
201209
}
202210
// Trans Port
203211
// NOTICE|BaseEventListener|Opened Transparent pf/netfilter listener on 127.0.0.1:9040
204-
msg.contains("Opened Transparent pf/netfilter listener on ") -> {
212+
msg.contains("Opened Transparent pf/netfilter listener ") -> {
205213
transPort = getPortFromMsg(msg)
206214
if (isBootstrappingComplete())
207215
updateAppEventBroadcasterWithPortInfo()

docs/topl-core-base/io.matthewnelson.topl_core_base/-event-broadcaster/index.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ See [BaseConsts.BroadcastType](../-base-consts/-broadcast-type/index.md)s
2222
*
2323
* @param [torService] [BaseService] for context.
2424
* */
25-
internal class ServiceEventBroadcaster(private val torService: BaseService): EventBroadcaster() {
25+
internal class ServiceEventBroadcaster private constructor(
26+
private val torService: BaseService
27+
): EventBroadcaster() {
28+
29+
companion object {
30+
@JvmSynthetic
31+
fun instantiate(torService: BaseService): ServiceEventBroadcaster =
32+
ServiceEventBroadcaster(torService)
33+
}
2634

2735
private val scopeMain: CoroutineScope
2836
get() = torService.getScopeMain()
@@ -180,28 +188,28 @@ internal class ServiceEventBroadcaster(private val torService: BaseService): Eve
180188
}
181189
// Dns Port
182190
// NOTICE|OnionProxyManager|Opened DNS listener on 127.0.0.1:5400
183-
msg.contains("Opened DNS listener on ") -> {
191+
msg.contains("Opened DNS listener ") -> {
184192
dnsPort = getPortFromMsg(msg)
185193
if (isBootstrappingComplete())
186194
updateAppEventBroadcasterWithPortInfo()
187195
}
188196
// Http Tunnel Port
189197
// NOTICE|BaseEventListener|Opened HTTP tunnel listener on 127.0.0.1:8118
190-
msg.contains("Opened HTTP tunnel listener on ") -> {
198+
msg.contains("Opened HTTP tunnel listener ") -> {
191199
httpTunnelPort = getPortFromMsg(msg)
192200
if (isBootstrappingComplete())
193201
updateAppEventBroadcasterWithPortInfo()
194202
}
195203
// Socks Port
196204
// NOTICE|BaseEventListener|Opened Socks listener on 127.0.0.1:9050
197-
msg.contains("Opened Socks listener on ") -> {
205+
msg.contains("Opened Socks listener ") -> {
198206
socksPort = getPortFromMsg(msg)
199207
if (isBootstrappingComplete())
200208
updateAppEventBroadcasterWithPortInfo()
201209
}
202210
// Trans Port
203211
// NOTICE|BaseEventListener|Opened Transparent pf/netfilter listener on 127.0.0.1:9040
204-
msg.contains("Opened Transparent pf/netfilter listener on ") -> {
212+
msg.contains("Opened Transparent pf/netfilter listener ") -> {
205213
transPort = getPortFromMsg(msg)
206214
if (isBootstrappingComplete())
207215
updateAppEventBroadcasterWithPortInfo()

docs/topl-core/io.matthewnelson.topl_core.broadcaster/-broadcast-logger/debug.md

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

33
# debug
44

5-
`fun debug(msg: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-core/src/main/java/io/matthewnelson/topl_core/broadcaster/BroadcastLogger.kt#L122)
5+
`fun debug(msg: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-core/src/main/java/io/matthewnelson/topl_core/broadcaster/BroadcastLogger.kt#L131)
66

77
Will only broadcast if [hasDebugLogs](#) is on.
88

docs/topl-core/io.matthewnelson.topl_core.broadcaster/-broadcast-logger/error.md

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

33
# error
44

5-
`fun error(msg: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-core/src/main/java/io/matthewnelson/topl_core/broadcaster/BroadcastLogger.kt#L148)
5+
`fun error(msg: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-core/src/main/java/io/matthewnelson/topl_core/broadcaster/BroadcastLogger.kt#L157)

docs/topl-core/io.matthewnelson.topl_core.broadcaster/-broadcast-logger/exception.md

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

33
# exception
44

5-
`fun exception(e: `[`Exception`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-exception/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-core/src/main/java/io/matthewnelson/topl_core/broadcaster/BroadcastLogger.kt#L129)
5+
`fun exception(e: `[`Exception`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-exception/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-core/src/main/java/io/matthewnelson/topl_core/broadcaster/BroadcastLogger.kt#L138)

docs/topl-core/io.matthewnelson.topl_core.broadcaster/-broadcast-logger/notice.md

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

33
# notice
44

5-
`fun notice(msg: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-core/src/main/java/io/matthewnelson/topl_core/broadcaster/BroadcastLogger.kt#L136)
5+
`fun notice(msg: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-core/src/main/java/io/matthewnelson/topl_core/broadcaster/BroadcastLogger.kt#L145)

docs/topl-core/io.matthewnelson.topl_core.broadcaster/-broadcast-logger/tor-state.md

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

33
# torState
44

5-
`fun torState(state: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, networkState: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-core/src/main/java/io/matthewnelson/topl_core/broadcaster/BroadcastLogger.kt#L154)
5+
`fun torState(state: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, networkState: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-core/src/main/java/io/matthewnelson/topl_core/broadcaster/BroadcastLogger.kt#L163)

docs/topl-core/io.matthewnelson.topl_core.broadcaster/-broadcast-logger/warn.md

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

33
# warn
44

5-
`fun warn(msg: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-core/src/main/java/io/matthewnelson/topl_core/broadcaster/BroadcastLogger.kt#L142)
5+
`fun warn(msg: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/05nelsonm/TorOnionProxyLibrary-Android/blob/master/topl-core/src/main/java/io/matthewnelson/topl_core/broadcaster/BroadcastLogger.kt#L151)

0 commit comments

Comments
 (0)