feat: auto-tunneling flexibility

Added tunnel settings feature where users can configure a tunnel to be used on certain SSID or with mobile data.
Closes #50

Added feature where if a tunnel was active when phone restarted, the app will start that tunnel on boot.

Removed automatic auto-tunnel toggling/override from the tunnel tile and app shortcuts as it can cause undesirable behavior.

Added second tile to control auto-tunneling pause/resume state from a tile.

Added two additional static shortcuts to be able to control auto-tunneling pause/resume state from shortcuts.

Fixed bug where crashes can happen from serializing and deserializing tunnel configs by removing the need for serialization of tunnel configs.

Refactored logic of watcher and tunnel service to make state more predictable.
#127

Fixed bug where rapidly toggling tunnels can cause crashes.
Closes #145

Improved how tunnels are manually toggled from one to another.

Improved logic/storage around primary tunnel behavior.

Fixes issue where info level logs were not populating on release builds.

Increase allowed name length displayed in UI.
Closes #143

Fixes bug where androidTV could crash in certain situations.

Bump versions.

Updated screenshots.
This commit is contained in:
Zane Schepke
2024-03-29 23:53:41 -04:00
parent 1d644748e5
commit b1fdb5b9b2
103 changed files with 2323 additions and 1152 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ android {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
"proguard-rules.pro",
)
}
}
@@ -1,40 +1,42 @@
package com.zaneschepke.logcatter.model
enum class LogLevel(val signifier: String) {
DEBUG("D") {
override fun color(): Long {
return 0xFF2196F3
}
override fun color(): Long {
return 0xFF2196F3
}
},
INFO("I"){
INFO("I") {
override fun color(): Long {
return 0xFF4CAF50
}
},
ASSERT("A"){
},
ASSERT("A") {
override fun color(): Long {
return 0xFF9C27B0
}
},
WARNING("W"){
WARNING("W") {
override fun color(): Long {
return 0xFFFFC107
}
},
ERROR("E"){
},
ERROR("E") {
override fun color(): Long {
return 0xFFF44336
}
},
VERBOSE("V"){
},
VERBOSE("V") {
override fun color(): Long {
return 0xFF000000
}
};
abstract fun color() : Long
abstract fun color(): Long
companion object {
fun fromSignifier(signifier: String) : LogLevel {
return when(signifier) {
fun fromSignifier(signifier: String): LogLevel {
return when (signifier) {
DEBUG.signifier -> DEBUG
INFO.signifier -> INFO
WARNING.signifier -> WARNING
@@ -6,22 +6,37 @@ data class LogMessage(
val time: Instant,
val pid: String,
val tid: String,
val level : LogLevel,
val level: LogLevel,
val tag: String,
val message: String
) {
override fun toString(): String {
return "$time $pid $tid $level $tag message= $message"
}
companion object {
fun from(logcatLine : String) : LogMessage {
return if(logcatLine.contains("---------")) LogMessage(Instant.now(), "0","0",LogLevel.VERBOSE,"System", logcatLine)
fun from(logcatLine: String): LogMessage {
return if (logcatLine.contains("---------")) LogMessage(
Instant.now(),
"0",
"0",
LogLevel.VERBOSE,
"System",
logcatLine,
)
else {
//TODO improve this
val parts = logcatLine.trim().split(" ").filter { it.isNotEmpty() }
val epochParts = parts[0].split(".").map { it.toLong() }
val message = parts.subList(5, parts.size).joinToString(" ")
LogMessage(Instant.ofEpochSecond(epochParts[0], epochParts[1]), parts[1], parts[2], LogLevel.fromSignifier(parts[3]), parts[4], message)
LogMessage(
Instant.ofEpochSecond(epochParts[0], epochParts[1]),
parts[1],
parts[2],
LogLevel.fromSignifier(parts[3]),
parts[4],
message,
)
}
}
}