Skip to content

Commit

Permalink
updated some dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
DatL4g committed Oct 10, 2024
1 parent 8b09bab commit 26cf6c7
Show file tree
Hide file tree
Showing 10 changed files with 136 additions and 15 deletions.
7 changes: 7 additions & 0 deletions composeApp/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@
android:exported="true"
android:readPermission="dev.datlag.burningseries.READ_DATABASE"
android:grantUriPermissions="true" />

<service android:name=".model.common.MimasuUpdateService"
android:exported="true">
<intent-filter>
<action android:name="dev.datlag.mimasu.core.update.IUpdateService" />
</intent-filter>
</service>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fun AboutDialog(component: AboutComponent) {

ModalBottomSheet(
onDismissRequest = component::dismiss,
windowInsets = insets,
contentWindowInsets = { insets },
sheetState = sheetState
) {
val libs by produceState<Libs?>(null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fun SettingsDialog(component: SettingsComponent) {

ModalBottomSheet(
onDismissRequest = component::dismiss,
windowInsets = insets,
contentWindowInsets = { insets },
sheetState = sheetState
) {
val userState by component.user.collectAsStateWithLifecycle(null)
Expand Down
28 changes: 15 additions & 13 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
app = "6.0.0"
aboutlibraries = "11.2.2"
ackpine = "0.7.1"
activity = "1.9.1"
activity = "1.9.2"
android = "8.5.1"
android-core = "1.13.1"
android-sqlite = "2.4.0"
apollo = "4.0.0-beta.7"
atomicfu = "0.25.0"
blurhash = "0.3.0"
coil = "3.0.0-alpha09"
compose = "1.6.11"
coroutines = "1.8.1"
coil = "3.0.0-rc01"
compose = "1.7.0-rc01"
coroutines = "1.9.0"
crashlytics-plugin = "3.0.2"
datastore = "1.1.1"
datetime = "0.6.0"
datetime = "0.6.1"
decompose = "3.1.0"
desugar = "2.0.4"
desugar = "2.1.2"
firebase = "1.13.0"
firebase-android = "21.0.0"
firebase-android-analytics = "22.0.2"
Expand All @@ -30,13 +30,13 @@ kast = "0.2.1"
kmpalette = "3.1.0"
kodein = "7.22.0"
kolor = "1.7.0"
konfig = "0.15.1"
kotlin = "2.0.0"
konfig = "0.15.2"
kotlin = "2.0.20"
ksoup = "0.1.2"
ksp = "2.0.0-1.0.23"
ksp = "2.0.20-1.0.25"
ktor = "2.3.12"
ktorfit = "2.0.0"
media3 = "1.4.0"
ktorfit = "2.1.0"
media3 = "1.4.1"
moko-resources = "0.24.1"
multidex = "2.0.1"
nanoid = "1.0.1"
Expand All @@ -45,8 +45,9 @@ oidc = "0.10.0"
okhttp = "4.12.0"
osdetector = "1.7.3"
qrose = "1.0.1"
sekret = "2.0.0-alpha-05"
serialization = "1.7.1"
sekret = "2.0.0-alpha-07"
serialization = "1.7.3"
service = "2.8.6"
skeo = "0.2.1"
sqldelight = "2.0.2"
splashscreen = "1.0.1"
Expand Down Expand Up @@ -128,6 +129,7 @@ sekret = { group = "dev.datlag.sekret", name = "sekret", version.ref = "sekret"
serialization = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-core", version.ref = "serialization" }
serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "serialization" }
serialization-protobuf = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-protobuf", version.ref = "serialization" }
service = { group = "androidx.lifecycle", name = "lifecycle-service", version.ref = "service" }
skeo = { group = "dev.datlag.skeo", name = "skeo", version.ref = "skeo" }
sqldelight-coroutines = { group = "app.cash.sqldelight", name = "coroutines-extensions", version.ref = "sqldelight" }
sqldelight-android = { group = "app.cash.sqldelight", name = "android-driver", version.ref = "sqldelight" }
Expand Down
23 changes: 23 additions & 0 deletions model/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ plugins {
alias(libs.plugins.multiplatform)
alias(libs.plugins.serialization)
alias(libs.plugins.atomicfu)
alias(libs.plugins.android.library)
}

kotlin {
androidTarget()
jvm()

iosX64()
Expand Down Expand Up @@ -34,5 +36,26 @@ kotlin {
implementation(libs.coroutines)
implementation(libs.tooling)
}

androidMain.dependencies {
implementation(libs.service)
}
}
}

android {
compileSdk = 34
namespace = "dev.datlag.burningseries.model"
sourceSets["main"].aidl.srcDirs("src/androidMain/aidl")

defaultConfig {
minSdk = 23
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures {
aidl = true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package dev.datlag.mimasu.core.update;

import dev.datlag.mimasu.core.update.IUpdateInfo;

interface IUpdateCheckCallback {
void onUpdateInfo(in IUpdateInfo updateInfo);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package dev.datlag.mimasu.core.update;

interface IUpdateInfo {
boolean available();

boolean required();

@nullable String playstore();

@nullable String directDownload();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// IUpdateService.aidl
package dev.datlag.mimasu.core.update;

import dev.datlag.mimasu.core.update.IUpdateCheckCallback;

interface IUpdateService {
void hasUpdate(in IUpdateCheckCallback callback);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package dev.datlag.burningseries.model.common

import kotlin.reflect.KClass

actual val KClass<*>.name: String
get() = this.qualifiedName?.ifBlank { null }
?: this.simpleName?.ifBlank { null }
?: this.java.canonicalName?.ifBlank { null } ?: this.java.name.ifBlank { null } ?: this.toString()
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package dev.datlag.burningseries.model.common

import android.content.Intent
import android.os.IBinder
import androidx.lifecycle.LifecycleService
import androidx.lifecycle.lifecycleScope
import dev.datlag.mimasu.core.update.IUpdateCheckCallback
import dev.datlag.mimasu.core.update.IUpdateInfo
import dev.datlag.mimasu.core.update.IUpdateService
import kotlinx.coroutines.CoroutineScope

class MimasuUpdateService : LifecycleService() {

override fun onBind(intent: Intent): IBinder {
super.onBind(intent)

return Binder(lifecycleScope)
}

data class UpdateInfo(
val available: Boolean,
val required: Boolean,
val playStore: String? = null,
val directDownload: String? = null
) : IUpdateInfo.Stub() {
override fun available(): Boolean {
return available
}

override fun required(): Boolean {
return required
}

override fun playstore(): String? {
return playStore
}

override fun directDownload(): String? {
return directDownload
}
}

class Binder(
val scope: CoroutineScope
) : IUpdateService.Stub() {
override fun hasUpdate(callback: IUpdateCheckCallback?) {
callback?.onUpdateInfo(
UpdateInfo(
available = true,
required = true
)
)
}
}
}

0 comments on commit 26cf6c7

Please sign in to comment.