From 8b566e47b67d74d1915bc9f2c07204dd1a222197 Mon Sep 17 00:00:00 2001 From: zuoxiao <470321431@qq.com> Date: 星期三, 04 六月 2025 13:44:00 +0800 Subject: [PATCH] feat(generallibrary): 添加按钮和对话框的背景 drawable --- baselibrary/src/main/java/com/dayu/baselibrary/tools/nfc/NativeNfcReadHelper.java | 24 ++++++++++++++++++------ 1 files changed, 18 insertions(+), 6 deletions(-) diff --git a/baselibrary/src/main/java/com/dayu/baselibrary/tools/nfc/NativeNfcReadHelper.java b/baselibrary/src/main/java/com/dayu/baselibrary/tools/nfc/NativeNfcReadHelper.java index 1080205..ef74114 100644 --- a/baselibrary/src/main/java/com/dayu/baselibrary/tools/nfc/NativeNfcReadHelper.java +++ b/baselibrary/src/main/java/com/dayu/baselibrary/tools/nfc/NativeNfcReadHelper.java @@ -31,8 +31,6 @@ private static NativeNfcReadHelper helper; - public NativeNfcReadHelper(Intent intent, Activity activity) { - } @Override @@ -49,7 +47,7 @@ */ public static NativeNfcReadHelper getInstence(Intent intent, Activity activity) { if (helper == null) { - helper = new NativeNfcReadHelper(intent, activity); + helper = new NativeNfcReadHelper(); } helper.setIntent(intent); return helper; @@ -128,7 +126,6 @@ @Override public String getCradType() { - MifareClassic mfc = MifareClassic.get(tag); if (null != mfc) { try { @@ -388,6 +385,9 @@ @Override public String getCardNumber() { + if (tag == null) { + return ""; + } MifareClassic mfc = MifareClassic.get(tag); if (null != mfc) { try { @@ -402,7 +402,9 @@ } } } else if (!listA_PS.isEmpty()) { - if (mfc.authenticateSectorWithKeyA(0, listA_PS.get(0))) { + if (mfc.authenticateSectorWithKeyA(0, defauleKey)) { + isOpen = true; + } else if (mfc.authenticateSectorWithKeyA(0, listA_PS.get(0))) { isOpen = true; } } @@ -433,7 +435,13 @@ } + + + public String getCardNumberNoClose() { + if (tag == null) { + return ""; + } MifareClassic mfc = MifareClassic.get(tag); if (null != mfc) { try { @@ -448,7 +456,9 @@ } } } else if (!listA_PS.isEmpty()) { - if (mfc.authenticateSectorWithKeyA(0, listA_PS.get(0))) { + if (mfc.authenticateSectorWithKeyA(0, defauleKey)) { + isOpen = true; + } else if (mfc.authenticateSectorWithKeyA(0, listA_PS.get(0))) { isOpen = true; } } @@ -664,4 +674,6 @@ } return null; } + + } -- Gitblit v1.8.0