mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-05 03:57:24 +00:00
Minor fixes to strings and ui, crash fixed #63
This commit is contained in:
1 parent
a2f37e6b9f
commit
278c06170b
16 files changed
+157
-177
No files matched your search
+2
-2
@@ -13,9 +13,9 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0"
|
||||
implementation "org.json:json:20211205"
|
||||
implementation "org.json:json:20220320"
|
||||
|
||||
testImplementation "junit:junit:4.13.2"
|
||||
testImplementation "org.mockito:mockito-core:4.3.1"
|
||||
testImplementation "org.mockito:mockito-core:4.4.0"
|
||||
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.0"
|
||||
}
|
||||
@@ -67,7 +67,8 @@ fun String.isValidIPv4(): Boolean {
|
||||
}
|
||||
|
||||
fun String.isValidPort(): Boolean {
|
||||
return this.isNotEmpty() && this.toInt() in 1024..65535
|
||||
val port = "([1-9]|[1-9]\\d{1,3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])"
|
||||
return this.matches(port.toRegex()) && this.toInt() in 1024..65535
|
||||
}
|
||||
|
||||
fun ping(hostname: String, port: Int): Int {
|
||||
|
||||
Reference in new issue
Block a user