Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Quincy379
jadx
提交
6df31501
J
jadx
项目概览
Quincy379
/
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,发现更多精彩内容 >>
提交
6df31501
编写于
5月 24, 2018
作者:
S
Skylot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
gui: add Hack font
上级
1931e783
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
41 addition
and
7 deletion
+41
-7
jadx-gui/build.gradle
jadx-gui/build.gradle
+3
-1
jadx-gui/src/main/java/jadx/gui/settings/JadxSettings.java
jadx-gui/src/main/java/jadx/gui/settings/JadxSettings.java
+3
-1
jadx-gui/src/main/java/jadx/gui/settings/JadxSettingsWindow.java
...i/src/main/java/jadx/gui/settings/JadxSettingsWindow.java
+10
-0
jadx-gui/src/main/java/jadx/gui/utils/Utils.java
jadx-gui/src/main/java/jadx/gui/utils/Utils.java
+25
-5
jadx-gui/src/main/resources/fonts/Hack-Regular.ttf
jadx-gui/src/main/resources/fonts/Hack-Regular.ttf
+0
-0
未找到文件。
jadx-gui/build.gradle
浏览文件 @
6df31501
...
@@ -40,7 +40,7 @@ jar {
...
@@ -40,7 +40,7 @@ jar {
}
}
startScripts
{
startScripts
{
defaultJvmOpts
=
[
'-Xms128M'
,
'-Xmx4g'
]
defaultJvmOpts
=
[
'-Xms128M'
,
'-Xmx4g'
,
'-Dawt.useSystemAAFontSettings=lcd'
,
'-Dswing.aatext=true'
]
doLast
{
doLast
{
def
str
=
windowsScript
.
text
def
str
=
windowsScript
.
text
str
=
str
.
replaceAll
(
'java.exe'
,
'javaw.exe'
)
str
=
str
.
replaceAll
(
'java.exe'
,
'javaw.exe'
)
...
@@ -58,10 +58,12 @@ launch4j {
...
@@ -58,10 +58,12 @@ launch4j {
outfile
=
"jadx-gui-${version}.exe"
outfile
=
"jadx-gui-${version}.exe"
copyright
=
'Skylot'
copyright
=
'Skylot'
windowTitle
=
'jadx'
windowTitle
=
'jadx'
jvmOptions
=
[
'-Dawt.useSystemAAFontSettings=lcd'
,
'-Dswing.aatext=true'
]
jreRuntimeBits
=
"64"
jreRuntimeBits
=
"64"
initialHeapPercent
=
5
initialHeapPercent
=
5
maxHeapSize
=
4096
maxHeapSize
=
4096
maxHeapPercent
=
70
maxHeapPercent
=
70
}
}
test
{
test
{
...
...
jadx-gui/src/main/java/jadx/gui/settings/JadxSettings.java
浏览文件 @
6df31501
...
@@ -16,6 +16,8 @@ import org.slf4j.LoggerFactory;
...
@@ -16,6 +16,8 @@ import org.slf4j.LoggerFactory;
import
jadx.api.JadxArgs
;
import
jadx.api.JadxArgs
;
import
jadx.cli.JadxCLIArgs
;
import
jadx.cli.JadxCLIArgs
;
import
static
jadx
.
gui
.
utils
.
Utils
.
FONT_HACK
;
public
class
JadxSettings
extends
JadxCLIArgs
{
public
class
JadxSettings
extends
JadxCLIArgs
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
JadxSettings
.
class
);
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
JadxSettings
.
class
);
...
@@ -23,7 +25,7 @@ public class JadxSettings extends JadxCLIArgs {
...
@@ -23,7 +25,7 @@ public class JadxSettings extends JadxCLIArgs {
private
static
final
int
RECENT_FILES_COUNT
=
15
;
private
static
final
int
RECENT_FILES_COUNT
=
15
;
private
static
final
int
CURRENT_SETTINGS_VERSION
=
1
;
private
static
final
int
CURRENT_SETTINGS_VERSION
=
1
;
private
static
final
Font
DEFAULT_FONT
=
new
RSyntaxTextArea
().
getFont
();
private
static
final
Font
DEFAULT_FONT
=
FONT_HACK
!=
null
?
FONT_HACK
:
new
RSyntaxTextArea
().
getFont
();
static
final
Set
<
String
>
SKIP_FIELDS
=
new
HashSet
<>(
Arrays
.
asList
(
static
final
Set
<
String
>
SKIP_FIELDS
=
new
HashSet
<>(
Arrays
.
asList
(
"files"
,
"input"
,
"outputDir"
,
"verbose"
,
"printHelp"
"files"
,
"input"
,
"outputDir"
,
"verbose"
,
"printHelp"
...
...
jadx-gui/src/main/java/jadx/gui/settings/JadxSettingsWindow.java
浏览文件 @
6df31501
...
@@ -19,6 +19,8 @@ import say.swing.JFontChooser;
...
@@ -19,6 +19,8 @@ import say.swing.JFontChooser;
import
jadx.gui.ui.MainWindow
;
import
jadx.gui.ui.MainWindow
;
import
jadx.gui.utils.NLS
;
import
jadx.gui.utils.NLS
;
import
static
jadx
.
gui
.
utils
.
Utils
.
FONT_HACK
;
public
class
JadxSettingsWindow
extends
JDialog
{
public
class
JadxSettingsWindow
extends
JDialog
{
private
static
final
long
serialVersionUID
=
-
1804570470377354148L
;
private
static
final
long
serialVersionUID
=
-
1804570470377354148L
;
...
@@ -37,6 +39,7 @@ public class JadxSettingsWindow extends JDialog {
...
@@ -37,6 +39,7 @@ public class JadxSettingsWindow extends JDialog {
this
.
startSettings
=
JadxSettingsAdapter
.
makeString
(
settings
);
this
.
startSettings
=
JadxSettingsAdapter
.
makeString
(
settings
);
initUI
();
initUI
();
registerBundledFonts
();
setTitle
(
NLS
.
str
(
"preferences.title"
));
setTitle
(
NLS
.
str
(
"preferences.title"
));
setSize
(
400
,
550
);
setSize
(
400
,
550
);
...
@@ -46,6 +49,13 @@ public class JadxSettingsWindow extends JDialog {
...
@@ -46,6 +49,13 @@ public class JadxSettingsWindow extends JDialog {
pack
();
pack
();
}
}
public
static
void
registerBundledFonts
()
{
GraphicsEnvironment
grEnv
=
GraphicsEnvironment
.
getLocalGraphicsEnvironment
();
if
(
FONT_HACK
!=
null
)
{
grEnv
.
registerFont
(
FONT_HACK
);
}
}
private
void
initUI
()
{
private
void
initUI
()
{
JPanel
panel
=
new
JPanel
();
JPanel
panel
=
new
JPanel
();
panel
.
setLayout
(
new
BoxLayout
(
panel
,
BoxLayout
.
PAGE_AXIS
));
panel
.
setLayout
(
new
BoxLayout
(
panel
,
BoxLayout
.
PAGE_AXIS
));
...
...
jadx-gui/src/main/java/jadx/gui/utils/Utils.java
浏览文件 @
6df31501
package
jadx.gui.utils
;
package
jadx.gui.utils
;
import
javax.swing.*
;
import
java.awt.*
;
import
java.io.InputStream
;
import
java.net.URL
;
import
java.net.URL
;
import
javax.swing.*
;
import
jadx.core.dex.info.AccessInfo
;
import
jadx.core.dex.info.AccessInfo
;
import
jadx.core.dex.instructions.args.ArgType
;
import
jadx.core.dex.instructions.args.ArgType
;
import
jadx.core.utils.exceptions.JadxRuntimeException
;
import
jadx.core.utils.exceptions.JadxRuntimeException
;
import
org.jetbrains.annotations.Nullable
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
public
class
Utils
{
public
class
Utils
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
Utils
.
class
);
private
static
final
ImageIcon
ICON_STATIC
=
openIcon
(
"static_co"
);
private
static
final
ImageIcon
ICON_FINAL
=
openIcon
(
"final_co"
);
private
static
final
ImageIcon
ICON_ABSTRACT
=
openIcon
(
"abstract_co"
);
private
static
final
ImageIcon
ICON_NATIVE
=
openIcon
(
"native_co"
);
private
static
final
ImageIcon
ICON_STATIC
=
Utils
.
openIcon
(
"static_co"
);
public
static
final
Font
FONT_HACK
=
openFontTTF
(
"Hack-Regular"
);
private
static
final
ImageIcon
ICON_FINAL
=
Utils
.
openIcon
(
"final_co"
);
private
static
final
ImageIcon
ICON_ABSTRACT
=
Utils
.
openIcon
(
"abstract_co"
);
private
static
final
ImageIcon
ICON_NATIVE
=
Utils
.
openIcon
(
"native_co"
);
private
Utils
()
{
private
Utils
()
{
}
}
...
@@ -26,6 +34,18 @@ public class Utils {
...
@@ -26,6 +34,18 @@ public class Utils {
return
new
ImageIcon
(
resource
);
return
new
ImageIcon
(
resource
);
}
}
@Nullable
public
static
Font
openFontTTF
(
String
name
)
{
String
fontPath
=
"/fonts/"
+
name
+
".ttf"
;
try
(
InputStream
is
=
Utils
.
class
.
getResourceAsStream
(
fontPath
))
{
Font
font
=
Font
.
createFont
(
Font
.
TRUETYPE_FONT
,
is
);
return
font
.
deriveFont
(
12
f
);
}
catch
(
Exception
e
)
{
LOG
.
error
(
"Failed load font by path: {}"
,
fontPath
,
e
);
return
null
;
}
}
public
static
void
addKeyBinding
(
JComponent
comp
,
KeyStroke
key
,
String
id
,
Action
action
)
{
public
static
void
addKeyBinding
(
JComponent
comp
,
KeyStroke
key
,
String
id
,
Action
action
)
{
comp
.
getInputMap
().
put
(
key
,
id
);
comp
.
getInputMap
().
put
(
key
,
id
);
comp
.
getActionMap
().
put
(
id
,
action
);
comp
.
getActionMap
().
put
(
id
,
action
);
...
...
jadx-gui/src/main/resources/fonts/Hack-Regular.ttf
0 → 100644
浏览文件 @
6df31501
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录