fix: improve decoding errors handling (#2676)

This commit is contained in:
Skylot
2025-10-29 18:14:32 +00:00
parent e008e818b0
commit f17c46224d
9 changed files with 42 additions and 44 deletions
+4 -5
View File
@@ -55,7 +55,7 @@ public class JadxCLI {
private static JadxArgs buildArgs(JadxCLIArgs cliArgs) {
LogHelper.initLogLevel(cliArgs);
LogHelper.setLogLevelsForLoadingStage();
LogHelper.applyLogLevels();
JadxArgs jadxArgs = cliArgs.toJadxArgs();
jadxArgs.setCodeCache(new NoOpCodeCache());
jadxArgs.setUsageInfoCache(new EmptyUsageInfoCache());
@@ -72,7 +72,6 @@ public class JadxCLI {
if (checkForErrors(jadx)) {
return 1;
}
LogHelper.setLogLevelsForDecompileStage();
if (!SingleClassMode.process(jadx, cliArgs)) {
save(jadx);
}
@@ -110,10 +109,10 @@ public class JadxCLI {
jadx.getArgs().setSkipSources(true);
}
}
if (jadx.getErrorsCount() > 0) {
LOG.error("Load with errors! Check log for details");
int errorsCount = jadx.getErrorsCount();
if (errorsCount > 0) {
LOG.error("Loading finished with errors! Count: {}", errorsCount);
// continue processing
return false;
}
return false;
}
+1 -14
View File
@@ -56,20 +56,7 @@ public class LogHelper {
applyLogLevel(logLevelValue);
}
public static void setLogLevelsForLoadingStage() {
if (logLevelValue == null) {
return;
}
if (logLevelValue == LogLevelEnum.PROGRESS) {
// show load errors
LogHelper.applyLogLevel(LogLevelEnum.ERROR);
fixForShowProgress();
return;
}
applyLogLevel(logLevelValue);
}
public static void setLogLevelsForDecompileStage() {
public static void applyLogLevels() {
if (logLevelValue == null) {
return;
}