Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
06ec145802
|
|||
|
6624778f7f
|
|||
|
1af1f071ad
|
|||
|
f87db4e6d3
|
|||
|
|
07bd66fb39 |
@@ -16,8 +16,8 @@ android {
|
|||||||
applicationId 'org.koitharu.kotatsu'
|
applicationId 'org.koitharu.kotatsu'
|
||||||
minSdk = 21
|
minSdk = 21
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
versionCode = 593
|
versionCode = 594
|
||||||
versionName = '6.2.5'
|
versionName = '6.2.6'
|
||||||
generatedDensities = []
|
generatedDensities = []
|
||||||
testInstrumentationRunner "org.koitharu.kotatsu.HiltTestRunner"
|
testInstrumentationRunner "org.koitharu.kotatsu.HiltTestRunner"
|
||||||
ksp {
|
ksp {
|
||||||
@@ -82,11 +82,11 @@ afterEvaluate {
|
|||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
//noinspection GradleDependency
|
//noinspection GradleDependency
|
||||||
implementation('com.github.KotatsuApp:kotatsu-parsers:4ca3a492b0') {
|
implementation('com.github.KotatsuApp:kotatsu-parsers:face1d5b26') {
|
||||||
exclude group: 'org.json', module: 'json'
|
exclude group: 'org.json', module: 'json'
|
||||||
}
|
}
|
||||||
|
|
||||||
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.9.10'
|
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.9.20'
|
||||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
|
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||||
@@ -119,8 +119,8 @@ dependencies {
|
|||||||
implementation 'androidx.room:room-ktx:2.6.0'
|
implementation 'androidx.room:room-ktx:2.6.0'
|
||||||
ksp 'androidx.room:room-compiler:2.6.0'
|
ksp 'androidx.room:room-compiler:2.6.0'
|
||||||
|
|
||||||
implementation 'com.squareup.okhttp3:okhttp:4.11.0'
|
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
|
||||||
implementation 'com.squareup.okhttp3:okhttp-dnsoverhttps:4.11.0'
|
implementation 'com.squareup.okhttp3:okhttp-dnsoverhttps:4.12.0'
|
||||||
implementation 'com.squareup.okio:okio:3.6.0'
|
implementation 'com.squareup.okio:okio:3.6.0'
|
||||||
|
|
||||||
implementation 'com.hannesdorfmann:adapterdelegates4-kotlin-dsl:4.3.2'
|
implementation 'com.hannesdorfmann:adapterdelegates4-kotlin-dsl:4.3.2'
|
||||||
@@ -131,8 +131,8 @@ dependencies {
|
|||||||
implementation 'androidx.hilt:hilt-work:1.0.0'
|
implementation 'androidx.hilt:hilt-work:1.0.0'
|
||||||
kapt 'androidx.hilt:hilt-compiler:1.0.0'
|
kapt 'androidx.hilt:hilt-compiler:1.0.0'
|
||||||
|
|
||||||
implementation 'io.coil-kt:coil-base:2.4.0'
|
implementation 'io.coil-kt:coil-base:2.5.0'
|
||||||
implementation 'io.coil-kt:coil-svg:2.4.0'
|
implementation 'io.coil-kt:coil-svg:2.5.0'
|
||||||
implementation 'com.github.KotatsuApp:subsampling-scale-image-view:cf089a264d'
|
implementation 'com.github.KotatsuApp:subsampling-scale-image-view:cf089a264d'
|
||||||
implementation 'com.github.solkin:disk-lru-cache:1.4'
|
implementation 'com.github.solkin:disk-lru-cache:1.4'
|
||||||
implementation 'io.noties.markwon:core:4.6.2'
|
implementation 'io.noties.markwon:core:4.6.2'
|
||||||
@@ -143,7 +143,7 @@ dependencies {
|
|||||||
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.12'
|
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.12'
|
||||||
|
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
testImplementation 'org.json:json:20230618'
|
testImplementation 'org.json:json:20231013'
|
||||||
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3'
|
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3'
|
||||||
|
|
||||||
androidTestImplementation 'androidx.test:runner:1.5.2'
|
androidTestImplementation 'androidx.test:runner:1.5.2'
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class CompositeMutex<T : Any> : Set<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun isEmpty(): Boolean {
|
override fun isEmpty(): Boolean {
|
||||||
return state.isEmpty
|
return state.isEmpty()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun iterator(): Iterator<T> {
|
override fun iterator(): Iterator<T> {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class CompositeMutex2<T : Any> : Set<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun isEmpty(): Boolean {
|
override fun isEmpty(): Boolean {
|
||||||
return delegates.isEmpty
|
return delegates.isEmpty()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun iterator(): Iterator<T> {
|
override fun iterator(): Iterator<T> {
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ class AppearanceSettingsFragment :
|
|||||||
|
|
||||||
private val deviceLocales = LocaleManagerCompat.getSystemLocales(context)
|
private val deviceLocales = LocaleManagerCompat.getSystemLocales(context)
|
||||||
.map { it.language }
|
.map { it.language }
|
||||||
|
.distinct()
|
||||||
|
|
||||||
override fun compare(a: Locale, b: Locale): Int {
|
override fun compare(a: Locale, b: Locale): Int {
|
||||||
return if (a === b) {
|
return if (a === b) {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import org.koitharu.kotatsu.core.ui.AlertDialogFragment
|
|||||||
import org.koitharu.kotatsu.core.util.ext.getDisplayMessage
|
import org.koitharu.kotatsu.core.util.ext.getDisplayMessage
|
||||||
import org.koitharu.kotatsu.core.util.ext.observe
|
import org.koitharu.kotatsu.core.util.ext.observe
|
||||||
import org.koitharu.kotatsu.core.util.ext.observeEvent
|
import org.koitharu.kotatsu.core.util.ext.observeEvent
|
||||||
|
import org.koitharu.kotatsu.core.util.ext.tryLaunch
|
||||||
import org.koitharu.kotatsu.databinding.DialogProgressBinding
|
import org.koitharu.kotatsu.databinding.DialogProgressBinding
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.FileOutputStream
|
import java.io.FileOutputStream
|
||||||
@@ -28,7 +29,7 @@ class BackupDialogFragment : AlertDialogFragment<DialogProgressBinding>() {
|
|||||||
|
|
||||||
private var backup: File? = null
|
private var backup: File? = null
|
||||||
private val saveFileContract = registerForActivityResult(
|
private val saveFileContract = registerForActivityResult(
|
||||||
ActivityResultContracts.CreateDocument("*/*"),
|
ActivityResultContracts.CreateDocument("application/zip"),
|
||||||
) { uri ->
|
) { uri ->
|
||||||
val file = backup
|
val file = backup
|
||||||
if (uri != null && file != null) {
|
if (uri != null && file != null) {
|
||||||
@@ -81,7 +82,10 @@ class BackupDialogFragment : AlertDialogFragment<DialogProgressBinding>() {
|
|||||||
|
|
||||||
private fun onBackupDone(file: File) {
|
private fun onBackupDone(file: File) {
|
||||||
this.backup = file
|
this.backup = file
|
||||||
saveFileContract.launch(file.name)
|
if (!saveFileContract.tryLaunch(file.name)) {
|
||||||
|
Toast.makeText(requireContext(), R.string.operation_not_supported, Toast.LENGTH_SHORT).show()
|
||||||
|
dismiss()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun saveBackup(file: File, output: Uri) {
|
private fun saveBackup(file: File, output: Uri) {
|
||||||
@@ -91,7 +95,7 @@ class BackupDialogFragment : AlertDialogFragment<DialogProgressBinding>() {
|
|||||||
it.write(file.readBytes())
|
it.write(file.readBytes())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Toast.makeText(requireContext(), R.string.backup_saved, Toast.LENGTH_LONG).show()
|
Toast.makeText(requireContext(), R.string.backup_saved, Toast.LENGTH_SHORT).show()
|
||||||
dismiss()
|
dismiss()
|
||||||
} catch (e: InterruptedException) {
|
} catch (e: InterruptedException) {
|
||||||
throw e
|
throw e
|
||||||
|
|||||||
@@ -16,15 +16,11 @@ import androidx.work.workDataOf
|
|||||||
import dagger.Reusable
|
import dagger.Reusable
|
||||||
import dagger.assisted.Assisted
|
import dagger.assisted.Assisted
|
||||||
import dagger.assisted.AssistedInject
|
import dagger.assisted.AssistedInject
|
||||||
import okio.buffer
|
|
||||||
import okio.sink
|
|
||||||
import okio.source
|
|
||||||
import org.koitharu.kotatsu.core.backup.BackupRepository
|
import org.koitharu.kotatsu.core.backup.BackupRepository
|
||||||
import org.koitharu.kotatsu.core.backup.BackupZipOutput
|
import org.koitharu.kotatsu.core.backup.BackupZipOutput
|
||||||
import org.koitharu.kotatsu.core.prefs.AppSettings
|
import org.koitharu.kotatsu.core.prefs.AppSettings
|
||||||
import org.koitharu.kotatsu.core.util.ext.awaitUniqueWorkInfoByName
|
import org.koitharu.kotatsu.core.util.ext.awaitUniqueWorkInfoByName
|
||||||
import org.koitharu.kotatsu.core.util.ext.deleteAwait
|
import org.koitharu.kotatsu.core.util.ext.deleteAwait
|
||||||
import org.koitharu.kotatsu.core.util.ext.writeAllCancellable
|
|
||||||
import org.koitharu.kotatsu.settings.work.PeriodicWorkScheduler
|
import org.koitharu.kotatsu.settings.work.PeriodicWorkScheduler
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
@@ -52,12 +48,10 @@ class PeriodicalBackupWorker @AssistedInject constructor(
|
|||||||
}
|
}
|
||||||
val dirUri = settings.periodicalBackupOutput ?: return Result.success(resultData)
|
val dirUri = settings.periodicalBackupOutput ?: return Result.success(resultData)
|
||||||
val target = DocumentFile.fromTreeUri(applicationContext, dirUri)
|
val target = DocumentFile.fromTreeUri(applicationContext, dirUri)
|
||||||
?.createFile("application/zip", file.name)
|
?.createFile("application/zip", file.nameWithoutExtension)
|
||||||
?.uri ?: return Result.failure()
|
?.uri ?: return Result.failure()
|
||||||
applicationContext.contentResolver.openOutputStream(target)?.use { output ->
|
applicationContext.contentResolver.openOutputStream(target, "wt")?.use { output ->
|
||||||
file.source().use { input ->
|
file.inputStream().copyTo(output)
|
||||||
output.sink().buffer().writeAllCancellable(input)
|
|
||||||
}
|
|
||||||
} ?: return Result.failure()
|
} ?: return Result.failure()
|
||||||
file.deleteAwait()
|
file.deleteAwait()
|
||||||
return Result.success(resultData)
|
return Result.success(resultData)
|
||||||
@@ -79,6 +73,7 @@ class PeriodicalBackupWorker @AssistedInject constructor(
|
|||||||
settings.periodicalBackupFrequency,
|
settings.periodicalBackupFrequency,
|
||||||
TimeUnit.DAYS,
|
TimeUnit.DAYS,
|
||||||
).setConstraints(constraints.build())
|
).setConstraints(constraints.build())
|
||||||
|
.keepResultsForAtLeast(20, TimeUnit.DAYS)
|
||||||
.addTag(TAG)
|
.addTag(TAG)
|
||||||
.build()
|
.build()
|
||||||
workManager
|
workManager
|
||||||
|
|||||||
@@ -483,4 +483,25 @@
|
|||||||
<string name="show">Mostrar</string>
|
<string name="show">Mostrar</string>
|
||||||
<string name="color_black">Preto</string>
|
<string name="color_black">Preto</string>
|
||||||
<string name="this_month">Esse mês</string>
|
<string name="this_month">Esse mês</string>
|
||||||
|
<string name="frequency_every_day">Diariamente</string>
|
||||||
|
<string name="categories">Categorias</string>
|
||||||
|
<string name="list_options">Opções da lista</string>
|
||||||
|
<string name="backup_frequency">Frequência de criação de backup</string>
|
||||||
|
<string name="suggest_new_sources">Sugerir novas fontes após a atualização do aplicativo</string>
|
||||||
|
<string name="periodic_backups_enable">Ativar backups periódicos</string>
|
||||||
|
<string name="enhanced_colors_summary">Reduz a formação de faixas, mas pode afetar o desempenho</string>
|
||||||
|
<string name="frequency_every_2_days">A cada 2 dias</string>
|
||||||
|
<string name="frequency_once_per_week">Semanalmente</string>
|
||||||
|
<string name="periodic_backups">Backups periódicos</string>
|
||||||
|
<string name="frequency_twice_per_month">Duas vezes ao mês</string>
|
||||||
|
<string name="online_variant">Variante on-line</string>
|
||||||
|
<string name="by_relevance">Relevância</string>
|
||||||
|
<string name="state_abandoned">Abandonado</string>
|
||||||
|
<string name="keep_screen_on">Manter a tela ligada</string>
|
||||||
|
<string name="frequency_once_per_month">Uma vez por mês</string>
|
||||||
|
<string name="enhanced_colors">Modo de cor de 32 bits</string>
|
||||||
|
<string name="keep_screen_on_summary">Não desligue a tela enquanto estiver lendo mangá</string>
|
||||||
|
<string name="last_successful_backup">Último backup bem-sucedido: %s</string>
|
||||||
|
<string name="backups_output_directory">Local de saída de backups</string>
|
||||||
|
<string name="suggest_new_sources_summary">Solicitação para ativar fontes recém-adicionadas após a atualização do aplicativo</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -5,9 +5,9 @@ buildscript {
|
|||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:8.1.2'
|
classpath 'com.android.tools.build:gradle:8.1.2'
|
||||||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10'
|
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20'
|
||||||
classpath 'com.google.dagger:hilt-android-gradle-plugin:2.48.1'
|
classpath 'com.google.dagger:hilt-android-gradle-plugin:2.48.1'
|
||||||
classpath 'com.google.devtools.ksp:symbol-processing-gradle-plugin:1.9.10-1.0.13'
|
classpath 'com.google.devtools.ksp:symbol-processing-gradle-plugin:1.9.20-RC2-1.0.13'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user