Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
[BUG] 花指令混淆部分遇到类加载报错解决
Browse files Browse the repository at this point in the history
  • Loading branch information
4ra1n committed Aug 1, 2024
1 parent d1a5714 commit 0c923cf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- [功能] 添加对泛型 `signature` 的处理
- [优化] 优化 `builtin` 黑名单解析和注释
- [BUG] 修复没有添加目录到 `JAR ENTRY` 的问题
- [BUG] 花指令混淆部分遇到类加载报错解决
- [BUG] 修复 `MANIFEST.MF` 没有完全修改的问题

感谢以下用户的贡献:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ public static void transform(BaseConfig config) {
ClassWriter classWriter = new CustomClassWriter(classReader,
ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS, loader);
JunkCodeChanger changer = new JunkCodeChanger(classWriter, config);
classReader.accept(changer, Const.AnalyzeASMOptions);
try {
classReader.accept(changer, Const.AnalyzeASMOptions);
} catch (Exception ignored) {
// CustomClassLoader 可能会找不到类
// 这个地方目前做法是跳过这个类的花指令混淆
logger.debug("花指令混淆使用自定义类加载器出现错误");
continue;
}
Files.delete(newClassPath);
Files.write(newClassPath, classWriter.toByteArray());
} catch (MethodTooLargeException ex) {
Expand Down

0 comments on commit 0c923cf

Please sign in to comment.