Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_39073359
jadx
提交
a3e97443
J
jadx
项目概览
qq_39073359
/
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
a3e97443
编写于
2月 24, 2022
作者:
S
Skylot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore(cli): additional debug messages for java-convert plugin
上级
7030daec
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
7 deletion
+12
-7
jadx-core/src/main/java/jadx/api/JadxDecompiler.java
jadx-core/src/main/java/jadx/api/JadxDecompiler.java
+4
-1
jadx-plugins/jadx-java-convert/src/main/java/jadx/plugins/input/javaconvert/JavaConvertLoader.java
...ava/jadx/plugins/input/javaconvert/JavaConvertLoader.java
+8
-6
未找到文件。
jadx-core/src/main/java/jadx/api/JadxDecompiler.java
浏览文件 @
a3e97443
...
...
@@ -123,13 +123,16 @@ public final class JadxDecompiler implements Closeable {
loadedInputs
.
clear
();
List
<
Path
>
inputPaths
=
Utils
.
collectionMap
(
args
.
getInputFiles
(),
File:
:
toPath
);
List
<
Path
>
inputFiles
=
FileUtils
.
expandDirs
(
inputPaths
);
long
start
=
System
.
currentTimeMillis
();
for
(
JadxInputPlugin
inputPlugin
:
pluginManager
.
getInputPlugins
())
{
ILoadResult
loadResult
=
inputPlugin
.
loadFiles
(
inputFiles
);
if
(
loadResult
!=
null
&&
!
loadResult
.
isEmpty
())
{
loadedInputs
.
add
(
loadResult
);
}
}
LOG
.
debug
(
"Loaded using {} inputs plugin"
,
loadedInputs
.
size
());
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"Loaded using {} inputs plugin in {} ms"
,
loadedInputs
.
size
(),
System
.
currentTimeMillis
()
-
start
);
}
}
private
void
reset
()
{
...
...
jadx-plugins/jadx-java-convert/src/main/java/jadx/plugins/input/javaconvert/JavaConvertLoader.java
浏览文件 @
a3e97443
...
...
@@ -53,6 +53,7 @@ public class JavaConvertLoader {
return
;
}
try
{
LOG
.
debug
(
"Converting class files ..."
);
Path
jarFile
=
Files
.
createTempFile
(
"jadx-"
,
".jar"
);
try
(
JarOutputStream
jo
=
new
JarOutputStream
(
Files
.
newOutputStream
(
jarFile
)))
{
for
(
Path
file
:
clsFiles
)
{
...
...
@@ -64,7 +65,7 @@ public class JavaConvertLoader {
}
}
result
.
addTempPath
(
jarFile
);
LOG
.
debug
(
"Packed class files {} into jar {}"
,
clsFiles
,
jarFile
);
LOG
.
debug
(
"Packed class files {} into jar {}"
,
clsFiles
.
size
()
,
jarFile
);
convertJar
(
result
,
jarFile
);
}
catch
(
Exception
e
)
{
LOG
.
error
(
"Error process class files"
,
e
);
...
...
@@ -120,7 +121,7 @@ public class JavaConvertLoader {
if
(!
Objects
.
equals
(
repackNeeded
,
Boolean
.
TRUE
))
{
return
false
;
}
LOG
.
debug
(
"Repacking jar file: {} ..."
,
path
.
toAbsolutePath
());
Path
jarFile
=
Files
.
createTempFile
(
"jadx-classes-"
,
".jar"
);
result
.
addTempPath
(
jarFile
);
try
(
JarOutputStream
jo
=
new
JarOutputStream
(
Files
.
newOutputStream
(
jarFile
)))
{
...
...
@@ -130,6 +131,7 @@ public class JavaConvertLoader {
if
(
entryName
.
endsWith
(
".class"
))
{
if
(
entryName
.
endsWith
(
"module-info.class"
)
||
entryName
.
startsWith
(
"META-INF/versions/"
))
{
LOG
.
debug
(
" exclude: {}"
,
entryName
);
return
;
}
byte
[]
clsFileContent
=
CommonFileUtils
.
loadBytes
(
in
);
...
...
@@ -155,7 +157,7 @@ public class JavaConvertLoader {
private
static
void
convertSimpleJar
(
ConvertResult
result
,
Path
path
)
throws
Exception
{
Path
tempDirectory
=
Files
.
createTempDirectory
(
"jadx-"
);
result
.
addTempPath
(
tempDirectory
);
LOG
.
debug
(
"Converting to dex ..."
);
try
{
DxConverter
.
run
(
path
,
tempDirectory
);
}
catch
(
Throwable
e
)
{
...
...
@@ -166,9 +168,9 @@ public class JavaConvertLoader {
LOG
.
error
(
"D8 convert failed: {}"
,
ex
.
getMessage
());
}
}
LOG
.
debug
(
"Converted
to dex: {}"
,
path
.
toAbsolutePath
());
result
.
addConvertedFiles
(
collectFilesInDir
(
tempDirectory
)
);
List
<
Path
>
dexFiles
=
collectFilesInDir
(
tempDirectory
);
LOG
.
debug
(
"Converted
{} to dex files: {}"
,
path
.
toAbsolutePath
(),
dexFiles
.
size
());
result
.
addConvertedFiles
(
dexFiles
);
}
private
static
List
<
Path
>
collectFilesInDir
(
Path
tempDirectory
)
throws
IOException
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录