mirror of
https://github.com/mihonapp/mihon.git
synced 2025-08-05 14:21:31 +02:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
493ad93957 | ||
|
dbe8f3cfbe | ||
|
08cdac968d | ||
|
f12d5ba689 | ||
|
0afd77d110 | ||
|
7551941ef2 | ||
|
9ca0307e1c | ||
|
9a6f8be28c |
.github
README.mdapp
build.gradle
2
.github/ISSUE_TEMPLATE.md
vendored
2
.github/ISSUE_TEMPLATE.md
vendored
@@ -4,6 +4,8 @@
|
||||
|
||||
**App version:**
|
||||
|
||||
**Android version:**
|
||||
|
||||
**Issue/Request:**
|
||||
|
||||
**Steps to reproduce (if applicable)**
|
||||
|
@@ -1,6 +1,6 @@
|
||||
| Build | Stable | Dev | Contribute | Contact |
|
||||
|-------|----------|---------|------------|---------|
|
||||
| [](https://travis-ci.org/inorichi/tachiyomi) | [)](https://github.com/inorichi/tachiyomi/releases) | [](http://tachiyomi.kanade.eu/latest) [](//github.com/inorichi/tachiyomi/wiki/F-Droid-for-dev-versions) | [](https://hosted.weblate.org/engage/tachiyomi/?utm_source=widget) | [](https://discord.gg/tachiyomi) |
|
||||
| [](https://travis-ci.org/inorichi/tachiyomi) | [)](https://github.com/inorichi/tachiyomi/releases) | [](http://tachiyomi.kanade.eu/latest) | [](https://hosted.weblate.org/engage/tachiyomi/?utm_source=widget) | [](https://discord.gg/tachiyomi) |
|
||||
|
||||
|
||||
# Tachiyomi
|
||||
@@ -23,7 +23,7 @@ Features include:
|
||||
## Download
|
||||
Get the app from our [releases page](https://github.com/inorichi/tachiyomi/releases).
|
||||
|
||||
If you want to try new features before they get to the stable release, you can download the dev version [here](http://tachiyomi.kanade.eu/latest) (auto-updates not included), or add our [F-Droid repo](https://github.com/inorichi/tachiyomi/wiki/F-Droid-for-dev-versions).
|
||||
If you want to try new features before they get to the stable release, you can download the dev version [here](http://tachiyomi.kanade.eu/latest). (auto-updates not included)
|
||||
|
||||
## Issues, Feature Requests and Contributing
|
||||
|
||||
|
@@ -38,8 +38,8 @@ android {
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 27
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
versionCode 39
|
||||
versionName "0.8.1"
|
||||
versionCode 40
|
||||
versionName "0.8.2"
|
||||
|
||||
buildConfigField "String", "COMMIT_COUNT", "\"${getCommitCount()}\""
|
||||
buildConfigField "String", "COMMIT_SHA", "\"${getGitSha()}\""
|
||||
@@ -161,7 +161,9 @@ dependencies {
|
||||
implementation 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'
|
||||
|
||||
// Database
|
||||
implementation 'eu.kanade.storio:storio:1.13.0'
|
||||
implementation 'android.arch.persistence:db:1.0.0'
|
||||
implementation 'com.github.inorichi.storio:storio-common:8be19de@aar'
|
||||
implementation 'com.github.inorichi.storio:storio-sqlite:8be19de@aar'
|
||||
implementation 'io.requery:sqlite-android:3.25.2'
|
||||
|
||||
// Model View Presenter
|
||||
|
@@ -12,8 +12,22 @@ class CloudflareInterceptor : Interceptor {
|
||||
|
||||
private val challengePattern = Regex("""name="jschl_vc" value="(\w+)"""")
|
||||
|
||||
private val sPattern = Regex("""name="s" value="([^"]+)""")
|
||||
|
||||
private val kPattern = Regex("""k\s+=\s+'([^']+)';""")
|
||||
|
||||
private val serverCheck = arrayOf("cloudflare-nginx", "cloudflare")
|
||||
|
||||
private interface IBase64 {
|
||||
fun decode(input: String): String
|
||||
}
|
||||
|
||||
private val b64: IBase64 = object : IBase64 {
|
||||
override fun decode(input: String): String {
|
||||
return okio.ByteString.decodeBase64(input)!!.utf8()
|
||||
}
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
override fun intercept(chain: Interceptor.Chain): Response {
|
||||
val response = chain.proceed(chain.request())
|
||||
@@ -45,23 +59,36 @@ class CloudflareInterceptor : Interceptor {
|
||||
val operation = operationPattern.find(content)?.groups?.get(1)?.value
|
||||
val challenge = challengePattern.find(content)?.groups?.get(1)?.value
|
||||
val pass = passPattern.find(content)?.groups?.get(1)?.value
|
||||
val s = sPattern.find(content)?.groups?.get(1)?.value
|
||||
|
||||
if (operation == null || challenge == null || pass == null) {
|
||||
// If `k` is null, it uses old methods.
|
||||
val k = kPattern.find(content)?.groups?.get(1)?.value ?: ""
|
||||
val innerHTMLValue = Regex("""<div(.*)id="$k"(.*)>(.*)</div>""")
|
||||
.find(content)?.groups?.get(3)?.value ?: ""
|
||||
|
||||
if (operation == null || challenge == null || pass == null || s == null) {
|
||||
throw Exception("Failed resolving Cloudflare challenge")
|
||||
}
|
||||
|
||||
// Export native Base64 decode function to js object.
|
||||
duktape.set("b64", IBase64::class.java, b64)
|
||||
|
||||
// Return simulated innerHTML when call DOM.
|
||||
val simulatedDocumentJS = """var document = { getElementById: function (x) { return { innerHTML: "$innerHTMLValue" }; } }"""
|
||||
|
||||
val js = operation
|
||||
.replace(Regex("""a\.value = (.+ \+ t\.length(\).toFixed\(10\))?).+"""), "$1")
|
||||
.replace(Regex("""a\.value = (.+\.toFixed\(10\);).+"""), "$1")
|
||||
.replace(Regex("""\s{3,}[a-z](?: = |\.).+"""), "")
|
||||
.replace("t.length", "${domain.length}")
|
||||
.replace("\n", "")
|
||||
|
||||
val result = duktape.evaluate(js) as String
|
||||
val result = duktape.evaluate("""$simulatedDocumentJS;$ATOB_JS;var t="$domain";$js""") as String
|
||||
|
||||
val cloudflareUrl = HttpUrl.parse("${url.scheme()}://$domain/cdn-cgi/l/chk_jschl")!!
|
||||
.newBuilder()
|
||||
.addQueryParameter("jschl_vc", challenge)
|
||||
.addQueryParameter("pass", pass)
|
||||
.addQueryParameter("s", s)
|
||||
.addQueryParameter("jschl_answer", result)
|
||||
.toString()
|
||||
|
||||
@@ -76,4 +103,8 @@ class CloudflareInterceptor : Interceptor {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
companion object {
|
||||
// atob() is browser API, Using Android's own function. (java.util.Base64 can't be used because of min API level)
|
||||
private const val ATOB_JS = """var atob = function (input) { return b64.decode(input) }"""
|
||||
}
|
||||
}
|
@@ -116,21 +116,15 @@ class ReaderProgressBar @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the aggregated visibility of this view changes. It also starts of stops the
|
||||
* rotation animation according to [isVisible].
|
||||
* Called when the visibility of this view changes.
|
||||
*/
|
||||
override fun onVisibilityAggregated(isVisible: Boolean) {
|
||||
super.onVisibilityAggregated(isVisible)
|
||||
|
||||
if (isVisible != aggregatedIsVisible) {
|
||||
aggregatedIsVisible = isVisible
|
||||
|
||||
// let's be nice with the UI thread
|
||||
if (isVisible) {
|
||||
startAnimation()
|
||||
} else {
|
||||
stopAnimation()
|
||||
}
|
||||
override fun setVisibility(visibility: Int) {
|
||||
super.setVisibility(visibility)
|
||||
val isVisible = visibility == View.VISIBLE
|
||||
if (isVisible) {
|
||||
startAnimation()
|
||||
} else {
|
||||
stopAnimation()
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -29,9 +29,9 @@ class SettingsGeneralController : SettingsController() {
|
||||
listPreference {
|
||||
key = Keys.lang
|
||||
titleRes = R.string.pref_language
|
||||
entryValues = arrayOf("", "ar", "bg", "bn", "de", "en-US", "en-GB", "es", "fr", "hi",
|
||||
"hu", "in", "it", "ja", "ko", "lv", "ms", "nl", "pl", "pt", "pt-BR", "ro",
|
||||
"ru", "tr", "vi")
|
||||
entryValues = arrayOf("", "ar", "bg", "bn", "ca", "cs", "de", "el", "en-US", "en-GB",
|
||||
"es", "fr", "hi", "hu", "in", "it", "ja", "ko", "lv", "ms", "nb-rNO", "nl", "pl", "pt",
|
||||
"pt-BR", "ro", "ru", "sr", "sv", "th", "tr", "uk", "vi", "zh-rCN")
|
||||
entries = entryValues.map { value ->
|
||||
val locale = LocaleHelper.getLocaleFromString(value.toString())
|
||||
locale?.getDisplayName(locale)?.capitalize() ?:
|
||||
|
@@ -51,7 +51,12 @@ fun syncChaptersWithSource(db: DatabaseHelper,
|
||||
toAdd.add(sourceChapter)
|
||||
} else {
|
||||
//this forces metadata update for the main viewable things in the chapter list
|
||||
if (source is HttpSource) {
|
||||
source.prepareNewChapter(sourceChapter, manga)
|
||||
}
|
||||
|
||||
ChapterRecognition.parseChapterNumber(sourceChapter, manga)
|
||||
|
||||
if (shouldUpdateDbChapter(dbChapter, sourceChapter)) {
|
||||
dbChapter.scanlator = sourceChapter.scanlator
|
||||
dbChapter.name = sourceChapter.name
|
||||
|
@@ -1,5 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<changelog bulletedList="true">
|
||||
<changelogversion versionName="v0.8.2" changeDate="">
|
||||
<changelogtext>Updated Cloudflare.</changelogtext>
|
||||
<changelogtext>Fixed crashes with some translations.</changelogtext>
|
||||
</changelogversion>
|
||||
|
||||
<changelogversion versionName="v0.8.1" changeDate="">
|
||||
<changelogtext>Fixed latest Cloudflare changes.</changelogtext>
|
||||
<changelogtext>Bundled SQLite for better performance and new features.</changelogtext>
|
||||
|
@@ -402,7 +402,7 @@
|
||||
<string name="invalid_combination">Le défaut ne peut pas être selectionné avec des autres catégories</string>
|
||||
<string name="delete_downloads_for_manga">Supprimer les chapitres téléchargés ?</string>
|
||||
|
||||
<string name="notification_new_chapters_text">Pour %1$s chapitres</string>
|
||||
<string name="notification_new_chapters_text">Pour %1$d chapitres</string>
|
||||
<string name="track">Suivi</string>
|
||||
<string name="action_sort_total">Nombre de chapitres</string>
|
||||
<string name="short_recent_updates">Actualisations</string>
|
||||
@@ -522,4 +522,4 @@ Assurez-vous que vous êtes connecté à des sources qui le demande avant de com
|
||||
<string name="migrating">En cours de déplacement…</string>
|
||||
|
||||
<string name="darkblue_theme">Bleu foncé</string>
|
||||
</resources>
|
||||
</resources>
|
||||
|
@@ -14,7 +14,7 @@
|
||||
<string name="label_recent_updates">पुस्तकालय अद्यतन</string>
|
||||
<string name="label_latest_updates">नवीनतम अद्यतन</string>
|
||||
<string name="label_categories">श्रेणियाँ</string>
|
||||
<string name="label_selected">श्रेणियाँ</string>
|
||||
<string name="label_selected">श्रेणियाँ %1$d</string>
|
||||
<string name="label_backup">बैकअप</string>
|
||||
|
||||
|
||||
@@ -475,4 +475,4 @@
|
||||
<string name="transition_pages_error">पृष्ठों को लोड करने में विफल है: %1$s</string>
|
||||
|
||||
<string name="darkblue_theme">गहरा नीला</string>
|
||||
</resources>
|
||||
</resources>
|
||||
|
@@ -366,16 +366,13 @@
|
||||
<string name="color_filter_r_value">R</string>
|
||||
<string name="pref_download_new_categories">Categorias para incluir na transferência</string>
|
||||
<string name="pref_backup_directory">Pasta de Backups</string>
|
||||
<string name="dialog_restoring_backup">A restaurar backup...
|
||||
\n%1$ adicionado a biblioteca</string>
|
||||
<string name="dialog_restoring_source_not_found">A restaurar backup...
|
||||
\n%1$ Fonte não encontrada</string>
|
||||
<string name="dialog_restoring_backup">A restaurar backup…\n%1$s adicionado a biblioteca</string>
|
||||
<string name="dialog_restoring_source_not_found">A restaurar backup…\n%1$s Fonte não encontrada</string>
|
||||
<string name="backup_created">Backup criado</string>
|
||||
<string name="restore_completed">Restauro completo</string>
|
||||
<string name="error_opening_log">Não foi possivel abrir o registo</string>
|
||||
<string name="restore_completed_content">Restauro levou %1$.
|
||||
\n%2$ erros encontrados.</string>
|
||||
<string name="file_saved">Ficheiro salvo em %1$</string>
|
||||
<string name="restore_completed_content">Restauro levou %1$s.\n%2$s erros encontrados.</string>
|
||||
<string name="file_saved">Ficheiro salvo em %1$s</string>
|
||||
<string name="backup_choice">O que pretende fazer backup\?</string>
|
||||
<string name="pref_refresh_library_metadata">Refrescar metadata da biblioteca</string>
|
||||
<string name="pref_backup_slots">Máximo de backups automáticos</string>
|
||||
@@ -384,4 +381,4 @@
|
||||
<string name="ext_trust">Confiar</string>
|
||||
<string name="ext_untrusted">Não confiar</string>
|
||||
<string name="download_custom">Transferir personalizado</string>
|
||||
</resources>
|
||||
</resources>
|
||||
|
@@ -242,7 +242,7 @@
|
||||
<string name="backup_created">Copie de rezervă creată</string>
|
||||
<string name="restore_completed">Restaurare completă</string>
|
||||
<string name="error_opening_log">Nu s-a putut deschide log</string>
|
||||
<string name="restore_completed_content">Restaurarea a durat %$s.
|
||||
<string name="restore_completed_content">Restaurarea a durat %1$s.
|
||||
\n%2$s erori găsite.</string>
|
||||
<string name="backup_restore_content">Restaurare folosește sursa pentru a aduce datele, cost suplimentar aplicabil. De asemenea verificați dacă sunteți autentificați în sursele ce au nevoie înainte de a incepe restaurarea.</string>
|
||||
<string name="file_saved">Fișier salvat in %1$s</string>
|
||||
@@ -395,7 +395,7 @@
|
||||
<string name="downloading">Descărcare…</string>
|
||||
<string name="download_progress">Descărcat %1$d%%</string>
|
||||
<string name="chapter_progress">Pagina: %1$d</string>
|
||||
<string name="chapter_subtitle">Capitolul %1$d</string>
|
||||
<string name="chapter_subtitle">Capitolul %1$s</string>
|
||||
<string name="no_next_chapter">Capitolul următor nu a fost găsit</string>
|
||||
<string name="no_previous_chapter">Capitolul precedent nu a fost găsit</string>
|
||||
<string name="decode_image_error">Imaginea nu a putu fi decodată</string>
|
||||
|
@@ -22,6 +22,5 @@ allprojects {
|
||||
maven { url "https://jitpack.io" }
|
||||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||
jcenter()
|
||||
maven { url "https://dl.bintray.com/inorichi/maven" }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user