|
@@ -257,6 +257,7 @@ public class DecryptExecutor {
|
|
|
final File zipFile = new File(zipFilePath);
|
|
final File zipFile = new File(zipFilePath);
|
|
|
byte[] nonClassFileChecklistBytes = IOUtil.readFileFromWorkbenchRoot(zipFile, Constant.ALREADY_ENCRYPTED_NON_CLASS_FILE_CHECKLIST_SAVE_FILE);
|
|
byte[] nonClassFileChecklistBytes = IOUtil.readFileFromWorkbenchRoot(zipFile, Constant.ALREADY_ENCRYPTED_NON_CLASS_FILE_CHECKLIST_SAVE_FILE);
|
|
|
String nonClassFileChecklist = new String(nonClassFileChecklistBytes, StandardCharsets.UTF_8);
|
|
String nonClassFileChecklist = new String(nonClassFileChecklistBytes, StandardCharsets.UTF_8);
|
|
|
|
|
+ Logger.debug(DecryptExecutor.class, "nonClassFileChecklist -> " + nonClassFileChecklist);
|
|
|
if (StrUtil.isBlank(nonClassFileChecklist)) {
|
|
if (StrUtil.isBlank(nonClassFileChecklist)) {
|
|
|
Logger.debug(DecryptExecutor.class, "nonClassFileChecklist is empty.");
|
|
Logger.debug(DecryptExecutor.class, "nonClassFileChecklist is empty.");
|
|
|
return new HashMap<>(1);
|
|
return new HashMap<>(1);
|
|
@@ -268,13 +269,14 @@ public class DecryptExecutor {
|
|
|
Map<String, byte[]> replaceMap = new HashMap<>(16);
|
|
Map<String, byte[]> replaceMap = new HashMap<>(16);
|
|
|
for (String zipEntryName : needToDecryptNonClassFileSet) {
|
|
for (String zipEntryName : needToDecryptNonClassFileSet) {
|
|
|
byte[] encryptedBytes = IOUtil.readFileFromWorkbenchRoot(zipFile, Constant.DEFAULT_ENCRYPTED_NON_CLASSES_SAVE_DIR + zipEntryName);
|
|
byte[] encryptedBytes = IOUtil.readFileFromWorkbenchRoot(zipFile, Constant.DEFAULT_ENCRYPTED_NON_CLASSES_SAVE_DIR + zipEntryName);
|
|
|
- byte[] bytes = EncryptUtil.decrypt(encryptedBytes, userIfInputPwdWhileDecrypt ? password :
|
|
|
|
|
- obtainAutoGeneratedPwdWhileEncrypt(zipFilePath, Constant.DEFAULT_ENCRYPTED_BASE_SAVE_DIR));
|
|
|
|
|
// 只处理有印章的
|
|
// 只处理有印章的
|
|
|
- if (DecryptExecutor.verifySeal(bytes)) {
|
|
|
|
|
|
|
+ if (DecryptExecutor.verifySeal(encryptedBytes)) {
|
|
|
|
|
+ byte[] bytes = EncryptUtil.decrypt(encryptedBytes, userIfInputPwdWhileDecrypt ? password :
|
|
|
|
|
+ obtainAutoGeneratedPwdWhileEncrypt(zipFilePath, Constant.DEFAULT_ENCRYPTED_BASE_SAVE_DIR));
|
|
|
replaceMap.put(zipEntryName, bytes);
|
|
replaceMap.put(zipEntryName, bytes);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ Logger.debug(DecryptExecutor.class, "un-mask non-classes contains -> " + replaceMap.keySet());
|
|
|
return JarUtil.rewriteZipEntry(new ZipFile(zipFilePath), replaceMap);
|
|
return JarUtil.rewriteZipEntry(new ZipFile(zipFilePath), replaceMap);
|
|
|
}
|
|
}
|
|
|
|
|
|