maintenance

This commit is contained in:
Chloe committed 2025-09-14 15:54:26 -07:00
1 parent 0b92f4a318
commit aa51c201e5
7 files changed
+58 -39

No files matched your search

+21 -17
View File
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
val composeBOM: String by rootProject.extra val composeBOM: String by rootProject.extra
kotlin { kotlin {
@@ -68,8 +70,10 @@ android {
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8
} }
kotlinOptions { kotlin {
jvmTarget = "1.8" compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
} }
buildFeatures { buildFeatures {
compose = true compose = true
@@ -92,24 +96,24 @@ android {
dependencies { dependencies {
implementation (platform("androidx.compose:compose-bom:$composeBOM")) implementation (platform("androidx.compose:compose-bom:$composeBOM"))
implementation ("androidx.core:core-ktx:1.16.0") implementation ("androidx.core:core-ktx:1.17.0")
implementation ("androidx.compose.ui:ui") implementation ("androidx.compose.ui:ui")
implementation ("androidx.compose.material3:material3") implementation ("androidx.compose.material3:material3")
implementation ("androidx.compose.ui:ui-tooling-preview") implementation ("androidx.compose.ui:ui-tooling-preview")
implementation ("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7") implementation ("androidx.lifecycle:lifecycle-runtime-ktx:2.9.3")
implementation ("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.7") implementation ("androidx.lifecycle:lifecycle-viewmodel-compose:2.9.3")
implementation ("androidx.activity:activity-compose:1.10.1") implementation ("androidx.activity:activity-compose:1.11.0")
implementation ("androidx.activity:activity-ktx:1.10.1") implementation ("androidx.activity:activity-ktx:1.11.0")
implementation ("androidx.appcompat:appcompat:1.7.0") implementation ("androidx.appcompat:appcompat:1.7.1")
implementation ("androidx.documentfile:documentfile:1.0.1") implementation ("androidx.documentfile:documentfile:1.1.0")
implementation ("com.squareup.okio:okio:3.11.0") implementation ("com.squareup.okio:okio:3.16.0")
implementation ("com.squareup.okhttp3:okhttp:4.12.0") implementation ("com.squareup.okhttp3:okhttp:5.1.0")
implementation ("org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.1") implementation ("org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0")
implementation ("org.jetbrains.kotlinx:kotlinx-serialization-json-okio:1.8.1") implementation ("org.jetbrains.kotlinx:kotlinx-serialization-json-okio:1.9.0")
implementation ("org.jetbrains.kotlinx:kotlinx-datetime:0.6.2") implementation ("org.jetbrains.kotlinx:kotlinx-datetime:0.7.1")
implementation ("com.mikepenz:multiplatform-markdown-renderer-android:0.33.0") implementation ("com.mikepenz:multiplatform-markdown-renderer-android:0.37.0")
implementation ("com.mikepenz:multiplatform-markdown-renderer-m3:0.33.0") implementation ("com.mikepenz:multiplatform-markdown-renderer-m3:0.37.0")
implementation ("androidx.browser:browser:1.8.0") implementation ("androidx.browser:browser:1.9.0")
debugImplementation ("androidx.compose.ui:ui-tooling") debugImplementation ("androidx.compose.ui:ui-tooling")
coreLibraryDesugaring ("com.android.tools:desugar_jdk_libs:2.1.5") coreLibraryDesugaring ("com.android.tools:desugar_jdk_libs:2.1.5")
} }
+1 -1
View File
@@ -13,7 +13,7 @@ option(USE_TULIPHOOK "enables choice of hooking library" OFF)
if (USE_TULIPHOOK) if (USE_TULIPHOOK)
FetchContent_Declare(TulipHook FetchContent_Declare(TulipHook
GIT_REPOSITORY https://github.com/geode-sdk/TulipHook.git GIT_REPOSITORY https://github.com/geode-sdk/TulipHook.git
GIT_TAG 9aa1f95091ebac18c657d57b755f59d00fe6f1f8 GIT_TAG v3.1.4
) )
set(TULIP_LINK_SOURCE ON CACHE INTERNAL "") set(TULIP_LINK_SOURCE ON CACHE INTERNAL "")
@@ -1,13 +1,14 @@
package com.geode.launcher.log package com.geode.launcher.log
import kotlinx.datetime.Clock import kotlin.time.Clock
import kotlinx.datetime.Instant import kotlin.time.Instant
import kotlinx.datetime.TimeZone import kotlinx.datetime.TimeZone
import kotlinx.datetime.toJavaInstant
import kotlinx.datetime.toLocalDateTime import kotlinx.datetime.toLocalDateTime
import okio.Buffer import okio.Buffer
import okio.BufferedSource import okio.BufferedSource
import java.io.IOException import java.io.IOException
import kotlin.time.ExperimentalTime
import kotlin.time.toJavaInstant
fun BufferedSource.readCChar(): Char { fun BufferedSource.readCChar(): Char {
return this.readUtf8CodePoint().toChar() return this.readUtf8CodePoint().toChar()
@@ -115,7 +116,7 @@ enum class LogPriority {
/** /**
* Represents a log entry from logcat. * Represents a log entry from logcat.
*/ */
data class LogLine( data class LogLine @OptIn(ExperimentalTime::class) constructor(
val process: ProcessInformation, val process: ProcessInformation,
val time: Instant, val time: Instant,
val logId: Int, val logId: Int,
@@ -134,6 +135,7 @@ data class LogLine(
else -> throw IOException("LogLine::fromInputStream: unknown format for (headerSize = $size)") else -> throw IOException("LogLine::fromInputStream: unknown format for (headerSize = $size)")
} }
@OptIn(ExperimentalTime::class)
fun fromBufferedSource(source: BufferedSource): LogLine { fun fromBufferedSource(source: BufferedSource): LogLine {
/* /*
// from android <liblog/include/log/log_read.h> // from android <liblog/include/log/log_read.h>
@@ -200,6 +202,7 @@ data class LogLine(
) )
} }
@OptIn(ExperimentalTime::class)
fun showException(exception: Exception) = LogLine( fun showException(exception: Exception) = LogLine(
process = ProcessInformation(0, 0, 0), process = ProcessInformation(0, 0, 0),
time = Clock.System.now(), time = Clock.System.now(),
@@ -210,12 +213,14 @@ data class LogLine(
) )
} }
@OptIn(ExperimentalTime::class)
val identifier = time.toJavaInstant() val identifier = time.toJavaInstant()
val messageTrimmed by lazy { val messageTrimmed by lazy {
this.message.trim { it <= ' ' } this.message.trim { it <= ' ' }
} }
@OptIn(ExperimentalTime::class)
val formattedTime by lazy { this.time.toLocalDateTime(TimeZone.currentSystemDefault()) } val formattedTime by lazy { this.time.toLocalDateTime(TimeZone.currentSystemDefault()) }
val asSimpleString by lazy { val asSimpleString by lazy {
"$formattedTime [${this.priority.toChar()}/${this.tag}]: ${this.messageTrimmed}" "$formattedTime [${this.priority.toChar()}/${this.tag}]: ${this.messageTrimmed}"
@@ -46,6 +46,7 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalUriHandler import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextLinkStyles
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextDecoration import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@@ -59,13 +60,14 @@ import com.geode.launcher.utils.PreferenceUtils
import com.mikepenz.markdown.compose.LocalBulletListHandler import com.mikepenz.markdown.compose.LocalBulletListHandler
import com.mikepenz.markdown.m3.Markdown import com.mikepenz.markdown.m3.Markdown
import com.mikepenz.markdown.m3.markdownTypography import com.mikepenz.markdown.m3.markdownTypography
import kotlinx.datetime.toJavaInstant
import org.intellij.markdown.flavours.gfm.GFMFlavourDescriptor import org.intellij.markdown.flavours.gfm.GFMFlavourDescriptor
import java.io.File import java.io.File
import java.net.ConnectException import java.net.ConnectException
import java.net.UnknownHostException import java.net.UnknownHostException
import java.text.DateFormat import java.text.DateFormat
import java.util.Date import java.util.Date
import kotlin.time.ExperimentalTime
import kotlin.time.toJavaInstant
fun clearDownloadedApks(context: Context) { fun clearDownloadedApks(context: Context) {
// technically we should be using the activity results but it was too inconsistent for my liking // technically we should be using the activity results but it was too inconsistent for my liking
@@ -135,7 +137,7 @@ fun installLauncherUpdate(context: Context) {
} }
} }
@OptIn(ExperimentalMaterial3Api::class) @OptIn(ExperimentalMaterial3Api::class, ExperimentalTime::class)
@Composable @Composable
fun LauncherUpdateInformation(onDismiss: () -> Unit) { fun LauncherUpdateInformation(onDismiss: () -> Unit) {
val context = LocalContext.current val context = LocalContext.current
@@ -196,9 +198,11 @@ fun LauncherUpdateInformation(onDismiss: () -> Unit) {
Markdown( Markdown(
content = nextRelease.release.body.replace("\r", ""), content = nextRelease.release.body.replace("\r", ""),
typography = markdownTypography( typography = markdownTypography(
link = MaterialTheme.typography.bodyLarge.copy( textLink = TextLinkStyles(
style = MaterialTheme.typography.bodyLarge.copy(
textDecoration = TextDecoration.Underline, textDecoration = TextDecoration.Underline,
color = MaterialTheme.colorScheme.primary, color = MaterialTheme.colorScheme.primary,
).toSpanStyle()
), ),
), ),
flavour = GFMFlavourDescriptor(), flavour = GFMFlavourDescriptor(),
@@ -1,11 +1,12 @@
package com.geode.launcher.updater package com.geode.launcher.updater
import com.geode.launcher.utils.LaunchUtils import com.geode.launcher.utils.LaunchUtils
import kotlinx.datetime.Instant import kotlin.time.Instant
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlin.time.ExperimentalTime
@Serializable @Serializable
data class Asset( data class Asset @OptIn(ExperimentalTime::class) constructor(
val url: String, val url: String,
val id: Int, val id: Int,
val name: String, val name: String,
@@ -16,7 +17,7 @@ data class Asset(
) )
@Serializable @Serializable
data class Release( data class Release @OptIn(ExperimentalTime::class) constructor(
val url: String, val url: String,
val id: Int, val id: Int,
val targetCommitish: String, val targetCommitish: String,
@@ -30,7 +31,7 @@ data class Release(
) )
@Serializable @Serializable
data class LoaderVersion( data class LoaderVersion @OptIn(ExperimentalTime::class) constructor(
val tag: String, val tag: String,
val version: String, val version: String,
val createdAt: Instant, val createdAt: Instant,
@@ -66,6 +67,7 @@ class DownloadableGitHubLoaderRelease(private val release: Release) : Downloadab
return release.tagName return release.tagName
} }
@OptIn(ExperimentalTime::class)
override fun getDescriptor(): Long { override fun getDescriptor(): Long {
return release.createdAt.epochSeconds return release.createdAt.epochSeconds
} }
@@ -95,6 +97,7 @@ class DownloadableLauncherRelease(val release: Release) : Downloadable() {
return release.tagName return release.tagName
} }
@OptIn(ExperimentalTime::class)
override fun getDescriptor(): Long { override fun getDescriptor(): Long {
return release.createdAt.epochSeconds return release.createdAt.epochSeconds
} }
@@ -132,6 +135,7 @@ class DownloadableLoaderRelease(private val version: LoaderVersion) : Downloadab
return version.tag return version.tag
} }
@OptIn(ExperimentalTime::class)
override fun getDescriptor(): Long { override fun getDescriptor(): Long {
return version.createdAt.epochSeconds return version.createdAt.epochSeconds
} }
@@ -1,9 +1,9 @@
package com.geode.launcher.updater package com.geode.launcher.updater
import com.geode.launcher.utils.DownloadUtils.executeCoroutine import com.geode.launcher.utils.DownloadUtils.executeCoroutine
import kotlinx.datetime.Clock import kotlin.time.Clock
import kotlinx.datetime.DateTimeUnit import kotlinx.datetime.DateTimeUnit
import kotlinx.datetime.Instant import kotlin.time.Instant
import kotlinx.datetime.until import kotlinx.datetime.until
import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.json.Json import kotlinx.serialization.json.Json
@@ -14,6 +14,7 @@ import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import java.io.IOException import java.io.IOException
import java.net.URL import java.net.URL
import kotlin.time.ExperimentalTime
class ReleaseRepository(private val httpClient: OkHttpClient) { class ReleaseRepository(private val httpClient: OkHttpClient) {
companion object { companion object {
@@ -49,7 +50,7 @@ class ReleaseRepository(private val httpClient: OkHttpClient) {
return getReleaseByUrl(url)?.let(::DownloadableGitHubLoaderRelease) return getReleaseByUrl(url)?.let(::DownloadableGitHubLoaderRelease)
} }
@OptIn(ExperimentalSerializationApi::class) @OptIn(ExperimentalSerializationApi::class, ExperimentalTime::class)
suspend fun getLatestGeodePreRelease(): DownloadableGitHubLoaderRelease? { suspend fun getLatestGeodePreRelease(): DownloadableGitHubLoaderRelease? {
val releasesUrl = "$GITHUB_API_BASE/repos/geode-sdk/geode/releases?per_page=2" val releasesUrl = "$GITHUB_API_BASE/repos/geode-sdk/geode/releases?per_page=2"
val url = URL(releasesUrl) val url = URL(releasesUrl)
@@ -104,6 +105,7 @@ class ReleaseRepository(private val httpClient: OkHttpClient) {
} }
} }
@OptIn(ExperimentalTime::class)
private fun generateRateLimitMessage(resetTime: Instant): String { private fun generateRateLimitMessage(resetTime: Instant): String {
val currentTime = Clock.System.now() val currentTime = Clock.System.now()
val resetDelay = currentTime.until(resetTime, DateTimeUnit.SECOND) val resetDelay = currentTime.until(resetTime, DateTimeUnit.SECOND)
@@ -113,7 +115,7 @@ class ReleaseRepository(private val httpClient: OkHttpClient) {
return "api ratelimit reached, try again in ${formattedWait}" return "api ratelimit reached, try again in ${formattedWait}"
} }
@OptIn(ExperimentalSerializationApi::class) @OptIn(ExperimentalSerializationApi::class, ExperimentalTime::class)
private suspend fun getReleaseByUrl(url: URL): Release? { private suspend fun getReleaseByUrl(url: URL): Release? {
val request = Request.Builder() val request = Request.Builder()
.url(url) .url(url)
+6 -6
View File
@@ -1,14 +1,14 @@
buildscript { buildscript {
val composeBOM by extra("2025.04.01") val composeBOM by extra("2025.09.00")
} }
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins { plugins {
id("com.android.application") version "8.9.2" apply false id("com.android.application") version "8.13.0" apply false
id("com.android.library") version "8.9.2" apply false id("com.android.library") version "8.13.0" apply false
id("org.jetbrains.kotlin.android") version "2.1.20" apply false id("org.jetbrains.kotlin.android") version "2.2.20" apply false
id("org.jetbrains.kotlin.plugin.serialization") version "2.1.20" apply false id("org.jetbrains.kotlin.plugin.serialization") version "2.2.20" apply false
id("org.jetbrains.kotlin.plugin.compose") version "2.1.20" apply false id("org.jetbrains.kotlin.plugin.compose") version "2.2.20" apply false
} }
tasks.register<Delete>("clean") { tasks.register<Delete>("clean") {