This commit is contained in:
Horis
2025-04-08 20:52:23 +08:00
parent bf8ea4bea3
commit 9309af8757
4 changed files with 2 additions and 40 deletions
-34
View File
@@ -22,19 +22,10 @@
# 混合时不使用大小写混合,混合后的类名为小写
-dontusemixedcaseclassnames
# 指定不去忽略非公共库的类
-dontskipnonpubliclibraryclasses
# 这句话能够使我们的项目混淆后产生映射文件
# 包含有类名->混淆后类名的映射关系
-verbose
# 指定不去忽略非公共库的类成员
-dontskipnonpubliclibraryclassmembers
# 不做预校验,preverify是proguard的四个步骤之一,Android不需要preverify,去掉这一步能够加快混淆速度
-dontpreverify
# 保留Annotation不混淆
-keepattributes *Annotation*,InnerClasses
@@ -55,31 +46,6 @@
# 屏蔽错误Unresolved class name
#noinspection ShrinkerUnresolvedReference
# 保留枚举类不被混淆
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
# 保留Serializable序列化的类不被混淆
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
!static !transient <fields>;
!private <fields>;
!private <methods>;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
# 对于带有回调函数的onXXEvent、**On*Listener的,不能被混淆
-keepclassmembers class * {
void *(**On*Event);
void *(**On*Listener);
}
# 移除Log类打印各个等级日志的代码,打正式包的时候可以做为禁log使用,这里可以作为禁止log打印的功能使用
# 记得proguard-android.txt中一定不要加-dontoptimize才起作用
# 另外的一种实现方案是通过BuildConfig.DEBUG的变量来控制
@@ -544,7 +544,7 @@ abstract class BaseReadAloudService : BaseService(),
if (nSubtitle.isNullOrBlank())
nSubtitle = getString(R.string.read_aloud_s)
val builder = NotificationCompat
.Builder(this@BaseReadAloudService, AppConst.channelIdReadAloud)
.Builder(this, AppConst.channelIdReadAloud)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setForegroundServiceBehavior(NotificationCompat.FOREGROUND_SERVICE_IMMEDIATE)
.setCategory(NotificationCompat.CATEGORY_TRANSPORT)
@@ -157,7 +157,7 @@ class WebViewActivity : VMBaseActivity<ActivityWebViewBinding, WebViewModel>() {
}
}
@SuppressLint("JavascriptInterface", "SetJavaScriptEnabled")
@SuppressLint("SetJavaScriptEnabled")
private fun initWebView(url: String, headerMap: HashMap<String, String>) {
binding.progressBar.fontColor = accentColor
binding.webView.webChromeClient = CustomWebChromeClient()
@@ -177,7 +177,6 @@ class WebViewActivity : VMBaseActivity<ActivityWebViewBinding, WebViewModel>() {
}
}
AppCookieManager.applyToWebView(url)
binding.webView.addJavascriptInterface(this, "app")
binding.webView.setOnLongClickListener {
val hitTestResult = binding.webView.hitTestResult
if (hitTestResult.type == WebView.HitTestResult.IMAGE_TYPE ||
@@ -229,9 +229,6 @@ class ReadRssActivity : VMBaseActivity<ActivityRssReadBinding, ReadRssViewModel>
setDarkeningAllowed(AppConfig.isNightTheme)
}
binding.webView.addJavascriptInterface(this, "thisActivity")
viewModel.rssSource?.let {
binding.webView.addJavascriptInterface(it, "thisSource")
}
binding.webView.setOnLongClickListener {
val hitTestResult = binding.webView.hitTestResult
if (hitTestResult.type == WebView.HitTestResult.IMAGE_TYPE ||