Update some domain (#8380)

* TruyenVN update domain

* LXManga update domain

* TopTruyen update domain

* ManhuaRock update domain & add option domain switch
This commit is contained in:
are-are-are 2025-04-06 23:43:28 +07:00 committed by Draff
parent d8e635afac
commit 8dcfac5ba8
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
9 changed files with 60 additions and 12 deletions

View File

@ -14,7 +14,7 @@
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="lxmanga.cloud"
android:host="lxmanga.sbs"
android:pathPattern="/truyen/..*"
android:scheme="https" />
</intent-filter>

View File

@ -1,7 +1,7 @@
ext {
extName = 'LXManga'
extClass = '.LxHentai'
extVersionCode = 17
extVersionCode = 18
isNsfw = true
}

View File

@ -29,7 +29,7 @@ class LxHentai : ParsedHttpSource(), ConfigurableSource {
override val id = 6495630445796108150
private val defaultBaseUrl = "https://lxmanga.art"
private val defaultBaseUrl = "https://lxmanga.sbs"
override val baseUrl by lazy { getPrefBaseUrl() }

View File

@ -1,7 +1,7 @@
ext {
extName = "ManhuaRock"
extClass = ".ManhuaRock"
extVersionCode = 12
extVersionCode = 13
}
apply from: "$rootDir/common.gradle"

View File

@ -1,14 +1,20 @@
package eu.kanade.tachiyomi.extension.vi.manhuarock
import android.content.SharedPreferences
import android.util.Log
import android.widget.Toast
import androidx.preference.EditTextPreference
import androidx.preference.PreferenceScreen
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import keiyoushi.utils.getPreferences
import kotlinx.serialization.Serializable
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
@ -25,7 +31,7 @@ import java.text.SimpleDateFormat
import java.util.Locale
import java.util.TimeZone
class ManhuaRock : ParsedHttpSource() {
class ManhuaRock : ParsedHttpSource(), ConfigurableSource {
// Site changed from FMReader to some Madara copycat
override val versionId = 2
@ -34,7 +40,11 @@ class ManhuaRock : ParsedHttpSource() {
override val lang = "vi"
override val baseUrl = "https://manhuarock2.com"
private val defaultBaseUrl = "https://manhuarock1.site"
override val baseUrl by lazy { getPrefBaseUrl() }
private val preferences: SharedPreferences = getPreferences()
override val supportsLatest = true
@ -246,4 +256,42 @@ class ManhuaRock : ParsedHttpSource() {
Slug("Adult", "the-loai/adult"),
Slug("Action", "the-loai/action"),
)
init {
preferences.getString(DEFAULT_BASE_URL_PREF, null).let { prefDefaultBaseUrl ->
if (prefDefaultBaseUrl != defaultBaseUrl) {
preferences.edit()
.putString(BASE_URL_PREF, defaultBaseUrl)
.putString(DEFAULT_BASE_URL_PREF, defaultBaseUrl)
.apply()
}
}
}
private fun getPrefBaseUrl(): String = preferences.getString(BASE_URL_PREF, defaultBaseUrl)!!
override fun setupPreferenceScreen(screen: PreferenceScreen) {
EditTextPreference(screen.context).apply {
key = BASE_URL_PREF
title = BASE_URL_PREF_TITLE
summary = BASE_URL_PREF_SUMMARY
setDefaultValue(defaultBaseUrl)
dialogTitle = BASE_URL_PREF_TITLE
dialogMessage = "Default: $defaultBaseUrl"
setOnPreferenceChangeListener { _, _ ->
Toast.makeText(screen.context, RESTART_APP, Toast.LENGTH_LONG).show()
true
}
}.let(screen::addPreference)
}
companion object {
private const val DEFAULT_BASE_URL_PREF = "defaultBaseUrl"
private const val RESTART_APP = "Khởi chạy lại ứng dụng để áp dụng thay đổi."
private const val BASE_URL_PREF_TITLE = "Ghi đè URL cơ sở"
private const val BASE_URL_PREF = "overrideBaseUrl"
private const val BASE_URL_PREF_SUMMARY =
"Dành cho sử dụng tạm thời, cập nhật tiện ích sẽ xóa cài đặt."
}
}

View File

@ -2,8 +2,8 @@ ext {
extName = 'Top Truyen'
extClass = '.TopTruyen'
themePkg = 'wpcomics'
baseUrl = 'https://www.toptruyentv2.pro'
overrideVersionCode = 10
baseUrl = 'https://www.toptruyentv3.pro'
overrideVersionCode = 11
isNsfw = true
}

View File

@ -23,7 +23,7 @@ import java.util.TimeZone
class TopTruyen :
WPComics(
"Top Truyen",
"https://www.toptruyentv2.pro",
"https://www.toptruyentv3.pro",
"vi",
dateFormat = SimpleDateFormat("dd-MM-yyyy", Locale.ROOT).apply {
timeZone = TimeZone.getTimeZone("Asia/Ho_Chi_Minh")

View File

@ -2,8 +2,8 @@ ext {
extName = 'TruyenVN'
extClass = '.TruyenVN'
themePkg = 'madara'
baseUrl = 'https://truyenvn.tech'
overrideVersionCode = 13
baseUrl = 'https://truyenvn.ac'
overrideVersionCode = 14
isNsfw = true
}

View File

@ -12,7 +12,7 @@ import java.util.Locale
class TruyenVN :
Madara(
"TruyenVN",
"https://truyenvn.tech",
"https://truyenvn.ac",
"vi",
dateFormat = SimpleDateFormat("dd/MM/yyyy", Locale.ROOT),
),