Compare commits

...

10 Commits

Author SHA1 Message Date
Eric
737ca4a916 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (425 of 425 strings)

Co-authored-by: Eric <hamburger2048@users.noreply.hosted.weblate.org>
Translate-URL: https://hosted.weblate.org/projects/kotatsu/strings/zh_Hans/
Translation: Kotatsu/Strings
2023-03-04 07:41:04 +02:00
Oğuz Ersen
b2958d03e4 Translated using Weblate (Turkish)
Currently translated at 100.0% (425 of 425 strings)

Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
Translate-URL: https://hosted.weblate.org/projects/kotatsu/strings/tr/
Translation: Kotatsu/Strings
2023-03-04 07:41:04 +02:00
J. Lavoie
af8550744f Translated using Weblate (French)
Currently translated at 100.0% (425 of 425 strings)

Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Translate-URL: https://hosted.weblate.org/projects/kotatsu/strings/fr/
Translation: Kotatsu/Strings
2023-03-04 07:41:04 +02:00
gallegonovato
2f5fd71bb1 Translated using Weblate (Spanish)
Currently translated at 100.0% (425 of 425 strings)

Co-authored-by: gallegonovato <fran-carro@hotmail.es>
Translate-URL: https://hosted.weblate.org/projects/kotatsu/strings/es/
Translation: Kotatsu/Strings
2023-03-04 07:41:04 +02:00
Dpper
271750ad93 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (424 of 424 strings)

Co-authored-by: Dpper <ruslan20020401@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/kotatsu/strings/uk/
Translation: Kotatsu/Strings
2023-03-04 07:41:04 +02:00
Koitharu
0281c09dde Update version 2023-03-04 07:40:43 +02:00
Koitharu
f2ac3c331c Limit favourite category name length 2023-03-03 18:51:58 +02:00
Koitharu
4fc56f9786 Fix detailed list genres scrolling 2023-03-03 07:54:59 +02:00
Koitharu
a13c498d00 Fix ThemeChooserPreference memory leak 2023-03-02 18:42:48 +02:00
Koitharu
e15934bdc6 Option to inore SSL errors 2023-03-02 18:38:11 +02:00
16 changed files with 86 additions and 16 deletions

View File

@@ -15,8 +15,8 @@ android {
applicationId 'org.koitharu.kotatsu'
minSdkVersion 21
targetSdkVersion 33
versionCode 518
versionName '4.4.2'
versionCode 519
versionName '4.4.3'
generatedDensities = []
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View File

@@ -96,6 +96,9 @@ interface AppModule {
writeTimeout(20, TimeUnit.SECONDS)
cookieJar(cookieJar)
dns(DoHManager(cache, settings))
if (settings.isSSLBypassEnabled) {
bypassSSLErrors()
}
cache(cache)
addInterceptor(GZipInterceptor())
addInterceptor(commonHeadersInterceptor)

View File

@@ -0,0 +1,30 @@
package org.koitharu.kotatsu.core.network
import android.annotation.SuppressLint
import okhttp3.OkHttpClient
import org.koitharu.kotatsu.utils.ext.printStackTraceDebug
import java.security.SecureRandom
import java.security.cert.X509Certificate
import javax.net.ssl.SSLContext
import javax.net.ssl.SSLSocketFactory
import javax.net.ssl.X509TrustManager
@SuppressLint("CustomX509TrustManager")
fun OkHttpClient.Builder.bypassSSLErrors() = also { builder ->
runCatching {
val trustAllCerts = object : X509TrustManager {
override fun checkClientTrusted(chain: Array<X509Certificate>, authType: String) = Unit
override fun checkServerTrusted(chain: Array<X509Certificate>, authType: String) = Unit
override fun getAcceptedIssuers(): Array<X509Certificate> = emptyArray()
}
val sslContext = SSLContext.getInstance("SSL")
sslContext.init(null, arrayOf(trustAllCerts), SecureRandom())
val sslSocketFactory: SSLSocketFactory = sslContext.socketFactory
builder.sslSocketFactory(sslSocketFactory, trustAllCerts)
builder.hostnameVerifier { _, _ -> true }
}.onFailure {
it.printStackTraceDebug()
}
}

View File

@@ -255,6 +255,9 @@ class AppSettings @Inject constructor(@ApplicationContext context: Context) {
val dnsOverHttps: DoHProvider
get() = prefs.getEnumValue(KEY_DOH, DoHProvider.NONE)
val isSSLBypassEnabled: Boolean
get() = prefs.getBoolean(KEY_SSL_BYPASS, false)
var localListOrder: SortOrder
get() = prefs.getEnumValue(KEY_LOCAL_LIST_ORDER, SortOrder.NEWEST)
set(value) = prefs.edit { putEnumValue(KEY_LOCAL_LIST_ORDER, value) }
@@ -380,6 +383,7 @@ class AppSettings @Inject constructor(@ApplicationContext context: Context) {
const val KEY_LOGS_SHARE = "logs_share"
const val KEY_SOURCES_GRID = "sources_grid"
const val KEY_UPDATES_UNSTABLE = "updates_unstable"
const val KEY_SSL_BYPASS = "ssl_bypass"
// About
const val KEY_APP_UPDATE = "app_update"

View File

@@ -60,6 +60,9 @@ fun mangaListDetailedItemAD(
lifecycle(lifecycleOwner)
enqueueWith(coil)
}
if (payloads.isEmpty()) {
binding.scrollViewTags.scrollTo(0, 0)
}
binding.chipsTags.setChips(item.tags)
binding.ratingBar.isVisible = item.manga.hasRating
binding.ratingBar.rating = binding.ratingBar.numStars * item.manga.rating

View File

@@ -5,6 +5,7 @@ import android.os.Bundle
import android.view.View
import androidx.preference.ListPreference
import androidx.preference.Preference
import com.google.android.material.snackbar.Snackbar
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.launch
import org.koitharu.kotatsu.R
@@ -85,6 +86,10 @@ class ContentSettingsFragment :
AppSettings.KEY_SOURCES_HIDDEN -> {
bindRemoteSourcesSummary()
}
AppSettings.KEY_SSL_BYPASS -> {
Snackbar.make(listView, R.string.settings_apply_restart_required, Snackbar.LENGTH_INDEFINITE).show()
}
}
}

View File

@@ -19,6 +19,7 @@ import androidx.preference.PreferenceViewHolder
import org.koitharu.kotatsu.R
import org.koitharu.kotatsu.core.prefs.ColorScheme
import org.koitharu.kotatsu.databinding.ItemColorSchemeBinding
import java.lang.ref.WeakReference
class ThemeChooserPreference @JvmOverloads constructor(
context: Context,
@@ -68,7 +69,7 @@ class ThemeChooserPreference @JvmOverloads constructor(
}
scrollView.viewTreeObserver.run {
scrollPersistListener?.let { removeOnScrollChangedListener(it) }
scrollPersistListener = ScrollPersistListener(scrollView, lastScrollPosition)
scrollPersistListener = ScrollPersistListener(WeakReference(scrollView), lastScrollPosition)
addOnScrollChangedListener(scrollPersistListener)
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
@@ -106,7 +107,6 @@ class ThemeChooserPreference @JvmOverloads constructor(
}
super.onRestoreInstanceState(state.superState)
lastScrollPosition[0] = state.scrollPosition
// notifyChanged()
}
private fun setValueInternal(enumName: String, notifyChanged: Boolean) {
@@ -152,11 +152,12 @@ class ThemeChooserPreference @JvmOverloads constructor(
}
private class ScrollPersistListener(
private val scrollView: HorizontalScrollView,
private val scrollViewRef: WeakReference<HorizontalScrollView>,
private val lastScrollPosition: IntArray,
) : ViewTreeObserver.OnScrollChangedListener {
override fun onScrollChanged() {
val scrollView = scrollViewRef.get() ?: return
lastScrollPosition[0] = scrollView.scrollX
}
}

View File

@@ -52,7 +52,7 @@ abstract class SyncProvider : ContentProvider() {
.selection(selection, selectionArgs)
.orderBy(sortOrder)
.create()
logger.log("query: ${sqlQuery.sql}")
logger.log("query: ${sqlQuery.sql} (${selectionArgs.contentToString()})")
return database.openHelper.readableDatabase.query(sqlQuery)
}
@@ -75,7 +75,7 @@ abstract class SyncProvider : ContentProvider() {
override fun delete(uri: Uri, selection: String?, selectionArgs: Array<out String>?): Int {
val table = getTableName(uri) ?: return 0
logger.log { "delete: $table ($selection) : ($selectionArgs)" }
logger.log { "delete: $table ($selection) : (${selectionArgs.contentToString()})" }
return database.openHelper.writableDatabase.delete(table, selection, selectionArgs)
}
@@ -84,7 +84,7 @@ abstract class SyncProvider : ContentProvider() {
if (values == null || table == null) {
return 0
}
logger.log { "update: $table ($selection) : ($selectionArgs) [$values]" }
logger.log { "update: $table ($selection) : (${selectionArgs.contentToString()}) [$values]" }
return database.openHelper.writableDatabase
.update(table, SQLiteDatabase.CONFLICT_IGNORE, values, selection, selectionArgs)
}

View File

@@ -47,7 +47,8 @@
android:layout_height="wrap_content"
android:hint="@string/name"
android:imeOptions="actionDone"
android:inputType="textCapSentences" />
android:inputType="textCapSentences"
android:maxLength="120" />
</com.google.android.material.textfield.TextInputLayout>
@@ -91,4 +92,4 @@
</ScrollView>
</LinearLayout>
</LinearLayout>

View File

@@ -422,4 +422,5 @@
<string name="allow_unstable_updates_summary">Actualizaciones propuestas para las versiones beta de la aplicación</string>
<string name="allow_unstable_updates">Permitir actualizaciones inestables</string>
<string name="download_started">Descarga iniciada</string>
<string name="user_agent">Encabezado del agente de usuario</string>
</resources>

View File

@@ -421,4 +421,5 @@
<string name="download_started">Téléchargement commencé</string>
<string name="theme_name_kanade">Kanade</string>
<string name="allow_unstable_updates_summary">Proposer des mises à jour des versions bêta de l\'application</string>
<string name="user_agent">En-tête UserAgent</string>
</resources>

View File

@@ -409,4 +409,15 @@
<string name="theme_name_dynamic">Dinamik</string>
<string name="color_theme">renk vurgusu</string>
<string name="show_in_grid_view">Izgara görünümünde göster</string>
<string name="theme_name_mamimi">Mamimi</string>
<string name="theme_name_kanade">Kanade</string>
<string name="user_agent">UserAgent başlığı</string>
<string name="allow_unstable_updates_summary">Uygulamanın beta sürümleri için güncellemeler öner</string>
<string name="allow_unstable_updates">Kararsız güncellemelere izin ver</string>
<string name="download_started">İndirme başladı</string>
<string name="theme_name_miku">Miku</string>
<string name="theme_name_asuka">Asuka</string>
<string name="theme_name_mion">Mion</string>
<string name="theme_name_rikka">Rikka</string>
<string name="theme_name_sakura">Sakura</string>
</resources>

View File

@@ -416,4 +416,7 @@
<string name="theme_name_dynamic">Динамічний</string>
<string name="color_theme">Колірний акцент</string>
<string name="show_in_grid_view">Показати у вигляді сітки</string>
<string name="allow_unstable_updates">Дозволити нестабільні оновлення</string>
<string name="allow_unstable_updates_summary">Пропонувати оновлення до бета-версій додатку</string>
<string name="download_started">Завантаження розпочато</string>
</resources>

View File

@@ -421,4 +421,5 @@
<string name="allow_unstable_updates">允许不稳定更新</string>
<string name="allow_unstable_updates_summary">提示更新到测试版</string>
<string name="download_started">已开始下载</string>
<string name="user_agent">UserAgent 标头</string>
</resources>

View File

@@ -425,4 +425,5 @@
<string name="allow_unstable_updates_summary">Propose updates to beta versions of the app</string>
<string name="download_started">Download started</string>
<string name="user_agent">UserAgent header</string>
<string name="settings_apply_restart_required">Please restart the application to apply these changes</string>
</resources>

View File

@@ -20,12 +20,6 @@
android:title="@string/suggestions"
app:allowDividerAbove="true" />
<ListPreference
android:entries="@array/doh_providers"
android:key="doh"
android:title="@string/dns_over_https"
app:useSimpleSummaryProvider="true" />
<ListPreference
android:defaultValue="0"
android:entries="@array/network_policy"
@@ -56,6 +50,17 @@
android:valueTo="5"
app:defaultValue="2" />
<ListPreference
android:entries="@array/doh_providers"
android:key="doh"
android:title="@string/dns_over_https"
app:allowDividerAbove="true"
app:useSimpleSummaryProvider="true" />
<SwitchPreferenceCompat
android:key="ssl_bypass"
android:title="Ignore SSL errors" />
<PreferenceScreen
android:fragment="org.koitharu.kotatsu.settings.backup.BackupSettingsFragment"
android:title="@string/backup_restore"