Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
colcode
jadx
提交
6fb1c8d3
J
jadx
项目概览
colcode
/
jadx
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
提交
6fb1c8d3
编写于
2月 17, 2018
作者:
S
Skylot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
gui: don't decode resources on file open
上级
6047a27c
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
49 addition
and
19 deletion
+49
-19
jadx-core/src/main/java/jadx/core/xmlgen/ResContainer.java
jadx-core/src/main/java/jadx/core/xmlgen/ResContainer.java
+1
-1
jadx-gui/src/main/java/jadx/gui/treemodel/JClass.java
jadx-gui/src/main/java/jadx/gui/treemodel/JClass.java
+6
-1
jadx-gui/src/main/java/jadx/gui/treemodel/JLoadableNode.java
jadx-gui/src/main/java/jadx/gui/treemodel/JLoadableNode.java
+5
-0
jadx-gui/src/main/java/jadx/gui/treemodel/JResource.java
jadx-gui/src/main/java/jadx/gui/treemodel/JResource.java
+28
-12
jadx-gui/src/main/java/jadx/gui/treemodel/JRoot.java
jadx-gui/src/main/java/jadx/gui/treemodel/JRoot.java
+2
-1
jadx-gui/src/main/java/jadx/gui/treemodel/JSources.java
jadx-gui/src/main/java/jadx/gui/treemodel/JSources.java
+2
-1
jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
+3
-3
jadx-gui/src/main/resources/i18n/Messages_en_US.properties
jadx-gui/src/main/resources/i18n/Messages_en_US.properties
+2
-0
未找到文件。
jadx-core/src/main/java/jadx/core/xmlgen/ResContainer.java
浏览文件 @
6fb1c8d3
...
...
@@ -51,7 +51,7 @@ public class ResContainer implements Comparable<ResContainer> {
try
{
decoder
.
decode
(
content
,
os
);
}
catch
(
Exception
e
)
{
LOG
.
error
(
"Failed to decode 9-patch png image
"
,
e
);
LOG
.
error
(
"Failed to decode 9-patch png image
, path: {}"
,
name
,
e
);
}
newContent
=
new
ByteArrayInputStream
(
os
.
toByteArray
());
}
...
...
jadx-gui/src/main/java/jadx/gui/treemodel/JClass.java
浏览文件 @
6fb1c8d3
...
...
@@ -12,7 +12,7 @@ import jadx.core.dex.info.AccessInfo;
import
jadx.gui.utils.NLS
;
import
jadx.gui.utils.Utils
;
public
class
JClass
extends
JNode
{
public
class
JClass
extends
J
Loadable
Node
{
private
static
final
long
serialVersionUID
=
-
1239986875244097177L
;
private
static
final
ImageIcon
ICON_CLASS
=
Utils
.
openIcon
(
"class_obj"
);
...
...
@@ -43,6 +43,11 @@ public class JClass extends JNode {
return
cls
;
}
@Override
public
void
loadNode
()
{
getRootClass
().
load
();
}
public
synchronized
void
load
()
{
if
(!
loaded
)
{
cls
.
decompile
();
...
...
jadx-gui/src/main/java/jadx/gui/treemodel/JLoadableNode.java
0 → 100644
浏览文件 @
6fb1c8d3
package
jadx.gui.treemodel
;
public
abstract
class
JLoadableNode
extends
JNode
{
public
abstract
void
loadNode
();
}
jadx-gui/src/main/java/jadx/gui/treemodel/JResource.java
浏览文件 @
6fb1c8d3
...
...
@@ -6,16 +6,20 @@ import java.util.List;
import
java.util.Map
;
import
org.fife.ui.rsyntaxtextarea.SyntaxConstants
;
import
org.jetbrains.annotations.NotNull
;
import
jadx.api.ResourceFile
;
import
jadx.api.ResourceFileContent
;
import
jadx.api.ResourceType
;
import
jadx.core.codegen.CodeWriter
;
import
jadx.core.xmlgen.ResContainer
;
import
jadx.gui.utils.NLS
;
import
jadx.gui.utils.OverlayIcon
;
import
jadx.gui.utils.Utils
;
public
class
JResource
extends
JNode
implements
Comparable
<
JResource
>
{
import
static
jadx
.
api
.
ResourceFileContent
.
createResourceFileContentInstance
;
public
class
JResource
extends
JLoadableNode
implements
Comparable
<
JResource
>
{
private
static
final
long
serialVersionUID
=
-
201018424302612434L
;
private
static
final
ImageIcon
ROOT_ICON
=
Utils
.
openIcon
(
"cf_obj"
);
...
...
@@ -50,22 +54,35 @@ public class JResource extends JNode implements Comparable<JResource> {
this
.
name
=
name
;
this
.
shortName
=
shortName
;
this
.
type
=
type
;
this
.
loaded
=
false
;
}
public
final
void
update
()
{
loadContent
();
removeAllChildren
();
for
(
JResource
res
:
files
)
{
res
.
update
();
add
(
res
);
if
(!
loaded
)
{
if
(
type
==
JResType
.
DIR
||
type
==
JResType
.
ROOT
||
resFile
.
getType
()
==
ResourceType
.
ARSC
)
{
add
(
new
TextNode
(
NLS
.
str
(
"tree.loading"
)));
}
}
else
{
loadContent
();
for
(
JResource
res
:
files
)
{
res
.
update
();
add
(
res
);
}
}
}
@Override
public
void
loadNode
()
{
loadContent
();
loaded
=
true
;
update
();
}
private
void
loadContent
()
{
getContent
();
for
(
JResource
res
:
files
)
{
res
.
loadContent
();
}
}
@Override
...
...
@@ -101,8 +118,8 @@ public class JResource extends JNode implements Comparable<JResource> {
String
resName
=
rc
.
getName
();
String
[]
path
=
resName
.
split
(
"/"
);
String
resShortName
=
path
.
length
==
0
?
resName
:
path
[
path
.
length
-
1
];
ResourceFileContent
fileContent
=
ResourceFileContent
.
createResourceFileContentInstance
(
resShortName
,
ResourceType
.
XML
,
cw
);
if
(
fileContent
!=
null
)
{
ResourceFileContent
fileContent
=
createResourceFileContentInstance
(
resShortName
,
ResourceType
.
XML
,
cw
);
if
(
fileContent
!=
null
)
{
addPath
(
path
,
root
,
new
JResource
(
fileContent
,
resName
,
resShortName
,
JResType
.
FILE
));
}
}
...
...
@@ -242,7 +259,7 @@ public class JResource extends JNode implements Comparable<JResource> {
}
@Override
public
int
compareTo
(
JResource
o
)
{
public
int
compareTo
(
@NotNull
JResource
o
)
{
return
name
.
compareTo
(
o
.
name
);
}
...
...
@@ -266,5 +283,4 @@ public class JResource extends JNode implements Comparable<JResource> {
public
int
hashCode
()
{
return
name
.
hashCode
();
}
}
jadx-gui/src/main/java/jadx/gui/treemodel/JRoot.java
浏览文件 @
6fb1c8d3
...
...
@@ -10,6 +10,7 @@ import java.util.regex.Pattern;
import
jadx.api.ResourceFile
;
import
jadx.gui.JadxWrapper
;
import
jadx.gui.treemodel.JResource.JResType
;
import
jadx.gui.utils.NLS
;
import
jadx.gui.utils.Utils
;
public
class
JRoot
extends
JNode
{
...
...
@@ -41,7 +42,7 @@ public class JRoot extends JNode {
if
(
resources
.
isEmpty
())
{
return
Collections
.
emptyList
();
}
JResource
root
=
new
JResource
(
null
,
"Resources"
,
JResType
.
ROOT
);
JResource
root
=
new
JResource
(
null
,
NLS
.
str
(
"tree.resources_title"
)
,
JResType
.
ROOT
);
String
splitPathStr
=
Pattern
.
quote
(
File
.
separator
);
for
(
ResourceFile
rf
:
resources
)
{
String
rfName
;
...
...
jadx-gui/src/main/java/jadx/gui/treemodel/JSources.java
浏览文件 @
6fb1c8d3
...
...
@@ -12,6 +12,7 @@ import java.util.Set;
import
jadx.api.JavaPackage
;
import
jadx.gui.JadxWrapper
;
import
jadx.gui.utils.NLS
;
import
jadx.gui.utils.Utils
;
public
class
JSources
extends
JNode
{
...
...
@@ -132,6 +133,6 @@ public class JSources extends JNode {
@Override
public
String
makeString
()
{
return
"Source code"
;
return
NLS
.
str
(
"tree.sources_title"
)
;
}
}
jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
浏览文件 @
6fb1c8d3
...
...
@@ -41,6 +41,7 @@ import jadx.gui.jobs.IndexJob;
import
jadx.gui.settings.JadxSettings
;
import
jadx.gui.settings.JadxSettingsWindow
;
import
jadx.gui.treemodel.JClass
;
import
jadx.gui.treemodel.JLoadableNode
;
import
jadx.gui.treemodel.JNode
;
import
jadx.gui.treemodel.JResource
;
import
jadx.gui.treemodel.JRoot
;
...
...
@@ -581,9 +582,8 @@ public class MainWindow extends JFrame {
public
void
treeWillExpand
(
TreeExpansionEvent
event
)
throws
ExpandVetoException
{
TreePath
path
=
event
.
getPath
();
Object
node
=
path
.
getLastPathComponent
();
if
(
node
instanceof
JClass
)
{
JClass
cls
=
(
JClass
)
node
;
cls
.
getRootClass
().
load
();
if
(
node
instanceof
JLoadableNode
)
{
((
JLoadableNode
)
node
).
loadNode
();
}
}
...
...
jadx-gui/src/main/resources/i18n/Messages_en_US.properties
浏览文件 @
6fb1c8d3
...
...
@@ -23,6 +23,8 @@ file.save_all_msg=Select directory for save decompiled sources
file.select
=
Select
file.exit
=
Exit
tree.sources_title
=
Source code
tree.resources_title
=
Resources
tree.loading
=
Loading...
search
=
Search
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录