From 9c11fb9a45b0f1ff2a86eb139078e5361216434b Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期三, 29 十一月 2023 14:59:10 +0800
Subject: [PATCH] 读取模拟卡修改后注释(未完成)
---
app/src/main/java/com/dayu/recharge/tools/BaseNFCHelper.java | 25 ++++++++++++++++++++++---
1 files changed, 22 insertions(+), 3 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 77e1c11..806ebed 100644
--- a/app/src/main/java/com/dayu/recharge/tools/BaseNFCHelper.java
+++ b/app/src/main/java/com/dayu/recharge/tools/BaseNFCHelper.java
@@ -20,9 +20,18 @@
*/
public class BaseNFCHelper {
/**
- * 榛樿瀵嗙爜
+ * 榛樿瀵嗙爜锛堢櫧鍗″瘑鐮侊級
*/
- public byte[] bytes;
+ public byte[] defauleKey;
+
+ /**
+ * 鍏徃瀵嗙爜
+ */
+ public byte[] companyKey;
+
+ String companyKeyA;
+ String companyKeyB;
+
public BaseNFCHelper() {
// 瑙e瘑瀛楃涓�
@@ -33,7 +42,17 @@
cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(encodedKey, "AES"));
byte[] decryptedBytes = cipher.doFinal(encryptedBytes);
String decryptedText = new String(decryptedBytes, StandardCharsets.UTF_8);
- bytes = HexUtil.hexToByteArray(decryptedText);
+ defauleKey = HexUtil.hexToByteArray(decryptedText);
+
+ byte[] encryptedBytes2 = Base64.decode("aYC9feYEOFOQHuzflLIXSw==", 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