Skip to content

Commit

Permalink
v3.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
15dd committed Oct 18, 2024
1 parent ed276d7 commit 402efc0
Show file tree
Hide file tree
Showing 14 changed files with 115 additions and 100 deletions.
11 changes: 11 additions & 0 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
applicationId = "com.cyh128.hikari_novel"
minSdk = 24
targetSdk = 34
versionCode = 241007
versionName = "3.1.0"
versionCode = 241018
versionName = "3.1.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -80,12 +80,13 @@ dependencies {
//android相关
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("com.google.android.material:material:1.13.0-alpha06")
implementation("com.google.android.material:material:1.13.0-alpha07")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.recyclerview:recyclerview:1.3.2")
implementation("androidx.viewpager2:viewpager2:1.1.0")
implementation("androidx.navigation:navigation-fragment-ktx:2.8.2")
implementation("androidx.navigation:navigation-ui-ktx:2.8.2")

implementation("androidx.navigation:navigation-fragment-ktx:2.8.3")
implementation("androidx.navigation:navigation-ui-ktx:2.8.3")

//数据库
implementation("androidx.room:room-ktx:2.6.1")
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
3 changes: 2 additions & 1 deletion app/src/main/java/com/cyh128/hikari_novel/HikariApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import dagger.hilt.android.HiltAndroidApp
import okhttp3.OkHttpClient
import rxhttp.RxHttpPlugins
import rxhttp.wrapper.cookie.CookieStore
import java.util.Locale
import javax.net.ssl.SSLSession


Expand All @@ -33,6 +34,6 @@ class HikariApp : Application() {
.errorActivity(CrashActivity::class.java)
.apply()

Lingver.init(this)
Lingver.init(this, Locale.SIMPLIFIED_CHINESE)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,14 @@ class Wenku8Repository @Inject constructor(
val requestUrl: String?
val charset: String?
when(Lingver.getInstance().getLocale()) {
Locale.SIMPLIFIED_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/modules/article/toplist.php?sort=$ranking&page=$index"
charset = "GBK"
}
Locale.TRADITIONAL_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/modules/article/toplist.php?sort=$ranking&page=$index&charset=big5"
charset = "BIG5-HKSCS"
}
else -> throw RuntimeException()
else -> {
requestUrl = "https://${getWenku8Node()}/modules/article/toplist.php?sort=$ranking&page=$index"
charset = "GBK"
}
}
network.getData(requestUrl)
.awaitResult { body ->
Expand All @@ -101,15 +100,14 @@ class Wenku8Repository @Inject constructor(
val requestUrl: String?
val charset: String?
when(Lingver.getInstance().getLocale()) {
Locale.SIMPLIFIED_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/modules/article/tags.php?t=$category&v=$sort&page=$index"
charset = "GBK"
}
Locale.TRADITIONAL_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/modules/article/tags.php?t=$category&v=$sort&page=$index&charset=big5"
charset = "BIG5-HKSCS"
}
else -> throw RuntimeException()
else -> {
requestUrl = "https://${getWenku8Node()}/modules/article/tags.php?t=$category&v=$sort&page=$index"
charset = "GBK"
}
}
network.getData(requestUrl)
.awaitResult { body ->
Expand All @@ -128,15 +126,14 @@ class Wenku8Repository @Inject constructor(
val requestUrl: String?
val charset: String?
when(Lingver.getInstance().getLocale()) {
Locale.SIMPLIFIED_CHINESE -> {
requestUrl = url
charset = "GBK"
}
Locale.TRADITIONAL_CHINESE -> {
requestUrl = "$url&charset=big5"
charset = "BIG5-HKSCS" //不能使用普通的big5编码,不然无法显示日文
}
else -> throw RuntimeException()
else -> {
requestUrl = url
charset = "GBK"
}
}
network.getData(requestUrl)
.awaitResult { body ->
Expand All @@ -155,15 +152,14 @@ class Wenku8Repository @Inject constructor(
val requestUrl: String?
val charset: String?
when(Lingver.getInstance().getLocale()) {
Locale.SIMPLIFIED_CHINESE -> {
requestUrl = url
charset = "GBK"
}
Locale.TRADITIONAL_CHINESE -> {
requestUrl = "$url?charset=big5"
charset = "BIG5-HKSCS"
}
else -> throw RuntimeException()
else -> {
requestUrl = url
charset = "GBK"
}
}
network.getData(requestUrl)
.awaitResult { body ->
Expand All @@ -181,15 +177,14 @@ class Wenku8Repository @Inject constructor(
val requestUrl: String?
val charset: String?
when(Lingver.getInstance().getLocale()) {
Locale.SIMPLIFIED_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/modules/article/addbookcase.php?bid=$aid"
charset = "GBK"
}
Locale.TRADITIONAL_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/modules/article/addbookcase.php?bid=$aid&charset=big5"
charset = "BIG5-HKSCS"
}
else -> throw RuntimeException()
else -> {
requestUrl = "https://${getWenku8Node()}/modules/article/addbookcase.php?bid=$aid"
charset = "GBK"
}
}
network.getData(requestUrl)
.awaitResult { body ->
Expand Down Expand Up @@ -218,15 +213,14 @@ class Wenku8Repository @Inject constructor(
val requestUrl: String?
val charset: String?
when(Lingver.getInstance().getLocale()) {
Locale.SIMPLIFIED_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/modules/article/bookcase.php"
charset = "GBK"
}
Locale.TRADITIONAL_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/modules/article/bookcase.php?charset=big5"
charset = "BIG5-HKSCS"
}
else -> throw RuntimeException()
else -> {
requestUrl = "https://${getWenku8Node()}/modules/article/bookcase.php"
charset = "GBK"
}
}
network.getData(requestUrl)
.awaitResult { body ->
Expand All @@ -244,15 +238,14 @@ class Wenku8Repository @Inject constructor(
val requestUrl: String?
val charset: String?
when(Lingver.getInstance().getLocale()) {
Locale.SIMPLIFIED_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/modules/article/reviews.php?aid=$aid&page=$index"
charset = "GBK"
}
Locale.TRADITIONAL_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/modules/article/reviews.php?aid=$aid&page=$index&charset=big5"
charset = "BIG5-HKSCS"
}
else -> throw RuntimeException()
else -> {
requestUrl = "https://${getWenku8Node()}/modules/article/reviews.php?aid=$aid&page=$index"
charset = "GBK"
}
}
network.getData(requestUrl)
.awaitResult { body ->
Expand All @@ -270,15 +263,14 @@ class Wenku8Repository @Inject constructor(
val requestUrl: String?
val charset: String?
when(Lingver.getInstance().getLocale()) {
Locale.SIMPLIFIED_CHINESE -> {
requestUrl = "$url&page=$index"
charset = "GBK"
}
Locale.TRADITIONAL_CHINESE -> {
requestUrl = "$url&page=$index&charset=big5"
charset = "BIG5-HKSCS"
}
else -> throw RuntimeException()
else -> {
requestUrl = "$url&page=$index"
charset = "GBK"
}
}
network.getData(requestUrl)
.awaitResult { body ->
Expand All @@ -295,15 +287,14 @@ class Wenku8Repository @Inject constructor(
val requestUrl: String?
val charset: String?
when(Lingver.getInstance().getLocale()) {
Locale.SIMPLIFIED_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/index.php"
charset = "GBK"
}
Locale.TRADITIONAL_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/index.php?charset=big5"
charset = "BIG5-HKSCS"
}
else -> throw RuntimeException()
else -> {
requestUrl = "https://${getWenku8Node()}/index.php"
charset = "GBK"
}
}
network.getData(requestUrl)
.awaitResult { body ->
Expand All @@ -321,15 +312,14 @@ class Wenku8Repository @Inject constructor(
val requestUrl: String?
val charset: String?
when(Lingver.getInstance().getLocale()) {
Locale.SIMPLIFIED_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/modules/article/uservote.php?id=$aid"
charset = "GBK"
}
Locale.TRADITIONAL_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/modules/article/uservote.php?id=$aid&charset=big5"
charset = "BIG5-HKSCS"
}
else -> throw RuntimeException()
else -> {
requestUrl = "https://${getWenku8Node()}/modules/article/uservote.php?id=$aid"
charset = "GBK"
}
}
network.getData(requestUrl)
.awaitResult { body ->
Expand All @@ -347,15 +337,14 @@ class Wenku8Repository @Inject constructor(
val requestUrl: String?
val charset: String?
when(Lingver.getInstance().getLocale()) {
Locale.SIMPLIFIED_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/modules/article/search.php?searchtype=articlename&searchkey=$title&page=$index"
charset = "GBK"
}
Locale.TRADITIONAL_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/modules/article/search.php?searchtype=articlename&searchkey=$title&page=$index&charset=big5"
charset = "BIG5-HKSCS"
}
else -> throw RuntimeException()
else -> {
requestUrl = "https://${getWenku8Node()}/modules/article/search.php?searchtype=articlename&searchkey=$title&page=$index"
charset = "GBK"
}
}
network.getData(requestUrl)
.awaitResult { body ->
Expand All @@ -380,15 +369,14 @@ class Wenku8Repository @Inject constructor(
val requestUrl: String?
val charset: String?
when(Lingver.getInstance().getLocale()) {
Locale.SIMPLIFIED_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/modules/article/search.php?searchtype=author&searchkey=$author&page=$index"
charset = "GBK"
}
Locale.TRADITIONAL_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/modules/article/search.php?searchtype=author&searchkey=$author&page=$index&charset=big5"
charset = "BIG5-HKSCS"
}
else -> throw RuntimeException()
else -> {
requestUrl = "https://${getWenku8Node()}/modules/article/search.php?searchtype=author&searchkey=$author&page=$index"
charset = "GBK"
}
}
network.getData(requestUrl)
.awaitResult { body ->
Expand Down Expand Up @@ -418,15 +406,14 @@ class Wenku8Repository @Inject constructor(
val requestUrl: String?
val charset: String?
when(Lingver.getInstance().getLocale()) {
Locale.SIMPLIFIED_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/userdetail.php"
charset = "GBK"
}
Locale.TRADITIONAL_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/userdetail.php?charset=big5"
charset = "BIG5-HKSCS"
}
else -> throw RuntimeException()
else -> {
requestUrl = "https://${getWenku8Node()}/userdetail.php"
charset = "GBK"
}
}
network.getData(requestUrl)
.awaitResult { body ->
Expand All @@ -444,15 +431,14 @@ class Wenku8Repository @Inject constructor(
val requestUrl: String?
val charset: String?
when(Lingver.getInstance().getLocale()) {
Locale.SIMPLIFIED_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/modules/article/articlelist.php?fullflag=1&page=$index"
charset = "GBK"
}
Locale.TRADITIONAL_CHINESE -> {
requestUrl = "https://${getWenku8Node()}/modules/article/articlelist.php?fullflag=1&page=$index&charset=big5"
charset = "BIG5-HKSCS"
}
else -> throw RuntimeException()
else -> {
requestUrl = "https://${getWenku8Node()}/modules/article/articlelist.php?fullflag=1&page=$index"
charset = "GBK"
}
}
network.getData(requestUrl)
.awaitResult { body ->
Expand All @@ -473,9 +459,8 @@ class Wenku8Repository @Inject constructor(
//获取小说内容
suspend fun getNovelContent(aid: String, cid: String): Result<ChapterContentResponse> {
val requestUrl = when(Lingver.getInstance().getLocale()) {
Locale.SIMPLIFIED_CHINESE -> "action=book&do=text&aid=$aid&cid=$cid&t=0"
Locale.TRADITIONAL_CHINESE -> "action=book&do=text&aid=$aid&cid=$cid&t=1"
else -> throw RuntimeException()
else -> "action=book&do=text&aid=$aid&cid=$cid&t=0"
}
network.getDataFromAppWenku8Com(requestUrl)
.awaitResult {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package com.cyh128.hikari_novel.ui.view.other
import android.os.Bundle
import com.cyh128.hikari_novel.base.BaseActivity
import com.cyh128.hikari_novel.databinding.ActivityCrashBinding
import com.cyh128.hikari_novel.ui.view.main.more.more.setting.SettingActivity
import com.cyh128.hikari_novel.util.openUrl
import com.cyh128.hikari_novel.util.startActivity
import com.developer.crashx.CrashActivity

class CrashActivity: BaseActivity<ActivityCrashBinding>() {
Expand All @@ -17,5 +19,8 @@ class CrashActivity: BaseActivity<ActivityCrashBinding>() {
binding.bACrashReport.setOnClickListener {
openUrl("https://github.com/15dd/wenku8reader/issues")
}
binding.bACrashSetting.setOnClickListener {
startActivity<SettingActivity>()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class ReadActivity : BaseActivity<ActivityHorizontalReadBinding>() {
bottomViewBinding.sVHReadConfigRestoreChapterReadHistory.isChecked = false
}
.setNegativeButton(R.string.not_restore) { _, _ -> }
.setPositiveButton(R.string.restore_chapter_read_history) { _, _ ->
.setPositiveButton(R.string.restore_chapter_read_history_with_confirm) { _, _ ->
binding.pvAHRead.pageNum = it.location
}
.show()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class ReadFragment : BaseFragment<FragmentVerticalReadBinding>() {
(requireActivity() as ReadActivity).setRestoreChapterReadHistoryDisable()
}
.setNegativeButton(R.string.not_restore) { _, _ -> }
.setPositiveButton(R.string.restore_chapter_read_history) { _, _ ->
.setPositiveButton(R.string.restore_chapter_read_history_with_confirm) { _, _ ->
binding.nsvFVRead.scrollTo(0, it.location) //滚动到指定位置
}
.show()
Expand Down
Loading

0 comments on commit 402efc0

Please sign in to comment.