Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
keyescgm
jadx
提交
8785c33d
J
jadx
项目概览
keyescgm
/
jadx
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jadx
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8785c33d
编写于
5月 18, 2021
作者:
S
Skylot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: add option to disable methods inline (#1170)
上级
661ebe43
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
54 addition
and
8 deletion
+54
-8
README.md
README.md
+3
-1
jadx-cli/src/main/java/jadx/cli/JadxCLIArgs.java
jadx-cli/src/main/java/jadx/cli/JadxCLIArgs.java
+8
-0
jadx-core/src/main/java/jadx/api/JadxArgs.java
jadx-core/src/main/java/jadx/api/JadxArgs.java
+9
-0
jadx-core/src/main/java/jadx/core/Jadx.java
jadx-core/src/main/java/jadx/core/Jadx.java
+6
-4
jadx-gui/src/main/java/jadx/gui/settings/JadxSettings.java
jadx-gui/src/main/java/jadx/gui/settings/JadxSettings.java
+15
-3
jadx-gui/src/main/java/jadx/gui/settings/JadxSettingsWindow.java
...i/src/main/java/jadx/gui/settings/JadxSettingsWindow.java
+8
-0
jadx-gui/src/main/resources/i18n/Messages_de_DE.properties
jadx-gui/src/main/resources/i18n/Messages_de_DE.properties
+1
-0
jadx-gui/src/main/resources/i18n/Messages_en_US.properties
jadx-gui/src/main/resources/i18n/Messages_en_US.properties
+1
-0
jadx-gui/src/main/resources/i18n/Messages_es_ES.properties
jadx-gui/src/main/resources/i18n/Messages_es_ES.properties
+1
-0
jadx-gui/src/main/resources/i18n/Messages_ko_KR.properties
jadx-gui/src/main/resources/i18n/Messages_ko_KR.properties
+1
-0
jadx-gui/src/main/resources/i18n/Messages_zh_CN.properties
jadx-gui/src/main/resources/i18n/Messages_zh_CN.properties
+1
-0
未找到文件。
README.md
浏览文件 @
8785c33d
...
@@ -68,7 +68,7 @@ and also packed to `build/jadx-<version>.zip`
...
@@ -68,7 +68,7 @@ and also packed to `build/jadx-<version>.zip`
### Usage
### Usage
```
```
jadx[-gui] [options] <input file> (.apk, .dex, .jar, .class, .smali, .zip, .aar, .arsc, .aab)
jadx[-gui] [options] <input file
s
> (.apk, .dex, .jar, .class, .smali, .zip, .aar, .arsc, .aab)
options:
options:
-d, --output-dir - output directory
-d, --output-dir - output directory
-ds, --output-dir-src - output directory for sources
-ds, --output-dir-src - output directory for sources
...
@@ -82,7 +82,9 @@ options:
...
@@ -82,7 +82,9 @@ options:
--show-bad-code - show inconsistent code (incorrectly decompiled)
--show-bad-code - show inconsistent code (incorrectly decompiled)
--no-imports - disable use of imports, always write entire package name
--no-imports - disable use of imports, always write entire package name
--no-debug-info - disable debug info
--no-debug-info - disable debug info
--add-debug-lines - add comments with debug line numbers if available
--no-inline-anonymous - disable anonymous classes inline
--no-inline-anonymous - disable anonymous classes inline
--no-inline-methods - disable methods inline
--no-replace-consts - don't replace constant value with matching constant field
--no-replace-consts - don't replace constant value with matching constant field
--escape-unicode - escape non latin characters in strings (with \u)
--escape-unicode - escape non latin characters in strings (with \u)
--respect-bytecode-access-modifiers - don't change original access modifiers
--respect-bytecode-access-modifiers - don't change original access modifiers
...
...
jadx-cli/src/main/java/jadx/cli/JadxCLIArgs.java
浏览文件 @
8785c33d
...
@@ -64,6 +64,9 @@ public class JadxCLIArgs {
...
@@ -64,6 +64,9 @@ public class JadxCLIArgs {
@Parameter
(
names
=
{
"--no-inline-anonymous"
},
description
=
"disable anonymous classes inline"
)
@Parameter
(
names
=
{
"--no-inline-anonymous"
},
description
=
"disable anonymous classes inline"
)
protected
boolean
inlineAnonymousClasses
=
true
;
protected
boolean
inlineAnonymousClasses
=
true
;
@Parameter
(
names
=
{
"--no-inline-methods"
},
description
=
"disable methods inline"
)
protected
boolean
inlineMethods
=
true
;
@Parameter
(
names
=
"--no-replace-consts"
,
description
=
"don't replace constant value with matching constant field"
)
@Parameter
(
names
=
"--no-replace-consts"
,
description
=
"don't replace constant value with matching constant field"
)
protected
boolean
replaceConsts
=
true
;
protected
boolean
replaceConsts
=
true
;
...
@@ -215,6 +218,7 @@ public class JadxCLIArgs {
...
@@ -215,6 +218,7 @@ public class JadxCLIArgs {
args
.
setDebugInfo
(
debugInfo
);
args
.
setDebugInfo
(
debugInfo
);
args
.
setInsertDebugLines
(
addDebugLines
);
args
.
setInsertDebugLines
(
addDebugLines
);
args
.
setInlineAnonymousClasses
(
inlineAnonymousClasses
);
args
.
setInlineAnonymousClasses
(
inlineAnonymousClasses
);
args
.
setInlineMethods
(
inlineMethods
);
args
.
setRenameCaseSensitive
(
isRenameCaseSensitive
());
args
.
setRenameCaseSensitive
(
isRenameCaseSensitive
());
args
.
setRenameValid
(
isRenameValid
());
args
.
setRenameValid
(
isRenameValid
());
args
.
setRenamePrintable
(
isRenamePrintable
());
args
.
setRenamePrintable
(
isRenamePrintable
());
...
@@ -274,6 +278,10 @@ public class JadxCLIArgs {
...
@@ -274,6 +278,10 @@ public class JadxCLIArgs {
return
inlineAnonymousClasses
;
return
inlineAnonymousClasses
;
}
}
public
boolean
isInlineMethods
()
{
return
inlineMethods
;
}
public
boolean
isDeobfuscationOn
()
{
public
boolean
isDeobfuscationOn
()
{
return
deobfuscationOn
;
return
deobfuscationOn
;
}
}
...
...
jadx-core/src/main/java/jadx/api/JadxArgs.java
浏览文件 @
8785c33d
...
@@ -42,6 +42,7 @@ public class JadxArgs {
...
@@ -42,6 +42,7 @@ public class JadxArgs {
private
boolean
debugInfo
=
true
;
private
boolean
debugInfo
=
true
;
private
boolean
insertDebugLines
=
false
;
private
boolean
insertDebugLines
=
false
;
private
boolean
inlineAnonymousClasses
=
true
;
private
boolean
inlineAnonymousClasses
=
true
;
private
boolean
inlineMethods
=
true
;
private
boolean
skipResources
=
false
;
private
boolean
skipResources
=
false
;
private
boolean
skipSources
=
false
;
private
boolean
skipSources
=
false
;
...
@@ -199,6 +200,14 @@ public class JadxArgs {
...
@@ -199,6 +200,14 @@ public class JadxArgs {
this
.
inlineAnonymousClasses
=
inlineAnonymousClasses
;
this
.
inlineAnonymousClasses
=
inlineAnonymousClasses
;
}
}
public
boolean
isInlineMethods
()
{
return
inlineMethods
;
}
public
void
setInlineMethods
(
boolean
inlineMethods
)
{
this
.
inlineMethods
=
inlineMethods
;
}
public
boolean
isSkipResources
()
{
public
boolean
isSkipResources
()
{
return
skipResources
;
return
skipResources
;
}
}
...
...
jadx-core/src/main/java/jadx/core/Jadx.java
浏览文件 @
8785c33d
...
@@ -125,8 +125,9 @@ public class Jadx {
...
@@ -125,8 +125,9 @@ public class Jadx {
if
(
args
.
isDebugInfo
())
{
if
(
args
.
isDebugInfo
())
{
passes
.
add
(
new
DebugInfoApplyVisitor
());
passes
.
add
(
new
DebugInfoApplyVisitor
());
}
}
if
(
args
.
isInlineMethods
())
{
passes
.
add
(
new
InlineMethods
());
passes
.
add
(
new
InlineMethods
());
}
passes
.
add
(
new
GenericTypesVisitor
());
passes
.
add
(
new
GenericTypesVisitor
());
passes
.
add
(
new
ShadowFieldVisitor
());
passes
.
add
(
new
ShadowFieldVisitor
());
passes
.
add
(
new
DeboxingVisitor
());
passes
.
add
(
new
DeboxingVisitor
());
...
@@ -153,8 +154,9 @@ public class Jadx {
...
@@ -153,8 +154,9 @@ public class Jadx {
passes
.
add
(
new
ClassModifier
());
passes
.
add
(
new
ClassModifier
());
passes
.
add
(
new
LoopRegionVisitor
());
passes
.
add
(
new
LoopRegionVisitor
());
if
(
args
.
isInlineMethods
())
{
passes
.
add
(
new
MarkMethodsForInline
());
passes
.
add
(
new
MarkMethodsForInline
());
}
passes
.
add
(
new
ProcessVariables
());
passes
.
add
(
new
ProcessVariables
());
passes
.
add
(
new
PrepareForCodeGen
());
passes
.
add
(
new
PrepareForCodeGen
());
if
(
args
.
isCfgOutput
())
{
if
(
args
.
isCfgOutput
())
{
...
...
jadx-gui/src/main/java/jadx/gui/settings/JadxSettings.java
浏览文件 @
8785c33d
package
jadx.gui.settings
;
package
jadx.gui.settings
;
import
java.awt.*
;
import
java.awt.Font
;
import
java.awt.GraphicsDevice
;
import
java.awt.GraphicsEnvironment
;
import
java.awt.Rectangle
;
import
java.awt.Window
;
import
java.nio.file.Path
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.nio.file.Paths
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -13,7 +17,7 @@ import java.util.Map;
...
@@ -13,7 +17,7 @@ import java.util.Map;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.function.Consumer
;
import
java.util.function.Consumer
;
import
javax.swing.
*
;
import
javax.swing.
JFrame
;
import
org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
;
import
org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
;
import
org.jetbrains.annotations.Nullable
;
import
org.jetbrains.annotations.Nullable
;
...
@@ -37,7 +41,7 @@ public class JadxSettings extends JadxCLIArgs {
...
@@ -37,7 +41,7 @@ public class JadxSettings extends JadxCLIArgs {
private
static
final
Path
USER_HOME
=
Paths
.
get
(
System
.
getProperty
(
"user.home"
));
private
static
final
Path
USER_HOME
=
Paths
.
get
(
System
.
getProperty
(
"user.home"
));
private
static
final
int
RECENT_PROJECTS_COUNT
=
15
;
private
static
final
int
RECENT_PROJECTS_COUNT
=
15
;
private
static
final
int
CURRENT_SETTINGS_VERSION
=
1
1
;
private
static
final
int
CURRENT_SETTINGS_VERSION
=
1
2
;
private
static
final
Font
DEFAULT_FONT
=
new
RSyntaxTextArea
().
getFont
();
private
static
final
Font
DEFAULT_FONT
=
new
RSyntaxTextArea
().
getFont
();
...
@@ -336,6 +340,10 @@ public class JadxSettings extends JadxCLIArgs {
...
@@ -336,6 +340,10 @@ public class JadxSettings extends JadxCLIArgs {
this
.
inlineAnonymousClasses
=
inlineAnonymousClasses
;
this
.
inlineAnonymousClasses
=
inlineAnonymousClasses
;
}
}
public
void
setInlineMethods
(
boolean
inlineMethods
)
{
this
.
inlineMethods
=
inlineMethods
;
}
public
void
setFsCaseSensitive
(
boolean
fsCaseSensitive
)
{
public
void
setFsCaseSensitive
(
boolean
fsCaseSensitive
)
{
this
.
fsCaseSensitive
=
fsCaseSensitive
;
this
.
fsCaseSensitive
=
fsCaseSensitive
;
}
}
...
@@ -583,6 +591,10 @@ public class JadxSettings extends JadxCLIArgs {
...
@@ -583,6 +591,10 @@ public class JadxSettings extends JadxCLIArgs {
fontStr
=
fontStr
.
replace
(
'-'
,
'/'
);
fontStr
=
fontStr
.
replace
(
'-'
,
'/'
);
fromVersion
++;
fromVersion
++;
}
}
if
(
fromVersion
==
11
)
{
inlineMethods
=
true
;
fromVersion
++;
}
if
(
fromVersion
!=
CURRENT_SETTINGS_VERSION
)
{
if
(
fromVersion
!=
CURRENT_SETTINGS_VERSION
)
{
throw
new
JadxRuntimeException
(
"Incorrect settings upgrade"
);
throw
new
JadxRuntimeException
(
"Incorrect settings upgrade"
);
}
}
...
...
jadx-gui/src/main/java/jadx/gui/settings/JadxSettingsWindow.java
浏览文件 @
8785c33d
...
@@ -442,6 +442,13 @@ public class JadxSettingsWindow extends JDialog {
...
@@ -442,6 +442,13 @@ public class JadxSettingsWindow extends JDialog {
needReload
();
needReload
();
});
});
JCheckBox
inlineMethods
=
new
JCheckBox
();
inlineMethods
.
setSelected
(
settings
.
isInlineMethods
());
inlineMethods
.
addItemListener
(
e
->
{
settings
.
setInlineMethods
(
e
.
getStateChange
()
==
ItemEvent
.
SELECTED
);
needReload
();
});
JCheckBox
fsCaseSensitive
=
new
JCheckBox
();
JCheckBox
fsCaseSensitive
=
new
JCheckBox
();
fsCaseSensitive
.
setSelected
(
settings
.
isFsCaseSensitive
());
fsCaseSensitive
.
setSelected
(
settings
.
isFsCaseSensitive
());
fsCaseSensitive
.
addItemListener
(
e
->
{
fsCaseSensitive
.
addItemListener
(
e
->
{
...
@@ -460,6 +467,7 @@ public class JadxSettingsWindow extends JDialog {
...
@@ -460,6 +467,7 @@ public class JadxSettingsWindow extends JDialog {
other
.
addRow
(
NLS
.
str
(
"preferences.respectBytecodeAccessModifiers"
),
respectBytecodeAccessModifiers
);
other
.
addRow
(
NLS
.
str
(
"preferences.respectBytecodeAccessModifiers"
),
respectBytecodeAccessModifiers
);
other
.
addRow
(
NLS
.
str
(
"preferences.useImports"
),
useImports
);
other
.
addRow
(
NLS
.
str
(
"preferences.useImports"
),
useImports
);
other
.
addRow
(
NLS
.
str
(
"preferences.inlineAnonymous"
),
inlineAnonymous
);
other
.
addRow
(
NLS
.
str
(
"preferences.inlineAnonymous"
),
inlineAnonymous
);
other
.
addRow
(
NLS
.
str
(
"preferences.inlineMethods"
),
inlineMethods
);
other
.
addRow
(
NLS
.
str
(
"preferences.fsCaseSensitive"
),
fsCaseSensitive
);
other
.
addRow
(
NLS
.
str
(
"preferences.fsCaseSensitive"
),
fsCaseSensitive
);
other
.
addRow
(
NLS
.
str
(
"preferences.fallback"
),
fallback
);
other
.
addRow
(
NLS
.
str
(
"preferences.fallback"
),
fallback
);
other
.
addRow
(
NLS
.
str
(
"preferences.skipResourcesDecode"
),
resourceDecode
);
other
.
addRow
(
NLS
.
str
(
"preferences.skipResourcesDecode"
),
resourceDecode
);
...
...
jadx-gui/src/main/resources/i18n/Messages_de_DE.properties
浏览文件 @
8785c33d
...
@@ -118,6 +118,7 @@ preferences.replaceConsts=Konstanten ersetzen
...
@@ -118,6 +118,7 @@ preferences.replaceConsts=Konstanten ersetzen
preferences.respectBytecodeAccessModifiers
=
Modifikatoren für Bytecode-Zugriff beachten
preferences.respectBytecodeAccessModifiers
=
Modifikatoren für Bytecode-Zugriff beachten
preferences.useImports
=
Importauszüge verwenden
preferences.useImports
=
Importauszüge verwenden
preferences.inlineAnonymous
=
Anonyme Inline-Klassen
preferences.inlineAnonymous
=
Anonyme Inline-Klassen
#preferences.inlineMethods=Inline methods
preferences.fsCaseSensitive
=
Dateisystem unterscheidet zwischen Groß/Kleinschreibung
preferences.fsCaseSensitive
=
Dateisystem unterscheidet zwischen Groß/Kleinschreibung
preferences.skipResourcesDecode
=
Keine Ressourcen dekodieren
preferences.skipResourcesDecode
=
Keine Ressourcen dekodieren
preferences.autoSave
=
Autom. speichern
preferences.autoSave
=
Autom. speichern
...
...
jadx-gui/src/main/resources/i18n/Messages_en_US.properties
浏览文件 @
8785c33d
...
@@ -118,6 +118,7 @@ preferences.replaceConsts=Replace constants
...
@@ -118,6 +118,7 @@ preferences.replaceConsts=Replace constants
preferences.respectBytecodeAccessModifiers
=
Respect bytecode access modifiers
preferences.respectBytecodeAccessModifiers
=
Respect bytecode access modifiers
preferences.useImports
=
Use import statements
preferences.useImports
=
Use import statements
preferences.inlineAnonymous
=
Inline anonymous classes
preferences.inlineAnonymous
=
Inline anonymous classes
preferences.inlineMethods
=
Inline methods
preferences.fsCaseSensitive
=
File system is case sensitive
preferences.fsCaseSensitive
=
File system is case sensitive
preferences.skipResourcesDecode
=
Don't decode resources
preferences.skipResourcesDecode
=
Don't decode resources
preferences.autoSave
=
Auto save
preferences.autoSave
=
Auto save
...
...
jadx-gui/src/main/resources/i18n/Messages_es_ES.properties
浏览文件 @
8785c33d
...
@@ -118,6 +118,7 @@ preferences.replaceConsts=Reemplazar constantes
...
@@ -118,6 +118,7 @@ preferences.replaceConsts=Reemplazar constantes
#preferences.respectBytecodeAccessModifiers=
#preferences.respectBytecodeAccessModifiers=
#preferences.useImports=
#preferences.useImports=
#preferences.inlineAnonymous=
#preferences.inlineAnonymous=
#preferences.inlineMethods=Inline methods
#preferences.fsCaseSensitive=
#preferences.fsCaseSensitive=
preferences.skipResourcesDecode
=
No descodificar recursos
preferences.skipResourcesDecode
=
No descodificar recursos
#preferences.autoSave=
#preferences.autoSave=
...
...
jadx-gui/src/main/resources/i18n/Messages_ko_KR.properties
浏览文件 @
8785c33d
...
@@ -118,6 +118,7 @@ preferences.replaceConsts=상수 바꾸기
...
@@ -118,6 +118,7 @@ preferences.replaceConsts=상수 바꾸기
preferences.respectBytecodeAccessModifiers
=
바이트코드 액세스 수정자 존중
preferences.respectBytecodeAccessModifiers
=
바이트코드 액세스 수정자 존중
preferences.useImports
=
import 문 사용
preferences.useImports
=
import 문 사용
preferences.inlineAnonymous
=
인라인 익명 클래스
preferences.inlineAnonymous
=
인라인 익명 클래스
#preferences.inlineMethods=Inline methods
preferences.fsCaseSensitive
=
파일 시스템 대소문자 구별
preferences.fsCaseSensitive
=
파일 시스템 대소문자 구별
preferences.skipResourcesDecode
=
리소스 디코딩 하지 않기
preferences.skipResourcesDecode
=
리소스 디코딩 하지 않기
preferences.autoSave
=
자동 저장
preferences.autoSave
=
자동 저장
...
...
jadx-gui/src/main/resources/i18n/Messages_zh_CN.properties
浏览文件 @
8785c33d
...
@@ -118,6 +118,7 @@ preferences.replaceConsts=替换常量
...
@@ -118,6 +118,7 @@ preferences.replaceConsts=替换常量
preferences.respectBytecodeAccessModifiers
=
遵守字节码访问修饰符
preferences.respectBytecodeAccessModifiers
=
遵守字节码访问修饰符
preferences.useImports
=
使用 import 语句
preferences.useImports
=
使用 import 语句
preferences.inlineAnonymous
=
内联匿名类
preferences.inlineAnonymous
=
内联匿名类
#preferences.inlineMethods=Inline methods
preferences.fsCaseSensitive
=
文件系统区分大小写
preferences.fsCaseSensitive
=
文件系统区分大小写
preferences.skipResourcesDecode
=
不反编译资源文件
preferences.skipResourcesDecode
=
不反编译资源文件
preferences.autoSave
=
自动保存
preferences.autoSave
=
自动保存
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录