soot
soot copied to clipboard
Soot obfuscation class name remains the same
Hello
Soot obfuscation issue here, I'm obfuscating class names and method names and I hit this error a lot
somehow the originalName is equal to the obfuscatedName
any ideas?
I'm using soot 4
13:51:11.476 |-ERROR [ForkJoinPool.commonPool-worker-3] c.p.p.r.s.d.c.o.s.SootObfuscationService - OBFUSCATION_RESULT_PREFIX_{"classesMapping":[{"originalName":"com/magg/psa/dex/core","obfuscatedName":"com/magg/psa/dex/core","methodsMapping":[]},{"originalName":"com/magg/psa/dex/creditcard","obfuscatedName":"com/magg/psa/dex/creditcard","methodsMapping":[]},{"originalName":"com/magg/psa/dex/creditcard/CreditCardController","obfuscatedName":"com/magg/psa/dex/creditcard/$$55$","methodsMapping":[{"originalName":"getFirstAction","obfuscatedName":"Ill11"}]},{"originalName":"com/magg/psa/dex/wakeup","obfuscatedName":"com/magg/psa/dex/wakeup","methodsMapping":[]},{"originalName":"com/magg/psa/dex/wakeup/WakeUpController","obfuscatedName":"com/magg/psa/dex/wakeup/S$5$5","methodsMapping":[{"originalName":"createEntryPointContext","obfuscatedName":"_____"},{"originalName":"getFirstAction","obfuscatedName":"Ill11"},{"originalName":"createErrorRequestParams","obfuscatedName":"ll1II"},{"originalName":"canSendRequestAboutError","obfuscatedName":"IllII"},{"originalName":"createEntryPointContext","obfuscatedName":"_____"}]},{"originalName":"com/magg/psa/dex/auth/core","obfuscatedName":"com/magg/psa/dex/auth/core","methodsMapping":[]}]} [ReferencePipeline.java:439]
here's the logic to obfuscate
final List<String> args =
asList(JAVA, "-cp", Constants.CLASSPATH, "-Xmx256m", SootProcess.class.getName(), GSON.toJson(params));
final ProcessBuilder builder = new ProcessBuilder(args).inheritIO().redirectError(Redirect.PIPE);
try {
final Process process = builder.start();
int exitCode = process.waitFor();
final List<String> errorLines;
try (BufferedReader reader = new BufferedReader(
new InputStreamReader(process.getErrorStream(), StandardCharsets.UTF_8))) {
errorLines = reader.lines().peek(log::error).collect(toList());
}
if (exitCode != 0) {
throw new ObfuscationException("Soot obfuscation process exited with code " + exitCode + "."
+ " And message: " + System.lineSeparator() + String.join(System.lineSeparator(), errorLines));
}
final String obfuscationResult = find(errorLines, SootProcess.OBFUSCATION_RESULT_PREFIX);
return GSON.fromJson(obfuscationResult, ObfuscationMapping.class);
} catch (IOException e) {
throw new ObfuscationException("Cannot run soot obfuscation process.", e);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ObfuscationException("Soot obfuscation process was unexpectedly interrupted.", e);
}