Skip to content

Commit

Permalink
Try-catch each rule
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisTestUser authored Jul 20, 2021
1 parent dcd2eff commit 101db98
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions src/main/java/com/javadeobfuscator/deobfuscator/Deobfuscator.java
Original file line number Diff line number Diff line change
Expand Up @@ -382,25 +382,31 @@ public void start() throws Throwable {
logger.info("Detecting known obfuscators");

for (Rule rule : Rules.RULES) {
String message = rule.test(this);
if (message == null) {
continue;
}

logger.info("");
logger.info("{}: {}", rule.getClass().getSimpleName(), rule.getDescription());
logger.info("\t{}", message);
logger.info("Recommend transformers:");
logger.info("(Choose one transformer. If there are multiple, it's recommended to try the transformer listed first)");

Collection<Class<? extends Transformer<?>>> recommended = rule.getRecommendTransformers();
if (recommended == null) {
logger.info("\tNone");
} else {
for (Class<? extends Transformer<?>> transformer : recommended) {
logger.info("\t{}", transformer.getName());
}
}
try
{
String message = rule.test(this);
if (message == null) {
continue;
}

logger.info("");
logger.info("{}: {}", rule.getClass().getSimpleName(), rule.getDescription());
logger.info("\t{}", message);
logger.info("Recommend transformers:");
logger.info("(Choose one transformer. If there are multiple, it's recommended to try the transformer listed first)");

Collection<Class<? extends Transformer<?>>> recommended = rule.getRecommendTransformers();
if (recommended == null) {
logger.info("\tNone");
} else {
for (Class<? extends Transformer<?>> transformer : recommended) {
logger.info("\t{}", transformer.getName());
}
}
}catch(Exception e)
{
e.printStackTrace();
}
}

logger.info("All detectors have been run. If you do not see anything listed, check if your file only contains name obfuscation.");
Expand Down

0 comments on commit 101db98

Please sign in to comment.