* feature: add translation full content * feature: add translation full content * feature: add translation full content * feature: add translation full content * feature: add translation full content * feature:use chunk files replace chunk cache db * feature:use chunk files replace chunk cache db * feature:use chunk files replace chunk cache db * feature: add translation config navigation and refactor translation settings * feature: 体验优化 * feature: fixed error prompt * Fix Gson deserialization error for LLM translation classes under R8 obfuscation * Fix PMD error * feature: pre-translation * feature: pre-translation * 优化 * 优化 * 增加书籍详情页关联书籍推荐功能 * 修复关联书籍"更多"按钮URL模板变量未解析的问题 * 修复发现按钮部分不执行JS的问题 * 优化书籍详情封面长按逻辑 * 阅读界面自定义图标问题 * R8反混淆问题 * 主题保存时保存图片等资源 * 在首页、发现页等长按时,提供了一个查看简短书籍信息的界面与右上角书籍信息角标。现在书籍信息角标在封面设置中显示 * 现在可配置主页图标 * 主页模块配置被遮挡的问题 * 一些优化 * fix: address code review findings (null safety, error propagation, performance) - TranslateChapterUseCase: wrap execute() in try-catch to prevent task stuck in Translating state; propagate actual translation error instead of generic "Translation incomplete"; defensive null check on pairs - DictionaryRepositoryImpl: safe call on pairs for Gson null-bypass - LlmTranslateRepositoryImpl: safe calls on json.sentences and json.choices to prevent NPE from unexpected API responses - ContentChunker: normalize \r\n to \n before splitting paragraphs to handle Windows-formatted text files - BookInfoViewModel: parallelize related books loading with async/awaitAll - CoilBookCover: add finalPath as remember key to reset state on reuse - ThemeImportExport: fallback to filesDir when getExternalFilesDir is null --------- Co-authored-by: duanhl <duanhl7749@gmail.com>
154 lines
5.1 KiB
Prolog
154 lines
5.1 KiB
Prolog
# Add project specific ProGuard rules here.
|
|
# You can control the set of applied configuration files using the
|
|
# proguardFiles setting in build.gradle.kts.
|
|
#
|
|
# 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.**{*;}
|
|
# Gson反序列化用的数据传输类
|
|
-keep class io.legado.app.model.translation.**{*;}
|
|
-keep class io.legado.app.domain.model.DictPair{*;}
|
|
-keep class io.legado.app.domain.model.BookDictionary{*;}
|
|
-keep class io.legado.app.domain.model.TextChunk{*;}
|
|
-keep class io.legado.app.domain.model.ModuleDef{*;}
|
|
-keep class io.legado.app.domain.model.ModuleItem{*;}
|
|
-keep class io.legado.app.domain.model.CustomSetItem{*;}
|
|
-keep class io.legado.app.data.repository.GoogleTranslateResponse{*;}
|
|
-keep class io.legado.app.data.repository.GoogleSentence{*;}
|
|
-keep class io.legado.app.data.repository.GoogleSpell{*;}
|
|
-keep class io.legado.app.data.repository.OpenAIResponse{*;}
|
|
-keep class io.legado.app.data.repository.OpenAIChoice{*;}
|
|
-keep class io.legado.app.data.repository.OpenAIMessage{*;}
|
|
# 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;
|
|
}
|
|
|
|
# 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{*;}
|
|
# 忽略 Ktor 在 Android 上对 Java SE 管理类的引用
|
|
-dontwarn java.lang.management.**
|
|
-dontwarn io.ktor.util.debug.IntellijIdeaDebugDetector
|
|
-keep,allowobfuscation class io.ktor.util.debug.** { *; }
|