Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
keyescgm
jadx
提交
4732fa36
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,发现更多精彩内容 >>
提交
4732fa36
编写于
5月 07, 2021
作者:
S
Skylot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(gui): improve code area performance and line numbers repaint (#1167)
上级
8dad158a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
10 addition
and
22 deletion
+10
-22
jadx-core/src/main/java/jadx/api/JavaClass.java
jadx-core/src/main/java/jadx/api/JavaClass.java
+0
-5
jadx-gui/src/main/java/jadx/gui/JadxWrapper.java
jadx-gui/src/main/java/jadx/gui/JadxWrapper.java
+0
-2
jadx-gui/src/main/java/jadx/gui/treemodel/JClass.java
jadx-gui/src/main/java/jadx/gui/treemodel/JClass.java
+5
-7
jadx-gui/src/main/java/jadx/gui/ui/codearea/CodePanel.java
jadx-gui/src/main/java/jadx/gui/ui/codearea/CodePanel.java
+0
-3
jadx-gui/src/main/java/jadx/gui/ui/codearea/LineNumbers.java
jadx-gui/src/main/java/jadx/gui/ui/codearea/LineNumbers.java
+5
-5
未找到文件。
jadx-core/src/main/java/jadx/api/JavaClass.java
浏览文件 @
4732fa36
...
...
@@ -66,11 +66,6 @@ public final class JavaClass implements JavaNode {
return
cls
.
getSmali
();
}
public
synchronized
void
unload
()
{
cls
.
unload
();
listsLoaded
=
false
;
}
/**
* Internal API. Not Stable!
*/
...
...
jadx-gui/src/main/java/jadx/gui/JadxWrapper.java
浏览文件 @
4732fa36
...
...
@@ -68,8 +68,6 @@ public class JadxWrapper {
decompiler
.
getArgs
().
setRootDir
(
dir
);
decompiler
.
save
(
500
,
(
done
,
total
)
->
progressMonitor
.
setProgress
((
int
)
(
done
*
100.0
/
total
)));
progressMonitor
.
close
();
LOG
.
info
(
"decompilation complete, freeing memory ..."
);
decompiler
.
getClasses
().
forEach
(
JavaClass:
:
unload
);
LOG
.
info
(
"done"
);
};
new
Thread
(
save
).
start
();
...
...
jadx-gui/src/main/java/jadx/gui/treemodel/JClass.java
浏览文件 @
4732fa36
...
...
@@ -57,11 +57,11 @@ public class JClass extends JLoadableNode {
}
public
synchronized
void
load
()
{
if
(!
loaded
)
{
cls
.
decompile
();
cls
.
unload
();
loaded
=
true
;
if
(
loaded
)
{
return
;
}
cls
.
decompile
();
loaded
=
true
;
update
();
}
...
...
@@ -69,7 +69,6 @@ public class JClass extends JLoadableNode {
cls
.
reload
();
loaded
=
true
;
update
();
cls
.
unload
();
}
public
synchronized
void
update
()
{
...
...
@@ -93,8 +92,7 @@ public class JClass extends JLoadableNode {
@Override
public
@Nullable
ICodeInfo
getCodeInfo
()
{
load
();
return
cls
.
getClassNode
().
getCode
();
return
cls
.
getCodeInfo
();
}
@Override
...
...
jadx-gui/src/main/java/jadx/gui/ui/codearea/CodePanel.java
浏览文件 @
4732fa36
...
...
@@ -120,9 +120,6 @@ public class CodePanel extends JPanel {
if
(
codeArea
instanceof
SmaliArea
)
{
return
;
}
LineNumbers
numbers
=
new
LineNumbers
(
codeArea
);
numbers
.
setUseSourceLines
(
isUseSourceLines
());
codeScrollPane
.
setRowHeaderView
(
numbers
);
initLineNumbers
(
isUseSourceLines
());
}
...
...
jadx-gui/src/main/java/jadx/gui/ui/codearea/LineNumbers.java
浏览文件 @
4732fa36
...
...
@@ -42,7 +42,8 @@ public class LineNumbers extends JPanel implements CaretListener {
private
static
final
int
NUM_HEIGHT
=
Integer
.
MAX_VALUE
-
1000000
;
private
static
final
Map
<?,
?>
DESKTOP_HINTS
=
(
Map
<?,
?>)
Toolkit
.
getDefaultToolkit
().
getDesktopProperty
(
"awt.font.desktophints"
);
private
final
AbstractCodeArea
codeArea
;
private
final
transient
AbstractCodeArea
codeArea
;
private
final
transient
ICodeInfo
codeInfo
;
private
boolean
useSourceLines
=
true
;
private
transient
int
lastDigits
;
...
...
@@ -55,10 +56,11 @@ public class LineNumbers extends JPanel implements CaretListener {
private
transient
Insets
textAreaInsets
;
private
transient
Rectangle
visibleRect
=
new
Rectangle
();
private
transient
ICodeInfo
codeInfo
;
public
LineNumbers
(
AbstractCodeArea
codeArea
)
{
this
.
codeArea
=
codeArea
;
this
.
codeInfo
=
codeArea
.
getNode
().
getCodeInfo
();
setFont
(
codeArea
.
getFont
());
SyntaxScheme
syntaxScheme
=
codeArea
.
getSyntaxScheme
();
numberColor
=
syntaxScheme
.
getStyle
(
Token
.
LITERAL_NUMBER_DECIMAL_INT
).
foreground
;
...
...
@@ -110,8 +112,6 @@ public class LineNumbers extends JPanel implements CaretListener {
@SuppressWarnings
(
"deprecation"
)
@Override
public
void
paintComponent
(
Graphics
g
)
{
codeInfo
=
codeArea
.
getNode
().
getCodeInfo
();
visibleRect
=
g
.
getClipBounds
(
visibleRect
);
if
(
visibleRect
==
null
)
{
visibleRect
=
getVisibleRect
();
...
...
@@ -127,7 +127,7 @@ public class LineNumbers extends JPanel implements CaretListener {
Dimension
size
=
getSize
();
g
.
setColor
(
codeArea
.
getBackground
());
g
.
fillRect
(
0
,
0
,
size
.
width
,
size
.
height
);
g
.
fillRect
(
0
,
visibleRect
.
y
,
size
.
width
,
visibleRect
.
height
);
FontMetrics
fontMetrics
=
codeArea
.
getFontMetrics
(
font
);
Insets
insets
=
getInsets
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录