diff --git a/app/src/main/java/io/legado/app/data/AppDatabase.kt b/app/src/main/java/io/legado/app/data/AppDatabase.kt
index 7e141d90a..1cb68c80d 100644
--- a/app/src/main/java/io/legado/app/data/AppDatabase.kt
+++ b/app/src/main/java/io/legado/app/data/AppDatabase.kt
@@ -20,7 +20,7 @@ val appDb by lazy {
}
@Database(
- version = 48,
+ version = 49,
exportSchema = true,
entities = [Book::class, BookGroup::class, BookSource::class, BookChapter::class,
ReplaceRule::class, SearchBook::class, SearchKeyword::class, Cookie::class,
@@ -32,7 +32,8 @@ val appDb by lazy {
AutoMigration(from = 44, to = 45),
AutoMigration(from = 45, to = 46),
AutoMigration(from = 46, to = 47),
- AutoMigration(from = 47, to = 48)
+ AutoMigration(from = 47, to = 48),
+ AutoMigration(from = 48, to = 49)
]
)
abstract class AppDatabase : RoomDatabase() {
diff --git a/app/src/main/java/io/legado/app/data/entities/BookSource.kt b/app/src/main/java/io/legado/app/data/entities/BookSource.kt
index 228ba7915..85cf985b0 100644
--- a/app/src/main/java/io/legado/app/data/entities/BookSource.kt
+++ b/app/src/main/java/io/legado/app/data/entities/BookSource.kt
@@ -38,6 +38,9 @@ data class BookSource(
var enabled: Boolean = true,
// 启用发现
var enabledExplore: Boolean = true,
+ // 启用okhttp CookieJAr 自动保存每次请求的cookie
+ @ColumnInfo(defaultValue = "0")
+ var enabledCookieJar: Boolean = false,
// 并发率
override var concurrentRate: String? = null,
// 请求头
diff --git a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt
index 3f647fa46..a280057f9 100644
--- a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt
+++ b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt
@@ -190,6 +190,7 @@ class BookSourceEditActivity :
source?.let {
binding.cbIsEnable.isChecked = it.enabled
binding.cbIsEnableFind.isChecked = it.enabledExplore
+ binding.cbIsEnableCookie.isChecked = it.enabledCookieJar
binding.spType.setSelection(
when (it.bookSourceType) {
BookType.file -> 3
@@ -296,6 +297,7 @@ class BookSourceEditActivity :
val source = viewModel.bookSource?.copy() ?: BookSource()
source.enabled = binding.cbIsEnable.isChecked
source.enabledExplore = binding.cbIsEnableFind.isChecked
+ source.enabledCookieJar = binding.cbIsEnableCookie.isChecked
source.bookSourceType = when (binding.spType.selectedItemPosition) {
3 -> BookType.file
2 -> BookType.image
diff --git a/app/src/main/res/layout/activity_book_source_edit.xml b/app/src/main/res/layout/activity_book_source_edit.xml
index a6f529472..ceae414f2 100644
--- a/app/src/main/res/layout/activity_book_source_edit.xml
+++ b/app/src/main/res/layout/activity_book_source_edit.xml
@@ -33,6 +33,13 @@
android:checked="true"
android:text="@string/discovery" />
+
+
导入TTS
导入主题
导入txt目录规则
+ 自动保存cookie
diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml
index 7dfa85ddd..4d529828a 100644
--- a/app/src/main/res/values-ja-rJP/strings.xml
+++ b/app/src/main/res/values-ja-rJP/strings.xml
@@ -981,5 +981,6 @@
导入TTS
导入主题
导入txt目录规则
+ 自动保存cookie
diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml
index 1267823f2..81abdb45e 100644
--- a/app/src/main/res/values-pt-rBR/strings.xml
+++ b/app/src/main/res/values-pt-rBR/strings.xml
@@ -981,5 +981,6 @@
导入TTS
导入主题
导入txt目录规则
+ 自动保存cookie
diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml
index ef0fe4e40..4bda45ccd 100644
--- a/app/src/main/res/values-zh-rHK/strings.xml
+++ b/app/src/main/res/values-zh-rHK/strings.xml
@@ -978,5 +978,6 @@
导入TTS
导入主题
导入txt目录规则
+ 自动保存cookie
diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml
index 5af20d737..7cc8a41f3 100644
--- a/app/src/main/res/values-zh-rTW/strings.xml
+++ b/app/src/main/res/values-zh-rTW/strings.xml
@@ -980,5 +980,6 @@
导入TTS
导入主题
导入txt目录规则
+ 自动保存cookie
diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml
index b7204f02d..62dce0ac4 100644
--- a/app/src/main/res/values-zh/strings.xml
+++ b/app/src/main/res/values-zh/strings.xml
@@ -980,5 +980,6 @@
导入TTS
导入主题
导入txt目录规则
+ 自动保存cookie
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 262d98d30..b988c636d 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -981,5 +981,6 @@
导入TTS
导入主题
导入txt目录规则
+ 自动保存cookie