Skip to content

Commit

Permalink
v3.1.2 - Android 13, auto update, R8 minification
Browse files Browse the repository at this point in the history
  • Loading branch information
rt-bishop committed Oct 23, 2022
1 parent baf61ca commit b156f66
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 52 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout latest commit
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup java environment
uses: actions/setup-java@v1
with: { java-version: 11 }
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'

- name: Assemble APK and Bundle
run: |
Expand Down
5 changes: 3 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ plugins {
android {
compileSdkVersion 33
buildToolsVersion '33.0.0'
namespace 'com.rtbishop.look4sat'

defaultConfig {
applicationId "com.rtbishop.look4sat"
minSdk 21
targetSdk 33
versionCode 311
versionName '3.1.1'
versionCode 312
versionName '3.1.2'

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down
62 changes: 29 additions & 33 deletions base/src/main/java/com/rtbishop/look4sat/utility/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ package com.rtbishop.look4sat.utility

import com.rtbishop.look4sat.domain.predict.DEG2RAD
import com.rtbishop.look4sat.domain.predict.RAD2DEG
import java.net.InetSocketAddress
import java.net.Socket
import java.security.MessageDigest
import java.util.concurrent.TimeUnit
import java.util.regex.Pattern

fun Long.toTimerString(): String {
val format = "%02d:%02d:%02d"
Expand All @@ -43,23 +39,23 @@ fun Double.toDegrees(): Double = this * RAD2DEG

fun Double.toRadians(): Double = this * DEG2RAD

fun String.getHash(type: String = "SHA-256"): String {
val hexChars = "0123456789ABCDEF"
val bytes = MessageDigest.getInstance(type).digest(this.toByteArray())
val result = StringBuilder(bytes.size * 2)
bytes.forEach {
val i = it.toInt()
result.append(hexChars[i shr 4 and 0x0f])
result.append(hexChars[i and 0x0f])
}
return result.toString()
}
//fun String.getHash(type: String = "SHA-256"): String {
// val hexChars = "0123456789ABCDEF"
// val bytes = MessageDigest.getInstance(type).digest(this.toByteArray())
// val result = StringBuilder(bytes.size * 2)
// bytes.forEach {
// val i = it.toInt()
// result.append(hexChars[i shr 4 and 0x0f])
// result.append(hexChars[i and 0x0f])
// }
// return result.toString()
//}

fun String.isValidEmail(): Boolean {
val expression = "^[\\w.-]+@([\\w\\-]+\\.)+[A-Z]{2,8}$"
val pattern = Pattern.compile(expression, Pattern.CASE_INSENSITIVE)
return pattern.matcher(this).matches()
}
//fun String.isValidEmail(): Boolean {
// val expression = "^[\\w.-]+@([\\w\\-]+\\.)+[A-Z]{2,8}$"
// val pattern = Pattern.compile(expression, Pattern.CASE_INSENSITIVE)
// return pattern.matcher(this).matches()
//}

fun String.isValidIPv4(): Boolean {
val ip4 = "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\.(?!\$)|\$)){4}\$"
Expand All @@ -71,16 +67,16 @@ fun String.isValidPort(): Boolean {
return this.matches(port.toRegex()) && this.toInt() in 1024..65535
}

fun ping(hostname: String, port: Int): Int {
val start = System.currentTimeMillis()
val socket = Socket()
try {
socket.connect(InetSocketAddress(hostname, port), 5000)
socket.close()
} catch (exception: Exception) {
exception.printStackTrace()
println("Failed to ping: $hostname")
return Int.MAX_VALUE
}
return (System.currentTimeMillis() - start).toInt()
}
//fun ping(hostname: String, port: Int): Int {
// val start = System.currentTimeMillis()
// val socket = Socket()
// try {
// socket.connect(InetSocketAddress(hostname, port), 5000)
// socket.close()
// } catch (exception: Exception) {
// exception.printStackTrace()
// println("Failed to ping: $hostname")
// return Int.MAX_VALUE
// }
// return (System.currentTimeMillis() - start).toInt()
//}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ object QthConverter {
return (lat >= -90.0 && lat <= 90.0) && (lon >= -180.0 && lon <= 360.0)
}

fun isValidLocator(locator: String): Boolean {
private fun isValidLocator(locator: String): Boolean {
return locator.matches("[a-xA-X][a-xA-X][0-9][0-9][a-xA-X][a-xA-X]".toRegex())
}
}
16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
buildscript {
ext {
hilt_version = '2.43.2'
hilt_version = '2.44'
safe_args_version = '2.4.1'
application_version = '7.2.2'
application_version = '7.3.1'
library_version = '7.1.2'
kotlin_android_version = '1.6.10'
core_ktx_version = '1.8.0'
core_ktx_version = '1.9.0'
core_splashscreen_version = '1.0.0'
constraint_version = '2.1.4'
lifecycle_version = '2.5.1'
navigation_version = '2.5.1'
navigation_version = '2.5.2'
work_version = '2.7.1'
room_version = '2.4.3'
material_version = '1.6.1'
osmdroid_version = '6.1.14'
json_version = '20220320'
json_version = '20220924'
compose_version = '1.2.1'
activity_compose_version = '1.4.0'
material_adapter_version = '1.1.10'
fragment_test_version = '1.5.2'
fragment_test_version = '1.5.3'
leakcanary_version = '2.9.1'
junit_version = '4.13.2'
mockito_version = '4.7.0'
robolectric_version = '4.8.2'
mockito_version = '4.8.1'
robolectric_version = '4.9'
coroutines_test_version = '1.6.4'
androidx_test_version = '1.4.0'
androidx_junit_version = '1.1.3'
Expand Down
5 changes: 5 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/312.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Switched to targeting Android 13, API v33
Added automatic TLE update functionality
Added recent TLE update time information
Added passes recalculation on TLE update
Enabled APK build minification with R8
10 changes: 5 additions & 5 deletions fastlane/metadata/android/en-US/whatsnew/whatsnew-en-US
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Re-enabled the rotator control switch (fix)
Increased radar sweep rotation speed
Fixed negative lat/lon manual input bug
Added R4UAB TLE source and category
Updated libraries and dependencies
Switched to targeting Android 13, API v33
Added automatic TLE update functionality
Added recent TLE update time information
Added passes recalculation on TLE update
Enabled APK build minification with R8

0 comments on commit b156f66

Please sign in to comment.