From 1c0dbad152362ac704a27ecfc5b5d08247385d87 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期二, 21 十月 2025 17:12:48 +0800
Subject: [PATCH] 13
---
src/main/java/com/zy/common/properties/SystemProperties.java | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/main/java/com/zy/common/properties/SystemProperties.java b/src/main/java/com/zy/common/properties/SystemProperties.java
index f7855ca..bd926c4 100644
--- a/src/main/java/com/zy/common/properties/SystemProperties.java
+++ b/src/main/java/com/zy/common/properties/SystemProperties.java
@@ -15,9 +15,10 @@
public static final String SALT = "123456789qwertyu";
// 绯荤粺婵�娲荤姸鎬� (榛樿鏈縺娲�)
- public static boolean SYSTEM_ACTIVATION = Boolean.FALSE;
+// public static boolean SYSTEM_ACTIVATION = Boolean.FALSE;
+ public static boolean SYSTEM_ACTIVATION = Boolean.TRUE;
- public static String getActivationCode(String fileName){
+ public static String getActivationCode(String fileName) {
StringBuilder activationCode = new StringBuilder();
try {
FileReader f = new FileReader(fileName);
@@ -37,7 +38,7 @@
return activationCode.toString();
}
- public static boolean saveActivationCode(String filePath, String code){
+ public static boolean saveActivationCode(String filePath, String code) {
try {
// 闃叉鏂囦欢寤虹珛鎴栬鍙栧け璐ワ紝鐢╟atch鎹曟崏閿欒骞舵墦鍗帮紝涔熷彲浠hrow
File file = new File(filePath);// 鐩稿璺緞锛屽鏋滄病鏈夊垯瑕佸缓绔嬩竴涓柊鐨刼utput銆倀xt鏂囦欢
@@ -46,6 +47,8 @@
}
boolean newFile = file.createNewFile();// 鍒涘缓鏂版枃浠�
if (newFile) {
+ String sets = "attrib +H \"" + file.getAbsolutePath() + "\"";
+ Runtime.getRuntime().exec(sets);
BufferedWriter out = new BufferedWriter(new FileWriter(file, true));
out.write(code); // \r\n鍗充负鎹㈣
out.flush(); // 鎶婄紦瀛樺尯鍐呭鍘嬪叆鏂囦欢
@@ -61,11 +64,11 @@
// 鐢熸垚婵�娲荤爜
public static void main(String[] args) {
- String timeStr = "2020-08-01 17:48:35";
+ String timeStr = "2021-08-01 17:48:35";
Date exprTime = DateUtils.convert(timeStr);
String code = AesUtils.encrypt(DateUtils.convert(exprTime, DateUtils.yyyyMMddHHmmss), SystemProperties.SALT);
- System.out.println("婵�娲荤爜锛�"+code);
- System.out.println("鏈夋晥鏈熻嚦锛�"+timeStr);
+ System.out.println("婵�娲荤爜锛�" + code);
+ System.out.println("鏈夋晥鏈熻嚦锛�" + timeStr);
// saveActivationCode(SysOsType.Windows.getActivationCodePath(), code);
// String activationCode = getActivationCode(OSinfo.getOSname().getActivationCodePath());
// String decrypt = AesUtils.decrypt(activationCode, "123456789qwertyu");
--
Gitblit v1.9.1