feat(project): 初始化项目结构和配置
This commit is contained in:
Executable
+65
@@ -0,0 +1,65 @@
|
||||
name: BUG提交 / BUG Report
|
||||
description: Report bugs to developers
|
||||
labels: ["BUG"]
|
||||
body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: 确认 / Assignments
|
||||
description: 提交issue请确保完成以下前提,否则该issue可能被忽略 / Make sure you read checkboxs below
|
||||
options:
|
||||
- label: 搜索现有issues,不存在相似或相关的issue / No similar or related issues
|
||||
required: true
|
||||
- label: 最新[测试版](https://github.com/gedoor/legado/releases/beta)依然存在此问题 / Latest beta app does not work
|
||||
required: true
|
||||
- label: 此问题和Xposed、Lsposed、Magisk、手机主题、浏览器插件、无障碍服务等无关 / Make sure your machine is not touched by hook frameworks, plugins, accessibility etc
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: 问题描述 / Describe Bugs
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: 复现步骤 / How to reproduce
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: 确认 / Assignment
|
||||
options:
|
||||
- label: 已经提交复现所需要的附加资料 / Submit additions related with bugs
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: 其他信息 / Additions
|
||||
description: |
|
||||
反馈WEB书架前端问题时请提供浏览器版本信息,如Edge 129.0.2792.89
|
||||
placeholder: "请用```将提交的内容包裹"
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: 日志提交 / Relevant log output
|
||||
description: |
|
||||
阅读日志位于我的-关于-崩溃日志、保存日志、书架-右上角-日志,或者自行使用log工具抓取日志
|
||||
如果崩溃日志中包含`java.lang.OutOfMemoryError`,请安装最新测试版,在其他设置里打开记录堆转储,复现崩溃后去关于那里点保存日志,然后去备份目录里将heapDump文件夹里的文件打包压缩一下上传上来
|
||||
placeholder: "请用```将日志内容包裹"
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: 阅读版本 / Legado version
|
||||
placeholder: "3.22.110823"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Android版本 / Android version
|
||||
placeholder: "Android 12"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: 机型 / Model
|
||||
placeholder: "Redmi K30 Pro"
|
||||
validations:
|
||||
required: true
|
||||
Executable
+40
@@ -0,0 +1,40 @@
|
||||
name: 功能请求 / Features
|
||||
description: Request new features
|
||||
labels: ["需求"]
|
||||
body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: 确认 / Assignments
|
||||
description: 提交issue请确保完成以下前提,否则该issue可能被忽略 / Make sure you read checkbox below
|
||||
options:
|
||||
- label: 搜索现有issues,不存在相似或相关的issue / No related requests
|
||||
required: true
|
||||
- label: 最新[测试版](https://github.com/gedoor/legado/releases/beta)没有此功能 / Latest beta app does not this feature
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: 功能描述 / Features
|
||||
placeholder: 请清晰的、详细的描述你想要的功能
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: 期望实现方式 / How to implement
|
||||
placeholder: 阅读应该如何实现该功能
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: 阅读版本 / Legado version
|
||||
placeholder: "3.22.110823"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: 附加信息 / Additions
|
||||
placeholder: 其他的与功能相关的附加信息
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: 效果演示 / Demo
|
||||
placeholder: 可以手绘一些草图,或者提供可借鉴的图片
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: 简繁转化
|
||||
url: https://github.com/liuyueyi/quick-chinese-transfer/issues/new
|
||||
about: 简繁转化问题请优先到quick-chinese-transfer反馈
|
||||
- name: 讨论 / Discussions
|
||||
url: https://github.com/gedoor/legado/discussions
|
||||
about: Please ask and answer questions here.
|
||||
- name: 常见问题 / Wiki
|
||||
url: https://github.com/gedoor/legado/wiki
|
||||
about: Read wiki if your are new here.
|
||||
Executable
+45
@@ -0,0 +1,45 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
registries:
|
||||
maven-google:
|
||||
type: maven-repository
|
||||
# url: https://maven.google.com
|
||||
url: https://dl.google.com/dl/android/maven2/
|
||||
password: dummy
|
||||
username: dummy
|
||||
maven-central:
|
||||
type: maven-repository
|
||||
url: https://repo1.maven.org/maven2/
|
||||
password: dummy
|
||||
username: dummy
|
||||
maven-jitpack:
|
||||
type: maven-repository
|
||||
url: https://jitpack.io
|
||||
password: dummy
|
||||
username: dummy
|
||||
|
||||
updates:
|
||||
- package-ecosystem: gradle
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
registries: "*"
|
||||
open-pull-requests-limit: 20
|
||||
groups:
|
||||
kotlin_KSP:
|
||||
patterns:
|
||||
- "org.jetbrains.kotlin:*"
|
||||
- "com.google.devtools.ksp"
|
||||
# Maintain dependencies for GitHub Actions
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: npm
|
||||
directory: "modules/web"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
Executable
+92
@@ -0,0 +1,92 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#分支Stable Dev Beta
|
||||
branch=$1
|
||||
#api 最大偏移
|
||||
max_offset=$2
|
||||
|
||||
[ -z $1 ] && branch=Stable
|
||||
[ -z $2 ] && max_offset=3
|
||||
[ -z $GITHUB_ENV ] && echo "Error: Unexpected github workflow environment" && exit
|
||||
|
||||
offset=0
|
||||
|
||||
function fetch_version() {
|
||||
# 获取最新cronet版本
|
||||
lastest_cronet_version=`curl -s "https://chromiumdash.appspot.com/fetch_releases?channel=$branch&platform=Android&num=1&offset=$offset" | jq .[0].version -r`
|
||||
echo "lastest_cronet_version: $lastest_cronet_version"
|
||||
#lastest_cronet_version=100.0.4845.0
|
||||
lastest_cronet_main_version=${lastest_cronet_version%%\.*}.0.0.0
|
||||
check_version_exit
|
||||
}
|
||||
function check_version_exit() {
|
||||
# 检查版本是否存在
|
||||
local jar_url="https://storage.googleapis.com/chromium-cronet/android/$lastest_cronet_version/Release/cronet/cronet_api.jar"
|
||||
statusCode=$(curl -s -I -w %{http_code} "$jar_url" -o /dev/null)
|
||||
if [ $statusCode == "404" ]; then
|
||||
echo "storage.googleapis.com return 404 for cronet $lastest_cronet_version"
|
||||
if [[ $max_offset > $offset ]]; then
|
||||
offset=$(expr $offset + 1)
|
||||
echo "retry with offset $offset"
|
||||
fetch_version
|
||||
else
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
}
|
||||
function version_compare() {
|
||||
# 版本号比较 本地版本小于远程版本时返回0
|
||||
local local_version=$1
|
||||
local remote_version=$2
|
||||
if [[ $local_version == $remote_version ]]; then
|
||||
return 1
|
||||
fi
|
||||
if [[ $(printf '%s\n' "$1" "$2" | sort -V | head -n1) == $remote_version ]]; then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
# 添加变量到github env
|
||||
function write_github_env_variable() {
|
||||
echo "$1=$2" >> $GITHUB_ENV
|
||||
}
|
||||
|
||||
function sync_proguard_rules() {
|
||||
local raw_github_git="https://raw.githubusercontent.com/chromium/chromium/$lastest_cronet_version"
|
||||
local proguard_paths=(
|
||||
components/cronet/android/cronet_combined_impl_native_proguard_golden.cfg
|
||||
)
|
||||
local proguard_rules_path="$GITHUB_WORKSPACE/app/cronet-proguard-rules.pro"
|
||||
rm -f $proguard_rules_path
|
||||
echo "fetch cronet proguard rules from upstream $raw_github_git"
|
||||
for path in ${proguard_paths[@]}
|
||||
do
|
||||
echo "fetching $path ..."
|
||||
curl "$raw_github_git/$path" >> $proguard_rules_path
|
||||
done
|
||||
}
|
||||
##########
|
||||
# 获取本地cronet版本
|
||||
path=$GITHUB_WORKSPACE/gradle.properties
|
||||
current_cronet_version=`cat $path | grep CronetVersion | sed s/CronetVersion=//`
|
||||
echo "current_cronet_version: $current_cronet_version"
|
||||
|
||||
echo "fetch $branch release info from https://chromiumdash.appspot.com ..."
|
||||
fetch_version
|
||||
|
||||
if version_compare $current_cronet_version $lastest_cronet_version; then
|
||||
# 更新gradle.properties
|
||||
sed -i s/CronetVersion=.*/CronetVersion=$lastest_cronet_version/ $path
|
||||
sed -i s/CronetMainVersion=.*/CronetMainVersion=$lastest_cronet_main_version/ $path
|
||||
# 更新cronet_proguard_rules.pro
|
||||
sync_proguard_rules
|
||||
# 更新cronet版本
|
||||
sed -i "s/## cronet版本: .*/## cronet版本: $lastest_cronet_version/" $GITHUB_WORKSPACE/app/src/main/assets/updateLog.md
|
||||
# 生成pull request信息
|
||||
write_github_env_variable PR_TITLE "Bump cronet from $current_cronet_version to $lastest_cronet_version"
|
||||
write_github_env_variable PR_BODY "Changes in the [Git log](https://chromium.googlesource.com/chromium/src/+log/$current_cronet_version..$lastest_cronet_version)"
|
||||
# 生成cronet flag
|
||||
write_github_env_variable cronet ok
|
||||
fi
|
||||
Executable
+98
@@ -0,0 +1,98 @@
|
||||
import requests, os, datetime, sys
|
||||
|
||||
# Cookie 中 phpdisk_info 的值
|
||||
cookie_phpdisk_info = os.environ.get('phpdisk_info')
|
||||
# Cookie 中 ylogin 的值
|
||||
cookie_ylogin = os.environ.get('ylogin')
|
||||
|
||||
# 请求头
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36 Edg/89.0.774.45',
|
||||
'Accept-Language': 'zh-CN,zh;q=0.9',
|
||||
'Referer': 'https://pc.woozooo.com/account.php?action=login'
|
||||
}
|
||||
|
||||
# 小饼干
|
||||
cookie = {
|
||||
'ylogin': cookie_ylogin,
|
||||
'phpdisk_info': cookie_phpdisk_info
|
||||
}
|
||||
|
||||
|
||||
# 日志打印
|
||||
def log(msg):
|
||||
utc_time = datetime.datetime.utcnow()
|
||||
china_time = utc_time + datetime.timedelta(hours=8)
|
||||
print(f"[{china_time.strftime('%Y.%m.%d %H:%M:%S')}] {msg}")
|
||||
|
||||
|
||||
# 检查是否已登录
|
||||
def login_by_cookie():
|
||||
url_account = "https://pc.woozooo.com/account.php"
|
||||
if cookie['phpdisk_info'] is None:
|
||||
log('ERROR: 请指定 Cookie 中 phpdisk_info 的值!')
|
||||
return False
|
||||
if cookie['ylogin'] is None:
|
||||
log('ERROR: 请指定 Cookie 中 ylogin 的值!')
|
||||
return False
|
||||
res = requests.get(url_account, headers=headers, cookies=cookie, verify=True)
|
||||
if '网盘用户登录' in res.text:
|
||||
log('ERROR: 登录失败,请更新Cookie')
|
||||
return False
|
||||
else:
|
||||
log('登录成功')
|
||||
return True
|
||||
|
||||
|
||||
# 上传文件
|
||||
def upload_file(file_dir, folder_id):
|
||||
file_name = os.path.basename(file_dir)
|
||||
url_upload = "https://up.woozooo.com/fileup.php"
|
||||
headers['Referer'] = f'https://up.woozooo.com/mydisk.php?item=files&action=index&u={cookie_ylogin}'
|
||||
post_data = {
|
||||
"task": "1",
|
||||
"folder_id": folder_id,
|
||||
"id": "WU_FILE_0",
|
||||
"name": file_name,
|
||||
}
|
||||
files = {'upload_file': (file_name, open(file_dir, "rb"), 'application/octet-stream')}
|
||||
res = requests.post(url_upload, data=post_data, files=files, headers=headers, cookies=cookie, timeout=120).json()
|
||||
log(f"{file_dir} -> {res['info']}")
|
||||
return res['zt'] == 1
|
||||
|
||||
|
||||
# 上传文件夹内的文件
|
||||
def upload_folder(folder_dir, folder_id):
|
||||
file_list = sorted(os.listdir(folder_dir), reverse=True)
|
||||
for file in file_list:
|
||||
path = os.path.join(folder_dir, file)
|
||||
if os.path.isfile(path):
|
||||
upload_file(path, folder_id)
|
||||
else:
|
||||
upload_folder(path, folder_id)
|
||||
|
||||
|
||||
# 上传
|
||||
def upload(dir, folder_id):
|
||||
if dir is None:
|
||||
log('ERROR: 请指定上传的文件路径')
|
||||
return
|
||||
if folder_id is None:
|
||||
log('ERROR: 请指定蓝奏云的文件夹id')
|
||||
return
|
||||
if os.path.isfile(dir):
|
||||
upload_file(dir, str(folder_id))
|
||||
else:
|
||||
upload_folder(dir, str(folder_id))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
argv = sys.argv[1:]
|
||||
if len(argv) != 2:
|
||||
log('ERROR: 参数错误,请以这种格式重新尝试\npython lzy_web.py 需上传的路径 蓝奏云文件夹id')
|
||||
# 需上传的路径
|
||||
upload_path = argv[0]
|
||||
# 蓝奏云文件夹id
|
||||
lzy_folder_id = argv[1]
|
||||
if login_by_cookie():
|
||||
upload(upload_path, lzy_folder_id)
|
||||
Executable
+47
@@ -0,0 +1,47 @@
|
||||
import os, sys, telebot
|
||||
|
||||
# 上传文件
|
||||
def upload_file(tb, chat_id, file_dir):
|
||||
doc = open(file_dir, 'rb')
|
||||
tb.send_document(chat_id, doc)
|
||||
|
||||
# 上传文件夹内的文件
|
||||
def upload_folder(tb, chat_id, folder_dir):
|
||||
file_list = sorted(os.listdir(folder_dir))
|
||||
for file in file_list:
|
||||
path = os.path.join(folder_dir, file)
|
||||
if os.path.isfile(path):
|
||||
upload_file(tb, chat_id, path)
|
||||
else:
|
||||
upload_folder(tb, chat_id, path)
|
||||
|
||||
# 上传
|
||||
def upload(tb, chat_id, dir):
|
||||
if tb is None:
|
||||
log('ERROR: 输入正确的token')
|
||||
return
|
||||
if chat_id is None:
|
||||
log('ERROR: 输入正确的chat_id')
|
||||
return
|
||||
if dir is None:
|
||||
log('ERROR: 请指定上传的文件路径')
|
||||
return
|
||||
if os.path.isfile(dir):
|
||||
upload_file(tb, chat_id, dir)
|
||||
else:
|
||||
upload_folder(tb, chat_id, dir)
|
||||
|
||||
if __name__ == '__main__':
|
||||
argv = sys.argv[1:]
|
||||
if len(argv) != 3:
|
||||
log('ERROR: 参数错误,请以这种格式重新尝试\npython tg_bot.py $token $chat_id 待上传的路径')
|
||||
# Token
|
||||
TOKEN = argv[0]
|
||||
# chat_id
|
||||
chat_id = argv[1]
|
||||
# 待上传文件的路径
|
||||
upload_path = argv[2]
|
||||
#创建连接
|
||||
tb = telebot.TeleBot(TOKEN)
|
||||
#开始上传
|
||||
upload(tb, chat_id, upload_path)
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#更新fork
|
||||
name: update fork
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 16 * * *' #0点定时任务
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.repository.owner.id == github.event.sender.id && github.actor != 'gedoor' }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set env
|
||||
run: |
|
||||
git config --global user.email "github-actions@github.com"
|
||||
git config --global user.name "github-actions"
|
||||
- name: Update fork
|
||||
run: |
|
||||
git remote add upstream https://github.com/gedoor/legado.git
|
||||
git remote -v
|
||||
git fetch upstream
|
||||
git checkout master
|
||||
git merge upstream/master
|
||||
git push origin master
|
||||
Executable
+53
@@ -0,0 +1,53 @@
|
||||
name: Update Cronet
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# 周一北京时间9点
|
||||
- cron: 0 1 * * 1
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.repository == 'gedoor/legado' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Check Cronet Updates
|
||||
run: source .github/scripts/cronet.sh
|
||||
|
||||
- name: Set up JDK 17
|
||||
if: ${{ env.cronet == 'ok' }}
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
|
||||
- uses: gradle/actions/setup-gradle@v4
|
||||
if: ${{ env.cronet == 'ok' }}
|
||||
|
||||
- name: Download Cronet
|
||||
if: ${{ env.cronet == 'ok' }}
|
||||
run: |
|
||||
chmod +x gradlew
|
||||
./gradlew app:downloadCronet
|
||||
|
||||
- name: Create Pull Request
|
||||
if: ${{ env.cronet == 'ok' }}
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
continue-on-error: true
|
||||
with:
|
||||
token: ${{ secrets.ACTIONS_TOKEN }}
|
||||
title: ${{ env.PR_TITLE }}
|
||||
commit-message: |
|
||||
${{ env.PR_TITLE }}
|
||||
- ${{ env.PR_BODY }}
|
||||
body: ${{ env.PR_BODY }}
|
||||
branch: cronet
|
||||
delete-branch: true
|
||||
add-paths: |
|
||||
*cronet*jar
|
||||
*cronet.json
|
||||
*updateLog.md
|
||||
*gradle.properties
|
||||
*cronet-proguard-rules.pro
|
||||
Executable
BIN
Binary file not shown.
Executable
+140
@@ -0,0 +1,140 @@
|
||||
name: Release Build
|
||||
|
||||
on:
|
||||
# push:
|
||||
# branches:
|
||||
# - master
|
||||
# paths:
|
||||
# - 'CHANGELOG.md'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
|
||||
outputs:
|
||||
version: ${{ steps.set-ver.outputs.version }}
|
||||
play: ${{ steps.check.outputs.play }}
|
||||
sign: ${{ steps.check.outputs.sign }}
|
||||
steps:
|
||||
- id: set-ver
|
||||
run: |
|
||||
echo "version=$(date -d "8 hour" -u +3.%y.%m%d%H)" >> $GITHUB_OUTPUT
|
||||
- id: check
|
||||
run: |
|
||||
if [ ! -z "${{ secrets.RELEASE_KEY_STORE }}" ]; then
|
||||
echo "sign=yes" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
if [ ! -z "${{ secrets.SERVICE_ACCOUNT_JSON }}" ]; then
|
||||
echo "play=yes" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
build:
|
||||
needs: prepare
|
||||
if: ${{ needs.prepare.outputs.sign }}
|
||||
strategy:
|
||||
matrix:
|
||||
product: [ app, google ]
|
||||
fail-fast: false
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
product: ${{ matrix.product }}
|
||||
VERSION: ${{ needs.prepare.outputs.version }}
|
||||
play: ${{ needs.prepare.outputs.play }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
|
||||
- name: Release Apk Sign
|
||||
run: |
|
||||
# not use this output
|
||||
# echo "KeyStore=yes" >> $GITHUB_OUTPUT
|
||||
echo -e "\n" >> gradle.properties
|
||||
echo RELEASE_KEY_ALIAS='${{ secrets.RELEASE_KEY_ALIAS }}' >> gradle.properties
|
||||
echo RELEASE_KEY_PASSWORD='${{ secrets.RELEASE_KEY_PASSWORD }}' >> gradle.properties
|
||||
echo RELEASE_STORE_PASSWORD='${{ secrets.RELEASE_STORE_PASSWORD }}' >> gradle.properties
|
||||
echo RELEASE_STORE_FILE='./key.jks' >> gradle.properties
|
||||
echo ${{ secrets.RELEASE_KEY_STORE }} | base64 --decode > $GITHUB_WORKSPACE/app/key.jks
|
||||
|
||||
- name: Unify Version Name
|
||||
run: |
|
||||
echo "统一版本号"
|
||||
sed "/def version/c def version = \"${{ env.VERSION }}\"" $GITHUB_WORKSPACE/app/build.gradle -i
|
||||
|
||||
- name: Set up Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: Build With Gradle
|
||||
run: |
|
||||
echo "开始进行${{ env.product }}构建"
|
||||
chmod +x gradlew
|
||||
./gradlew assemble${{ env.product }}release --build-cache --parallel --daemon --warning-mode all
|
||||
|
||||
- name: Organize the Files
|
||||
run: |
|
||||
mkdir -p ${{ github.workspace }}/apk/
|
||||
cp -rf ${{ github.workspace }}/app/build/outputs/apk/*/*/*.apk ${{ github.workspace }}/apk/
|
||||
|
||||
- name: Upload App To Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: legado_${{ env.product }}
|
||||
path: ${{ github.workspace }}/apk/*.apk
|
||||
|
||||
- name: Release
|
||||
if: ${{ env.product == 'app' }}
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
name: legado_app_${{ env.VERSION }}
|
||||
tag_name: ${{ env.VERSION }}
|
||||
body_path: ${{ github.workspace }}/CHANGELOG.md
|
||||
draft: false
|
||||
prerelease: false
|
||||
files: ${{ github.workspace }}/apk/legado_app_*.apk
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Prepare For GooglePlay
|
||||
if: env.product == 'google' && env.play == 'yes'
|
||||
run: |
|
||||
mkdir -p ReleaseNotes
|
||||
ln -s ${{ github.workspace }}/CHANGELOG.md ReleaseNotes/whatsnew-en-US
|
||||
ln -s ${{ github.workspace }}/CHANGELOG.md ReleaseNotes/whatsnew-zh-CN
|
||||
|
||||
- name: Release To GooglePlay
|
||||
if: env.product == 'google' && env.play == 'yes'
|
||||
uses: r0adkll/upload-google-play@v1
|
||||
with:
|
||||
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
|
||||
packageName: io.legado.play
|
||||
releaseFiles: ${{ github.workspace }}/apk/legado_google_*.apk
|
||||
track: production
|
||||
whatsNewDirectory: ${{ github.workspace }}/ReleaseNotes
|
||||
|
||||
- name: Push Assets To "release" Branch
|
||||
if: ${{ github.actor == 'gedoor' }}
|
||||
run: |
|
||||
cd $GITHUB_WORKSPACE/apk/
|
||||
git init
|
||||
git checkout -b release
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git remote add origin "https://${{ github.actor }}:${{ secrets.ACTIONS_TOKEN }}@github.com/${{ github.actor }}/release"
|
||||
git add *.apk
|
||||
git commit -m "${{ env.VERSION }}"
|
||||
git push -f -u origin release
|
||||
|
||||
- name: Purge Jsdelivr Cache
|
||||
if: ${{ github.actor == 'gedoor' }}
|
||||
run: |
|
||||
result=$(curl -s https://purge.jsdelivr.net/gh/${{ github.actor }}/release@release/)
|
||||
if echo $result |grep -q 'success.*true'; then
|
||||
echo "jsdelivr缓存更新成功"
|
||||
else
|
||||
echo $result
|
||||
fi
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
|
||||
#
|
||||
# You can adjust the behavior by modifying this file.
|
||||
# For more information, see:
|
||||
# https://github.com/actions/stale
|
||||
name: closeStaleIssue
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# 每5天北京时间9点
|
||||
- cron: '30 1 1/5 * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.repository == 'gedoor/legado' }}
|
||||
permissions:
|
||||
issues: write
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: '由于长期没有状态更新,该问题将于5天后自动关闭。如有需要可重新打开。'
|
||||
days-before-stale: 30
|
||||
days-before-close: 5
|
||||
operations-per-run: 100
|
||||
Executable
+278
@@ -0,0 +1,278 @@
|
||||
name: Test Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '**'
|
||||
# - '!**/assets/**'
|
||||
# - '!**.md'
|
||||
- '!**/ISSUE_TEMPLATE/**'
|
||||
- '!**/modules/web/**'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**/modules/web/**'
|
||||
workflow_run:
|
||||
workflows: [Build Web]
|
||||
branches: [master]
|
||||
types:
|
||||
- completed
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ !startsWith(github.event.head_commit.message, 'Merge pull request') }}
|
||||
outputs:
|
||||
version: ${{ steps.set-ver.outputs.version }}
|
||||
versionL: ${{ steps.set-ver.outputs.versionL }}
|
||||
lanzou: ${{ steps.check.outputs.lanzou }}
|
||||
telegram: ${{ steps.check.outputs.telegram }}
|
||||
steps:
|
||||
- id: set-ver
|
||||
run: |
|
||||
echo "version=$(date -d "8 hour" -u +3.%y.%m%d%H)" >> $GITHUB_OUTPUT
|
||||
echo "versionL=$(date -d "8 hour" -u +3.%y.%m%d%H%M)" >> $GITHUB_OUTPUT
|
||||
- id: check
|
||||
run: |
|
||||
if [ ${{ secrets.LANZOU_ID }} ]; then
|
||||
echo "lanzou=yes" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
if [ ${{ secrets.BOT_TOKEN }} ]; then
|
||||
echo "telegram=yes" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
build:
|
||||
needs: prepare
|
||||
strategy:
|
||||
matrix:
|
||||
product: [ app ]
|
||||
type: [ release, releaseA ]
|
||||
fail-fast: false
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
product: ${{ matrix.product }}
|
||||
type: ${{ matrix.type }}
|
||||
VERSION: ${{ needs.prepare.outputs.version }}
|
||||
VERSIONL: ${{ needs.prepare.outputs.versionL }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
- name: Clear 18PlusList.txt
|
||||
run: |
|
||||
echo "清空18PlusList.txt"
|
||||
echo "">$GITHUB_WORKSPACE/app/src/main/assets/18PlusList.txt
|
||||
- name: Release Apk Sign
|
||||
run: |
|
||||
echo "给apk增加签名"
|
||||
cp $GITHUB_WORKSPACE/.github/workflows/legado.jks $GITHUB_WORKSPACE/app/legado.jks
|
||||
sed '$a\RELEASE_STORE_FILE=./legado.jks' $GITHUB_WORKSPACE/gradle.properties -i
|
||||
sed '$a\RELEASE_KEY_ALIAS=legado' $GITHUB_WORKSPACE/gradle.properties -i
|
||||
sed '$a\RELEASE_STORE_PASSWORD=gedoor_legado' $GITHUB_WORKSPACE/gradle.properties -i
|
||||
sed '$a\RELEASE_KEY_PASSWORD=gedoor_legado' $GITHUB_WORKSPACE/gradle.properties -i
|
||||
|
||||
- name: Set up Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: Build With Gradle
|
||||
continue-on-error: true
|
||||
run: |
|
||||
if [ ${{ env.type }} == 'release' ]; then
|
||||
typeName="原包名"
|
||||
else
|
||||
typeName="共存"
|
||||
sed "s/'.release'/'.releaseA'/" $GITHUB_WORKSPACE/app/build.gradle -i
|
||||
sed 's/.release/.releaseA/' $GITHUB_WORKSPACE/app/google-services.json -i
|
||||
fi
|
||||
echo "统一版本号"
|
||||
sed "/def version/c def version = \"${{ env.VERSION }}\"" $GITHUB_WORKSPACE/app/build.gradle -i
|
||||
echo "开始${{ env.product }}$typeName构建"
|
||||
chmod +x gradlew
|
||||
./gradlew assemble${{ env.product }}release --build-cache --parallel --daemon --warning-mode all
|
||||
echo "修改APK文件名"
|
||||
mkdir -p ${{ github.workspace }}/apk/
|
||||
for file in `ls ${{ github.workspace }}/app/build/outputs/apk/*/*/*.apk`; do
|
||||
mv "$file" ${{ github.workspace }}/apk/legado_${{ env.product }}_${{ env.VERSIONL }}_$typeName.apk
|
||||
done
|
||||
echo "移动mapping文件"
|
||||
mkdir -p ${{ github.workspace }}/mapping/
|
||||
for file in `ls ${{ github.workspace }}/app/build/outputs/mapping/*/mapping.txt`; do
|
||||
mv "$file" ${{ github.workspace }}/mapping/mapping.txt
|
||||
done
|
||||
|
||||
- name: Move Missing Rules Files
|
||||
run: |
|
||||
echo "移动missing_rules.txt文件"
|
||||
mkdir -p ${{ github.workspace }}/mapping/
|
||||
for file in `ls ${{ github.workspace }}/app/build/outputs/mapping/*/missing_rules.txt`; do
|
||||
mv "$file" ${{ github.workspace }}/mapping/missing_rules.txt
|
||||
done
|
||||
|
||||
- name: Upload Missing Rules File To Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: legado.${{ env.product }}.${{ env.type }}.mapping.missing_rules
|
||||
if-no-files-found: ignore
|
||||
path: ${{ github.workspace }}/mapping/missing_rules.txt
|
||||
|
||||
- name: Check Build production
|
||||
run: |
|
||||
if [ ! -d ${{ github.workspace }}/apk ]; then
|
||||
echo "Build production not found! Check gradle logs."
|
||||
exit 1
|
||||
fi
|
||||
cd ${{ github.workspace }}/apk/
|
||||
if [ ! -e legado_*.apk ]; then
|
||||
echo "Build production not found! Check gradle logs."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Upload App To Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: legado.${{ env.product }}.${{ env.type }}
|
||||
if-no-files-found: ignore
|
||||
path: ${{ github.workspace }}/apk/*.apk
|
||||
|
||||
- name: Upload Mapping File To Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: legado.${{ env.product }}.${{ env.type }}.mapping
|
||||
if-no-files-found: ignore
|
||||
path: ${{ github.workspace }}/mapping/mapping.txt
|
||||
|
||||
prerelease:
|
||||
needs: [ prepare, build ]
|
||||
if: github.event_name != 'pull_request' && github.repository == 'gedoor/legado'
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
VERSION: ${{ needs.prepare.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: apk/
|
||||
|
||||
- working-directory: apk/
|
||||
run: |
|
||||
mv */*.apk .
|
||||
rm -rf */
|
||||
|
||||
for file in `ls *.apk`; do
|
||||
if [[ "$file" == *原包名* ]]; then
|
||||
mv "$file" $(echo $file | sed s/原包名/release/)
|
||||
else
|
||||
mv "$file" $(echo $file | sed s/共存/releaseA/)
|
||||
fi
|
||||
done
|
||||
|
||||
- name: Delete Pre-Release
|
||||
run: |
|
||||
if gh release view beta &>/dev/null; then
|
||||
gh release delete beta -y
|
||||
fi
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
|
||||
- name: Create or update beta tag
|
||||
uses: richardsimko/update-tag@v1
|
||||
with:
|
||||
tag_name: beta
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Publish Pre-Release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
name: legado_app_${{ env.VERSION }}
|
||||
tag: "beta"
|
||||
body: |
|
||||
此版本为测试版,签名与正式版不同,可能存在不稳定情况,升级前请务必备份好数据。
|
||||
releaseA 为共存版本,可同时安装使用,功能没有区别。
|
||||
prerelease: true
|
||||
artifacts: ${{ github.workspace }}/apk/*.apk
|
||||
|
||||
lanzou:
|
||||
needs: [ prepare, build ]
|
||||
if: ${{ github.event_name != 'pull_request' && needs.prepare.outputs.lanzou == 'yes' }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
# 登录蓝奏云后在控制台运行document.cookie
|
||||
ylogin: ${{ secrets.LANZOU_ID }}
|
||||
phpdisk_info: ${{ secrets.LANZOU_PSD }}
|
||||
# 蓝奏云里的文件夹ID(阅读3测试版:2670621)
|
||||
LANZOU_FOLDER_ID: ${{ secrets.LANZOU_FOLDER_ID }}
|
||||
#蓝奏云分享链接
|
||||
LANZOU_URL: ${{ secrets.LANZOU_URL }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: apk/
|
||||
- working-directory: apk/
|
||||
run: mv */*.apk . ;rm -rf */
|
||||
- name: Upload To Lanzou
|
||||
continue-on-error: true
|
||||
run: |
|
||||
path="$GITHUB_WORKSPACE/apk/"
|
||||
python3 $GITHUB_WORKSPACE/.github/scripts/lzy_web.py "$path" "$LANZOU_FOLDER_ID"
|
||||
echo "[$(date -u -d '+8 hour' '+%Y.%m.%d %H:%M:%S')] 分享链接: $LANZOU_URL"
|
||||
|
||||
test_Branch:
|
||||
needs: [ prepare, build ]
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event_name != 'pull_request' && github.actor == 'gedoor' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: apk/
|
||||
- working-directory: apk/
|
||||
run: mv */*.apk . ;rm -rf */
|
||||
- name: Push To "test" Branch
|
||||
run: |
|
||||
cd $GITHUB_WORKSPACE/apk/
|
||||
git init
|
||||
git checkout -b test
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git remote add origin "https://${{ github.actor }}:${{ secrets.ACTIONS_TOKEN }}@github.com/${{ github.actor }}/release"
|
||||
git add *.apk
|
||||
git commit -m "${{ needs.prepare.outputs.versionL }}"
|
||||
git push -f -u origin test
|
||||
|
||||
telegram:
|
||||
needs: [ prepare, build ]
|
||||
if: ${{ github.event_name != 'pull_request' && needs.prepare.outputs.telegram == 'yes' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: apk/
|
||||
- working-directory: apk/
|
||||
run: |
|
||||
for file in `ls */*.apk`; do
|
||||
mv "$file" "$(echo "$file"|sed -e 's#.*\/##g' -e "s/_/ /g" -e 's/legado/阅读/')"
|
||||
done
|
||||
rm -rf */
|
||||
- name: Post to channel
|
||||
uses: xireiki/channel-post@v1
|
||||
with:
|
||||
chat_id: ${{ secrets.CHANNEL_ID }}
|
||||
bot_token: ${{ secrets.BOT_TOKEN }}
|
||||
context: "#阅读 #Legado #Beta ${{ needs.prepare.outputs.versionL }}"
|
||||
path: apk/*
|
||||
method: sendFile
|
||||
Executable
+65
@@ -0,0 +1,65 @@
|
||||
name: Build Web
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '**/modules/web/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**/modules/web/**'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
UPSTREAM_REPOSITORY: gedoor/legado
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
name: Install pnpm
|
||||
id: pnpm-install
|
||||
with:
|
||||
version: 9
|
||||
run_install: false
|
||||
|
||||
- name: Get pnpm store directory
|
||||
id: pnpm-cache
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: actions/cache@v4
|
||||
name: Setup pnpm cache
|
||||
with:
|
||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/web/package.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: Build and move files
|
||||
working-directory: modules/web
|
||||
run: |
|
||||
pnpm i
|
||||
pnpm build
|
||||
version="v$(date -d "8 hour" -u +3.%y.%m%d%H)"
|
||||
echo "APP_VER=$version" >> $GITHUB_ENV
|
||||
|
||||
- name: push changes
|
||||
if: ${{ github.event_name != 'pull_request' && github.repository == env.UPSTREAM_REPOSITORY }}
|
||||
uses: stefanzweifel/git-auto-commit-action@v5.1.0
|
||||
with:
|
||||
commit_message: Bump web ${{ env.APP_VER}}
|
||||
file_pattern: app/src/main/assets/web/vue/
|
||||
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
*.iml
|
||||
.gradle
|
||||
local.properties
|
||||
.DS_Store
|
||||
/build
|
||||
build/
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
/release
|
||||
/tmp
|
||||
node_modules/
|
||||
/app/app
|
||||
/app/google
|
||||
/app/gradle.properties
|
||||
package-lock.json
|
||||
.idea/
|
||||
# Kotlin 2.0
|
||||
.kotlin/
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
**2022/10/02**
|
||||
|
||||
* 更新cronet: 106.0.5249.79
|
||||
* 正文选择菜单朗读按钮长按可切换朗读选择内容和从选择开始处一直朗读
|
||||
* 源编辑输入框设置最大行数12,在行数特别多的时候更容易滚动到其它输入
|
||||
* 修复某些情况下无法搜索到标题的bug,净化规则较多的可能会降低搜索速度 by Xwite
|
||||
* 修复文件类书源换源后阅读bug by Xwite
|
||||
* Cronet 支持DnsHttpsSvcb by g2s20150909
|
||||
* 修复web进度同步问题 by 821938089
|
||||
* 启用混淆以减小app大小 有bug请带日志反馈
|
||||
* 其它一些优化
|
||||
Executable
+149
@@ -0,0 +1,149 @@
|
||||
# [English](English.md) [中文](README.md)
|
||||
|
||||
[](https://play.google.com/store/apps/details?id=io.legado.play.release)
|
||||
<a href="https://jb.gg/OpenSourceSupport" target="_blank">
|
||||
<img width="24" height="24" src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg?_gl=1*135yekd*_ga*OTY4Mjg4NDYzLjE2Mzk0NTE3MzQ.*_ga_9J976DJZ68*MTY2OTE2MzM5Ny4xMy4wLjE2NjkxNjMzOTcuNjAuMC4w&_ga=2.257292110.451256242.1669085120-968288463.1639451734" alt="idea"/>
|
||||
</a>
|
||||
<div align="center">
|
||||
<img width="125" height="125" src="https://github.com/gedoor/legado/raw/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png" alt="legado"/>
|
||||
|
||||
Legado / 开源阅读
|
||||
<br>
|
||||
<a href="https://gedoor.github.io" target="_blank">gedoor.github.io</a> / <a href="https://www.legado.top/" target="_blank">legado.top</a>
|
||||
<br>
|
||||
Legado is a free and open source novel reader for Android.
|
||||
</div>
|
||||
|
||||
[](#contents) [](#Function-) [](#Download-) [](#Community-) [](#API-) [](#Other-) [](#Grateful-) [](#Interface-)
|
||||
|
||||
>New user?
|
||||
>
|
||||
>The software does not provide content, you need to add it manually, such as importing book sources, etc.
|
||||
>Take a look at [official help documentation](https://www.yuque.com/legado/wiki),Maybe there's an answer you need inside.
|
||||
|
||||
# Function [](#Function-)
|
||||
|
||||
You can customize the book source, set your own rules, and capture web page data. The rules are simple and easy to understand. There are rules in the software. List bookshelf, grid bookshelf switch freely. The book source rules support search and discovery, and all the functions of finding books and reading books are all customized, making it easier to find books.
|
||||
* Custom ebook sources, set your own rules to capture web data, the rules are simple and easy to understand, the software has a rule description.
|
||||
* eBook sources rules support search and discovery, all find books and read books function all custom, find books more convenient.
|
||||
* Schedule updating your library for new chapters.
|
||||
* Online reading from web sources that can be imported in bulk
|
||||
* Local reading of Auto-download episodes.
|
||||
* Local reading of TXT or EPUB files
|
||||
* ebook Wishlist
|
||||
* Big text viewer. You can open eBook and txt in 1GB size
|
||||
* Automatic text replacement for removing ad in content
|
||||
* List bookshelf, grid bookshelf free to switch.
|
||||
* Subscription content, you can subscribe to any content you want to see, see what you want to see
|
||||
* A configurable reader with fonts, background, page transitions mode and other settings
|
||||
* Timer. Set interval time to listen ebook, time up, ebook turn off completely.
|
||||
* TTS book reader. tts can optionally be install“smartvoice-4.1.0” or ”Speech Services by Google“ Give your baby a storybook to listen to and teach your baby to talk,
|
||||
* Dark mode and E-Ink mode support and Web service support
|
||||
* Create backups to local or WebDav server
|
||||
* Decentralization web3
|
||||
* Support replacement purification, it is very convenient to remove the content of advertisement replacement.
|
||||
* Support local TXT, EPUB reading, manual browsing, intelligent scanning.
|
||||
* Support highly customized reading interface, switch font, color, background, line spacing, paragraph spacing, bold, simplified and traditional conversion.
|
||||
* Support multiple page turning modes, covering, emulating, sliding, scrolling, etc.
|
||||
|
||||
|
||||
<a href="#readme">
|
||||
<img src="https://img.shields.io/badge/-Top-orange.svg" alt="#" align="right">
|
||||
</a>
|
||||
|
||||
# Download [](#Download-)
|
||||
|
||||
#### Android
|
||||
|
||||
* [Releases](https://github.com/gedoor/legado/releases/latest)
|
||||
* [Google play - $1.99](https://play.google.com/store/apps/details?id=io.legado.play.release)
|
||||
* [Coolapk](https://www.coolapk.com/apk/io.legado.app.release)
|
||||
* [\#Beta](https://kunfei.lanzoui.com/b0f810h4b)
|
||||
* [IzzyOnDroid F-Droid Repository](https://apt.izzysoft.de/fdroid/index/apk/io.legado.app.release)
|
||||
|
||||
|
||||
#### IOS
|
||||
|
||||
* Stopped(No release) - [Github](https://github.com/gedoor/YueDuFlutter)
|
||||
|
||||
<a href="#readme">
|
||||
<img src="https://img.shields.io/badge/-Top-orange.svg" alt="#" align="right">
|
||||
</a>
|
||||
|
||||
# Community [](#Community-)
|
||||
|
||||
#### Telegram
|
||||
|
||||
[](https://t.me/yueduguanfang) [](https://t.me/legado_channels)
|
||||
|
||||
#### Discord
|
||||
|
||||
[](https://discord.gg/VtUfRyzRXn)
|
||||
|
||||
#### Other
|
||||
|
||||
https://www.yuque.com/legado/wiki/community
|
||||
|
||||
<a href="#readme">
|
||||
<img src="https://img.shields.io/badge/-Top-orange.svg" alt="#" align="right">
|
||||
</a>
|
||||
|
||||
# API [](#API-)
|
||||
|
||||
* Legado 3.0 The API is provided in 2 ways: `Web way` and `Content Provider way`. You can call it yourself as needed in [here](api.md).
|
||||
* One-click import by url recall reading, url format: legado://import/{path}?src={url}
|
||||
* Path Type: bookSource,rssSource,replaceRule,textTocRule,httpTTS,theme,readConfig,dictRule,addToBookshelf
|
||||
* path type explanation: Book source, subscription source, replacement rules, local txt novel directory rules, online reading engine, theme, reading layout, [add to bookshelf](/app/src/main/java/io/legado/app/ui/association/AddToBookshelfDialog.kt)
|
||||
|
||||
<a href="#readme">
|
||||
<img src="https://img.shields.io/badge/-Top-orange.svg" alt="#" align="right">
|
||||
</a>
|
||||
|
||||
# Other [](#Other-)
|
||||
|
||||
##### Disclaimers
|
||||
|
||||
https://gedoor.github.io/Disclaimer
|
||||
|
||||
##### Legado 3.0
|
||||
|
||||
* [eBook sources rules](https://mgz0227.github.io/The-tutorial-of-Legado/)
|
||||
* [Update Log](/app/src/main/assets/updateLog.md)
|
||||
* [Help Documentation](/app/src/main/assets/web/help/md/appHelp.md)
|
||||
* [web bookshelf](https://github.com/gedoor/legado_web_bookshelf)
|
||||
* [web source editor](https://github.com/gedoor/legado_web_source_editor)
|
||||
|
||||
<a href="#readme">
|
||||
<img src="https://img.shields.io/badge/-Top-orange.svg" alt="#" align="right">
|
||||
</a>
|
||||
|
||||
# Grateful [](#Grateful-)
|
||||
|
||||
> * org.jsoup:jsoup
|
||||
> * cn.wanghaomiao:JsoupXpath
|
||||
> * com.jayway.jsonpath:json-path
|
||||
> * com.github.gedoor:rhino-android
|
||||
> * com.squareup.okhttp3:okhttp
|
||||
> * com.github.bumptech.glide:glide
|
||||
> * org.nanohttpd:nanohttpd
|
||||
> * org.nanohttpd:nanohttpd-websocket
|
||||
> * cn.bingoogolapple:bga-qrcode-zxing
|
||||
> * com.jaredrummler:colorpicker
|
||||
> * org.apache.commons:commons-text
|
||||
> * io.noties.markwon:core
|
||||
> * io.noties.markwon:image-glide
|
||||
> * com.hankcs:hanlp
|
||||
> * com.positiondev.epublib:epublib-core
|
||||
|
||||
<a href="#readme">
|
||||
<img src="https://img.shields.io/badge/-Top-orange.svg" alt="#" align="right">
|
||||
</a>
|
||||
|
||||
# Interface [](#Interface-)
|
||||
|
||||
<img src="https://github.com/gedoor/gedoor.github.io/blob/master/static/img/legado/%E9%98%85%E8%AF%BB%E7%AE%80%E4%BB%8B1.jpg" width="270"><img src="https://github.com/gedoor/gedoor.github.io/blob/master/static/img/legado/%E9%98%85%E8%AF%BB%E7%AE%80%E4%BB%8B2.jpg" width="270"><img src="https://github.com/gedoor/gedoor.github.io/blob/master/static/img/legado/%E9%98%85%E8%AF%BB%E7%AE%80%E4%BB%8B3.jpg" width="270">
|
||||
<img src="https://github.com/gedoor/gedoor.github.io/blob/master/static/img/legado/%E9%98%85%E8%AF%BB%E7%AE%80%E4%BB%8B4.jpg" width="270"><img src="https://github.com/gedoor/gedoor.github.io/blob/master/static/img/legado/%E9%98%85%E8%AF%BB%E7%AE%80%E4%BB%8B5.jpg" width="270"><img src="https://github.com/gedoor/gedoor.github.io/blob/master/static/img/legado/%E9%98%85%E8%AF%BB%E7%AE%80%E4%BB%8B6.jpg" width="270">
|
||||
|
||||
<a href="#readme">
|
||||
<img src="https://img.shields.io/badge/-Top-orange.svg" alt="#" align="right">
|
||||
</a>
|
||||
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
Legado Copyright (C) 2019-2023 gedoor
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
@@ -0,0 +1,293 @@
|
||||
# 阅读[API](/app/src/main/java/io/legado/app/api/controller)
|
||||
|
||||
## 对于[Web](/app/src/main/java/io/legado/app/web/)的配置
|
||||
|
||||
您需要先在设置中启用"Web 服务"。
|
||||
|
||||
## 使用
|
||||
|
||||
### Web
|
||||
|
||||
以下说明假设您的操作在本机进行,且开放端口为1234。
|
||||
如果您要从远程计算机访问[阅读](),请将`127.0.0.1`替换成手机IP。
|
||||
|
||||
#### 插入单个书源
|
||||
|
||||
请求BODY内容为`JSON`字符串,
|
||||
格式参考[这个文件](/app/src/main/java/io/legado/app/data/entities/BookSource.kt)
|
||||
|
||||
```
|
||||
URL = http://127.0.0.1:1234/saveBookSource
|
||||
Method = POST
|
||||
```
|
||||
|
||||
#### 插入多个书源or订阅源
|
||||
|
||||
请求BODY内容为`JSON`字符串,
|
||||
格式参考[这个文件](/app/src/main/java/io/legado/app/data/entities/BookSource.kt),**为数组格式**。
|
||||
|
||||
```
|
||||
URL = http://127.0.0.1:1234/saveBookSources
|
||||
URL = http://127.0.0.1:1234/saveRssSources
|
||||
Method = POST
|
||||
```
|
||||
|
||||
#### 获取书源
|
||||
|
||||
```
|
||||
URL = http://127.0.0.1:1234/getBookSource?url=xxx
|
||||
URL = http://127.0.0.1:1234/getRssSource?url=xxx
|
||||
Method = GET
|
||||
```
|
||||
|
||||
#### 获取所有书源or订阅源
|
||||
|
||||
```
|
||||
URL = http://127.0.0.1:1234/getBookSources
|
||||
URL = http://127.0.0.1:1234/getRssSources
|
||||
Method = GET
|
||||
```
|
||||
|
||||
#### 删除多个书源or订阅源
|
||||
|
||||
请求BODY内容为`JSON`字符串,
|
||||
格式参考[这个文件](/app/src/main/java/io/legado/app/data/entities/BookSource.kt),**为数组格式**。
|
||||
|
||||
```
|
||||
URL = http://127.0.0.1:1234/deleteBookSources
|
||||
URL = http://127.0.0.1:1234/deleteRssSources
|
||||
Method = POST
|
||||
```
|
||||
|
||||
#### 调试源
|
||||
|
||||
key为书源搜索关键词,tag为源链接
|
||||
|
||||
```
|
||||
URL = ws://127.0.0.1:1235/bookSourceDebug
|
||||
URL = ws://127.0.0.1:1235/rssSourceDebug
|
||||
Message = { key: [String], tag: [String] }
|
||||
```
|
||||
|
||||
#### 获取替换规则
|
||||
|
||||
```
|
||||
URL = http://127.0.0.1:1234/getReplaceRules
|
||||
Method = GET
|
||||
```
|
||||
|
||||
#### 替换规则管理
|
||||
|
||||
请求BODY内容为`JSON`字符串,
|
||||
替换规则参考[这个文件](/app/src/main/java/io/legado/app/data/entities/ReplaceRule.kt)。
|
||||
|
||||
##### 删除
|
||||
|
||||
```
|
||||
URL = http://127.0.0.1:1234/deleteReplaceRule
|
||||
Method = POST
|
||||
Body = [ReplaceRule]
|
||||
```
|
||||
##### 插入
|
||||
|
||||
```
|
||||
URL = http://127.0.0.1:1234/saveReplaceRule
|
||||
Method = POST
|
||||
Body = [ReplaceRule]
|
||||
```
|
||||
|
||||
##### 测试
|
||||
|
||||
返回测试文本text替换结果
|
||||
|
||||
```
|
||||
URL = http://127.0.0.1:1234/testReplaceRule
|
||||
Method = POST
|
||||
Body = { rule: [ReplaceRule], text: [String] }
|
||||
```
|
||||
|
||||
#### 搜索在线书籍
|
||||
|
||||
若想获取对应的书籍的目录正文 请先**插入书籍**以启用缓存,如果试读后决定不添加到书籍,请**删除书籍**
|
||||
|
||||
```
|
||||
URL = ws://127.0.0.1:1235/searchBook
|
||||
Message = { key: [String] }
|
||||
```
|
||||
|
||||
#### 插入书籍
|
||||
|
||||
请求BODY内容为`JSON`字符串,
|
||||
格式参考[这个文件](/app/src/main/java/io/legado/app/data/entities/Book.kt)。
|
||||
|
||||
```
|
||||
URL = http://127.0.0.1:1234/saveBook
|
||||
Method = POST
|
||||
```
|
||||
|
||||
#### 删除书籍
|
||||
|
||||
```
|
||||
URL = http://127.0.0.1:1234/deleteBook
|
||||
Method = POST
|
||||
```
|
||||
|
||||
#### 获取所有书籍
|
||||
|
||||
```
|
||||
URL = http://127.0.0.1:1234/getBookshelf
|
||||
Method = GET
|
||||
```
|
||||
|
||||
获取APP内的所有书籍。
|
||||
|
||||
#### 获取书籍章节列表
|
||||
|
||||
```
|
||||
URL = http://127.0.0.1:1234/getChapterList?url=xxx
|
||||
Method = GET
|
||||
```
|
||||
|
||||
获取指定图书的章节列表。
|
||||
|
||||
#### 获取书籍内容
|
||||
|
||||
```
|
||||
URL = http://127.0.0.1:1234/getBookContent?url=xxx&index=1
|
||||
Method = GET
|
||||
```
|
||||
|
||||
获取指定图书的第`index`章节的文本内容。
|
||||
|
||||
#### 获取封面
|
||||
|
||||
```
|
||||
URL = http://127.0.0.1:1234/cover?path=xxxxx
|
||||
Method = GET
|
||||
```
|
||||
|
||||
#### 获取正文图片
|
||||
|
||||
```
|
||||
URL = http://127.0.0.1:1234/image?url=${bookUrl}&path=${picUrl}&width=${width}
|
||||
Method = GET
|
||||
```
|
||||
|
||||
#### 保存书籍进度
|
||||
|
||||
请求BODY内容为`JSON`字符串,
|
||||
格式参考[这个文件](/app/src/main/java/io/legado/app/data/entities/BookProgress.kt)。
|
||||
|
||||
```
|
||||
URL = http://127.0.0.1:1234/saveBookProgress
|
||||
Method = POST
|
||||
```
|
||||
|
||||
### [Content Provider](/app/src/main/java/io/legado/app/api/ReaderProvider.kt)
|
||||
|
||||
|
||||
* 需声明`io.legado.READ_WRITE`权限
|
||||
* `providerHost`为`包名.readerProvider`, 如`io.legado.app.release.readerProvider`,不同包的地址不同,防止冲突安装失败
|
||||
* 以下出现的`providerHost`请自行替换
|
||||
|
||||
#### 插入单个书源or订阅源
|
||||
|
||||
创建`Key="json"`的`ContentValues`,内容为`JSON`字符串,
|
||||
格式参考[这个文件](/app/src/main/java/io/legado/app/data/entities/BookSource.kt)
|
||||
|
||||
```
|
||||
URL = content://providerHost/bookSource/insert
|
||||
URL = content://providerHost/rssSource/insert
|
||||
Method = insert
|
||||
```
|
||||
|
||||
#### 插入多个书源or订阅源
|
||||
|
||||
创建`Key="json"`的`ContentValues`,内容为`JSON`字符串,
|
||||
格式参考[这个文件](/app/src/main/java/io/legado/app/data/entities/BookSource.kt),**为数组格式**。
|
||||
|
||||
```
|
||||
URL = content://providerHost/bookSources/insert
|
||||
URL = content://providerHost/rssSources/insert
|
||||
Method = insert
|
||||
```
|
||||
|
||||
#### 获取书源or订阅源
|
||||
|
||||
获取指定URL对应的书源信息。
|
||||
用`Cursor.getString(0)`取出返回结果。
|
||||
|
||||
```
|
||||
URL = content://providerHost/bookSource/query?url=xxx
|
||||
URL = content://providerHost/rssSource/query?url=xxx
|
||||
Method = query
|
||||
```
|
||||
|
||||
#### 获取所有书源or订阅源
|
||||
|
||||
获取APP内的所有订阅源。
|
||||
用`Cursor.getString(0)`取出返回结果。
|
||||
|
||||
```
|
||||
URL = content://providerHost/bookSources/query
|
||||
URL = content://providerHost/rssSources/query
|
||||
Method = query
|
||||
```
|
||||
|
||||
#### 删除多个书源or订阅源
|
||||
|
||||
创建`Key="json"`的`ContentValues`,内容为`JSON`字符串,
|
||||
格式参考[这个文件](/app/src/main/java/io/legado/app/data/entities/BookSource.kt),**为数组格式**。
|
||||
|
||||
```
|
||||
URL = content://providerHost/bookSources/delete
|
||||
URL = content://providerHost/rssSources/delete
|
||||
Method = delete
|
||||
```
|
||||
|
||||
#### 插入书籍
|
||||
|
||||
创建`Key="json"`的`ContentValues`,内容为`JSON`字符串,
|
||||
格式参考[这个文件](/app/src/main/java/io/legado/app/data/entities/Book.kt)。
|
||||
|
||||
```
|
||||
URL = content://providerHost/book/insert
|
||||
Method = insert
|
||||
```
|
||||
|
||||
#### 获取所有书籍
|
||||
|
||||
获取APP内的所有书籍。
|
||||
用`Cursor.getString(0)`取出返回结果。
|
||||
|
||||
```
|
||||
URL = content://providerHost/books/query
|
||||
Method = query
|
||||
```
|
||||
|
||||
#### 获取书籍章节列表
|
||||
|
||||
获取指定图书的章节列表。
|
||||
用`Cursor.getString(0)`取出返回结果。
|
||||
|
||||
```
|
||||
URL = content://providerHost/book/chapter/query?url=xxx
|
||||
Method = query
|
||||
```
|
||||
|
||||
#### 获取书籍内容
|
||||
|
||||
获取指定图书的第`index`章节的文本内容。
|
||||
用`Cursor.getString(0)`取出返回结果。
|
||||
|
||||
```
|
||||
URL = content://providerHost/book/content/query?url=xxx&index=1
|
||||
Method = query
|
||||
```
|
||||
|
||||
#### 获取封面
|
||||
|
||||
```
|
||||
URL = content://providerHost/book/cover/query?path=xxxx
|
||||
Method = query
|
||||
```
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
/build
|
||||
/so
|
||||
Executable
+292
@@ -0,0 +1,292 @@
|
||||
plugins {
|
||||
// id "com.android.application"
|
||||
// id 'org.jetbrains.kotlin.android'
|
||||
// id 'kotlin-parcelize'
|
||||
// //id 'kotlin-kapt'
|
||||
// id 'com.google.devtools.ksp'
|
||||
// id "com.google.gms.google-services"
|
||||
|
||||
alias libs.plugins.android.application
|
||||
alias libs.plugins.kotlin.android
|
||||
alias libs.plugins.kotlin.parcelize
|
||||
alias libs.plugins.room
|
||||
alias libs.plugins.ksp
|
||||
alias libs.plugins.google.services
|
||||
}
|
||||
apply from: 'download.gradle'
|
||||
|
||||
static def releaseTime() {
|
||||
return new Date().format("yy.MMddHH", TimeZone.getTimeZone("GMT+8"))
|
||||
}
|
||||
|
||||
def name = "legado"
|
||||
def version = "3." + releaseTime()
|
||||
def gitCommits = Integer.parseInt('git rev-list HEAD --count'.execute().text.trim())
|
||||
|
||||
android {
|
||||
compileSdk = compile_sdk_version
|
||||
namespace = 'io.legado.app'
|
||||
kotlin {
|
||||
jvmToolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
if (project.hasProperty("RELEASE_STORE_FILE")) {
|
||||
myConfig {
|
||||
storeFile file(RELEASE_STORE_FILE)
|
||||
storePassword RELEASE_STORE_PASSWORD
|
||||
keyAlias RELEASE_KEY_ALIAS
|
||||
keyPassword RELEASE_KEY_PASSWORD
|
||||
enableV1Signing = true
|
||||
enableV2Signing = true
|
||||
enableV3Signing = true
|
||||
enableV4Signing = true
|
||||
}
|
||||
}
|
||||
}
|
||||
defaultConfig {
|
||||
applicationId "io.legado.app"
|
||||
minSdk 21
|
||||
targetSdk 36
|
||||
versionCode 10000 + gitCommits
|
||||
versionName version
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
project.ext.set("archivesBaseName", name + "_" + version)
|
||||
|
||||
buildConfigField "String", "Cronet_Version", "\"$CronetVersion\""
|
||||
buildConfigField "String", "Cronet_Main_Version", "\"$CronetMainVersion\""
|
||||
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments += [
|
||||
"room.incremental" : "true",
|
||||
"room.expandProjection": "true",
|
||||
"room.schemaLocation" : "$projectDir/schemas".toString()
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
viewBinding = true
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
if (project.hasProperty("RELEASE_STORE_FILE")) {
|
||||
signingConfig signingConfigs.myConfig
|
||||
}
|
||||
applicationIdSuffix '.release'
|
||||
if (getApplicationIdSuffix() == '.releaseA') {
|
||||
manifestPlaceholders.put("app_name", "@string/app_name_a")
|
||||
} else {
|
||||
manifestPlaceholders.put("app_name", "@string/app_name")
|
||||
}
|
||||
|
||||
minifyEnabled true
|
||||
shrinkResources = true
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'cronet-proguard-rules.pro'
|
||||
}
|
||||
debug {
|
||||
if (project.hasProperty("RELEASE_STORE_FILE")) {
|
||||
signingConfig signingConfigs.myConfig
|
||||
}
|
||||
manifestPlaceholders.put("app_name", "@string/app_name")
|
||||
|
||||
applicationIdSuffix '.debug'
|
||||
versionNameSuffix 'debug'
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'cronet-proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
//noinspection GrDeprecatedAPIUsage
|
||||
flavorDimensions = ['mode']
|
||||
productFlavors {
|
||||
app {
|
||||
dimension "mode"
|
||||
manifestPlaceholders.put("APP_CHANNEL_VALUE", "app")
|
||||
}
|
||||
}
|
||||
|
||||
android.applicationVariants.configureEach { variant ->
|
||||
variant.outputs.configureEach {
|
||||
def flavor = variant.productFlavors[0].name
|
||||
outputFileName = "${name}_${flavor}_${defaultConfig.versionName}.apk"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
room {
|
||||
schemaDirectory "$projectDir/schemas"
|
||||
}
|
||||
// 设定Room的KSP参数
|
||||
ksp {
|
||||
arg("room.incremental", "true")
|
||||
arg("room.expandProjection", "true")
|
||||
arg("room.generateKotlin", "false")
|
||||
//arg("room.schemaLocation", "$projectDir/schemas")
|
||||
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
// Flag to enable support for the new language APIs
|
||||
coreLibraryDesugaringEnabled = true
|
||||
// Sets Java compatibility
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
packaging {
|
||||
resources.excludes.add('META-INF/*')
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
// Adds exported schema location as test app assets.
|
||||
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
|
||||
}
|
||||
lint {
|
||||
checkDependencies = true
|
||||
}
|
||||
tasks.withType(JavaCompile).tap {
|
||||
configureEach {
|
||||
//options.compilerArgs << "-Xlint:unchecked"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
//compileOnly "com.android.tools.build:gradle:$agp_version"
|
||||
//noinspection GradleDependency,GradlePackageUpdate
|
||||
//coreLibraryDesugaring('com.android.tools:desugar_jdk_libs_nio:2.0.4')
|
||||
coreLibraryDesugaring(libs.desugar)
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.bundles.androidTest)
|
||||
//kotlin
|
||||
//noinspection GradleDependency,DifferentStdlibGradleVersion
|
||||
implementation(libs.kotlin.stdlib)
|
||||
//Kotlin反射
|
||||
//noinspection GradleDependency,DifferentStdlibGradleVersion
|
||||
//implementation(libs.kotlin.reflect)
|
||||
|
||||
|
||||
//协程
|
||||
//def coroutines_version = '1.7.3'
|
||||
implementation(libs.bundles.coroutines)
|
||||
|
||||
|
||||
//图像处理库Toolkit
|
||||
implementation(libs.renderscript.intrinsics.replacement.toolkit)
|
||||
|
||||
//androidX
|
||||
implementation(libs.core.ktx)
|
||||
implementation(libs.appcompat.appcompat)
|
||||
implementation(libs.activity.ktx)
|
||||
implementation(libs.fragment.ktx)
|
||||
implementation(libs.preference.ktx)
|
||||
implementation(libs.androidx.constraintlayout)
|
||||
implementation(libs.androidx.swiperefreshlayout)
|
||||
implementation(libs.androidx.recyclerview)
|
||||
implementation(libs.androidx.viewpager2)
|
||||
implementation(libs.androidx.webkit)
|
||||
implementation(libs.androidx.documentfile)
|
||||
|
||||
//google
|
||||
implementation(libs.material)
|
||||
implementation(libs.flexbox)
|
||||
implementation(libs.gson)
|
||||
|
||||
//lifecycle
|
||||
implementation(libs.lifecycle.common.java8)
|
||||
implementation(libs.lifecycle.service)
|
||||
|
||||
//media
|
||||
implementation(libs.media.media)
|
||||
// For media playback using ExoPlayer
|
||||
implementation(libs.media3.exoplayer)
|
||||
// For loading data using the OkHttp network stack
|
||||
implementation(libs.media3.datasource.okhttp)
|
||||
// For exposing and controlling media sessions
|
||||
//implementation "androidx.media3:media3-session:$media3_version"
|
||||
|
||||
//Splitties
|
||||
implementation(libs.splitties.appctx)
|
||||
implementation(libs.splitties.systemservices)
|
||||
implementation(libs.splitties.views)
|
||||
|
||||
//room sql语句不高亮解决方法https://issuetracker.google.com/issues/234612964#comment6
|
||||
implementation(libs.room.runtime)
|
||||
implementation(libs.room.ktx)
|
||||
//kapt("androidx.room:room-compiler:$room_version")
|
||||
ksp(libs.room.compiler)
|
||||
androidTestImplementation(libs.room.testing)
|
||||
|
||||
//liveEventBus
|
||||
implementation(libs.liveeventbus)
|
||||
|
||||
//规则相关
|
||||
implementation(libs.jsoup)
|
||||
implementation(libs.json.path)
|
||||
implementation(libs.jsoupxpath)
|
||||
implementation(project(path: ':modules:book'))
|
||||
implementation(project(path: ':modules:rhino'))
|
||||
|
||||
//JS rhino
|
||||
|
||||
//网络
|
||||
implementation(libs.okhttp)
|
||||
implementation(fileTree(dir: 'cronetlib', include: ['*.jar', '*.aar']))
|
||||
implementation(libs.protobuf.javalite)
|
||||
|
||||
//Glide
|
||||
implementation(libs.glide.glide)
|
||||
implementation(libs.glide.okhttp)
|
||||
ksp(libs.glide.ksp)
|
||||
|
||||
//Svg
|
||||
implementation(libs.androidsvg)
|
||||
//Glide svg plugin
|
||||
implementation(libs.glide.svg)
|
||||
|
||||
//webServer
|
||||
implementation(libs.nanohttpd.nanohttpd)
|
||||
implementation(libs.nanohttpd.websocket)
|
||||
|
||||
//二维码
|
||||
//noinspection GradleDependency
|
||||
implementation(libs.zxing.lite)
|
||||
|
||||
//颜色选择
|
||||
implementation(libs.colorpicker)
|
||||
|
||||
//压缩解压
|
||||
implementation libs.libarchive
|
||||
|
||||
//apache
|
||||
implementation(libs.commons.text)
|
||||
|
||||
//MarkDown
|
||||
implementation(libs.markwon.core)
|
||||
implementation(libs.markwon.image.glide)
|
||||
implementation(libs.markwon.ext.tables)
|
||||
implementation(libs.markwon.html)
|
||||
|
||||
//转换繁体
|
||||
implementation(libs.quick.chinese.transfer.core)
|
||||
|
||||
//加解密类库,有些书源使用
|
||||
//noinspection GradleDependency,GradlePackageUpdate
|
||||
implementation(libs.hutool.crypto)
|
||||
|
||||
//firebase, 崩溃统计和性能统计
|
||||
implementation platform(libs.firebase.bom)
|
||||
implementation libs.firebase.analytics
|
||||
implementation libs.firebase.perf
|
||||
|
||||
implementation libs.glide.recyclerview
|
||||
|
||||
//LeakCanary, 内存泄露检测
|
||||
//debugImplementation('com.squareup.leakcanary:leakcanary-android:2.7')
|
||||
|
||||
//com.github.AmrDeveloper:CodeView代码编辑已集成到应用内
|
||||
//epubLib集成到应用内
|
||||
}
|
||||
Executable
+232
@@ -0,0 +1,232 @@
|
||||
# -------- Config Path: base/android/proguard/shared_with_cronet.flags --------
|
||||
# Copyright 2016 The Chromium Authors
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
# Contains flags that we want to apply not only to Chromium APKs, but also to
|
||||
# third-party apps that bundle the Cronet library.
|
||||
|
||||
# WARNING: rules in this file are applied to entire third-party APKs, not just
|
||||
# Chromium code. They MUST be scoped appropriately to avoid side effects on app
|
||||
# code that we do not own.
|
||||
|
||||
# Keep all CREATOR fields within Parcelable that are kept.
|
||||
-keepclassmembers class !cr_allowunused,org.chromium.** implements android.os.Parcelable {
|
||||
public static *** CREATOR;
|
||||
}
|
||||
|
||||
# Don't obfuscate Parcelables as they might be marshalled outside Chrome.
|
||||
# If we annotated all Parcelables that get put into Bundles other than
|
||||
# for saveInstanceState (e.g. PendingIntents), then we could actually keep the
|
||||
# names of just those ones. For now, we'll just keep them all.
|
||||
-keepnames,allowaccessmodification class !cr_allowunused,org.chromium.** implements android.os.Parcelable {}
|
||||
|
||||
# Keep all enum values and valueOf methods. See
|
||||
# http://proguard.sourceforge.net/index.html#manual/examples.html
|
||||
# for the reason for this. Also, see http://crbug.com/248037.
|
||||
-keepclassmembers enum !cr_allowunused,org.chromium.** {
|
||||
public static **[] values();
|
||||
}
|
||||
|
||||
# Required to remove fields until b/274802355 is resolved.
|
||||
-assumevalues class !cr_allowunused,** {
|
||||
final org.chromium.base.ThreadUtils$ThreadChecker * return _NONNULL_;
|
||||
}
|
||||
# -------- Config Path: build/android/chromium_annotations.flags --------
|
||||
# Copyright 2022 The Chromium Authors
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
# Contains flags related to annotations in //build/android that can be safely
|
||||
# shared with Cronet, and thus would be appropriate for third-party apps to
|
||||
# include.
|
||||
|
||||
# Keep all annotation related attributes that can affect runtime
|
||||
-keepattributes RuntimeVisible*Annotations
|
||||
-keepattributes AnnotationDefault
|
||||
|
||||
# Keeps for class level annotations.
|
||||
-keep,allowaccessmodification @org.chromium.build.annotations.UsedByReflection class ** {}
|
||||
|
||||
# Keeps for method level annotations.
|
||||
-keepclasseswithmembers,allowaccessmodification class ** {
|
||||
@org.chromium.build.annotations.UsedByReflection <methods>;
|
||||
}
|
||||
-keepclasseswithmembers,allowaccessmodification class ** {
|
||||
@org.chromium.build.annotations.UsedByReflection <fields>;
|
||||
}
|
||||
|
||||
# Never inline classes, methods, or fields with this annotation, but allow
|
||||
# shrinking and obfuscation.
|
||||
# Relevant to fields when they are needed to store strong references to objects
|
||||
# that are held as weak references by native code.
|
||||
-if @org.chromium.build.annotations.DoNotInline class * {
|
||||
*** *(...);
|
||||
}
|
||||
-keep,allowobfuscation,allowaccessmodification class <1> {
|
||||
*** <2>(...);
|
||||
}
|
||||
-keepclassmembers,allowobfuscation,allowaccessmodification class * {
|
||||
@org.chromium.build.annotations.DoNotInline <methods>;
|
||||
}
|
||||
-keepclassmembers,allowobfuscation,allowaccessmodification class * {
|
||||
@org.chromium.build.annotations.DoNotInline <fields>;
|
||||
}
|
||||
|
||||
-alwaysinline class * {
|
||||
@org.chromium.build.annotations.AlwaysInline *;
|
||||
}
|
||||
|
||||
# Keep all logs (Log.VERBOSE = 2). R8 does not allow setting to 0.
|
||||
-maximumremovedandroidloglevel 1 class ** {
|
||||
@org.chromium.build.annotations.DoNotStripLogs <methods>;
|
||||
}
|
||||
-maximumremovedandroidloglevel 1 @org.chromium.build.annotations.DoNotStripLogs class ** {
|
||||
<methods>;
|
||||
}
|
||||
|
||||
# Never merge classes horizontally or vertically with this annotation.
|
||||
# Relevant to classes being used as a key in maps or sets.
|
||||
-keep,allowaccessmodification,allowobfuscation,allowshrinking @org.chromium.build.annotations.DoNotClassMerge class *
|
||||
|
||||
# Mark members annotated with IdentifierNameString as identifier name strings
|
||||
-identifiernamestring class * {
|
||||
@org.chromium.build.annotations.IdentifierNameString *;
|
||||
}
|
||||
|
||||
# Mark fields with this to help R8 figure out that they cannot be null.
|
||||
# Use assumevalues in addition to assumenosideeffects block because Google3 proguard cannot parse
|
||||
# assumenosideeffects blocks which overwrite return value.
|
||||
-assumevalues class ** {
|
||||
@org.chromium.build.annotations.AssumeNonNull *** *(...) return _NONNULL_;
|
||||
}
|
||||
-assumenosideeffects class ** {
|
||||
@org.chromium.build.annotations.AssumeNonNull *** *(...);
|
||||
}
|
||||
-assumevalues class ** {
|
||||
@org.chromium.build.annotations.AssumeNonNull *** * return _NONNULL_;
|
||||
}
|
||||
-assumenosideeffects class ** {
|
||||
@org.chromium.build.annotations.AssumeNonNull *** *;
|
||||
}
|
||||
# -------- Config Path: components/cronet/android/cronet_impl_common_proguard.cfg --------
|
||||
# Proguard config for apps that depend on cronet_impl_common_java.jar.
|
||||
|
||||
# Used through reflection by the API code to figure out the version of the impl
|
||||
# code it's talking to.
|
||||
-keep public class org.chromium.net.impl.ImplVersion {
|
||||
public *;
|
||||
}
|
||||
|
||||
-dontwarn com.google.errorprone.annotations.DoNotMock
|
||||
# -------- Config Path: components/cronet/android/cronet_impl_native_proguard.cfg --------
|
||||
# Proguard config for apps that depend on cronet_impl_native_java.jar.
|
||||
|
||||
# This constructor is called using the reflection from Cronet API (cronet_api.jar).
|
||||
-keep class org.chromium.net.impl.NativeCronetProvider {
|
||||
public <init>(android.content.Context);
|
||||
}
|
||||
|
||||
# While Chrome doesn't need to keep these with their version of R8, some cronet
|
||||
# users may be on other optimizers which still require the annotation to be
|
||||
# kept in order for the keep rules to work.
|
||||
-keep @interface org.chromium.build.annotations.DoNotInline
|
||||
-keep @interface org.chromium.build.annotations.UsedByReflection
|
||||
-keep @interface org.chromium.build.annotations.IdentifierNameString
|
||||
-keep @interface org.jni_zero.AccessedByNative
|
||||
-keep @interface org.jni_zero.CalledByNative
|
||||
-keep @interface org.jni_zero.CalledByNativeUnchecked
|
||||
|
||||
# Suppress unnecessary warnings.
|
||||
-dontnote org.chromium.net.ProxyChangeListener$ProxyReceiver
|
||||
-dontnote org.chromium.net.AndroidKeyStore
|
||||
# Needs 'void setTextAppearance(int)' (API level 23).
|
||||
-dontwarn org.chromium.base.ApiCompatibilityUtils
|
||||
# Needs 'boolean onSearchRequested(android.view.SearchEvent)' (API level 23).
|
||||
-dontwarn org.chromium.base.WindowCallbackWrapper
|
||||
|
||||
# Generated for chrome apk and not included into cronet.
|
||||
-dontwarn org.chromium.base.multidex.ChromiumMultiDexInstaller
|
||||
-dontwarn org.chromium.base.library_loader.LibraryLoader
|
||||
-dontwarn org.chromium.base.SysUtils
|
||||
-dontwarn org.chromium.build.NativeLibraries
|
||||
|
||||
# Objects of this type are passed around by native code, but the class
|
||||
# is never used directly by native code. Since the class is not loaded, it does
|
||||
# not need to be preserved as an entry point.
|
||||
-dontnote org.chromium.net.UrlRequest$ResponseHeadersMap
|
||||
# https://android.googlesource.com/platform/sdk/+/marshmallow-mr1-release/files/proguard-android.txt#54
|
||||
-dontwarn android.support.**
|
||||
|
||||
# This class should be explicitly kept to avoid failure if
|
||||
# class/merging/horizontal proguard optimization is enabled.
|
||||
-keep class org.chromium.base.CollectionUtil
|
||||
|
||||
# Skip protobuf runtime check for isOnAndroidDevice().
|
||||
# A nice-to-have optimization shamelessly stolen from //third_party/protobuf/java/lite/proguard.pgcfg.
|
||||
-assumevalues class com.google.protobuf.Android {
|
||||
static boolean ASSUME_ANDROID return true;
|
||||
}
|
||||
|
||||
# See crbug.com/1440987. We must keep every native that we are manually
|
||||
# registering. If Cronet bumps its min-sdk past 21, we may be able to move to
|
||||
# automatic JNI registration.
|
||||
-keepclasseswithmembers,includedescriptorclasses,allowaccessmodification class org.chromium.**,J.N {
|
||||
native <methods>;
|
||||
}
|
||||
|
||||
# Protobuf builder uses reflection so make sure ProGuard leaves it alone. See
|
||||
# https://crbug.com/1395764.
|
||||
# Note that we can't simply use the rule from
|
||||
# //third_party/protobuf/java/lite/proguard.pgcfg, because some users who
|
||||
# consume our ProGuard rules do not want all their protos to be kept. Instead,
|
||||
# use a more specific rule that covers Chromium protos only.
|
||||
-keepclassmembers class org.chromium.** extends com.google.protobuf.GeneratedMessageLite {
|
||||
<fields>;
|
||||
}
|
||||
# -------- Config Path: components/cronet/android/cronet_shared_proguard.cfg --------
|
||||
# Proguard config for apps that depend on cronet_shared_java.jar (which should
|
||||
# be all apps that depend on any part of Cronet)
|
||||
|
||||
# Part of the Android System SDK, so ProGuard won't be able to resolve it if
|
||||
# running against the standard SDK.
|
||||
-dontwarn android.util.StatsEvent
|
||||
-dontwarn android.util.StatsEvent$*
|
||||
# There is also an undefined reference to android.util.StatsLog.write(), which
|
||||
# R8 appears to be fine with but other processors (e.g. internal Google
|
||||
# ProGuard) may not be. See b/315269496.
|
||||
-dontwarn android.util.StatsLog
|
||||
# -------- Config Path: third_party/androidx/androidx_annotations.flags --------
|
||||
# Copyright 2023 The Chromium Authors
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
-keep @androidx.annotation.Keep class *
|
||||
-keepclasseswithmembers,allowaccessmodification class * {
|
||||
@androidx.annotation.Keep <fields>;
|
||||
}
|
||||
-keepclasseswithmembers,allowaccessmodification class * {
|
||||
@androidx.annotation.Keep <methods>;
|
||||
}
|
||||
# -------- Config Path: third_party/jni_zero/proguard.flags --------
|
||||
# Copyright 2023 The Chromium Authors
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
# Keeps for method level annotations.
|
||||
-keepclasseswithmembers,allowaccessmodification class ** {
|
||||
@org.jni_zero.AccessedByNative <fields>;
|
||||
}
|
||||
-keepclasseswithmembers,includedescriptorclasses,allowaccessmodification class ** {
|
||||
@org.jni_zero.CalledByNative <methods>;
|
||||
}
|
||||
-keepclasseswithmembers,includedescriptorclasses,allowaccessmodification class ** {
|
||||
@org.jni_zero.CalledByNativeUnchecked <methods>;
|
||||
}
|
||||
|
||||
# Allow unused native methods to be removed, but prevent renaming on those that
|
||||
# are kept.
|
||||
# TODO(crbug.com/315973491): Restrict the broad scope of this rule.
|
||||
-keepclasseswithmembernames,includedescriptorclasses,allowaccessmodification class ** {
|
||||
native <methods>;
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
+112
@@ -0,0 +1,112 @@
|
||||
import java.security.MessageDigest
|
||||
|
||||
apply plugin: 'de.undercouch.download'
|
||||
|
||||
def BASE_PATH = "https://storage.googleapis.com/chromium-cronet/android/" + CronetVersion + "/Release/cronet/"
|
||||
def assetsDir = projectDir.toString() + "/src/main/assets"
|
||||
def libPath = projectDir.toString() + "/cronetlib"
|
||||
def soPath = projectDir.toString() + "/so"
|
||||
|
||||
/**
|
||||
* 从文件生成MD5
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
static def generateMD5(final file) {
|
||||
MessageDigest digest = MessageDigest.getInstance("MD5")
|
||||
file.withInputStream() { is ->
|
||||
byte[] buffer = new byte[1024]
|
||||
//noinspection GroovyUnusedAssignment
|
||||
int numRead = 0
|
||||
while ((numRead = is.read(buffer)) > 0) {
|
||||
digest.update(buffer, 0, numRead)
|
||||
}
|
||||
}
|
||||
return String.format("%032x", new BigInteger(1, digest.digest())).toLowerCase()
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载Cronet相关的jar
|
||||
*/
|
||||
tasks.register('downloadJar', Download) {
|
||||
src([
|
||||
BASE_PATH + "cronet_api.jar",
|
||||
BASE_PATH + "cronet_impl_common_java.jar",
|
||||
BASE_PATH + "cronet_impl_native_java.jar",
|
||||
BASE_PATH + "cronet_impl_platform_java.jar",
|
||||
BASE_PATH + "cronet_shared_java.jar"
|
||||
])
|
||||
dest libPath
|
||||
overwrite true
|
||||
onlyIfModified false
|
||||
}
|
||||
/**
|
||||
* 下载Cronet的arm64-v8a so
|
||||
*/
|
||||
tasks.register('downloadARM64', Download) {
|
||||
src BASE_PATH + "libs/arm64-v8a/libcronet." + CronetVersion + ".so"
|
||||
dest soPath + "/arm64-v8a.so"
|
||||
overwrite true
|
||||
onlyIfModified true
|
||||
}
|
||||
/**
|
||||
* 下载Cronet的armeabi-v7a so
|
||||
*/
|
||||
tasks.register('downloadARMv7', Download) {
|
||||
src BASE_PATH + "libs/armeabi-v7a/libcronet." + CronetVersion + ".so"
|
||||
dest soPath + "/armeabi-v7a.so"
|
||||
overwrite true
|
||||
onlyIfModified true
|
||||
}
|
||||
/**
|
||||
* 下载Cronet的x86_64 so
|
||||
*/
|
||||
tasks.register('downloadX86_64', Download) {
|
||||
src BASE_PATH + "libs/x86_64/libcronet." + CronetVersion + ".so"
|
||||
dest soPath + "/x86_64.so"
|
||||
overwrite true
|
||||
onlyIfModified true
|
||||
}
|
||||
/**
|
||||
* 下载Cronet的x86 so
|
||||
*/
|
||||
tasks.register('downloadX86', Download) {
|
||||
src BASE_PATH + "libs/x86/libcronet." + CronetVersion + ".so"
|
||||
dest soPath + "/x86.so"
|
||||
overwrite true
|
||||
onlyIfModified true
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新Cronet版本时执行这个task
|
||||
* 先更改gradle.properties 里面的版本号,然后再执行
|
||||
* gradlew app:downloadCronet
|
||||
*/
|
||||
tasks.register('downloadCronet') {
|
||||
dependsOn downloadJar, downloadARM64, downloadARMv7, downloadX86_64, downloadX86
|
||||
|
||||
doLast {
|
||||
StringBuilder sb = new StringBuilder("{")
|
||||
def files = new File(soPath).listFiles()
|
||||
for (File file : files) {
|
||||
println file.name.replace(".so", "")
|
||||
sb.append("\"").append(file.name.replace(".so", "")).append("\":\"").append(generateMD5(file)).append("\",")
|
||||
}
|
||||
sb.append("\"version\":\"").append(CronetVersion).append("\"}")
|
||||
|
||||
println sb.toString()
|
||||
|
||||
println assetsDir
|
||||
def f1 = new File(assetsDir + "/cronet.json")
|
||||
if (!f1.exists()) {
|
||||
f1.parentFile.mkdirs()
|
||||
f1.createNewFile()
|
||||
}
|
||||
f1.text = sb.toString()
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Executable
+151
@@ -0,0 +1,151 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "453392274790",
|
||||
"firebase_url": "https://legado-fca69.firebaseio.com",
|
||||
"project_id": "legado-fca69",
|
||||
"storage_bucket": "legado-fca69.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:453392274790:android:c4eac14b1410eec5f624a7",
|
||||
"android_client_info": {
|
||||
"package_name": "io.legado.app.debug"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "453392274790-hnbpatpce9hbjiggj76hgo7queu86atq.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyD90mfNLhA7cAzzI9SonpSz5mrF5BnmyJA"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "453392274790-hnbpatpce9hbjiggj76hgo7queu86atq.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:453392274790:android:c1481c1c3d3f51eff624a7",
|
||||
"android_client_info": {
|
||||
"package_name": "io.legado.app.release"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "453392274790-trrgennt5njr1lhil1sgtf0ogcgd38fo.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "io.legado.app.release",
|
||||
"certificate_hash": "fd67dba87b7b761631266f19ddde249054aac5c1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "453392274790-hnbpatpce9hbjiggj76hgo7queu86atq.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyD90mfNLhA7cAzzI9SonpSz5mrF5BnmyJA"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "453392274790-hnbpatpce9hbjiggj76hgo7queu86atq.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:453392274790:android:b891abd2331577dff624a7",
|
||||
"android_client_info": {
|
||||
"package_name": "io.legado.play.release"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "453392274790-f8sjn6ohs72rg1dvp0pdvk42nkq54p0k.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "io.legado.play.release",
|
||||
"certificate_hash": "00819ace9891386e535967cbafd6a88f3797bd5b"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "453392274790-hnbpatpce9hbjiggj76hgo7queu86atq.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyD90mfNLhA7cAzzI9SonpSz5mrF5BnmyJA"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "453392274790-hnbpatpce9hbjiggj76hgo7queu86atq.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:453392274790:android:b891abd2331577dff624a7",
|
||||
"android_client_info": {
|
||||
"package_name": "io.legado.play.debug"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "453392274790-f8sjn6ohs72rg1dvp0pdvk42nkq54p0k.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "io.legado.play.debug",
|
||||
"certificate_hash": "00819ace9891386e535967cbafd6a88f3797bd5b"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "453392274790-hnbpatpce9hbjiggj76hgo7queu86atq.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyD90mfNLhA7cAzzI9SonpSz5mrF5BnmyJA"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "453392274790-hnbpatpce9hbjiggj76hgo7queu86atq.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
# 混合时不使用大小写混合,混合后的类名为小写
|
||||
-dontusemixedcaseclassnames
|
||||
|
||||
# 这句话能够使我们的项目混淆后产生映射文件
|
||||
# 包含有类名->混淆后类名的映射关系
|
||||
-verbose
|
||||
|
||||
# 保留Annotation不混淆
|
||||
-keepattributes *Annotation*,InnerClasses
|
||||
|
||||
# 避免混淆泛型
|
||||
-keepattributes Signature
|
||||
|
||||
# 指定混淆是采用的算法,后面的参数是一个过滤器
|
||||
# 这个过滤器是谷歌推荐的算法,一般不做更改
|
||||
-optimizations !code/simplification/cast,!field/*,!class/merging/*
|
||||
|
||||
-flattenpackagehierarchy
|
||||
|
||||
#############################################
|
||||
#
|
||||
# Android开发中一些需要保留的公共部分
|
||||
#
|
||||
#############################################
|
||||
# 屏蔽错误Unresolved class name
|
||||
#noinspection ShrinkerUnresolvedReference
|
||||
|
||||
# 移除Log类打印各个等级日志的代码,打正式包的时候可以做为禁log使用,这里可以作为禁止log打印的功能使用
|
||||
# 记得proguard-android.txt中一定不要加-dontoptimize才起作用
|
||||
# 另外的一种实现方案是通过BuildConfig.DEBUG的变量来控制
|
||||
-assumenosideeffects class android.util.Log {
|
||||
public static int v(...);
|
||||
public static int i(...);
|
||||
public static int w(...);
|
||||
public static int d(...);
|
||||
public static int e(...);
|
||||
}
|
||||
|
||||
# 保持js引擎调用的java类
|
||||
-keep class * extends io.legado.app.help.JsExtensions{*;}
|
||||
# 数据类
|
||||
-keep class **.data.entities.**{*;}
|
||||
# hutool-core hutool-crypto
|
||||
-keep class
|
||||
!cn.hutool.core.util.RuntimeUtil,
|
||||
!cn.hutool.core.util.ClassLoaderUtil,
|
||||
!cn.hutool.core.util.ReflectUtil,
|
||||
!cn.hutool.core.util.SerializeUtil,
|
||||
!cn.hutool.core.util.ClassUtil,
|
||||
cn.hutool.core.codec.**,
|
||||
cn.hutool.core.util.**{*;}
|
||||
-keep class cn.hutool.crypto.**{*;}
|
||||
-dontwarn cn.hutool.**
|
||||
# 缓存 Cookie
|
||||
-keep class **.help.http.CookieStore{*;}
|
||||
-keep class **.help.CacheManager{*;}
|
||||
# StrResponse
|
||||
-keep class **.help.http.StrResponse{*;}
|
||||
|
||||
# markwon
|
||||
-dontwarn org.commonmark.ext.gfm.**
|
||||
|
||||
-keep class okhttp3.*{*;}
|
||||
-keep class okio.*{*;}
|
||||
-keep class com.jayway.jsonpath.*{*;}
|
||||
|
||||
# LiveEventBus
|
||||
-keepclassmembers class androidx.lifecycle.LiveData {
|
||||
*** mObservers;
|
||||
*** mActiveCount;
|
||||
}
|
||||
-keepclassmembers class androidx.arch.core.internal.SafeIterableMap {
|
||||
*** size();
|
||||
*** putIfAbsent(...);
|
||||
}
|
||||
|
||||
## ChangeBookSourceDialog initNavigationView
|
||||
-keepclassmembers class androidx.appcompat.widget.Toolbar {
|
||||
*** mNavButtonView;
|
||||
}
|
||||
|
||||
# MenuExtensions applyOpenTint
|
||||
-keepnames class androidx.appcompat.view.menu.SubMenuBuilder
|
||||
-keep class androidx.appcompat.view.menu.MenuBuilder {
|
||||
*** setOptionalIconsVisible(...);
|
||||
*** getNonActionItems();
|
||||
}
|
||||
|
||||
# FileDocExtensions.kt treeDocumentFileConstructor
|
||||
-keep class androidx.documentfile.provider.TreeDocumentFile {
|
||||
<init>(...);
|
||||
}
|
||||
|
||||
# JsoupXpath
|
||||
-keep,allowobfuscation class * implements org.seimicrawler.xpath.core.AxisSelector{*;}
|
||||
-keep,allowobfuscation class * implements org.seimicrawler.xpath.core.NodeTest{*;}
|
||||
-keep,allowobfuscation class * implements org.seimicrawler.xpath.core.Function{*;}
|
||||
|
||||
## JSOUP
|
||||
-keep class org.jsoup.**{*;}
|
||||
-dontwarn org.jspecify.annotations.NullMarked
|
||||
|
||||
## ExoPlayer 反射设置ua 保证该私有变量不被混淆
|
||||
-keepclassmembers class androidx.media3.datasource.cache.CacheDataSource$Factory {
|
||||
*** upstreamDataSourceFactory;
|
||||
}
|
||||
## ExoPlayer 如果还不能播放就取消注释这个
|
||||
# -keep class com.google.android.exoplayer2.** {*;}
|
||||
|
||||
## 对外提供api
|
||||
-keep class io.legado.app.api.ReturnData{*;}
|
||||
|
||||
# Cronet
|
||||
-keepclassmembers class org.chromium.net.X509Util {
|
||||
*** sDefaultTrustManager;
|
||||
*** sTestTrustManager;
|
||||
}
|
||||
|
||||
# Throwable
|
||||
-keepnames class * extends java.lang.Throwable
|
||||
-keepclassmembernames,allowobfuscation class * extends java.lang.Throwable{*;}
|
||||
+1022
File diff suppressed because it is too large
Load Diff
+1176
File diff suppressed because it is too large
Load Diff
+1182
File diff suppressed because it is too large
Load Diff
+1188
File diff suppressed because it is too large
Load Diff
+1194
File diff suppressed because it is too large
Load Diff
+1194
File diff suppressed because it is too large
Load Diff
+1200
File diff suppressed because it is too large
Load Diff
+1226
File diff suppressed because it is too large
Load Diff
+1226
File diff suppressed because it is too large
Load Diff
+1258
File diff suppressed because it is too large
Load Diff
+1265
File diff suppressed because it is too large
Load Diff
+1028
File diff suppressed because it is too large
Load Diff
+1271
File diff suppressed because it is too large
Load Diff
+1283
File diff suppressed because it is too large
Load Diff
+1277
File diff suppressed because it is too large
Load Diff
+1283
File diff suppressed because it is too large
Load Diff
+1324
File diff suppressed because it is too large
Load Diff
+1368
File diff suppressed because it is too large
Load Diff
+1392
File diff suppressed because it is too large
Load Diff
+1392
File diff suppressed because it is too large
Load Diff
+1404
File diff suppressed because it is too large
Load Diff
+1410
File diff suppressed because it is too large
Load Diff
+1036
File diff suppressed because it is too large
Load Diff
+1485
File diff suppressed because it is too large
Load Diff
+1422
File diff suppressed because it is too large
Load Diff
+1422
File diff suppressed because it is too large
Load Diff
+1417
File diff suppressed because it is too large
Load Diff
+1423
File diff suppressed because it is too large
Load Diff
+1441
File diff suppressed because it is too large
Load Diff
+1441
File diff suppressed because it is too large
Load Diff
+1459
File diff suppressed because it is too large
Load Diff
+1465
File diff suppressed because it is too large
Load Diff
+1471
File diff suppressed because it is too large
Load Diff
+1093
File diff suppressed because it is too large
Load Diff
+1483
File diff suppressed because it is too large
Load Diff
+1513
File diff suppressed because it is too large
Load Diff
+1519
File diff suppressed because it is too large
Load Diff
+1537
File diff suppressed because it is too large
Load Diff
+1557
File diff suppressed because it is too large
Load Diff
+1618
File diff suppressed because it is too large
Load Diff
+1618
File diff suppressed because it is too large
Load Diff
+1625
File diff suppressed because it is too large
Load Diff
+1633
File diff suppressed because it is too large
Load Diff
+1654
File diff suppressed because it is too large
Load Diff
+1093
File diff suppressed because it is too large
Load Diff
+1666
File diff suppressed because it is too large
Load Diff
+1674
File diff suppressed because it is too large
Load Diff
+1680
File diff suppressed because it is too large
Load Diff
+1692
File diff suppressed because it is too large
Load Diff
+1711
File diff suppressed because it is too large
Load Diff
+1711
File diff suppressed because it is too large
Load Diff
+1711
File diff suppressed because it is too large
Load Diff
+1717
File diff suppressed because it is too large
Load Diff
+1724
File diff suppressed because it is too large
Load Diff
+1740
File diff suppressed because it is too large
Load Diff
+1131
File diff suppressed because it is too large
Load Diff
+1778
File diff suppressed because it is too large
Load Diff
+1786
File diff suppressed because it is too large
Load Diff
+1830
File diff suppressed because it is too large
Load Diff
+1838
File diff suppressed because it is too large
Load Diff
+1847
File diff suppressed because it is too large
Load Diff
+1853
File diff suppressed because it is too large
Load Diff
+1859
File diff suppressed because it is too large
Load Diff
+1879
File diff suppressed because it is too large
Load Diff
+1885
File diff suppressed because it is too large
Load Diff
+1885
File diff suppressed because it is too large
Load Diff
+1131
File diff suppressed because it is too large
Load Diff
+1891
File diff suppressed because it is too large
Load Diff
+1898
File diff suppressed because it is too large
Load Diff
+1912
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user