Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jmir1 committed May 31, 2022
2 parents 17bf803 + 11c61d4 commit ad77b6c
Show file tree
Hide file tree
Showing 412 changed files with 8,497 additions and 5,984 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/report_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ body:
description: |
If you're experiencing crashes, share the crash logs from **More → Settings → Advanced** then press **Dump crash logs**.
placeholder: |
You can paste the crash logs in pure text or upload it as an attachment.
You can paste the crash logs in plain text or upload it as an attachment.
- type: input
id: aniyomi-version
Expand Down
9 changes: 9 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pull_request_rules:
- name: Automatically merge translations
conditions:
- "author=weblate"
- "-conflict"
- "current-day-of-week=Sat"
actions:
merge:
method: squash
14 changes: 14 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": [
"config:base"
],
"schedule": ["every sunday"],
"ignoreDeps": [
"androidx.core:core-splashscreen",
"androidx.work:work-runtime-ktx",
"info.android15.nucleus:nucleus-support-v7",
"info.android15.nucleus:nucleus",
"com.android.tools:r8",
"com.google.guava:guava"
]
}
7 changes: 4 additions & 3 deletions .github/workflows/build_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@ jobs:
uses: actions/dependency-review-action@v1

- name: Set up JDK 11
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 11
distribution: adopt

- name: Copy CI gradle.properties
run: |
mkdir -p ~/.gradle
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
- name: Build app
- name: Build app and run unit tests
uses: gradle/gradle-command-action@v2
with:
arguments: assembleStandardRelease
arguments: assembleStandardRelease testStandardReleaseUnitTest
7 changes: 4 additions & 3 deletions .github/workflows/build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,20 @@ jobs:
uses: gradle/wrapper-validation-action@v1

- name: Set up JDK 11
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 11
distribution: adopt

- name: Copy CI gradle.properties
run: |
mkdir -p ~/.gradle
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
- name: Build app
- name: Build app and run unit tests
uses: gradle/gradle-command-action@v2
with:
arguments: assembleStandardRelease
arguments: assembleStandardRelease testStandardReleaseUnitTest

# Sign APK and create release for tags

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Features include:
* Online reading from a variety of sources
* Local reading of downloaded content
* A configurable reader with multiple viewers, reading directions and other settings.
* Tracker support: [MyAnimeList](https://myanimelist.net/), [AniList](https://anilist.co/), [Kitsu](https://kitsu.io/), [Shikimori](https://shikimori.one), and [Bangumi](https://bgm.tv/)
* Tracker support: [MyAnimeList](https://myanimelist.net/), [AniList](https://anilist.co/), [Kitsu](https://kitsu.io/), [MangaUpdates](https://mangaupdates.com), [Shikimori](https://shikimori.one), and [Bangumi](https://bgm.tv/)
* Categories to organize your library
* Light and dark themes
* Schedule updating your library for new chapters
Expand Down
24 changes: 14 additions & 10 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -139,25 +139,27 @@ android {
kotlinCompilerExtensionVersion = compose.versions.compose.get()
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}

sqldelight {
database("Database") {
packageName = "eu.kanade.tachiyomi"
dialect = "sqlite:3.24"
sourceFolders = listOf("sqldelight")
}
database("AnimeDatabase") {
packageName = "eu.kanade.tachiyomi.mi"
dialect = "sqlite:3.24"
sourceFolders = listOf("sqldelightanime")
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}

dependencies {
Expand All @@ -169,12 +171,14 @@ dependencies {
implementation(compose.material.icons)
implementation(compose.animation)
implementation(compose.ui.tooling)
implementation(compose.ui.util)
implementation(compose.accompanist.webview)
implementation(compose.accompanist.swiperefresh)

implementation(androidx.paging.runtime)
implementation(androidx.paging.compose)

implementation(libs.sqldelight.sqlite)
implementation(androidx.sqlite)
implementation(libs.sqldelight.android.driver)
implementation(libs.sqldelight.coroutines)
implementation(libs.sqldelight.android.paging)
Expand Down
1 change: 0 additions & 1 deletion app/proguard-android-optimize.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
-allowaccessmodification
-dontusemixedcaseclassnames
-verbose

Expand Down
34 changes: 4 additions & 30 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
-dontobfuscate

# Keep extension's common dependencies
# Keep common dependencies used in extensions
-keep,allowoptimization class eu.kanade.tachiyomi.** { public protected *; }
-keep,allowoptimization class androidx.preference.** { *; }
-keep,allowoptimization class androidx.preference.** { public protected *; }
-keep,allowoptimization class android.content.** { *; }
-keep,allowoptimization class kotlinx.coroutines.** { *; }
-keep,allowoptimization class uy.kohesive.injekt.** { public protected *; }
-keep,allowoptimization class android.test.base.** { *; }
-keep,allowoptimization class kotlin.** { public protected *; }
-keep,allowoptimization class kotlinx.coroutines.** { public protected *; }
-keep,allowoptimization class kotlinx.serialization.** { public protected *; }
-keep,allowoptimization class okhttp3.** { public protected *; }
-keep,allowoptimization class okio.** { public protected *; }
-keep,allowoptimization class rx.** { public protected *; }
-keep,allowoptimization class org.jsoup.** { public protected *; }
-keep,allowoptimization class com.google.gson.** { public protected *; }
-keep,allowoptimization class com.github.salomonbrys.kotson.** { public protected *; }
-keep,allowoptimization class com.squareup.duktape.** { public protected *; }
-keep,allowoptimization class app.cash.quickjs.** { public protected *; }
-keep,allowoptimization class uy.kohesive.injekt.** { public protected *; }
-keep,allowoptimization class is.xyz.mpv.** { *; }
-keep,allowoptimization class is.xyz.mpv.** { public protected *; }

##---------------Begin: proguard configuration for RxJava 1.x ----------
-dontwarn sun.misc.**
Expand All @@ -39,30 +37,6 @@
-dontnote rx.internal.util.PlatformDependent
##---------------End: proguard configuration for RxJava 1.x ----------

##---------------Begin: proguard configuration for Gson ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature

# For using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-dontwarn sun.misc.**

# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}
##---------------End: proguard configuration for Gson ----------

##---------------Begin: proguard configuration for kotlinx.serialization ----------
-keepattributes *Annotation*, InnerClasses
-dontnote kotlinx.serialization.AnnotationsKt # core serialization annotations
Expand Down
25 changes: 25 additions & 0 deletions app/src/main/java/eu/kanade/core/util/RxJavaExtensions.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package eu.kanade.core.util

import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.callbackFlow
import rx.Observable
import rx.Observer

fun <T : Any> Observable<T>.asFlow(): Flow<T> = callbackFlow {
val observer = object : Observer<T> {
override fun onNext(t: T) {
trySend(t)
}

override fun onError(e: Throwable) {
close(e)
}

override fun onCompleted() {
close()
}
}
val subscription = subscribe(observer)
awaitClose { subscription.unsubscribe() }
}
12 changes: 6 additions & 6 deletions app/src/main/java/eu/kanade/data/AndroidAnimeDatabaseHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class AndroidAnimeDatabaseHandler(
val db: AnimeDatabase,
private val driver: AndroidSqliteDriver,
val queryDispatcher: CoroutineDispatcher = Dispatchers.IO,
val transactionDispatcher: CoroutineDispatcher = queryDispatcher
val transactionDispatcher: CoroutineDispatcher = queryDispatcher,
) : AnimeDatabaseHandler {

val suspendingTransactionId = ThreadLocal<Int>()
Expand All @@ -30,21 +30,21 @@ class AndroidAnimeDatabaseHandler(

override suspend fun <T : Any> awaitList(
inTransaction: Boolean,
block: suspend AnimeDatabase.() -> Query<T>
block: suspend AnimeDatabase.() -> Query<T>,
): List<T> {
return dispatch(inTransaction) { block(db).executeAsList() }
}

override suspend fun <T : Any> awaitOne(
inTransaction: Boolean,
block: suspend AnimeDatabase.() -> Query<T>
block: suspend AnimeDatabase.() -> Query<T>,
): T {
return dispatch(inTransaction) { block(db).executeAsOne() }
}

override suspend fun <T : Any> awaitOneOrNull(
inTransaction: Boolean,
block: suspend AnimeDatabase.() -> Query<T>
block: suspend AnimeDatabase.() -> Query<T>,
): T? {
return dispatch(inTransaction) { block(db).executeAsOneOrNull() }
}
Expand All @@ -64,15 +64,15 @@ class AndroidAnimeDatabaseHandler(
override fun <T : Any> subscribeToPagingSource(
countQuery: AnimeDatabase.() -> Query<Long>,
transacter: AnimeDatabase.() -> Transacter,
queryProvider: AnimeDatabase.(Long, Long) -> Query<T>
queryProvider: AnimeDatabase.(Long, Long) -> Query<T>,
): PagingSource<Long, T> {
return QueryPagingSource(
countQuery = countQuery(db),
transacter = transacter(db),
dispatcher = queryDispatcher,
queryProvider = { limit, offset ->
queryProvider.invoke(db, limit, offset)
}
},
)
}

Expand Down
12 changes: 6 additions & 6 deletions app/src/main/java/eu/kanade/data/AndroidDatabaseHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class AndroidDatabaseHandler(
val db: Database,
private val driver: SqlDriver,
val queryDispatcher: CoroutineDispatcher = Dispatchers.IO,
val transactionDispatcher: CoroutineDispatcher = queryDispatcher
val transactionDispatcher: CoroutineDispatcher = queryDispatcher,
) : DatabaseHandler {

val suspendingTransactionId = ThreadLocal<Int>()
Expand All @@ -30,21 +30,21 @@ class AndroidDatabaseHandler(

override suspend fun <T : Any> awaitList(
inTransaction: Boolean,
block: suspend Database.() -> Query<T>
block: suspend Database.() -> Query<T>,
): List<T> {
return dispatch(inTransaction) { block(db).executeAsList() }
}

override suspend fun <T : Any> awaitOne(
inTransaction: Boolean,
block: suspend Database.() -> Query<T>
block: suspend Database.() -> Query<T>,
): T {
return dispatch(inTransaction) { block(db).executeAsOne() }
}

override suspend fun <T : Any> awaitOneOrNull(
inTransaction: Boolean,
block: suspend Database.() -> Query<T>
block: suspend Database.() -> Query<T>,
): T? {
return dispatch(inTransaction) { block(db).executeAsOneOrNull() }
}
Expand All @@ -64,15 +64,15 @@ class AndroidDatabaseHandler(
override fun <T : Any> subscribeToPagingSource(
countQuery: Database.() -> Query<Long>,
transacter: Database.() -> Transacter,
queryProvider: Database.(Long, Long) -> Query<T>
queryProvider: Database.(Long, Long) -> Query<T>,
): PagingSource<Long, T> {
return QueryPagingSource(
countQuery = countQuery(db),
transacter = transacter(db),
dispatcher = queryDispatcher,
queryProvider = { limit, offset ->
queryProvider.invoke(db, limit, offset)
}
},
)
}

Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/eu/kanade/data/AnimeDatabaseHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ interface AnimeDatabaseHandler {

suspend fun <T : Any> awaitList(
inTransaction: Boolean = false,
block: suspend AnimeDatabase.() -> Query<T>
block: suspend AnimeDatabase.() -> Query<T>,
): List<T>

suspend fun <T : Any> awaitOne(
inTransaction: Boolean = false,
block: suspend AnimeDatabase.() -> Query<T>
block: suspend AnimeDatabase.() -> Query<T>,
): T

suspend fun <T : Any> awaitOneOrNull(
inTransaction: Boolean = false,
block: suspend AnimeDatabase.() -> Query<T>
block: suspend AnimeDatabase.() -> Query<T>,
): T?

fun <T : Any> subscribeToList(block: AnimeDatabase.() -> Query<T>): Flow<List<T>>
Expand All @@ -34,6 +34,6 @@ interface AnimeDatabaseHandler {
fun <T : Any> subscribeToPagingSource(
countQuery: AnimeDatabase.() -> Query<Long>,
transacter: AnimeDatabase.() -> Transacter,
queryProvider: AnimeDatabase.(Long, Long) -> Query<T>
queryProvider: AnimeDatabase.(Long, Long) -> Query<T>,
): PagingSource<Long, T>
}
8 changes: 4 additions & 4 deletions app/src/main/java/eu/kanade/data/DatabaseHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ interface DatabaseHandler {

suspend fun <T : Any> awaitList(
inTransaction: Boolean = false,
block: suspend Database.() -> Query<T>
block: suspend Database.() -> Query<T>,
): List<T>

suspend fun <T : Any> awaitOne(
inTransaction: Boolean = false,
block: suspend Database.() -> Query<T>
block: suspend Database.() -> Query<T>,
): T

suspend fun <T : Any> awaitOneOrNull(
inTransaction: Boolean = false,
block: suspend Database.() -> Query<T>
block: suspend Database.() -> Query<T>,
): T?

fun <T : Any> subscribeToList(block: Database.() -> Query<T>): Flow<List<T>>
Expand All @@ -34,6 +34,6 @@ interface DatabaseHandler {
fun <T : Any> subscribeToPagingSource(
countQuery: Database.() -> Query<Long>,
transacter: Database.() -> Transacter,
queryProvider: Database.(Long, Long) -> Query<T>
queryProvider: Database.(Long, Long) -> Query<T>,
): PagingSource<Long, T>
}
3 changes: 3 additions & 0 deletions app/src/main/java/eu/kanade/data/DatabaseUtils.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package eu.kanade.data

fun Boolean.toLong() = if (this) 1L else 0L
Loading

0 comments on commit ad77b6c

Please sign in to comment.