Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
keyescgm
jadx
提交
cfbbd99b
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,发现更多精彩内容 >>
提交
cfbbd99b
编写于
4月 21, 2019
作者:
S
sergey-wowwow
提交者:
skylot
4月 21, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(gui): use command (CMD) button for MacOS (#165) (PR #616)
上级
c74b7f20
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
26 addition
and
14 deletion
+26
-14
jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
+13
-11
jadx-gui/src/main/java/jadx/gui/ui/codearea/CodePanel.java
jadx-gui/src/main/java/jadx/gui/ui/codearea/CodePanel.java
+1
-1
jadx-gui/src/main/java/jadx/gui/utils/TextStandardActions.java
...gui/src/main/java/jadx/gui/utils/TextStandardActions.java
+2
-2
jadx-gui/src/main/java/jadx/gui/utils/Utils.java
jadx-gui/src/main/java/jadx/gui/utils/Utils.java
+10
-0
未找到文件。
jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
浏览文件 @
cfbbd99b
...
@@ -8,10 +8,12 @@ import java.awt.DisplayMode;
...
@@ -8,10 +8,12 @@ import java.awt.DisplayMode;
import
java.awt.Font
;
import
java.awt.Font
;
import
java.awt.GraphicsDevice
;
import
java.awt.GraphicsDevice
;
import
java.awt.GraphicsEnvironment
;
import
java.awt.GraphicsEnvironment
;
import
java.awt.Toolkit
;
import
java.awt.dnd.DnDConstants
;
import
java.awt.dnd.DnDConstants
;
import
java.awt.dnd.DropTarget
;
import
java.awt.dnd.DropTarget
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
import
java.awt.event.ActionListener
;
import
java.awt.event.InputEvent
;
import
java.awt.event.KeyAdapter
;
import
java.awt.event.KeyAdapter
;
import
java.awt.event.KeyEvent
;
import
java.awt.event.KeyEvent
;
import
java.awt.event.MouseAdapter
;
import
java.awt.event.MouseAdapter
;
...
@@ -560,7 +562,7 @@ public class MainWindow extends JFrame {
...
@@ -560,7 +562,7 @@ public class MainWindow extends JFrame {
}
}
};
};
openAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"file.open_action"
));
openAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"file.open_action"
));
openAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_O
,
KeyEvent
.
CTRL_DOWN_MASK
));
openAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_O
,
Utils
.
ctrlButton
()
));
newProjectAction
=
new
AbstractAction
(
NLS
.
str
(
"file.new_project"
))
{
newProjectAction
=
new
AbstractAction
(
NLS
.
str
(
"file.new_project"
))
{
@Override
@Override
...
@@ -593,7 +595,7 @@ public class MainWindow extends JFrame {
...
@@ -593,7 +595,7 @@ public class MainWindow extends JFrame {
}
}
};
};
saveAllAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"file.save_all"
));
saveAllAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"file.save_all"
));
saveAllAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_S
,
KeyEvent
.
CTRL_DOWN_MASK
));
saveAllAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_S
,
Utils
.
ctrlButton
()
));
Action
exportAction
=
new
AbstractAction
(
NLS
.
str
(
"file.export_gradle"
),
ICON_EXPORT
)
{
Action
exportAction
=
new
AbstractAction
(
NLS
.
str
(
"file.export_gradle"
),
ICON_EXPORT
)
{
@Override
@Override
...
@@ -602,7 +604,7 @@ public class MainWindow extends JFrame {
...
@@ -602,7 +604,7 @@ public class MainWindow extends JFrame {
}
}
};
};
exportAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"file.export_gradle"
));
exportAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"file.export_gradle"
));
exportAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_E
,
KeyEvent
.
CTRL_DOWN_MASK
));
exportAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_E
,
Utils
.
ctrlButton
()
));
JMenu
recentProjects
=
new
JMenu
(
NLS
.
str
(
"menu.recent_projects"
));
JMenu
recentProjects
=
new
JMenu
(
NLS
.
str
(
"menu.recent_projects"
));
recentProjects
.
addMenuListener
(
new
RecentProjectsMenuListener
(
recentProjects
));
recentProjects
.
addMenuListener
(
new
RecentProjectsMenuListener
(
recentProjects
));
...
@@ -615,7 +617,7 @@ public class MainWindow extends JFrame {
...
@@ -615,7 +617,7 @@ public class MainWindow extends JFrame {
};
};
prefsAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"menu.preferences"
));
prefsAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"menu.preferences"
));
prefsAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_P
,
prefsAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_P
,
KeyEvent
.
CTRL_DOWN_MASK
|
KeyEvent
.
SHIFT_DOWN_MASK
));
Utils
.
ctrlButton
()
|
KeyEvent
.
SHIFT_DOWN_MASK
));
Action
exitAction
=
new
AbstractAction
(
NLS
.
str
(
"file.exit"
),
ICON_CLOSE
)
{
Action
exitAction
=
new
AbstractAction
(
NLS
.
str
(
"file.exit"
),
ICON_CLOSE
)
{
@Override
@Override
...
@@ -642,7 +644,7 @@ public class MainWindow extends JFrame {
...
@@ -642,7 +644,7 @@ public class MainWindow extends JFrame {
}
}
};
};
syncAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"menu.sync"
));
syncAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"menu.sync"
));
syncAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_T
,
KeyEvent
.
CTRL_DOWN_MASK
));
syncAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_T
,
Utils
.
ctrlButton
()
));
Action
textSearchAction
=
new
AbstractAction
(
NLS
.
str
(
"menu.text_search"
),
ICON_SEARCH
)
{
Action
textSearchAction
=
new
AbstractAction
(
NLS
.
str
(
"menu.text_search"
),
ICON_SEARCH
)
{
@Override
@Override
...
@@ -652,7 +654,7 @@ public class MainWindow extends JFrame {
...
@@ -652,7 +654,7 @@ public class MainWindow extends JFrame {
};
};
textSearchAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"menu.text_search"
));
textSearchAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"menu.text_search"
));
textSearchAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
textSearchAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_F
,
KeyEvent
.
CTRL_DOWN_MASK
|
KeyEvent
.
SHIFT_DOWN_MASK
));
getKeyStroke
(
KeyEvent
.
VK_F
,
Utils
.
ctrlButton
()
|
KeyEvent
.
SHIFT_DOWN_MASK
));
Action
clsSearchAction
=
new
AbstractAction
(
NLS
.
str
(
"menu.class_search"
),
ICON_FIND
)
{
Action
clsSearchAction
=
new
AbstractAction
(
NLS
.
str
(
"menu.class_search"
),
ICON_FIND
)
{
@Override
@Override
...
@@ -661,7 +663,7 @@ public class MainWindow extends JFrame {
...
@@ -661,7 +663,7 @@ public class MainWindow extends JFrame {
}
}
};
};
clsSearchAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"menu.class_search"
));
clsSearchAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"menu.class_search"
));
clsSearchAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_N
,
KeyEvent
.
CTRL_DOWN_MASK
));
clsSearchAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_N
,
Utils
.
ctrlButton
()
));
Action
deobfAction
=
new
AbstractAction
(
NLS
.
str
(
"menu.deobfuscation"
),
ICON_DEOBF
)
{
Action
deobfAction
=
new
AbstractAction
(
NLS
.
str
(
"menu.deobfuscation"
),
ICON_DEOBF
)
{
@Override
@Override
...
@@ -671,7 +673,7 @@ public class MainWindow extends JFrame {
...
@@ -671,7 +673,7 @@ public class MainWindow extends JFrame {
};
};
deobfAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"preferences.deobfuscation"
));
deobfAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"preferences.deobfuscation"
));
deobfAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
deobfAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_D
,
KeyEvent
.
CTRL_DOWN_MASK
|
KeyEvent
.
ALT_DOWN_MASK
));
getKeyStroke
(
KeyEvent
.
VK_D
,
Utils
.
ctrlButton
()
|
KeyEvent
.
ALT_DOWN_MASK
));
deobfToggleBtn
=
new
JToggleButton
(
deobfAction
);
deobfToggleBtn
=
new
JToggleButton
(
deobfAction
);
deobfToggleBtn
.
setSelected
(
settings
.
isDeobfuscationOn
());
deobfToggleBtn
.
setSelected
(
settings
.
isDeobfuscationOn
());
...
@@ -688,7 +690,7 @@ public class MainWindow extends JFrame {
...
@@ -688,7 +690,7 @@ public class MainWindow extends JFrame {
};
};
logAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"menu.log"
));
logAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"menu.log"
));
logAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_L
,
logAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_L
,
KeyEvent
.
CTRL_DOWN_MASK
|
KeyEvent
.
SHIFT_DOWN_MASK
));
Utils
.
ctrlButton
()
|
KeyEvent
.
SHIFT_DOWN_MASK
));
Action
aboutAction
=
new
AbstractAction
(
NLS
.
str
(
"menu.about"
),
ICON_JADX
)
{
Action
aboutAction
=
new
AbstractAction
(
NLS
.
str
(
"menu.about"
),
ICON_JADX
)
{
@Override
@Override
...
@@ -705,7 +707,7 @@ public class MainWindow extends JFrame {
...
@@ -705,7 +707,7 @@ public class MainWindow extends JFrame {
};
};
backAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"nav.back"
));
backAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"nav.back"
));
backAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_LEFT
,
backAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_LEFT
,
KeyEvent
.
CTRL_DOWN_MASK
|
KeyEvent
.
ALT_DOWN_MASK
));
Utils
.
ctrlButton
()
|
KeyEvent
.
ALT_DOWN_MASK
));
Action
forwardAction
=
new
AbstractAction
(
NLS
.
str
(
"nav.forward"
),
ICON_FORWARD
)
{
Action
forwardAction
=
new
AbstractAction
(
NLS
.
str
(
"nav.forward"
),
ICON_FORWARD
)
{
@Override
@Override
...
@@ -715,7 +717,7 @@ public class MainWindow extends JFrame {
...
@@ -715,7 +717,7 @@ public class MainWindow extends JFrame {
};
};
forwardAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"nav.forward"
));
forwardAction
.
putValue
(
Action
.
SHORT_DESCRIPTION
,
NLS
.
str
(
"nav.forward"
));
forwardAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_RIGHT
,
forwardAction
.
putValue
(
Action
.
ACCELERATOR_KEY
,
getKeyStroke
(
KeyEvent
.
VK_RIGHT
,
KeyEvent
.
CTRL_DOWN_MASK
|
KeyEvent
.
ALT_DOWN_MASK
));
Utils
.
ctrlButton
()
|
KeyEvent
.
ALT_DOWN_MASK
));
JMenu
file
=
new
JMenu
(
NLS
.
str
(
"menu.file"
));
JMenu
file
=
new
JMenu
(
NLS
.
str
(
"menu.file"
));
file
.
setMnemonic
(
KeyEvent
.
VK_F
);
file
.
setMnemonic
(
KeyEvent
.
VK_F
);
...
...
jadx-gui/src/main/java/jadx/gui/ui/codearea/CodePanel.java
浏览文件 @
cfbbd99b
...
@@ -32,7 +32,7 @@ public final class CodePanel extends ContentPanel {
...
@@ -32,7 +32,7 @@ public final class CodePanel extends ContentPanel {
add
(
searchBar
,
BorderLayout
.
NORTH
);
add
(
searchBar
,
BorderLayout
.
NORTH
);
add
(
scrollPane
);
add
(
scrollPane
);
KeyStroke
key
=
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_F
,
InputEvent
.
CTRL_DOWN_MASK
);
KeyStroke
key
=
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_F
,
Utils
.
ctrlButton
()
);
Utils
.
addKeyBinding
(
codeArea
,
key
,
"SearchAction"
,
new
SearchAction
());
Utils
.
addKeyBinding
(
codeArea
,
key
,
"SearchAction"
,
new
SearchAction
());
}
}
...
...
jadx-gui/src/main/java/jadx/gui/utils/TextStandardActions.java
浏览文件 @
cfbbd99b
...
@@ -100,9 +100,9 @@ public class TextStandardActions {
...
@@ -100,9 +100,9 @@ public class TextStandardActions {
}
}
private
void
addKeyActions
()
{
private
void
addKeyActions
()
{
KeyStroke
undoKey
=
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_Z
,
InputEvent
.
CTRL_DOWN_MASK
);
KeyStroke
undoKey
=
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_Z
,
Utils
.
ctrlButton
()
);
textComponent
.
getInputMap
().
put
(
undoKey
,
undoAction
);
textComponent
.
getInputMap
().
put
(
undoKey
,
undoAction
);
KeyStroke
redoKey
=
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_R
,
InputEvent
.
CTRL_DOWN_MASK
);
KeyStroke
redoKey
=
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_R
,
Utils
.
ctrlButton
()
);
textComponent
.
getInputMap
().
put
(
redoKey
,
redoAction
);
textComponent
.
getInputMap
().
put
(
redoKey
,
redoAction
);
}
}
...
...
jadx-gui/src/main/java/jadx/gui/utils/Utils.java
浏览文件 @
cfbbd99b
...
@@ -5,6 +5,7 @@ import java.awt.*;
...
@@ -5,6 +5,7 @@ import java.awt.*;
import
java.awt.datatransfer.Clipboard
;
import
java.awt.datatransfer.Clipboard
;
import
java.awt.datatransfer.StringSelection
;
import
java.awt.datatransfer.StringSelection
;
import
java.awt.datatransfer.Transferable
;
import
java.awt.datatransfer.Transferable
;
import
java.awt.event.InputEvent
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.net.URL
;
import
java.net.URL
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -202,4 +203,13 @@ public class Utils {
...
@@ -202,4 +203,13 @@ public class Utils {
icons
.
add
(
Utils
.
openImage
(
"/logos/jadx-logo.png"
));
icons
.
add
(
Utils
.
openImage
(
"/logos/jadx-logo.png"
));
window
.
setIconImages
(
icons
);
window
.
setIconImages
(
icons
);
}
}
public
static
int
ctrlButton
()
{
if
(
System
.
getProperty
(
"os.name"
).
toLowerCase
().
contains
(
"mac"
))
{
return
Toolkit
.
getDefaultToolkit
().
getMenuShortcutKeyMask
();
}
else
{
return
InputEvent
.
CTRL_DOWN_MASK
;
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录