From 936fb552a30c05fc7a60c20f47bf6fccbc2dc1c1 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期三, 27 十二月 2023 16:17:23 +0800
Subject: [PATCH] 备份一下代码
---
HDLLinkLocalSdk/src/main/java/com/hdl/sdk/link/common/utils/ByteUtils.java | 35 +----------------------------------
1 files changed, 1 insertions(+), 34 deletions(-)
diff --git a/HDLLinkLocalSdk/src/main/java/com/hdl/sdk/link/common/utils/ByteUtils.java b/HDLLinkLocalSdk/src/main/java/com/hdl/sdk/link/common/utils/ByteUtils.java
index e4f6a9d..2c2f4a1 100644
--- a/HDLLinkLocalSdk/src/main/java/com/hdl/sdk/link/common/utils/ByteUtils.java
+++ b/HDLLinkLocalSdk/src/main/java/com/hdl/sdk/link/common/utils/ByteUtils.java
@@ -203,41 +203,8 @@
}
public static int byteArrayToInt(byte[] b) {
- int i = (b[0] & 0xFF) * 256 * 256 * 256 + (b[1] & 0xFF) * 256 * 256 + (b[2] & 0xFF) * 256 + (b[3] & 0xFF);
- return i;
+ return (b[0] & 0xFF) * 256 * 256 * 256 + (b[1] & 0xFF) * 256 * 256 + (b[2] & 0xFF) * 256 + (b[3] & 0xFF);
}
- /**
- * 瑙e瘑
- *
- * @param contentByte 寰呰В瀵嗗緟瀛楃涓瞙exStr
- * @param contentByte 瀵嗛挜
- * @return
- */
- public static byte[] decrypt(byte[] contentByte) {
- try {
- //KEY杞崲
- Key key = new SecretKeySpec("HDLRDCENTER1985.".getBytes(), "AES");
- //瑙e瘑
- Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding");
- IvParameterSpec ivps = new IvParameterSpec("HDLRDCENTER1985.".getBytes());
- cipher.init(Cipher.DECRYPT_MODE, key, ivps);
- byte[] result = cipher.doFinal(contentByte);
- return result;
- } catch (NoSuchAlgorithmException e) {
- LogUtils.e(e.getMessage());
- } catch (InvalidKeyException e) {
- LogUtils.e(e.getMessage());
- } catch (NoSuchPaddingException e) {
- LogUtils.e(e.getMessage());
- } catch (BadPaddingException e) {
- LogUtils.e(e.getMessage());
- } catch (IllegalBlockSizeException e) {
- LogUtils.e(e.getMessage());
- } catch (InvalidAlgorithmParameterException e) {
- LogUtils.e(e.getMessage());
- }
- return null;
- }
}
--
Gitblit v1.8.0