From d09bdcac6830afaad6e277fb558c16d2aa6187a7 Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期四, 14 十二月 2023 11:13:21 +0800
Subject: [PATCH] 卡标识码列表功能相关,可分辨设置不同类型卡标识码
---
app/src/main/java/com/dayu/recharge/tools/BaseNFCHelper.java | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/app/src/main/java/com/dayu/recharge/tools/BaseNFCHelper.java b/app/src/main/java/com/dayu/recharge/tools/BaseNFCHelper.java
index 806ebed..49e1fad 100644
--- a/app/src/main/java/com/dayu/recharge/tools/BaseNFCHelper.java
+++ b/app/src/main/java/com/dayu/recharge/tools/BaseNFCHelper.java
@@ -20,7 +20,7 @@
*/
public class BaseNFCHelper {
/**
- * 榛樿瀵嗙爜锛堢櫧鍗″瘑鐮侊級
+ * 榛樿瀵嗙爜锛堢櫧鍗″瘑鐮侊級ffffffffffff
*/
public byte[] defauleKey;
@@ -28,14 +28,16 @@
* 鍏徃瀵嗙爜
*/
public byte[] companyKey;
-
+ //瀵嗙爜a鍖�
String companyKeyA;
+ //瀵嗙爜B鍖�
String companyKeyB;
public BaseNFCHelper() {
// 瑙e瘑瀛楃涓�
try {
+ //鍒濆瀵嗙爜
byte[] encryptedBytes = Base64.decode("orDiGzvueQqPpU+VQ3NEzQ==", Base64.DEFAULT);
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
byte[] encodedKey = {-117, -104, -100, 84, 111, -102, -29, -21, 72, -82, -105, 123, 77, 79, 17, -55, -102, -28, 50, 23, 67, 98, 0, -96, -10, -48, -60, 81, 113, 80, -32, -26};
@@ -43,16 +45,19 @@
byte[] decryptedBytes = cipher.doFinal(encryptedBytes);
String decryptedText = new String(decryptedBytes, StandardCharsets.UTF_8);
defauleKey = HexUtil.hexToByteArray(decryptedText);
-
- byte[] encryptedBytes2 = Base64.decode("aYC9feYEOFOQHuzflLIXSw==", Base64.DEFAULT);
+ //鍒濆瀵嗙爜
+// byte[] encryptedBytes2 = Base64.decode("aYC9feYEOFOQHuzflLIXSw==", Base64.DEFAULT);
+ byte[] encryptedBytes2 = Base64.decode("qeg4DUWf0ni9JfRWtD2krA==", Base64.DEFAULT);
byte[] decryptedBytes2 = cipher.doFinal(encryptedBytes2);
companyKeyA = new String(decryptedBytes2, StandardCharsets.UTF_8);
companyKey = HexUtil.hexToByteArray(companyKeyA);
+ //淇敼鍚庣殑瀵嗙爜
byte[] encryptedBytes3 = Base64.decode("n+SSZFb4DHsreVav/Z5ftg==", Base64.DEFAULT);
byte[] decryptedBytes3 = cipher.doFinal(encryptedBytes3);
companyKeyB = new String(decryptedBytes3, StandardCharsets.UTF_8);
+
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
} catch (NoSuchPaddingException e) {
--
Gitblit v1.8.0