未验证 提交 d3f6160e 编写于 作者: S Skylot

feat: add option to disable finally block extraction (#1592)

上级 03e4afb1
......@@ -102,6 +102,7 @@ options:
--add-debug-lines - add comments with debug line numbers if available
--no-inline-anonymous - disable anonymous classes inline
--no-inline-methods - disable methods inline
--no-finally - don't extract finally block
--no-replace-consts - don't replace constant value with matching constant field
--escape-unicode - escape non latin characters in strings (with \u)
--respect-bytecode-access-modifiers - don't change original access modifiers
......
......@@ -89,6 +89,9 @@ public class JadxCLIArgs {
@Parameter(names = { "--no-inline-methods" }, description = "disable methods inline")
protected boolean inlineMethods = true;
@Parameter(names = "--no-finally", description = "don't extract finally block")
protected boolean extractFinally = true;
@Parameter(names = "--no-replace-consts", description = "don't replace constant value with matching constant field")
protected boolean replaceConsts = true;
......@@ -282,6 +285,7 @@ public class JadxCLIArgs {
args.setInsertDebugLines(addDebugLines);
args.setInlineAnonymousClasses(inlineAnonymousClasses);
args.setInlineMethods(inlineMethods);
args.setExtractFinally(extractFinally);
args.setRenameFlags(renameFlags);
args.setFsCaseSensitive(fsCaseSensitive);
args.setCommentsLevel(commentsLevel);
......@@ -362,6 +366,10 @@ public class JadxCLIArgs {
return inlineMethods;
}
public boolean isExtractFinally() {
return extractFinally;
}
public boolean isDeobfuscationOn() {
return deobfuscationOn;
}
......
......@@ -385,6 +385,10 @@ public class JadxSettings extends JadxCLIArgs {
this.inlineMethods = inlineMethods;
}
public void setExtractFinally(boolean extractFinally) {
this.extractFinally = extractFinally;
}
public void setFsCaseSensitive(boolean fsCaseSensitive) {
this.fsCaseSensitive = fsCaseSensitive;
}
......
......@@ -542,6 +542,13 @@ public class JadxSettingsWindow extends JDialog {
needReload();
});
JCheckBox extractFinally = new JCheckBox();
extractFinally.setSelected(settings.isExtractFinally());
extractFinally.addItemListener(e -> {
settings.setExtractFinally(e.getStateChange() == ItemEvent.SELECTED);
needReload();
});
JCheckBox fsCaseSensitive = new JCheckBox();
fsCaseSensitive.setSelected(settings.isFsCaseSensitive());
fsCaseSensitive.addItemListener(e -> {
......@@ -578,6 +585,7 @@ public class JadxSettingsWindow extends JDialog {
other.addRow(NLS.str("preferences.useDebugInfo"), useDebugInfo);
other.addRow(NLS.str("preferences.inlineAnonymous"), inlineAnonymous);
other.addRow(NLS.str("preferences.inlineMethods"), inlineMethods);
other.addRow(NLS.str("preferences.extractFinally"), extractFinally);
other.addRow(NLS.str("preferences.fsCaseSensitive"), fsCaseSensitive);
other.addRow(NLS.str("preferences.useDx"), useDx);
other.addRow(NLS.str("preferences.skipResourcesDecode"), resourceDecode);
......
......@@ -146,6 +146,7 @@ preferences.useImports=Import statements generieren
preferences.useDebugInfo=Debug-Infos verwenden
preferences.inlineAnonymous=Anonyme Inline-Klassen
preferences.inlineMethods=Inline-Methoden
#preferences.extractFinally=Extract finally block
preferences.fsCaseSensitive=Dateisystem unterscheidet zwischen Groß/Kleinschreibung
preferences.skipResourcesDecode=Keine Ressourcen dekodieren
preferences.useKotlinMethodsForVarNames=Kotlin-Methoden für die Umbenennung von Variablen verwenden
......
......@@ -146,7 +146,8 @@ preferences.useImports=Use import statements
preferences.useDebugInfo=Use debug info
preferences.inlineAnonymous=Inline anonymous classes
preferences.inlineMethods=Inline methods
preferences.fsCaseSensitive=File system is case sensitive
preferences.extractFinally=Extract finally block
preferences.fsCaseSensitive=File system is case-sensitive
preferences.skipResourcesDecode=Don't decode resources
preferences.useKotlinMethodsForVarNames=Use kotlin methods for variables rename
preferences.commentsLevel=Code comments level
......
......@@ -146,6 +146,7 @@ preferences.replaceConsts=Reemplazar constantes
#preferences.useDebugInfo=Use debug info
#preferences.inlineAnonymous=
#preferences.inlineMethods=Inline methods
#preferences.extractFinally=Extract finally block
#preferences.fsCaseSensitive=
preferences.skipResourcesDecode=No descodificar recursos
#preferences.useKotlinMethodsForVarNames=Use kotlin methods for variables rename
......
......@@ -146,6 +146,7 @@ preferences.useImports=import 문 사용
#preferences.useDebugInfo=Use debug info
preferences.inlineAnonymous=인라인 익명 클래스
preferences.inlineMethods=인라인 메서드
#preferences.extractFinally=Extract finally block
preferences.fsCaseSensitive=파일 시스템 대소문자 구별
preferences.skipResourcesDecode=리소스 디코딩 하지 않기
#preferences.useKotlinMethodsForVarNames=Use kotlin methods for variables rename
......
......@@ -146,6 +146,7 @@ preferences.useImports=使用 import 语句
preferences.useDebugInfo=启用调试信息
preferences.inlineAnonymous=内联匿名类
preferences.inlineMethods=内联方法
#preferences.extractFinally=Extract finally block
preferences.fsCaseSensitive=文件系统区分大小写
preferences.skipResourcesDecode=不反编译资源文件
preferences.useKotlinMethodsForVarNames=使用Kotlin方法来重命名变量
......
......@@ -146,6 +146,7 @@ preferences.useImports=使用 import 陳述式
preferences.useDebugInfo=使用除錯資訊
preferences.inlineAnonymous=內嵌匿名類別
preferences.inlineMethods=內嵌方式
#preferences.extractFinally=Extract finally block
preferences.fsCaseSensitive=檔案系統區分大小寫
preferences.skipResourcesDecode=不要為資源解碼
preferences.useKotlinMethodsForVarNames=使用 Kotlin 方法來為變數重新命名
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册