Skip to content

Commit

Permalink
Merge remote-tracking branch 'j2k/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/ISSUE_TEMPLATE.md
#	.github/ISSUE_TEMPLATE/feature_request.yml
#	.github/ISSUE_TEMPLATE/issue_report.yml
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt
#	app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt
#	app/src/main/res/values-ar/strings.xml
#	app/src/main/res/values-es/strings.xml
#	app/src/main/res/values-hr/strings.xml
#	app/src/main/res/values-ja/strings.xml
#	app/src/main/res/values-pt-rBR/strings.xml
#	app/src/main/res/values-sv/strings.xml
#	app/src/main/res/values-th/strings.xml
#	app/src/main/res/values-vi/strings.xml
#	app/src/main/res/values-zh-rCN/strings.xml
#	app/src/main/res/values/strings.xml
#	buildSrc/src/main/kotlin/Dependencies.kt
  • Loading branch information
Saud-97 committed Oct 21, 2023
2 parents afb5fcd + 7feaf3b commit 2c993e8
Show file tree
Hide file tree
Showing 207 changed files with 4,351 additions and 2,660 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
I acknowledge that:

- If this is a bug or a feature, I will not use this issue template and instead use one of the options on the previous page
- I have tried the troubleshooting guide: https://tachiyomi.org/help/guides/troubleshooting-problems/
- I have updated to the latest version of the app (v1.7.1)
- I have tried the troubleshooting guide: https://tachiyomi.org/docs/guides/troubleshooting/
- I have updated to the latest version of the app (v1.7.2)
- I will not repeat an issue already requested
- If this is an request for an extension/source, that I should be opening an issue in https://github.com/tachiyomiorg/tachiyomi-extensions

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ body:
required: true
- label: If this is an issue with an extension, or a request for an extension, I should be opening an issue in the [extensions repository](https://github.com/tachiyomiorg/tachiyomi-extensions/issues/new/choose).
required: true
- label: I have updated the app to version **[1.7.1](https://github.com/saud-97/TachiyomiS97/releases/latest)**.
- label: I have updated the app to version **[1.7.2](https://github.com/saud-97/TachiyomiS97/releases/latest)**.
required: true
- label: I have checked through the app settings for my feature.
required: true
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/issue_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ body:
label: Android version
description: You can find this somewhere in your Android settings.
placeholder: |
Example: "Android 12"
Example: "Android 14"
validations:
required: true

Expand All @@ -73,7 +73,7 @@ body:
label: Device
description: List your device and model.
placeholder: |
Example: "Google Pixel 6"
Example: "Google Pixel 8"
validations:
required: true

Expand All @@ -100,7 +100,7 @@ body:
required: true
- label: I have tried the [troubleshooting guide](https://tachiyomi.org/help/guides/troubleshooting/).
required: true
- label: I have updated the app to version **[1.7.1](https://github.com/saud-97/TachiyomiS97/releases/latest)**.
- label: I have updated the app to version **[1.7.2](https://github.com/saud-97/TachiyomiS97/releases/latest)**.
required: true
- label: I have updated all installed extensions.
required: true
Expand Down
40 changes: 31 additions & 9 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ dependencies {
// Android X libraries
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.cardview:cardview:1.0.0")
implementation("com.google.android.material:material:1.10.0-rc01")
implementation("com.google.android.material:material:1.10.0")
implementation("androidx.webkit:webkit:1.8.0")
implementation("androidx.recyclerview:recyclerview:1.3.1")
implementation("androidx.preference:preference:1.2.1")
implementation("androidx.annotation:annotation:1.7.0")
implementation("androidx.browser:browser:1.6.0")
implementation("androidx.biometric:biometric:1.1.0")
implementation("androidx.palette:palette:1.0.0")
implementation("androidx.activity:activity-ktx:1.8.0-rc01")
implementation("androidx.activity:activity-ktx:1.8.0")
implementation("androidx.core:core-ktx:1.12.0")
implementation("com.google.android.flexbox:flexbox:3.0.0")
implementation("androidx.window:window:1.1.0")
Expand Down Expand Up @@ -208,7 +208,7 @@ dependencies {
implementation(kotlin("reflect", version = AndroidVersions.kotlin))

// JSON
val kotlinSerialization = "1.5.1"
val kotlinSerialization = "1.6.0"
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:${kotlinSerialization}")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:${kotlinSerialization}")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json-okio:${kotlinSerialization}")
Expand All @@ -232,7 +232,7 @@ dependencies {

// Database
implementation("androidx.sqlite:sqlite-ktx:2.3.1")
implementation("com.github.requery:sqlite-android:3.42.0")
implementation("com.github.requery:sqlite-android:3.39.2")
implementation("com.github.inorichi.storio:storio-common:8be19de@aar")
implementation("com.github.inorichi.storio:storio-sqlite:8be19de@aar")

Expand Down Expand Up @@ -274,9 +274,9 @@ dependencies {
implementation("com.getkeepsafe.taptargetview:taptargetview:1.13.3")

// Conductor
val conductorVersion = "3.0.0"
val conductorVersion = "4.0.0-preview-3"
implementation("com.bluelinelabs:conductor:$conductorVersion")
implementation("com.github.tachiyomiorg:conductor-support-preference:$conductorVersion")
implementation("com.github.tachiyomiorg:conductor-support-preference:3.0.0")

// Shizuku
val shizukuVersion = "12.1.0"
Expand All @@ -301,21 +301,43 @@ dependencies {
implementation("com.github.PhilJay:MPAndroidChart:v3.1.0")
}



tasks {
// See https://kotlinlang.org/docs/reference/experimental.html#experimental-status-of-experimental-api(-markers)
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.freeCompilerArgs += listOf(
"-Xcontext-receivers",
"-opt-in=kotlin.Experimental",
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.ExperimentalStdlibApi",
"-opt-in=androidx.compose.foundation.layout.ExperimentalLayoutApi",
"-opt-in=androidx.compose.material.ExperimentalMaterialApi",
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api",
"-opt-in=androidx.compose.material.ExperimentalMaterialApi",
"-opt-in=androidx.compose.ui.ExperimentalComposeUiApi",
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi",
"-opt-in=androidx.compose.animation.ExperimentalAnimationApi",
"-opt-in=androidx.compose.animation.graphics.ExperimentalAnimationGraphicsApi",
"-opt-in=coil.annotation.ExperimentalCoilApi",
"-opt-in=com.google.accompanist.permissions.ExperimentalPermissionsApi",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=kotlinx.coroutines.FlowPreview",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=kotlinx.coroutines.InternalCoroutinesApi",
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
"-opt-in=coil.annotation.ExperimentalCoilApi",
)

if (project.findProperty("tachiyomi.enableComposeCompilerMetrics") == "true") {
kotlinOptions.freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
project.buildDir.absolutePath + "/compose_metrics",
)
kotlinOptions.freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
project.buildDir.absolutePath + "/compose_metrics",
)
}
}

// Duplicating Hebrew string assets due to some locale code issues on different devices
Expand Down
13 changes: 7 additions & 6 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@
-keep class eu.kanade.tachiyomi.source.** { public protected *; } # Avoid access modification
-keep,allowoptimization class eu.kanade.** { public protected *; }
-keep,allowoptimization class tachiyomi.** { public protected *; }
-keep,allowoptimization class androidx.preference.** { *; }

# Keep common dependencies used in extensions
-keep,allowoptimization class androidx.preference.** { public protected *; }
-keep,allowoptimization class kotlin.** { public protected *; }
-keep class androidx.preference.** { public protected *; }
-keep 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 class kotlinx.serialization.** { public protected *; }
-keep class okhttp3.** { public protected *; }
-keep,allowoptimization class okio.** { public protected *; }
-keep,allowoptimization class rx.** { public protected *; }
-keep,allowoptimization class org.jsoup.** { public protected *; }
-keep class org.jsoup.** { public protected *; }
-keep,allowoptimization class com.google.gson.** { public protected *; }
-keep,allowoptimization class app.cash.quickjs.** { public protected *; }
-keep,allowoptimization class uy.kohesive.injekt.** { public protected *; }
-keep,allowoptimization class eu.davidea.flexibleadapter.** { public protected *; }
-keep class io.requery.android.database.** { public protected *; }

# From extensions-lib
-keep,allowoptimization class eu.kanade.tachiyomi.network.interceptor.RateLimitInterceptorKt { public protected *; }
Expand Down
29 changes: 25 additions & 4 deletions app/src/main/java/eu/kanade/tachiyomi/AppInfo.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
package eu.kanade.tachiyomi

import eu.kanade.tachiyomi.util.system.ImageUtil

/**
* Used by extensions.
*
* @since extension-lib 1.3
*/
object AppInfo {
fun getVersionCode() = BuildConfig.VERSION_CODE
fun getVersionName() = BuildConfig.VERSION_NAME
/**
* Version code of the host application. May be useful for sharing as User-Agent information.
* Note that this value differs between forks so logic should not rely on it.
*
* @since extension-lib 1.3
*/
fun getVersionCode(): Int = BuildConfig.VERSION_CODE

/**
* Version name of the host application. May be useful for sharing as User-Agent information.
* Note that this value differs between forks so logic should not rely on it.
*
* @since extension-lib 1.3
*/
fun getVersionName(): String = BuildConfig.VERSION_NAME

/**
* A list of supported image MIME types by the reader.
* e.g. ["image/jpeg", "image/png", ...]
*
* @since extension-lib 1.5
*/
fun getSupportedImageMimeTypes(): List<String> = ImageUtil.ImageType.values().map { it.mime }
}
9 changes: 9 additions & 0 deletions app/src/main/java/eu/kanade/tachiyomi/AppModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ import eu.kanade.tachiyomi.data.cache.CoverCache
import eu.kanade.tachiyomi.data.database.DatabaseHelper
import eu.kanade.tachiyomi.data.download.DownloadManager
import eu.kanade.tachiyomi.data.library.CustomMangaManager
import eu.kanade.tachiyomi.data.preference.AndroidPreferenceStore
import eu.kanade.tachiyomi.data.preference.PreferenceStore
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.data.track.TrackManager
import eu.kanade.tachiyomi.data.track.TrackPreferences
import eu.kanade.tachiyomi.extension.ExtensionManager
import eu.kanade.tachiyomi.network.JavaScriptEngine
import eu.kanade.tachiyomi.network.NetworkHelper
Expand All @@ -27,8 +30,14 @@ class AppModule(val app: Application) : InjektModule {
override fun InjektRegistrar.registerInjectables() {
addSingleton(app)

addSingletonFactory<PreferenceStore> {
AndroidPreferenceStore(app)
}

addSingletonFactory { PreferencesHelper(app) }

addSingletonFactory { TrackPreferences(get()) }

addSingletonFactory { DatabaseHelper(app) }

addSingletonFactory { ChapterCache(app) }
Expand Down
21 changes: 20 additions & 1 deletion app/src/main/java/eu/kanade/tachiyomi/Migrations.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import androidx.preference.PreferenceManager
import eu.kanade.tachiyomi.data.backup.BackupCreatorJob
import eu.kanade.tachiyomi.data.download.DownloadProvider
import eu.kanade.tachiyomi.data.library.LibraryUpdateJob
import eu.kanade.tachiyomi.data.preference.Preference
import eu.kanade.tachiyomi.data.preference.PreferenceKeys
import eu.kanade.tachiyomi.data.preference.PreferenceStore
import eu.kanade.tachiyomi.data.preference.PreferenceValues
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.data.preference.plusAssign
Expand Down Expand Up @@ -33,7 +35,11 @@ object Migrations {
* @param preferences Preferences of the application.
* @return true if a migration is performed, false otherwise.
*/
fun upgrade(preferences: PreferencesHelper, scope: CoroutineScope): Boolean {
fun upgrade(
preferences: PreferencesHelper,
preferenceStore: PreferenceStore,
scope: CoroutineScope,
): Boolean {
val context = preferences.context
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
prefs.edit {
Expand Down Expand Up @@ -220,6 +226,19 @@ object Migrations {
LibraryUpdateJob.cancelAllWorks(context)
LibraryUpdateJob.setupTask(context)
}
if (oldVersion < 108) {
preferenceStore.getAll()
.filter { it.key.startsWith("pref_mangasync_") || it.key.startsWith("track_token_") }
.forEach { (key, value) ->
if (value is String) {
preferenceStore
.getString(Preference.privateKey(key))
.set(value)

preferenceStore.getString(key).delete()
}
}
}

return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import kotlinx.coroutines.MainScope
import uy.kohesive.injekt.injectLazy
import java.util.Calendar
import java.util.Date
import kotlin.math.min

class UpdatesGridGlanceWidget : GlanceAppWidget() {
private val app: Application by injectLazy()
Expand Down Expand Up @@ -76,7 +77,7 @@ class UpdatesGridGlanceWidget : GlanceAppWidget() {
.flatMap { manager.getAppWidgetSizes(it) }
.maxBy { it.height.value * it.width.value }
.calculateRowAndColumnCount()
val processList = list ?: RecentsPresenter.getRecentManga(customAmount = rowCount * columnCount)
val processList = list ?: RecentsPresenter.getRecentManga(customAmount = min(50, rowCount * columnCount))

data = prepareList(processList, rowCount * columnCount)
ids.forEach { update(app, it) }
Expand Down

This file was deleted.

Loading

0 comments on commit 2c993e8

Please sign in to comment.