fix: treat filesystem as case insensitive by default, option added for change
This commit is contained in:
@@ -1,16 +1,11 @@
|
||||
package jadx.cli;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import jadx.api.JadxArgs;
|
||||
import jadx.api.JadxDecompiler;
|
||||
import jadx.core.utils.exceptions.JadxArgsValidateException;
|
||||
import jadx.core.utils.files.FileUtils;
|
||||
|
||||
public class JadxCLI {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(JadxCLI.class);
|
||||
@@ -32,7 +27,6 @@ public class JadxCLI {
|
||||
|
||||
static int processAndSave(JadxCLIArgs inputArgs) {
|
||||
JadxArgs args = inputArgs.toJadxArgs();
|
||||
args.setFsCaseSensitive(getFsCaseSensitivity(args));
|
||||
JadxDecompiler jadx = new JadxDecompiler(args);
|
||||
try {
|
||||
jadx.load();
|
||||
@@ -50,14 +44,4 @@ public class JadxCLI {
|
||||
}
|
||||
return errorsCount;
|
||||
}
|
||||
|
||||
private static boolean getFsCaseSensitivity(JadxArgs args) {
|
||||
List<File> testDirList = new ArrayList<>(3);
|
||||
testDirList.add(args.getOutDir());
|
||||
testDirList.add(args.getOutDirSrc());
|
||||
if (!args.getInputFiles().isEmpty()) {
|
||||
testDirList.add(args.getInputFiles().get(0));
|
||||
}
|
||||
return FileUtils.isCaseSensitiveFS(testDirList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,6 +85,9 @@ public class JadxCLIArgs {
|
||||
@Parameter(names = { "--deobf-use-sourcename" }, description = "use source file name as class name alias")
|
||||
protected boolean deobfuscationUseSourceNameAsAlias = true;
|
||||
|
||||
@Parameter(names = { "--fs-case-sensitive" }, description = "treat filesystem as case sensitive, false by default")
|
||||
protected boolean fsCaseSensitive = false;
|
||||
|
||||
@Parameter(names = { "--cfg" }, description = "save methods control flow graph to dot file")
|
||||
protected boolean cfgOutput = false;
|
||||
|
||||
@@ -190,6 +193,7 @@ public class JadxCLIArgs {
|
||||
args.setRenameCaseSensitive(isRenameCaseSensitive());
|
||||
args.setRenameValid(isRenameValid());
|
||||
args.setRenamePrintable(isRenamePrintable());
|
||||
args.setFsCaseSensitive(fsCaseSensitive);
|
||||
return args;
|
||||
}
|
||||
|
||||
@@ -321,8 +325,11 @@ public class JadxCLIArgs {
|
||||
}
|
||||
}
|
||||
|
||||
static class RenameConverter implements IStringConverter<Set<RenameEnum>> {
|
||||
public boolean isFsCaseSensitive() {
|
||||
return fsCaseSensitive;
|
||||
}
|
||||
|
||||
static class RenameConverter implements IStringConverter<Set<RenameEnum>> {
|
||||
private final String paramName;
|
||||
|
||||
RenameConverter(String paramName) {
|
||||
|
||||
Reference in New Issue
Block a user