?)
8 |
9 | fun onError(e: Exception)
10 |
11 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_shadow_bottom_night.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_shadow_top_night.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_prefs_color.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/modules/book/src/main/java/me/ag2s/epublib/browsersupport/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides classes that help make an epub reader application.
3 | *
4 | * These classes have no dependencies on graphic toolkits, they're purely
5 | * to help with the browsing/navigation logic.
6 | */
7 | package me.ag2s.epublib.browsersupport;
8 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/help/storage/BackupAES.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.help.storage
2 |
3 | import cn.hutool.crypto.symmetric.AES
4 | import io.legado.app.help.config.LocalConfig
5 | import io.legado.app.utils.MD5Utils
6 |
7 | class BackupAES : AES(
8 | MD5Utils.md5Encode(LocalConfig.password ?: "").encodeToByteArray(0, 16)
9 | )
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selector_btn_accent_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_log.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/modules/web/src/web.d.ts:
--------------------------------------------------------------------------------
1 | export type webReadConfig = {
2 | theme: number
3 | font: number
4 | fontSize: number
5 | readWidth: number
6 | infiniteLoading: boolean
7 | customFontName: string
8 | jumpDuration: number
9 | spacing: {
10 | paragraph: number
11 | line: number
12 | letter: number
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/base/adapter/animations/BaseAnimation.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.base.adapter.animations
2 |
3 | import android.animation.Animator
4 | import android.view.View
5 |
6 | /**
7 | * adapter item 动画
8 | */
9 | interface BaseAnimation {
10 |
11 | fun getAnimators(view: View): Array
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/lib/webdav/WebDavException.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.lib.webdav
2 |
3 | open class WebDavException(msg: String) : Exception(msg) {
4 |
5 | override fun fillInStackTrace(): Throwable {
6 | return this
7 | }
8 |
9 | }
10 |
11 | class ObjectNotFoundException(msg: String) : WebDavException(msg)
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/ui/book/manga/entities/ReaderLoading.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.ui.book.manga.entities
2 |
3 | data class ReaderLoading(
4 | override val chapterIndex: Int = 0,
5 | override val index: Int = 0,
6 | val mMessage: String? = null,
7 | val isVolume: Boolean = false
8 | ) : BaseMangaPage
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/recyclerview_divider_horizontal.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shape_circle.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shape_radius_1dp.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
--------------------------------------------------------------------------------
/modules/web/src/assets/bookshelf.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding: 0;
3 | margin: 0;
4 | height: 100vh;
5 | }
6 |
7 | #app {
8 | font-family: 'Avenir', Helvetica, Arial, sans-serif;
9 | -webkit-font-smoothing: antialiased;
10 | -moz-osx-font-smoothing: grayscale;
11 | color: #2c3e50;
12 | margin: 0;
13 | height: 100%;
14 | }
15 |
--------------------------------------------------------------------------------
/modules/web/src/assets/kbd.css:
--------------------------------------------------------------------------------
1 | kbd {
2 | align-items: center;
3 | background: rgba(125, 125, 125, 0.1);
4 | border-radius: 3px;
5 | border: 0;
6 | padding: 4px 5px;
7 | font-weight: bold;
8 | box-shadow:
9 | inset 0 -2px 0 0 #cdcde6,
10 | inset 0 0 1px 1px #fff,
11 | 0 1px 2px 1px rgba(30, 35, 90, 0.4);
12 | }
13 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | **2022/10/02**
2 |
3 | * 更新cronet: 106.0.5249.79
4 | * 正文选择菜单朗读按钮长按可切换朗读选择内容和从选择开始处一直朗读
5 | * 源编辑输入框设置最大行数12,在行数特别多的时候更容易滚动到其它输入
6 | * 修复某些情况下无法搜索到标题的bug,净化规则较多的可能会降低搜索速度 by Xwite
7 | * 修复文件类书源换源后阅读bug by Xwite
8 | * Cronet 支持DnsHttpsSvcb by g2s20150909
9 | * 修复web进度同步问题 by 821938089
10 | * 启用混淆以减小app大小 有bug请带日志反馈
11 | * 其它一些优化
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_eink_border_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shape_radius_10dp.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
--------------------------------------------------------------------------------
/modules/book/src/main/java/me/ag2s/epublib/epub/HtmlProcessor.java:
--------------------------------------------------------------------------------
1 | package me.ag2s.epublib.epub;
2 |
3 | import java.io.OutputStream;
4 |
5 | import me.ag2s.epublib.domain.Resource;
6 |
7 | @SuppressWarnings("unused")
8 | public interface HtmlProcessor {
9 |
10 | void processHtmlResource(Resource resource, OutputStream out);
11 | }
12 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/help/glide/GlideHeaders.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.help.glide
2 |
3 | import com.bumptech.glide.load.model.Headers
4 |
5 | class GlideHeaders(private val headers: MutableMap) : Headers {
6 |
7 | override fun getHeaders(): MutableMap {
8 | return headers
9 | }
10 |
11 | }
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/utils/canvasrecorder/pools/PicturePool.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.utils.canvasrecorder.pools
2 |
3 | import android.graphics.Picture
4 | import io.legado.app.utils.objectpool.BaseObjectPool
5 |
6 | class PicturePool : BaseObjectPool(64) {
7 |
8 | override fun create(): Picture = Picture()
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bottom_books.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bottom_person.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/dialog_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/modules/book/src/main/java/me/ag2s/epublib/domain/LazyResourceProvider.java:
--------------------------------------------------------------------------------
1 | package me.ag2s.epublib.domain;
2 |
3 | import java.io.IOException;
4 | import java.io.InputStream;
5 |
6 | /**
7 | * @author jake
8 | */
9 | public interface LazyResourceProvider {
10 |
11 | InputStream getResourceStream(String href) throws IOException;
12 | }
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bottom_explore.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/theme_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/lib/cronet/CallbackResult.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.lib.cronet
2 |
3 | import org.chromium.net.CronetException
4 |
5 | import java.nio.ByteBuffer
6 |
7 |
8 | data class CallbackResult(
9 | val callbackStep: CallbackStep,
10 | val buffer: ByteBuffer? = null,
11 | val exception: CronetException? = null
12 | )
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bottom_rss_feed.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selector_fillet_btn_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/lib/permission/OnRequestPermissionsResultCallback.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.lib.permission
2 |
3 | interface OnRequestPermissionsResultCallback {
4 |
5 | fun onRequestPermissionsResult(permissions: Array, grantResults: IntArray)
6 |
7 | fun onSettingActivityResult()
8 |
9 | fun onError(e: Exception)
10 | }
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_play_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reduce.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/launcher3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/launcher5.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/ui/config/ConfigTag.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.ui.config
2 |
3 | object ConfigTag {
4 |
5 | const val OTHER_CONFIG = "otherConfig"
6 | const val THEME_CONFIG = "themeConfig"
7 | const val BACKUP_CONFIG = "backupConfig"
8 | const val COVER_CONFIG = "coverConfig"
9 | const val WELCOME_CONFIG = "welcomeConfig"
10 |
11 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_arrow_drop_up.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher4_b.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher7_b.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_stop_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/launcher1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/launcher2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/launcher4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/launcher6.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_arrow_drop_down.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher5_b.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/app_update.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/theme_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_chapter_item_divider.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/bookmark.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/qr_code_scan.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/modules/rhino/src/main/java/com/script/Compilable.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Decompiled with CFR 0.152.
3 | */
4 | package com.script
5 |
6 | import java.io.Reader
7 |
8 | interface Compilable {
9 |
10 | @Throws(ScriptException::class)
11 | fun compile(script: Reader): CompiledScript
12 |
13 | @Throws(ScriptException::class)
14 | fun compile(script: String): CompiledScript
15 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_pause_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_skip_next.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_skip_previous.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/assets/web/help/md/SourceMRssHelp.md:
--------------------------------------------------------------------------------
1 | # 订阅源管理界面帮助
2 |
3 | * 订阅源可以通过规则订阅一些网络内容
4 | * 书源右上角标志
5 | * 绿点表示书源有发现,且启用了发现
6 | * 红点表示书源有发现,但是未启用
7 | * 没有标志表示此书源没有发现
8 | * 右上角有分组菜单,可以按分组筛选书源
9 | * 右上角更多菜单里包含
10 | * 新建订阅源
11 | * 本地导入
12 | * 网络导入
13 | * 二维码导入
14 | * 分享选中源
15 | * 选择源的更多操作在右下角的菜单里面,操作都是针对选择的书源
16 | * 启用所选
17 | * 禁用所选
18 | * 置顶所选
19 | * 置底所选
20 | * 导出所选
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/help/coroutine/ActivelyCancelException.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.help.coroutine
2 |
3 | import kotlin.coroutines.cancellation.CancellationException
4 |
5 | class ActivelyCancelException : CancellationException() {
6 |
7 | override fun fillInStackTrace(): Throwable {
8 | stackTrace = emptyArray()
9 | return this
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_sort_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_download.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_fast_forward.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selector_common_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_source_login.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/base/adapter/ItemViewHolder.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.base.adapter
2 |
3 | import androidx.recyclerview.widget.RecyclerView
4 | import androidx.viewbinding.ViewBinding
5 |
6 | /**
7 | * Created by Invincible on 2017/11/28.
8 | */
9 | @Suppress("MemberVisibilityCanBePrivate")
10 | class ItemViewHolder(val binding: ViewBinding) : RecyclerView.ViewHolder(binding.root)
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/data/entities/Cookie.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.data.entities
2 |
3 | import androidx.room.Entity
4 | import androidx.room.Index
5 | import androidx.room.PrimaryKey
6 |
7 | @Entity(tableName = "cookies", indices = [(Index(value = ["url"], unique = true))])
8 | data class Cookie(
9 | @PrimaryKey
10 | var url: String = "",
11 | var cookie: String = ""
12 | )
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_check.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_expand_less.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/data/entities/RssReadRecord.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.data.entities
2 |
3 | import androidx.room.Entity
4 | import androidx.room.PrimaryKey
5 |
6 | @Entity(tableName = "rssReadRecords")
7 | data class RssReadRecord(
8 | @PrimaryKey
9 | val record: String,
10 | val title: String? = null,
11 | val readTime: Long? = null,
12 | val read: Boolean = true
13 | )
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/data/entities/rule/ExploreKind.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.data.entities.rule
2 |
3 | /**
4 | * 发现分类
5 | */
6 | data class ExploreKind(
7 | val title: String = "",
8 | val url: String? = null,
9 | val style: FlexChildStyle? = null
10 | ) {
11 |
12 | fun style(): FlexChildStyle {
13 | return style ?: FlexChildStyle.defaultStyle
14 | }
15 |
16 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_expand_more.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_fast_rewind.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/group_manage.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/servers.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/help/http/OkhttpUncaughtExceptionHandler.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.help.http
2 |
3 | import io.legado.app.constant.AppLog
4 |
5 | object OkhttpUncaughtExceptionHandler : Thread.UncaughtExceptionHandler {
6 |
7 | override fun uncaughtException(t: Thread, e: Throwable) {
8 | AppLog.put("Okhttp Dispatcher中的线程执行出错\n${e.localizedMessage}", e)
9 | }
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/utils/WindowInsetsExtensions.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.utils
2 |
3 | import androidx.core.view.WindowInsetsCompat
4 |
5 | val WindowInsetsCompat.navigationBarHeight
6 | get() = (getInsets(WindowInsetsCompat.Type.systemBars()).bottom - imeHeight).coerceAtLeast(0)
7 |
8 | val WindowInsetsCompat.imeHeight
9 | get() = getInsets(WindowInsetsCompat.Type.ime()).bottom
10 |
--------------------------------------------------------------------------------
/modules/web/src/pages/bookshelf/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/modules/web/src/pages/source/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/utils/MenuItemExtensions.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.utils
2 |
3 | import android.view.MenuItem
4 | import android.widget.ImageButton
5 | import androidx.annotation.DrawableRes
6 | import io.legado.app.R
7 |
8 | fun MenuItem.setIconCompat(@DrawableRes iconRes: Int) {
9 | setIcon(iconRes)
10 | actionView?.findViewById(R.id.item)?.setImageDrawable(icon)
11 | }
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_arrow_back.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_action_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/keyboard_assists_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/server_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/source_subscription.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/lib/mobi/entities/NCX.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.lib.mobi.entities
2 |
3 | data class NCX(
4 | val index: Int,
5 | val offset: Int?,
6 | val size: Int?,
7 | val label: String,
8 | val headingLevel: Int?,
9 | val pos: List?,
10 | val parent: Int?,
11 | val firstChild: Int?,
12 | val lastChild: Int?,
13 | var children: List? = null
14 | )
15 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/book_info_edit.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/modules/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/constant/SourceType.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.constant
2 |
3 | import androidx.annotation.IntDef
4 |
5 | @Suppress("ConstPropertyName")
6 | object SourceType {
7 |
8 | const val book = 0
9 | const val rss = 1
10 |
11 | @Target(AnnotationTarget.VALUE_PARAMETER)
12 | @Retention(AnnotationRetention.SOURCE)
13 | @IntDef(book, rss)
14 | annotation class Type
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/data/entities/Cache.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.data.entities
2 |
3 | import androidx.room.Entity
4 | import androidx.room.Index
5 | import androidx.room.PrimaryKey
6 |
7 | @Entity(tableName = "caches", indices = [(Index(value = ["key"], unique = true))])
8 | data class Cache(
9 | @PrimaryKey
10 | val key: String = "",
11 | var value: String? = null,
12 | var deadline: Long = 0L
13 | )
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/lib/mobi/entities/MobiMetadata.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.lib.mobi.entities
2 |
3 | data class MobiMetadata(
4 | val identifier: String,
5 | val title: String,
6 | val author: List,
7 | val publisher: String,
8 | val language: String,
9 | val published: String,
10 | val description: String,
11 | val subject: List,
12 | val rights: String
13 | )
14 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/utils/MutableLiveDataExtensions.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.utils
2 |
3 | import android.os.Handler
4 | import android.os.Looper
5 | import androidx.lifecycle.MutableLiveData
6 |
7 | private val mainHandler by lazy { Handler(Looper.getMainLooper()) }
8 |
9 | fun MutableLiveData.sendValue(value: T) {
10 | mainHandler.post {
11 | this@sendValue.value = value
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_arrow_down.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/data/README.md:
--------------------------------------------------------------------------------
1 | # 存储数据用
2 |
3 | * dao 数据操作
4 | * entities 数据模型
5 | * \Book 书籍信息
6 | * \BookChapter 目录信息
7 | * \BookGroup 书籍分组
8 | * \Bookmark 书签
9 | * \BookSource 书源
10 | * \Cookie http cookie
11 | * \ReplaceRule 替换规则
12 | * \RssArticle rss条目
13 | * \RssReadRecord rss阅读记录
14 | * \RssSource rss源
15 | * \RssStar rss收藏
16 | * \SearchBook 搜索结果
17 | * \SearchKeyword 搜索关键字
18 | * \TxtTocRule txt文件目录规则
19 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/help/coroutine/CoroutineContainer.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.help.coroutine
2 |
3 | internal interface CoroutineContainer {
4 |
5 | fun add(coroutine: Coroutine<*>): Boolean
6 |
7 | fun addAll(vararg coroutines: Coroutine<*>): Boolean
8 |
9 | fun remove(coroutine: Coroutine<*>): Boolean
10 |
11 | fun delete(coroutine: Coroutine<*>): Boolean
12 |
13 | fun clear()
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/ui/book/manga/entities/MangaPage.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.ui.book.manga.entities
2 |
3 | data class MangaPage(
4 | override val chapterIndex: Int = 0,//总章节位置
5 | val chapterSize: Int,//总章节数量
6 | val mImageUrl: String = "",//当前URL
7 | override val index: Int = 0,//当前章节位置
8 | var imageCount: Int = 0,//当前章节内容总数
9 | val mChapterName: String = "",//章节名称
10 | ) : BaseMangaPage
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_searchview.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_arrow_right.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/file_chooser.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/modules/rhino/src/main/java/com/script/ScriptBindingsExtensions.kt:
--------------------------------------------------------------------------------
1 | package com.script
2 |
3 | import org.mozilla.javascript.Context
4 |
5 | inline fun buildScriptBindings(block: (bindings: ScriptBindings) -> Unit): ScriptBindings {
6 | val bindings = ScriptBindings()
7 | Context.enter()
8 | try {
9 | block(bindings)
10 | } finally {
11 | Context.exit()
12 | }
13 | return bindings
14 | }
15 |
--------------------------------------------------------------------------------
/app/src/main/assets/epub/chapter.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Chapter
6 |
7 |
8 |
9 |
10 | {title}
11 | {content}
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/lib/mobi/entities/KF8Section.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.lib.mobi.entities
2 |
3 | data class KF8Section(
4 | val index: Int,
5 | val skeleton: Skeleton,
6 | val frags: List,
7 | val fragEnd: Int,
8 | val length: Int,
9 | val totalLength: Int,
10 | val href: String,
11 | var next: KF8Section? = null
12 | ) {
13 | val linear get() = frags.isNotEmpty()
14 | }
15 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_star.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/search_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/modules/web/src/api/axios.ts:
--------------------------------------------------------------------------------
1 | import axios from 'axios'
2 |
3 | /** @type {string} localStorage保存自定义阅读http服务接口的键值 */
4 | export const baseURL_localStorage_key = 'remoteUrl'
5 | const SECOND = 1000
6 |
7 | const ajax = axios.create({
8 | baseURL:
9 | import.meta.env.VITE_API ||
10 | localStorage.getItem(baseURL_localStorage_key) ||
11 | location.origin,
12 | timeout: 120 * SECOND,
13 | })
14 |
15 | export default ajax
16 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/data/entities/BookChapterReview.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.data.entities
2 |
3 | import android.os.Parcelable
4 | import androidx.room.ColumnInfo
5 | import kotlinx.parcelize.Parcelize
6 |
7 | @Parcelize
8 | class BookChapterReview(
9 | @ColumnInfo(defaultValue = "0")
10 | var bookId: Long = 0,
11 | var chapterId: Long = 0,
12 | var summaryUrl: String = "",
13 | ): Parcelable {
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_cursor_left.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/help/book/BookContent.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.help.book
2 |
3 | import io.legado.app.data.entities.ReplaceRule
4 |
5 | data class BookContent(
6 | val sameTitleRemoved: Boolean,
7 | val textList: List,
8 | //起效的替换规则
9 | val effectiveReplaceRules: List?
10 | ) {
11 |
12 | override fun toString(): String {
13 | return textList.joinToString("\n")
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/lib/mobi/entities/IndxHeader.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.lib.mobi.entities
2 |
3 | data class IndxHeader(
4 | val magic: String,
5 | val length: Int,
6 | val type: Int,
7 | val idxt: Int,
8 | val numRecords: Int,
9 | val encoding: Int,
10 | val language: Int,
11 | val total: Int,
12 | val ordt: Int,
13 | val ligt: Int,
14 | val numLigt: Int,
15 | val numCncx: Int,
16 | )
17 |
--------------------------------------------------------------------------------
/app/src/main/res/color/selector_image.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_toc.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/app_log.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/assets/web/help/md/httpTTSHelp.md:
--------------------------------------------------------------------------------
1 | # 在线朗读规则说明
2 |
3 | * 在线朗读规则为url规则,同书源url
4 | * js参数
5 | ```
6 | speakText //朗读文本
7 | speakSpeed //朗读速度,5-50
8 | ```
9 | * 例:
10 | ```
11 | http://tts.baidu.com/text2audio,{
12 | "method": "POST",
13 | "body": "tex={{java.encodeURI(java.encodeURI(speakText))}}&spd={{String((speakSpeed + 5) / 10 + 4)}}&per=5003&cuid=baidu_speech_demo&idx=1&cod=2&lan=zh&ctp=1&pdt=1&vol=5&pit=5&_res_tag_=audio"
14 | }
15 | ```
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/ui/widget/recycler/scroller/FastScrollStateChangeListener.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.ui.widget.recycler.scroller
2 |
3 | interface FastScrollStateChangeListener {
4 |
5 | /**
6 | * Called when fast scrolling begins
7 | */
8 | fun onFastScrollStart(fastScroller: FastScroller)
9 |
10 | /**
11 | * Called when fast scrolling ends
12 | */
13 | fun onFastScrollStop(fastScroller: FastScroller)
14 | }
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/utils/objectpool/ObjectPoolLocked.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.utils.objectpool
2 |
3 | class ObjectPoolLocked(private val delegate: ObjectPool) : ObjectPool by delegate {
4 |
5 | @Synchronized
6 | override fun obtain(): T {
7 | return delegate.obtain()
8 | }
9 |
10 | @Synchronized
11 | override fun recycle(target: T) {
12 | return delegate.recycle(target)
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_cursor_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/crash_log.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/main_explore.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/assets/epub/intro.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Intro
6 |
7 |
8 |
9 |
10 | 内容简介
{intro}
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_swap_horiz.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/rss_read_record.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/exception/NoStackTraceException.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.exception
2 |
3 | /**
4 | * 不记录错误堆栈的报错
5 | */
6 | open class NoStackTraceException(msg: String) : Exception(msg) {
7 |
8 | override fun fillInStackTrace(): Throwable {
9 | stackTrace = emptyStackTrace
10 | return this
11 | }
12 |
13 | companion object {
14 | private val emptyStackTrace = emptyArray()
15 | }
16 |
17 | }
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/data/entities/rule/BookListRule.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.data.entities.rule
2 |
3 | /**
4 | * 书籍列表规则
5 | */
6 | interface BookListRule {
7 | var bookList: String?
8 | var name: String?
9 | var author: String?
10 | var intro: String?
11 | var kind: String?
12 | var lastChapter: String?
13 | var updateTime: String?
14 | var bookUrl: String?
15 | var coverUrl: String?
16 | var wordCount: String?
17 | }
--------------------------------------------------------------------------------
/modules/book/src/main/java/me/ag2s/base/ThrowableUtils.java:
--------------------------------------------------------------------------------
1 | package me.ag2s.base;
2 |
3 | import androidx.annotation.NonNull;
4 |
5 | import java.io.IOException;
6 |
7 | public class ThrowableUtils {
8 |
9 |
10 | public static @NonNull
11 | IOException rethrowAsIOException(Throwable throwable) throws IOException {
12 | IOException newException = new IOException(throwable.getMessage(), throwable);
13 | throw newException;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/main/assets/web/help/md/debugHelp.md:
--------------------------------------------------------------------------------
1 | # 书源调试
2 |
3 | * 调试搜索>>输入关键字,如:
4 | ```
5 | 系统
6 | ```
7 | * 调试发现>>输入发现URL,如:
8 | ```
9 | 月票榜::https://www.qidian.com/rank/yuepiao?page={{page}}
10 | ```
11 | * 调试详情页>>输入详情页URL,如:
12 | ```
13 | https://m.qidian.com/book/1015609210
14 | ```
15 | * 调试目录页>>输入目录页URL,如:
16 | ```
17 | ++https://www.zhaishuyuan.com/read/30394
18 | ```
19 | * 调试正文页>>输入正文页URL,如:
20 | ```
21 | --https://www.zhaishuyuan.com/chapter/30394/20940996
22 | ```
23 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bottom_explore_s.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/modules/web/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | .DS_Store
12 | dist
13 | dist-ssr
14 | coverage
15 | *.local
16 |
17 | /cypress/videos/
18 | /cypress/screenshots/
19 |
20 | # Editor directories and files
21 | .vscode/*
22 | !.vscode/extensions.json
23 | .idea
24 | *.suo
25 | *.ntvs*
26 | *.njsproj
27 | *.sln
28 | *.sw?
29 |
30 | *.tsbuildinfo
31 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/base/adapter/animations/SlideInBottomAnimation.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.base.adapter.animations
2 |
3 | import android.animation.Animator
4 | import android.animation.ObjectAnimator
5 | import android.view.View
6 |
7 | class SlideInBottomAnimation : BaseAnimation {
8 |
9 |
10 | override fun getAnimators(view: View): Array =
11 | arrayOf(ObjectAnimator.ofFloat(view, "translationY", view.measuredHeight.toFloat(), 0f))
12 | }
13 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/help/PaintPool.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.help
2 |
3 | import android.graphics.Paint
4 | import io.legado.app.utils.objectpool.BaseSafeObjectPool
5 |
6 | object PaintPool : BaseSafeObjectPool(8) {
7 |
8 | private val emptyPaint = Paint()
9 |
10 | override fun create(): Paint = Paint()
11 |
12 | override fun recycle(target: Paint) {
13 | target.set(emptyPaint)
14 | super.recycle(target)
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/recyclerview_divider_vertical.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/import_replace.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/io/legado/app/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app
2 |
3 | import org.junit.Assert.assertEquals
4 | import org.junit.Test
5 |
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 |
14 | @Test
15 | fun addition_isCorrect() {
16 | assertEquals(4, 2 + 2)
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/modules/rhino/src/main/java/com/script/Bindings.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Decompiled with CFR 0.152.
3 | */
4 | package com.script
5 |
6 | interface Bindings : MutableMap {
7 |
8 | override fun containsKey(key: String): Boolean
9 |
10 | override operator fun get(key: String): Any?
11 |
12 | override fun put(key: String, value: Any?): Any?
13 |
14 | override fun putAll(from: Map)
15 |
16 | override fun remove(key: String): Any?
17 |
18 | }
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/base/adapter/animations/SlideInLeftAnimation.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.base.adapter.animations
2 |
3 | import android.animation.Animator
4 | import android.animation.ObjectAnimator
5 | import android.view.View
6 |
7 |
8 | class SlideInLeftAnimation : BaseAnimation {
9 |
10 |
11 | override fun getAnimators(view: View): Array =
12 | arrayOf(ObjectAnimator.ofFloat(view, "translationX", -view.rootView.width.toFloat(), 0f))
13 | }
14 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/base/adapter/animations/SlideInRightAnimation.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.base.adapter.animations
2 |
3 | import android.animation.Animator
4 | import android.animation.ObjectAnimator
5 | import android.view.View
6 |
7 |
8 | class SlideInRightAnimation : BaseAnimation {
9 |
10 |
11 | override fun getAnimators(view: View): Array =
12 | arrayOf(ObjectAnimator.ofFloat(view, "translationX", view.rootView.width.toFloat(), 0f))
13 | }
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_folder.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_folder_open.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selector_tv_black.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/replace_rule_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
11 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/rss_source_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
11 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/txt_toc_rule_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
11 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: 简繁转化
4 | url: https://github.com/liuyueyi/quick-chinese-transfer/issues/new
5 | about: 简繁转化问题请优先到quick-chinese-transfer反馈
6 | - name: 讨论 / Discussions
7 | url: https://github.com/gedoor/legado/discussions
8 | about: Please ask and answer questions here.
9 | - name: 常见问题 / Wiki
10 | url: https://github.com/gedoor/legado/wiki
11 | about: Read wiki if your are new here.
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_storage_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/modules/web/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@vue/tsconfig/tsconfig.dom.json",
3 | "include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
4 | "exclude": ["src/**/__tests__/*"],
5 | "compilerOptions": {
6 | "composite": true,
7 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
8 |
9 | "baseUrl": ".",
10 | "paths": {
11 | "@/*": ["./src/*"],
12 | "@api": ["./src/api"],
13 | "@utils/*": ["./src/utils/*"]
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/utils/ConfigurationExtensions.kt:
--------------------------------------------------------------------------------
1 | @file:Suppress("unused")
2 |
3 | package io.legado.app.utils
4 |
5 | import android.content.res.Configuration
6 | import android.content.res.Resources
7 |
8 | val sysConfiguration: Configuration = Resources.getSystem().configuration
9 |
10 | val Configuration.isNightMode: Boolean
11 | get() {
12 | val mode = uiMode and Configuration.UI_MODE_NIGHT_MASK
13 | return mode == Configuration.UI_MODE_NIGHT_YES
14 | }
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/utils/Throttle.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.utils
2 |
3 | @Suppress("unused")
4 | class Throttle(
5 | wait: Long = 0L,
6 | leading: Boolean = true,
7 | trailing: Boolean = true,
8 | func: () -> T
9 | ) : Debounce(wait, wait, leading, trailing, func)
10 |
11 | fun throttle(
12 | wait: Long = 0L,
13 | leading: Boolean = true,
14 | trailing: Boolean = true,
15 | func: () -> T
16 | ) = Throttle(wait, leading, trailing, func)
17 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bookmark.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/save.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_img_border.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_close.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/code_edit.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/content_search.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/main_my.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/source_webview_login.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/ui/rss/read/VisibleWebView.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.ui.rss.read
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.view.View
6 | import android.webkit.WebView
7 |
8 | class VisibleWebView(
9 | context: Context,
10 | attrs: AttributeSet? = null
11 | ) : WebView(context, attrs) {
12 |
13 | override fun onWindowVisibilityChanged(visibility: Int) {
14 | super.onWindowVisibilityChanged(View.VISIBLE)
15 | }
16 |
17 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_title_bar.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/book_group_manage.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/modules/web/src/router/index.ts:
--------------------------------------------------------------------------------
1 | import { createWebHashHistory, createRouter } from 'vue-router'
2 | import { bookRoutes } from './bookRouter'
3 | import { sourceRoutes } from './sourceRouter'
4 |
5 | const router = createRouter({
6 | // history: createWebHistory(process.env.BASE_URL),
7 | history: createWebHashHistory(),
8 | routes: [bookRoutes, sourceRoutes].flat(),
9 | })
10 |
11 | router.afterEach(to => {
12 | if (to.name == 'shelf') document.title = '书架'
13 | })
14 |
15 | export default router
16 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/data/entities/ReadRecord.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.data.entities
2 |
3 | import androidx.room.ColumnInfo
4 | import androidx.room.Entity
5 |
6 | @Entity(tableName = "readRecord", primaryKeys = ["deviceId", "bookName"])
7 | data class ReadRecord(
8 | var deviceId: String = "",
9 | var bookName: String = "",
10 | @ColumnInfo(defaultValue = "0")
11 | var readTime: Long = 0L,
12 | @ColumnInfo(defaultValue = "0")
13 | var lastRead: Long = System.currentTimeMillis()
14 | )
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/ui/book/import/remote/ServersViewModel.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.ui.book.import.remote
2 |
3 | import android.app.Application
4 | import io.legado.app.base.BaseViewModel
5 | import io.legado.app.data.appDb
6 | import io.legado.app.data.entities.Server
7 |
8 | class ServersViewModel(application: Application): BaseViewModel(application) {
9 |
10 |
11 | fun delete(server: Server) {
12 | execute {
13 | appDb.serverDao.delete(server)
14 | }
15 | }
16 |
17 | }
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/ui/widget/seekbar/SeekBarChangeListener.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.ui.widget.seekbar
2 |
3 | import android.widget.SeekBar
4 |
5 | interface SeekBarChangeListener : SeekBar.OnSeekBarChangeListener {
6 |
7 | override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
8 |
9 | }
10 |
11 | override fun onStartTrackingTouch(seekBar: SeekBar) {
12 |
13 | }
14 |
15 | override fun onStopTrackingTouch(seekBar: SeekBar) {
16 |
17 | }
18 |
19 | }
--------------------------------------------------------------------------------
/app/src/main/res/menu/font_select.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/ui/book/import/local/ImportBook.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.ui.book.import.local
2 |
3 | import io.legado.app.model.localBook.LocalBook
4 | import io.legado.app.utils.FileDoc
5 |
6 | data class ImportBook(
7 | val file: FileDoc,
8 | var isOnBookShelf: Boolean = !file.isDir && LocalBook.isOnBookShelf(file.name)
9 | ) {
10 | val name get() = file.name
11 | val isDir get() = file.isDir
12 | val size get() = file.size
13 | val lastModified get() = file.lastModified
14 | }
15 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_folder_outline.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_lock_outline.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_number_picker.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/change_cover.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/modules/web/tsconfig.node.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@tsconfig/node20/tsconfig.json",
3 | "include": [
4 | "vite.config.*",
5 | "vitest.config.*",
6 | "cypress.config.*",
7 | "nightwatch.conf.*",
8 | "playwright.config.*"
9 | ],
10 | "compilerOptions": {
11 | "composite": true,
12 | "noEmit": true,
13 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
14 |
15 | "module": "ESNext",
16 | "moduleResolution": "Bundler",
17 | "types": ["node"]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/src/main/assets/web/help/md/webDavHelp.md:
--------------------------------------------------------------------------------
1 | # WebDav备份教程
2 |
3 | ### 阅读支持云备份,采用WebDav协议,所有支持WebDav的云盘都可以,建议采用坚果云,每月免费1G流量,用来备份阅读足够了,下面就采用坚果云来讲解配置步骤.
4 |
5 | 1. 打开坚果云网站 https://www.jianguoyun.com/d/home#/
6 | 2. 如果没有注册过坚果云先注册一下
7 | 3. 登录坚果云
8 | 4. 右上角用户名点开点账户信息
9 | 5. 点击安全选项
10 | 6. 在第三方管理里添加应用
11 | 7. 将应用示例里的服务器地址,用户名,和密码填到阅读的WebDav设置里
12 | 8. 阅读的WebDav配置在我的-备份与恢复,创建子文件夹选项保持默认即可
13 | 9. 设置完成后手动执行一下备份,看看是否成功
14 | 10. 恢复时选择想要恢复的备份文件
15 |
16 | ### 自动备份说明
17 |
18 | * 设置好备份之后每次退出App会自动进行备份
19 | * WebDav同一天的备份会覆盖,不同日期的备份不会覆盖
20 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/data/entities/RuleSub.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.data.entities
2 |
3 | import androidx.room.Entity
4 | import androidx.room.PrimaryKey
5 |
6 | @Entity(tableName = "ruleSubs")
7 | data class RuleSub(
8 | @PrimaryKey
9 | val id: Long = System.currentTimeMillis(),
10 | var name: String = "",
11 | var url: String = "",
12 | var type: Int = 0,
13 | var customOrder: Int = 0,
14 | var autoUpdate: Boolean = false,
15 | var update: Long = System.currentTimeMillis()
16 | )
17 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/ui/book/manga/config/MangaColorFilterConfig.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.ui.book.manga.config
2 |
3 | import io.legado.app.utils.GSON
4 |
5 | data class MangaColorFilterConfig(
6 | var r: Int = 0,
7 | var g: Int = 0,
8 | var b: Int = 0,
9 | var a: Int = 0,
10 | var l: Int = 0
11 | ) {
12 | fun toJson(): String {
13 | if (r == 0 && g == 0 && b == 0 && a == 0 && l == 0) {
14 | return ""
15 | }
16 | return GSON.toJson(this)
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_backup.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_exit.xml:
--------------------------------------------------------------------------------
1 |
8 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_more_vert.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_title_bar_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/modules/book/src/main/java/me/ag2s/epublib/domain/ManifestItemRefProperties.java:
--------------------------------------------------------------------------------
1 | package me.ag2s.epublib.domain;
2 |
3 | @SuppressWarnings("unused")
4 | public enum ManifestItemRefProperties implements ManifestProperties {
5 | PAGE_SPREAD_LEFT("page-spread-left"),
6 | PAGE_SPREAD_RIGHT("page-spread-right");
7 |
8 | private final String name;
9 |
10 | ManifestItemRefProperties(String name) {
11 | this.name = name;
12 | }
13 |
14 | public String getName() {
15 | return name;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/modules/web/src/pages/source/README.md:
--------------------------------------------------------------------------------
1 | # legado_web_editor
2 |
3 | ## 🚧开发注意
4 |
5 | 如果你想要调试项目 请修改文件`.env.development`里`VITE_API`为阅读web服务ip
6 |
7 | ## 路由
8 |
9 | /rssSource 订阅源编辑
10 | /rssSource 书源编辑
11 |
12 | ## 🎨Project setup
13 |
14 | ```
15 | pnpm i
16 | ```
17 |
18 | ### Compiles and hot-reloads for development
19 |
20 | ```
21 | pnpm dev
22 | ```
23 |
24 | ### Compiles and minifies for production
25 |
26 | ```
27 | pnpm build
28 | ```
29 |
30 | ### Lints and fixes files
31 |
32 | ```
33 | pnpm lint:fix
34 | ```
35 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/lib/theme/view/ThemeProgressBar.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.lib.theme.view
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.widget.ProgressBar
6 | import io.legado.app.lib.theme.accentColor
7 | import io.legado.app.utils.applyTint
8 |
9 | class ThemeProgressBar(context: Context, attrs: AttributeSet) : ProgressBar(context, attrs) {
10 |
11 | init {
12 | if (!isInEditMode) {
13 | applyTint(context.accentColor)
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/utils/AsyncFileHandler.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.utils
2 |
3 | import io.legado.app.help.globalExecutor
4 | import java.util.logging.FileHandler
5 | import java.util.logging.LogRecord
6 |
7 | class AsyncFileHandler(pattern: String) : FileHandler(pattern) {
8 |
9 | override fun publish(record: LogRecord?) {
10 | if (!isLoggable(record)) {
11 | return
12 | }
13 | globalExecutor.execute {
14 | super.publish(record)
15 | }
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/utils/objectpool/BaseObjectPool.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.utils.objectpool
2 |
3 | import androidx.annotation.CallSuper
4 | import androidx.core.util.Pools
5 |
6 | abstract class BaseObjectPool(size: Int) : ObjectPool {
7 |
8 | open val pool = Pools.SimplePool(size)
9 |
10 | override fun obtain(): T {
11 | return pool.acquire() ?: create()
12 | }
13 |
14 | @CallSuper
15 | override fun recycle(target: T) {
16 | pool.release(target)
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_add.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_pause_outline_24dp.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
--------------------------------------------------------------------------------
/modules/web/src/pages/bookshelf/README.md:
--------------------------------------------------------------------------------
1 | # 「阅读3.0」 web 端(已打包进阅读3.0,不能设置IP)
2 |
3 | 本程序为「阅读3.0」的配套 web 端,需要保证手机和电脑在同一局域网内,然后手机端打开 web 服务。
4 |
5 | ~~在线地址 http://alanskycn.gitee.io/vip/reader/~~
6 |
7 | ## 具体实现
8 |
9 | 使用 Vue3 开发
10 |
11 | ## 功能特性
12 |
13 | - 本地存储阅读记录与设置
14 | - 阅读主题切换
15 | - 夜间模式
16 | - 字号调节
17 | - 字体调节
18 | - 阅读宽度调节
19 |
20 | ## 使用方法
21 |
22 | ```shell
23 | pnpm install
24 | #安装项目
25 | pnpm dev
26 | #开发模式
27 | pnpm build
28 | #打包
29 | pnpm lint:fix
30 | #格式化代码
31 | ```
32 |
33 | - 调试的时候可以修改.env.development里面的地址连接手机端调试
34 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/ui/widget/recycler/VerticalDivider.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.ui.widget.recycler
2 |
3 | import android.content.Context
4 | import androidx.core.content.ContextCompat
5 | import androidx.recyclerview.widget.DividerItemDecoration
6 | import io.legado.app.R
7 |
8 | class VerticalDivider(context: Context) : DividerItemDecoration(context, VERTICAL) {
9 |
10 | init {
11 | ContextCompat.getDrawable(context, R.drawable.ic_divider)?.let {
12 | this.setDrawable(it)
13 | }
14 | }
15 |
16 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_star_border.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/assets/web/vue/assets/loading-6mEK85yy.js:
--------------------------------------------------------------------------------
1 | import{ak as i,D as g,N as c,a9 as d,al as f,u as m}from"./vendor-DYWUNZmw.js";const L=(s,t,l=i)=>{const a=g(!1);let r=null;const o=()=>a.value=!1,n=()=>a.value=!0;c(a,e=>{if(!e)return r==null?void 0:r.close();r=f.service({target:m(s),spinner:l,text:t,lock:!0,background:"rgba(0, 0, 0, 0)"})});const u=e=>{if(!(e instanceof Promise))throw TypeError("loadingWrapper argument must be Promise");return n(),e.finally(o)};return d(()=>{o()}),{isLoading:a,showLoading:n,closeLoading:o,loadingWrapper:u}};export{L as u};
2 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/ui/book/read/page/provider/LayoutProgressListener.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.ui.book.read.page.provider
2 |
3 | import io.legado.app.ui.book.read.page.entities.TextPage
4 |
5 | interface LayoutProgressListener {
6 |
7 | /**
8 | * 单页排版完成
9 | */
10 | fun onLayoutPageCompleted(index: Int, page: TextPage) {}
11 |
12 | /**
13 | * 全部排版完成
14 | */
15 | fun onLayoutCompleted() {}
16 |
17 | /**
18 | * 排版出现异常
19 | */
20 | fun onLayoutException(e: Throwable) {}
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_eink_border_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
10 | -
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bottom_person_s.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/lib/theme/view/ThemeCheckBox.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.lib.theme.view
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import androidx.appcompat.widget.AppCompatCheckBox
6 | import io.legado.app.lib.theme.accentColor
7 | import io.legado.app.utils.applyTint
8 |
9 | class ThemeCheckBox(context: Context, attrs: AttributeSet) : AppCompatCheckBox(context, attrs) {
10 |
11 | init {
12 | if (!isInEditMode) {
13 | applyTint(context.accentColor)
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/utils/AnimationExtensions.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.utils
2 |
3 | import android.content.Context
4 | import android.view.animation.Animation
5 | import android.view.animation.AnimationUtils
6 | import androidx.annotation.AnimRes
7 | import io.legado.app.help.config.AppConfig
8 |
9 | fun loadAnimation(context: Context, @AnimRes id: Int): Animation {
10 | val animation = AnimationUtils.loadAnimation(context, id)
11 | if (AppConfig.isEInkMode) {
12 | animation.duration = 0
13 | }
14 | return animation
15 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_volume_up.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/modules/book/src/main/java/me/ag2s/epublib/browsersupport/NavigationEventListener.java:
--------------------------------------------------------------------------------
1 | package me.ag2s.epublib.browsersupport;
2 |
3 | /**
4 | * Implemented by classes that want to be notified if the user moves to
5 | * another location in the book.
6 | *
7 | * @author paul
8 | */
9 | public interface NavigationEventListener {
10 |
11 | /**
12 | * Called whenever the user navigates to another position in the book.
13 | *
14 | * @param navigationEvent f
15 | */
16 | void navigationPerformed(NavigationEvent navigationEvent);
17 | }
--------------------------------------------------------------------------------
/modules/book/src/main/java/me/ag2s/umdlib/domain/UmdEnd.java:
--------------------------------------------------------------------------------
1 | package me.ag2s.umdlib.domain;
2 |
3 | import java.io.IOException;
4 |
5 | import me.ag2s.umdlib.tool.WrapOutputStream;
6 |
7 | /**
8 | * End part of UMD book, nothing to be special
9 | *
10 | * @author Ray Liang (liangguanhui@qq.com)
11 | * 2009-12-20
12 | */
13 | public class UmdEnd {
14 |
15 | public void buildEnd(WrapOutputStream wos) throws IOException {
16 | wos.writeBytes('#', 0x0C, 0, 0x01, 0x09);
17 | wos.writeInt(wos.getWritten() + 4);
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_eink_border_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
10 | -
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/modules/book/src/main/java/me/ag2s/epublib/Constants.java:
--------------------------------------------------------------------------------
1 | package me.ag2s.epublib;
2 |
3 |
4 | public interface Constants {
5 |
6 | String CHARACTER_ENCODING = "UTF-8";
7 | String DOCTYPE_XHTML = "";
8 | String NAMESPACE_XHTML = "http://www.w3.org/1999/xhtml";
9 | String EPUB_GENERATOR_NAME = "Ag2S EpubLib";
10 | String EPUB_DUOKAN_NAME = "DK-SONGTI";
11 | char FRAGMENT_SEPARATOR_CHAR = '#';
12 | String DEFAULT_TOC_ID = "toc";
13 | }
14 |
--------------------------------------------------------------------------------
/modules/book/src/main/java/me/ag2s/epublib/epub/BookProcessor.java:
--------------------------------------------------------------------------------
1 | package me.ag2s.epublib.epub;
2 |
3 | import me.ag2s.epublib.domain.EpubBook;
4 |
5 | /**
6 | * Post-processes a book.
7 | *
8 | * Can be used to clean up a book after reading or before writing.
9 | *
10 | * @author paul
11 | */
12 | public interface BookProcessor {
13 |
14 | /**
15 | * A BookProcessor that returns the input book unchanged.
16 | */
17 | BookProcessor IDENTITY_BOOKPROCESSOR = book -> book;
18 |
19 | EpubBook processBook(EpubBook book);
20 | }
21 |
--------------------------------------------------------------------------------
/modules/rhino/src/main/java/com/script/Invocable.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Decompiled with CFR 0.152.
3 | */
4 | package com.script
5 |
6 | interface Invocable {
7 | fun getInterface(clazz: Class): T?
8 |
9 | fun getInterface(obj: Any?, paramClass: Class): T?
10 |
11 | @Throws(ScriptException::class, NoSuchMethodException::class)
12 | fun invokeFunction(name: String, vararg args: Any): Any?
13 |
14 | @Throws(ScriptException::class, NoSuchMethodException::class)
15 | fun invokeMethod(obj: Any?, name: String, vararg args: Any): Any?
16 | }
--------------------------------------------------------------------------------
/modules/web/src/plugins/jump.d.ts:
--------------------------------------------------------------------------------
1 | export {}
2 | export type Options = {
3 | duration?: number | [(distance: number) => number]
4 | offset?: number
5 | callback?: () => void // "undefined" is a suitable default, and won't be called
6 | easing?: (
7 | timeElapsed: number,
8 | start: number,
9 | distance: number,
10 | duration: number,
11 | ) => number
12 | a11y?: boolean
13 | container?: HTMLElement | string
14 | }
15 | export default function (
16 | target: number | string | HTMLElement,
17 | options: Options = {},
18 | ): void
19 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/constant/NotificationId.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.constant
2 |
3 | /**
4 | * 通知ID不能重复,统一规划通知ID
5 | */
6 | @Suppress("ConstPropertyName")
7 | object NotificationId {
8 |
9 | const val ReadAloudService = 101
10 | const val AudioPlayService = 102
11 | const val CacheBookService = 103
12 | const val ExportBookService = 104
13 | const val WebService = 105
14 | const val DownloadService = 106
15 | const val CheckSourceService = 107
16 | const val Download = 10000
17 | const val ExportBook = 201
18 |
19 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_refresh_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/modules/web/src/router/bookRouter.ts:
--------------------------------------------------------------------------------
1 | import { createWebHashHistory, createRouter } from 'vue-router'
2 |
3 | export const bookRoutes = [
4 | {
5 | path: '/',
6 | name: 'shelf',
7 | component: () => import('../views/BookShelf.vue'),
8 | },
9 | {
10 | path: '/chapter',
11 | name: 'chapter',
12 | component: () => import('../views/BookChapter.vue'),
13 | },
14 | ]
15 |
16 | const router = createRouter({
17 | // mode: "history",
18 | history: createWebHashHistory(),
19 | routes: bookRoutes,
20 | })
21 |
22 | export default router
23 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/utils/canvasrecorder/CanvasRecorder.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.utils.canvasrecorder
2 |
3 | import android.graphics.Canvas
4 |
5 | interface CanvasRecorder {
6 |
7 | val width: Int
8 |
9 | val height: Int
10 |
11 | fun beginRecording(width: Int, height: Int): Canvas
12 |
13 | fun endRecording()
14 |
15 | fun draw(canvas: Canvas)
16 |
17 | fun invalidate()
18 |
19 | fun recycle()
20 |
21 | fun isDirty(): Boolean
22 |
23 | fun isLocked(): Boolean
24 |
25 | fun needRecord(): Boolean
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/lib/theme/view/ThemeRadioButton.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.lib.theme.view
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import androidx.appcompat.widget.AppCompatRadioButton
6 | import io.legado.app.lib.theme.accentColor
7 | import io.legado.app.utils.applyTint
8 |
9 | class ThemeRadioButton(context: Context, attrs: AttributeSet) :
10 | AppCompatRadioButton(context, attrs) {
11 |
12 | init {
13 | if (!isInEditMode) {
14 | applyTint(context.accentColor)
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/model/Download.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.model
2 |
3 | import android.content.Context
4 | import io.legado.app.constant.IntentAction
5 | import io.legado.app.service.DownloadService
6 | import io.legado.app.utils.startService
7 |
8 | object Download {
9 |
10 |
11 | fun start(context: Context, url: String, fileName: String) {
12 | context.startService {
13 | action = IntentAction.start
14 | putExtra("url", url)
15 | putExtra("fileName", fileName)
16 | }
17 | }
18 |
19 | }
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/ui/widget/text/PrimaryTextView.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.ui.widget.text
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import androidx.appcompat.widget.AppCompatTextView
6 | import io.legado.app.lib.theme.ThemeStore
7 |
8 | /**
9 | * @author Aidan Follestad (afollestad)
10 | */
11 | @Suppress("unused")
12 | class PrimaryTextView(context: Context, attrs: AttributeSet) :
13 | AppCompatTextView(context, attrs) {
14 |
15 | init {
16 | setTextColor(ThemeStore.textColorPrimary(context))
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_create_folder_outline.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_tab_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/ui/widget/text/SecondaryTextView.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.ui.widget.text
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import androidx.appcompat.widget.AppCompatTextView
6 | import io.legado.app.lib.theme.secondaryTextColor
7 |
8 | /**
9 | * @author Aidan Follestad (afollestad)
10 | */
11 | @Suppress("unused")
12 | class SecondaryTextView(context: Context, attrs: AttributeSet) :
13 | AppCompatTextView(context, attrs) {
14 |
15 | init {
16 | setTextColor(context.secondaryTextColor)
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/constant/BookSourceType.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.constant
2 |
3 | import androidx.annotation.IntDef
4 |
5 | @Suppress("ConstPropertyName")
6 | object BookSourceType {
7 |
8 | const val default = 0 // 0 文本
9 | const val audio = 1 // 1 音频
10 | const val image = 2 // 2 图片
11 | const val file = 3 // 3 只提供下载服务的网站
12 |
13 | @Target(AnnotationTarget.VALUE_PARAMETER)
14 | @Retention(AnnotationRetention.SOURCE)
15 | @IntDef(default, audio, image, file)
16 | annotation class Type
17 |
18 | }
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/ui/rss/article/BaseRssArticlesAdapter.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.ui.rss.article
2 |
3 | import android.content.Context
4 | import androidx.viewbinding.ViewBinding
5 | import io.legado.app.base.adapter.RecyclerAdapter
6 | import io.legado.app.data.entities.RssArticle
7 |
8 |
9 | abstract class BaseRssArticlesAdapter(context: Context, val callBack: CallBack) :
10 | RecyclerAdapter(context) {
11 |
12 | interface CallBack {
13 | val isGridLayout: Boolean
14 | fun readRss(rssArticle: RssArticle)
15 | }
16 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_radio_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/rss_main_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
11 |
12 |
15 |
16 |
19 |
20 |
--------------------------------------------------------------------------------
/modules/web/src/pages/bookshelf/main.js:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue'
2 | import App from '@/App.vue'
3 | import bookRouter from '@/router/bookRouter'
4 | import store from '@/store'
5 | import 'element-plus/theme-chalk/dark/css-vars.css'
6 |
7 | createApp(App).use(store).use(bookRouter).mount('#app')
8 |
9 | // 同步Element PLUS 夜间模式
10 | watch(
11 | () => useBookStore().isNight,
12 | isNight => {
13 | if (isNight) {
14 | document.documentElement.classList.add('dark')
15 | } else {
16 | document.documentElement.classList.remove('dark')
17 | }
18 | },
19 | )
20 |
--------------------------------------------------------------------------------
/modules/web/eslint.config.mjs:
--------------------------------------------------------------------------------
1 | import pluginVue from 'eslint-plugin-vue'
2 | import vueTsEslintConfig from '@vue/eslint-config-typescript'
3 | import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'
4 |
5 | export default [
6 | {
7 | name: 'app/files-to-lint',
8 | files: ['**/*.{ts,mts,tsx,vue}'],
9 | },
10 |
11 | {
12 | name: 'app/files-to-ignore',
13 | ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**', "src/plugins/jump.js"],
14 | },
15 |
16 | ...pluginVue.configs['flat/essential'],
17 | ...vueTsEslintConfig(),
18 | skipFormatting,
19 | ]
20 |
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/ui/book/read/page/entities/column/BaseColumn.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.ui.book.read.page.entities.column
2 |
3 | import android.graphics.Canvas
4 | import io.legado.app.ui.book.read.page.ContentTextView
5 | import io.legado.app.ui.book.read.page.entities.TextLine
6 |
7 | /**
8 | * 列基类
9 | */
10 | interface BaseColumn {
11 | var start: Float
12 | var end: Float
13 | var textLine: TextLine
14 |
15 | fun draw(view: ContentTextView, canvas: Canvas)
16 |
17 | fun isTouch(x: Float): Boolean {
18 | return x > start && x < end
19 | }
20 |
21 | }
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/base/VMBaseActivity.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.base
2 |
3 | import androidx.lifecycle.ViewModel
4 | import androidx.viewbinding.ViewBinding
5 | import io.legado.app.constant.Theme
6 |
7 | abstract class VMBaseActivity(
8 | fullScreen: Boolean = true,
9 | theme: Theme = Theme.Auto,
10 | toolBarTheme: Theme = Theme.Auto,
11 | transparent: Boolean = false,
12 | imageBg: Boolean = true
13 | ) : BaseActivity(fullScreen, theme, toolBarTheme, transparent, imageBg) {
14 |
15 | protected abstract val viewModel: VM
16 |
17 | }
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/data/entities/rule/RowUi.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.data.entities.rule
2 |
3 | data class RowUi(
4 | var name: String = "",
5 | var type: String = "text",
6 | var action: String? = null,
7 | var style: FlexChildStyle? = null
8 | ) {
9 |
10 | @Suppress("ConstPropertyName")
11 | object Type {
12 |
13 | const val text = "text"
14 | const val password = "password"
15 | const val button = "button"
16 |
17 | }
18 |
19 | fun style(): FlexChildStyle {
20 | return style ?: FlexChildStyle.defaultStyle
21 | }
22 |
23 | }
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/utils/ThrowableExtensions.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.utils
2 |
3 | import java.io.IOException
4 |
5 | val Throwable.stackTraceStr: String
6 | get() {
7 | val stackTrace = stackTraceToString()
8 | val lMsg = this.localizedMessage ?: "noErrorMsg"
9 | return when {
10 | stackTrace.isNotEmpty() -> stackTrace
11 | else -> lMsg
12 | }
13 | }
14 |
15 | fun Throwable.asIOException(): IOException {
16 | val newException = IOException(this.message)
17 | newException.initCause(this)
18 | return newException
19 | }
--------------------------------------------------------------------------------
/app/src/main/java/io/legado/app/utils/canvasrecorder/pools/CanvasPool.kt:
--------------------------------------------------------------------------------
1 | package io.legado.app.utils.canvasrecorder.pools
2 |
3 | import android.graphics.Canvas
4 | import androidx.core.util.Pools
5 |
6 | class CanvasPool(size: Int) {
7 |
8 | private val pool = Pools.SynchronizedPool