This commit is contained in:
parent
c897368828
commit
ca82fd4d86
|
|
@ -1,6 +1,8 @@
|
|||
# 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 桥接类保护
|
||||
-keep class com.stand.standapp.AndroidInterface { *; }
|
||||
|
|
@ -8,6 +10,8 @@
|
|||
|
||||
# 忽略不存在的可选依赖报错
|
||||
-dontwarn com.google.android.material.snackbar.**
|
||||
-dontwarn java.beans.**
|
||||
-dontwarn org.yaml.snakeyaml.**
|
||||
|
||||
# OkHttp 混淆规则
|
||||
-keepattributes Signature
|
||||
|
|
@ -19,5 +23,22 @@
|
|||
# A resource is loaded at runtime for config index:
|
||||
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
|
||||
|
||||
# 保护 PTT 原生回调类(native 通过 JNI 反射调用,不能混淆)
|
||||
-keep class com.example.kingway.ptt.** { *; }
|
||||
|
||||
## 保护打印机 SDK(jar 包中的类不能混淆)
|
||||
#-keep class com.dp.dp_serialportlist.** { *; }
|
||||
#-dontwarn com.dp.dp_serialportlist.**
|
||||
#-keep class com.zy.** { *; }
|
||||
#-dontwarn com.zy.**
|
||||
#
|
||||
## 保护硬件 GPIO 系统服务(隐藏 API,R8 不认识)
|
||||
#-keep class android.app.ZysjSystemManager { *; }
|
||||
#-dontwarn android.app.ZysjSystemManager
|
||||
|
||||
# 保护实体类 (如果你后续有 JSON 解析)
|
||||
-keep class com.stand.standapp.** { *; }
|
||||
-dontwarn java.beans.**
|
||||
|
||||
# R8 missing class 处理
|
||||
-ignorewarnings
|
||||
|
|
|
|||
|
|
@ -253,10 +253,10 @@ class AndroidInterface(private val activity: MainActivity) {
|
|||
|
||||
fun cutPaper(allCut: Boolean) {
|
||||
try {
|
||||
PrinterManager.getFactory()?.let {
|
||||
if (it.isConnection) {
|
||||
if (allCut) it.PaperAllCut() else it.PaperCut()
|
||||
}
|
||||
if (allCut){
|
||||
PrinterManager.getFactory()?.PaperAllCut();
|
||||
}else{
|
||||
PrinterManager.getFactory()?.PaperCut();
|
||||
}
|
||||
} catch (e: Throwable) {
|
||||
Timber.tag("JS_Interface").e(e, "cutPaper failed")
|
||||
|
|
|
|||
Loading…
Reference in New Issue