This commit is contained in:
844143714@qq,com 2026-05-06 23:57:47 +08:00
parent c897368828
commit ca82fd4d86
2 changed files with 26 additions and 5 deletions

View File

@ -1,6 +1,8 @@
# GeckoView 混淆规则 # GeckoView 混淆规则
-dontwarn org.mozilla.geckoview.** -dontwarn org.mozilla.geckoview.**
-keep class org.mozilla.gecko.util.DebugConfig { *; } -dontwarn org.mozilla.gecko.**
-keep class org.mozilla.gecko.** { *; }
-keep class org.mozilla.geckoview.** { *; }
# AndroidInterface 桥接类保护 # AndroidInterface 桥接类保护
-keep class com.stand.standapp.AndroidInterface { *; } -keep class com.stand.standapp.AndroidInterface { *; }
@ -8,6 +10,8 @@
# 忽略不存在的可选依赖报错 # 忽略不存在的可选依赖报错
-dontwarn com.google.android.material.snackbar.** -dontwarn com.google.android.material.snackbar.**
-dontwarn java.beans.**
-dontwarn org.yaml.snakeyaml.**
# OkHttp 混淆规则 # OkHttp 混淆规则
-keepattributes Signature -keepattributes Signature
@ -19,5 +23,22 @@
# A resource is loaded at runtime for config index: # A resource is loaded at runtime for config index:
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase -keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
# 保护 PTT 原生回调类native 通过 JNI 反射调用,不能混淆)
-keep class com.example.kingway.ptt.** { *; }
## 保护打印机 SDKjar 包中的类不能混淆)
#-keep class com.dp.dp_serialportlist.** { *; }
#-dontwarn com.dp.dp_serialportlist.**
#-keep class com.zy.** { *; }
#-dontwarn com.zy.**
#
## 保护硬件 GPIO 系统服务(隐藏 APIR8 不认识)
#-keep class android.app.ZysjSystemManager { *; }
#-dontwarn android.app.ZysjSystemManager
# 保护实体类 (如果你后续有 JSON 解析) # 保护实体类 (如果你后续有 JSON 解析)
-keep class com.stand.standapp.** { *; } -keep class com.stand.standapp.** { *; }
-dontwarn java.beans.**
# R8 missing class 处理
-ignorewarnings

View File

@ -253,10 +253,10 @@ class AndroidInterface(private val activity: MainActivity) {
fun cutPaper(allCut: Boolean) { fun cutPaper(allCut: Boolean) {
try { try {
PrinterManager.getFactory()?.let { if (allCut){
if (it.isConnection) { PrinterManager.getFactory()?.PaperAllCut();
if (allCut) it.PaperAllCut() else it.PaperCut() }else{
} PrinterManager.getFactory()?.PaperCut();
} }
} catch (e: Throwable) { } catch (e: Throwable) {
Timber.tag("JS_Interface").e(e, "cutPaper failed") Timber.tag("JS_Interface").e(e, "cutPaper failed")