fix(v0.11): 第六轮走查——legacy 去除 System.out 演示入口与 Kafka 消费端日志

- AESUtils / RSAUtils / SM4Utils / CustomXssUtil / SnowFlakeSerialCode:删除仅用于本地演示的 main,消除生产源码中的 System.out。
- KafkaConsumer:移除 printStackTrace;异常改为 logger.error(msg, e);Class.newInstance 改为 getDeclaredConstructor().newInstance()。

对应 docs/reviews 05 工程卫生项;全量 maven-cloudwalk-legacy-public 已通过 compile。

Made-with: Cursor
This commit is contained in:
反编译工作区
2026-04-25 00:16:42 +08:00
parent b565ce0658
commit 2d9fa1c9de
6 changed files with 9 additions and 65 deletions
@@ -1,7 +1,6 @@
package cn.cloudwalk.cloud.security;
import java.nio.charset.Charset;
import java.util.Arrays;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.binary.Base64;
@@ -148,18 +147,6 @@ throw new IllegalArgumentException("encode init error");
}
}
public static void main(String[] args) throws Exception {
byte[] bytes1 = { 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4 };
System.out.println("原数组长度:-----" + bytes1.length);
byte[] bytes = getEncCode(bytes1, "123asdasdasdas21");
System.out.println("加密后长度:-----" + bytes.length);
System.out.println(Arrays.toString(bytes));
byte[] bytes2 = getDecCode(bytes, "123asdasdasdas21");
System.out.println("还原数组长度:-----" + bytes2.length);
System.out.println(Arrays.toString(bytes2));
}
}
@@ -224,16 +224,6 @@ signature.update(data);
return signature.verify(Base64.decodeBase64(sign));
}
public static void main(String[] args) throws Exception {
Map<String, Object> map = initKey();
String str = "这是一段测试报文";
byte[] ret = encryptByPublic(str.getBytes("utf-8"), getPublicKey(map));
System.out.println(Base64.encodeBase64String(ret));
System.out.println(new String(decryptByPrivate(ret, getPrivateKey(map)), "utf-8"));
}
}
@@ -382,11 +382,6 @@ sms4(ciphertext, 16, key, plain, 0);
return plain;
}
public static void main(String[] args) throws Exception {
System.out.println(encodeSMS4("1aaaa", "465535453546785465342345"));
System.out.println(decodeSMS4(encodeSMS4("1aaaa", "465535453546785465342345"), "465535453546785465342345"));
}
}