mirror of
https://github.com/null2264/yokai.git
synced 2025-06-20 18:24:42 +00:00
Compare commits
3 commits
f604e4e256
...
abbe606473
Author | SHA1 | Date | |
---|---|---|---|
abbe606473 | |||
7ac42d5545 | |||
|
f90e2a1425 |
6 changed files with 63 additions and 40 deletions
|
@ -49,7 +49,6 @@ The format is simplified version of [Keep a Changelog](https://keepachangelog.co
|
||||||
- Refactor Library to store LibraryMap instead of flatten list of LibraryItem
|
- Refactor Library to store LibraryMap instead of flatten list of LibraryItem
|
||||||
- LibraryItem abstraction to make it easier to manage
|
- LibraryItem abstraction to make it easier to manage
|
||||||
- LibraryManga no longer extend MangaImpl
|
- LibraryManga no longer extend MangaImpl
|
||||||
- Replace Requery's SQLite with AndroidX's new KMP SQLite
|
|
||||||
- Update dependency gradle to v8.12
|
- Update dependency gradle to v8.12
|
||||||
- Update user agent (@Hiirbaf)
|
- Update user agent (@Hiirbaf)
|
||||||
- Update serialization to v1.8.1
|
- Update serialization to v1.8.1
|
||||||
|
@ -66,7 +65,8 @@ The format is simplified version of [Keep a Changelog](https://keepachangelog.co
|
||||||
- Update dependency com.getkeepsafe.taptargetview:taptargetview to v1.15.0
|
- Update dependency com.getkeepsafe.taptargetview:taptargetview to v1.15.0
|
||||||
- Update dependency androidx.window:window to v1.4.0
|
- Update dependency androidx.window:window to v1.4.0
|
||||||
- Update dependency androidx.webkit:webkit to v1.13.0
|
- Update dependency androidx.webkit:webkit to v1.13.0
|
||||||
- Update androidxSqlite to v2.5.1
|
- Update dependency androidx.sqlite:sqlite-ktx to v2.5.1
|
||||||
|
- Update dependency androidx.sqlite:sqlite to v2.5.1
|
||||||
- Update dependency androidx.recyclerview:recyclerview to v1.4.0
|
- Update dependency androidx.recyclerview:recyclerview to v1.4.0
|
||||||
- Update dependency androidx.core:core-ktx to v1.16.0
|
- Update dependency androidx.core:core-ktx to v1.16.0
|
||||||
- Update dependency androidx.compose:compose-bom to v2025.05.01
|
- Update dependency androidx.compose:compose-bom to v2025.05.01
|
||||||
|
@ -84,6 +84,7 @@ The format is simplified version of [Keep a Changelog](https://keepachangelog.co
|
||||||
- Update dependency androidx.constraintlayout:constraintlayout to v2.2.1
|
- Update dependency androidx.constraintlayout:constraintlayout to v2.2.1
|
||||||
- Update plugin firebase-crashlytics to v3.0.3
|
- Update plugin firebase-crashlytics to v3.0.3
|
||||||
- Update null2264/actions digest to 363cb9c
|
- Update null2264/actions digest to 363cb9c
|
||||||
|
- Update dependency io.github.pdvrieze.xmlutil:core-android to v0.91.1
|
||||||
|
|
||||||
## [1.9.7.2]
|
## [1.9.7.2]
|
||||||
|
|
||||||
|
|
|
@ -200,6 +200,7 @@ dependencies {
|
||||||
implementation(libs.play.services.gcm)
|
implementation(libs.play.services.gcm)
|
||||||
|
|
||||||
// Database
|
// Database
|
||||||
|
implementation(libs.sqlite.android)
|
||||||
implementation(libs.bundles.sqlite)
|
implementation(libs.bundles.sqlite)
|
||||||
|
|
||||||
// Model View Presenter
|
// Model View Presenter
|
||||||
|
|
|
@ -2,19 +2,12 @@ package yokai.core.di
|
||||||
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.sqlite.driver.bundled.BundledSQLiteDriver
|
import androidx.sqlite.db.SupportSQLiteDatabase
|
||||||
import androidx.sqlite.driver.bundled.SQLITE_OPEN_CREATE
|
|
||||||
import androidx.sqlite.driver.bundled.SQLITE_OPEN_READWRITE
|
|
||||||
import app.cash.sqldelight.db.SqlDriver
|
import app.cash.sqldelight.db.SqlDriver
|
||||||
|
import app.cash.sqldelight.driver.android.AndroidSqliteDriver
|
||||||
import co.touchlab.kermit.Logger
|
import co.touchlab.kermit.Logger
|
||||||
import com.chuckerteam.chucker.api.ChuckerCollector
|
import com.chuckerteam.chucker.api.ChuckerCollector
|
||||||
import com.chuckerteam.chucker.api.ChuckerInterceptor
|
import com.chuckerteam.chucker.api.ChuckerInterceptor
|
||||||
import com.eygraber.sqldelight.androidx.driver.AndroidxSqliteConfiguration
|
|
||||||
import com.eygraber.sqldelight.androidx.driver.AndroidxSqliteDatabaseType
|
|
||||||
import com.eygraber.sqldelight.androidx.driver.AndroidxSqliteDriver
|
|
||||||
import com.eygraber.sqldelight.androidx.driver.File
|
|
||||||
import com.eygraber.sqldelight.androidx.driver.SqliteJournalMode
|
|
||||||
import com.eygraber.sqldelight.androidx.driver.SqliteSync
|
|
||||||
import eu.kanade.tachiyomi.BuildConfig
|
import eu.kanade.tachiyomi.BuildConfig
|
||||||
import eu.kanade.tachiyomi.core.storage.AndroidStorageFolderProvider
|
import eu.kanade.tachiyomi.core.storage.AndroidStorageFolderProvider
|
||||||
import eu.kanade.tachiyomi.data.cache.ChapterCache
|
import eu.kanade.tachiyomi.data.cache.ChapterCache
|
||||||
|
@ -30,6 +23,7 @@ import eu.kanade.tachiyomi.network.NetworkHelper
|
||||||
import eu.kanade.tachiyomi.source.SourceManager
|
import eu.kanade.tachiyomi.source.SourceManager
|
||||||
import eu.kanade.tachiyomi.util.chapter.ChapterFilter
|
import eu.kanade.tachiyomi.util.chapter.ChapterFilter
|
||||||
import eu.kanade.tachiyomi.util.manga.MangaShortcutManager
|
import eu.kanade.tachiyomi.util.manga.MangaShortcutManager
|
||||||
|
import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
import kotlinx.serialization.protobuf.ProtoBuf
|
import kotlinx.serialization.protobuf.ProtoBuf
|
||||||
import nl.adaptivity.xmlutil.XmlDeclMode
|
import nl.adaptivity.xmlutil.XmlDeclMode
|
||||||
|
@ -48,23 +42,46 @@ fun appModule(app: Application) = module {
|
||||||
single { app }
|
single { app }
|
||||||
|
|
||||||
single<SqlDriver> {
|
single<SqlDriver> {
|
||||||
AndroidxSqliteDriver(
|
AndroidSqliteDriver(
|
||||||
createConnection = { name ->
|
|
||||||
BundledSQLiteDriver().open(name, SQLITE_OPEN_READWRITE or SQLITE_OPEN_CREATE)
|
|
||||||
},
|
|
||||||
databaseType = AndroidxSqliteDatabaseType.File(app, "tachiyomi.db"),
|
|
||||||
configuration = AndroidxSqliteConfiguration().apply {
|
|
||||||
isForeignKeyConstraintsEnabled = true
|
|
||||||
journalMode = SqliteJournalMode.WAL
|
|
||||||
sync = SqliteSync.Normal
|
|
||||||
},
|
|
||||||
schema = Database.Schema,
|
schema = Database.Schema,
|
||||||
onCreate = {
|
context = app,
|
||||||
Logger.d { "Creating new database..." }
|
name = "tachiyomi.db",
|
||||||
},
|
// factory = if (BuildConfig.DEBUG && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
onUpdate = { oldVersion, newVersion ->
|
// // Support database inspector in Android Studio
|
||||||
if (oldVersion < newVersion) {
|
// FrameworkSQLiteOpenHelperFactory()
|
||||||
Logger.d { "Upgrading database from $oldVersion to $newVersion" }
|
// } else {
|
||||||
|
// RequerySQLiteOpenHelperFactory()
|
||||||
|
// },
|
||||||
|
factory = RequerySQLiteOpenHelperFactory(),
|
||||||
|
callback = object : AndroidSqliteDriver.Callback(Database.Schema) {
|
||||||
|
override fun onOpen(db: SupportSQLiteDatabase) {
|
||||||
|
super.onOpen(db)
|
||||||
|
setPragma(db, "foreign_keys = ON")
|
||||||
|
setPragma(db, "journal_mode = WAL")
|
||||||
|
setPragma(db, "synchronous = NORMAL")
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setPragma(db: SupportSQLiteDatabase, pragma: String) {
|
||||||
|
val cursor = db.query("PRAGMA $pragma")
|
||||||
|
cursor.moveToFirst()
|
||||||
|
cursor.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Not sure if this is still needed, but just in case
|
||||||
|
override fun onConfigure(db: SupportSQLiteDatabase) {
|
||||||
|
db.setForeignKeyConstraintsEnabled(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreate(db: SupportSQLiteDatabase) {
|
||||||
|
Logger.d { "Creating new database..." }
|
||||||
|
super.onCreate(db)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onUpgrade(db: SupportSQLiteDatabase, oldVersion: Int, newVersion: Int) {
|
||||||
|
if (oldVersion < newVersion) {
|
||||||
|
Logger.d { "Upgrading database from $oldVersion to $newVersion" }
|
||||||
|
super.onUpgrade(db, oldVersion, newVersion)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
|
@ -28,6 +28,7 @@ multidex = { module = "androidx.multidex:multidex", version = "2.0.1" }
|
||||||
palette = { module = "androidx.palette:palette", version = "1.0.0" }
|
palette = { module = "androidx.palette:palette", version = "1.0.0" }
|
||||||
preference = { module = "androidx.preference:preference-ktx", version = "1.2.1" }
|
preference = { module = "androidx.preference:preference-ktx", version = "1.2.1" }
|
||||||
recyclerview = { module = "androidx.recyclerview:recyclerview", version = "1.4.0" }
|
recyclerview = { module = "androidx.recyclerview:recyclerview", version = "1.4.0" }
|
||||||
|
sqlite = { module = "androidx.sqlite:sqlite", version = "2.5.1" }
|
||||||
webkit = { module = "androidx.webkit:webkit", version = "1.13.0" }
|
webkit = { module = "androidx.webkit:webkit", version = "1.13.0" }
|
||||||
work = { module = "androidx.work:work-runtime-ktx", version = "2.10.1" }
|
work = { module = "androidx.work:work-runtime-ktx", version = "2.10.1" }
|
||||||
window = { module = "androidx.window:window", version = "1.4.0" }
|
window = { module = "androidx.window:window", version = "1.4.0" }
|
||||||
|
@ -37,7 +38,7 @@ androidx = [
|
||||||
"activity", "activity-compose", "annotation", "appcompat", "browser", "biometric", "cardview", "core",
|
"activity", "activity-compose", "annotation", "appcompat", "browser", "biometric", "cardview", "core",
|
||||||
"core-splashscreen", "layout-constraint", "glance-appwidget", "lifecycle-common", "lifecycle-livedata",
|
"core-splashscreen", "layout-constraint", "glance-appwidget", "lifecycle-common", "lifecycle-livedata",
|
||||||
"lifecycle-process", "lifecycle-runtime", "lifecycle-viewmodel", "lifecycle-viewmodel-compose", "multidex",
|
"lifecycle-process", "lifecycle-runtime", "lifecycle-viewmodel", "lifecycle-viewmodel-compose", "multidex",
|
||||||
"palette", "preference", "recyclerview", "layout-swiperefresh", "webkit", "work", "window"
|
"palette", "preference", "recyclerview", "sqlite", "layout-swiperefresh", "webkit", "work", "window"
|
||||||
]
|
]
|
||||||
|
|
||||||
[plugins]
|
[plugins]
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[versions]
|
[versions]
|
||||||
kotlin = "2.1.21"
|
kotlin = "2.1.21"
|
||||||
serialization = "1.8.1"
|
serialization = "1.8.1"
|
||||||
xml_serialization = "0.90.3"
|
xml_serialization = "0.91.1"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
|
gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
|
||||||
|
@ -15,7 +15,7 @@ serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-jso
|
||||||
serialization-json-okio = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json-okio", version.ref = "serialization" }
|
serialization-json-okio = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json-okio", version.ref = "serialization" }
|
||||||
serialization-protobuf = { module = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf", version.ref = "serialization" }
|
serialization-protobuf = { module = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf", version.ref = "serialization" }
|
||||||
serialization-xml-core = { module = "io.github.pdvrieze.xmlutil:core-android", version.ref = "xml_serialization" }
|
serialization-xml-core = { module = "io.github.pdvrieze.xmlutil:core-android", version.ref = "xml_serialization" }
|
||||||
serialization-xml = { module = "io.github.pdvrieze.xmlutil:serialization-android", version.ref = "xml_serialization" }
|
serialization-xml = { module = "io.github.pdvrieze.xmlutil:serialization", version.ref = "xml_serialization" }
|
||||||
immutable = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version = "0.4.0" }
|
immutable = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version = "0.4.0" }
|
||||||
|
|
||||||
[bundles]
|
[bundles]
|
||||||
|
|
|
@ -6,9 +6,9 @@ fast_adapter = "5.7.0"
|
||||||
moko = "0.24.5"
|
moko = "0.24.5"
|
||||||
okhttp = "5.0.0-alpha.16"
|
okhttp = "5.0.0-alpha.16"
|
||||||
shizuku = "13.1.5"
|
shizuku = "13.1.5"
|
||||||
androidxSqlite = "2.5.1"
|
# FIXME: Uncomment once SQLDelight support KMP AndroidX SQLiteDriver
|
||||||
# FIXME: Stay at 2.0.2 until 2.1.1 released because dialect is borked
|
#sqlite = "2.5.0-alpha04"
|
||||||
# REF: https://github.com/sqldelight/sqldelight/issues/5758
|
sqlite = "2.5.1"
|
||||||
sqldelight = "2.0.2"
|
sqldelight = "2.0.2"
|
||||||
junit = "5.11.3"
|
junit = "5.11.3"
|
||||||
kermit = "2.0.5"
|
kermit = "2.0.5"
|
||||||
|
@ -82,12 +82,13 @@ rxjava = { module = "io.reactivex:rxjava", version = "1.3.8" }
|
||||||
rxandroid = { module = "io.reactivex:rxandroid", version = "1.2.1" }
|
rxandroid = { module = "io.reactivex:rxandroid", version = "1.2.1" }
|
||||||
slice = { module = "com.github.mthli:Slice", version = "v1.2" }
|
slice = { module = "com.github.mthli:Slice", version = "v1.2" }
|
||||||
|
|
||||||
# SQLite interface
|
# FIXME: Uncomment once SQLDelight support KMP AndroidX SQLiteDriver
|
||||||
sqlite = { module = "androidx.sqlite:sqlite", version.ref = "androidxSqlite" }
|
#sqlite = { module = "androidx.sqlite:sqlite-bundled", version.ref = "sqlite" }
|
||||||
sqlite-bundled = { module = "androidx.sqlite:sqlite-bundled", version.ref = "androidxSqlite" }
|
sqlite-ktx = { module = "androidx.sqlite:sqlite-ktx", version.ref = "sqlite" }
|
||||||
|
sqlite-android = { module = "com.github.requery:sqlite-android", version = "3.49.0" }
|
||||||
|
|
||||||
sqldelight-coroutines = { module = "app.cash.sqldelight:coroutines-extensions", version.ref = "sqldelight" }
|
sqldelight-coroutines = { module = "app.cash.sqldelight:coroutines-extensions", version.ref = "sqldelight" }
|
||||||
sqldelight-androidx-driver = { module = "com.eygraber:sqldelight-androidx-driver", version = "0.0.12" }
|
sqldelight-android-driver = { module = "app.cash.sqldelight:android-driver", version.ref = "sqldelight" }
|
||||||
sqldelight-android-paging = { module = "app.cash.sqldelight:androidx-paging3-extensions", version.ref = "sqldelight" }
|
sqldelight-android-paging = { module = "app.cash.sqldelight:androidx-paging3-extensions", version.ref = "sqldelight" }
|
||||||
sqldelight-dialects-sql = { module = "app.cash.sqldelight:sqlite-3-38-dialect", version.ref = "sqldelight" }
|
sqldelight-dialects-sql = { module = "app.cash.sqldelight:sqlite-3-38-dialect", version.ref = "sqldelight" }
|
||||||
|
|
||||||
|
@ -113,11 +114,13 @@ moko = { id = "dev.icerock.mobile.multiplatform-resources", version.ref = "moko"
|
||||||
sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" }
|
sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" }
|
||||||
|
|
||||||
[bundles]
|
[bundles]
|
||||||
db = [ "sqldelight-coroutines", "sqldelight-androidx-driver" ]
|
db = [ "sqldelight-coroutines" ]
|
||||||
db-android = [ "sqldelight-android-paging" ]
|
db-android = [ "sqldelight-android-driver", "sqldelight-android-paging" ]
|
||||||
coil = [ "coil3", "coil3-svg", "coil3-gif", "coil3-okhttp" ]
|
coil = [ "coil3", "coil3-svg", "coil3-gif", "coil3-okhttp" ]
|
||||||
logging = [ "kermit" ]
|
logging = [ "kermit" ]
|
||||||
sqlite = [ "sqlite", "sqlite-bundled" ]
|
# FIXME: Uncomment once SQLDelight support KMP AndroidX SQLiteDriver
|
||||||
|
#sqlite = [ "sqlite", "sqlite-ktx" ]
|
||||||
|
sqlite = [ "sqlite-ktx" ]
|
||||||
test = [ "junit-api", "kotest-assertions", "mockk" ]
|
test = [ "junit-api", "kotest-assertions", "mockk" ]
|
||||||
test-android = [ "junit-android" ]
|
test-android = [ "junit-android" ]
|
||||||
test-runtime = [ "junit-engine" ]
|
test-runtime = [ "junit-engine" ]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue