Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_39073359
jadx
提交
b1b49e61
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,发现更多精彩内容 >>
提交
b1b49e61
编写于
4月 14, 2019
作者:
A
Ahmed Ashour
提交者:
skylot
4月 14, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: remove declaration of unused variable (PR #590)
上级
d23f4ac1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
11 addition
and
59 deletion
+11
-59
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
+10
-5
jadx-core/src/test/java/jadx/tests/integration/annotations/TestAnnotationsMix.java
...adx/tests/integration/annotations/TestAnnotationsMix.java
+1
-3
jadx-core/src/test/java/jadx/tests/integration/inner/TestAnonymousClass13.java
...va/jadx/tests/integration/inner/TestAnonymousClass13.java
+0
-2
jadx-core/src/test/java/jadx/tests/integration/invoke/TestConstructorInvoke.java
.../jadx/tests/integration/invoke/TestConstructorInvoke.java
+0
-49
未找到文件。
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
浏览文件 @
b1b49e61
package
jadx.core.codegen
;
import
static
jadx
.
core
.
utils
.
android
.
AndroidResourcesUtils
.
handleAppResField
;
import
java.util.ArrayList
;
import
java.util.EnumSet
;
import
java.util.Iterator
;
...
...
@@ -41,6 +43,7 @@ import jadx.core.dex.instructions.args.InsnWrapArg;
import
jadx.core.dex.instructions.args.LiteralArg
;
import
jadx.core.dex.instructions.args.Named
;
import
jadx.core.dex.instructions.args.RegisterArg
;
import
jadx.core.dex.instructions.args.SSAVar
;
import
jadx.core.dex.instructions.mods.ConstructorInsn
;
import
jadx.core.dex.instructions.mods.TernaryInsn
;
import
jadx.core.dex.nodes.ClassNode
;
...
...
@@ -52,8 +55,6 @@ import jadx.core.utils.RegionUtils;
import
jadx.core.utils.exceptions.CodegenException
;
import
jadx.core.utils.exceptions.JadxRuntimeException
;
import
static
jadx
.
core
.
utils
.
android
.
AndroidResourcesUtils
.
handleAppResField
;
public
class
InsnGen
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
InsnGen
.
class
);
...
...
@@ -219,9 +220,13 @@ public class InsnGen {
if
(
flag
!=
Flags
.
INLINE
)
{
code
.
startLineWithNum
(
insn
.
getSourceLine
());
}
if
(
insn
.
getResult
()
!=
null
&&
!
insn
.
contains
(
AFlag
.
ARITH_ONEARG
))
{
assignVar
(
code
,
insn
);
code
.
add
(
" = "
);
if
(
insn
.
getResult
()
!=
null
)
{
SSAVar
var
=
insn
.
getResult
().
getSVar
();
if
((
var
==
null
||
var
.
getUseCount
()
!=
0
||
insn
.
getType
()
!=
InsnType
.
CONSTRUCTOR
)
&&
!
insn
.
contains
(
AFlag
.
ARITH_ONEARG
))
{
assignVar
(
code
,
insn
);
code
.
add
(
" = "
);
}
}
makeInsnBody
(
code
,
insn
,
state
);
if
(
flag
!=
Flags
.
INLINE
)
{
...
...
jadx-core/src/test/java/jadx/tests/integration/annotations/TestAnnotationsMix.java
浏览文件 @
b1b49e61
...
...
@@ -10,7 +10,6 @@ import java.util.Arrays;
import
org.junit.jupiter.api.Test
;
import
jadx.NotYetImplemented
;
import
jadx.core.dex.nodes.ClassNode
;
import
jadx.tests.api.IntegrationTest
;
...
...
@@ -112,8 +111,7 @@ public class TestAnnotationsMix extends IntegrationTest {
}
@Test
@NotYetImplemented
public
void
testNYI
()
{
public
void
testDeclaration
()
{
ClassNode
cls
=
getClassNode
(
TestCls
.
class
);
String
code
=
cls
.
getCode
().
toString
();
...
...
jadx-core/src/test/java/jadx/tests/integration/inner/TestAnonymousClass13.java
浏览文件 @
b1b49e61
...
...
@@ -2,7 +2,6 @@ package jadx.tests.integration.inner;
import
org.junit.jupiter.api.Test
;
import
jadx.NotYetImplemented
;
import
jadx.tests.api.IntegrationTest
;
public
class
TestAnonymousClass13
extends
IntegrationTest
{
...
...
@@ -16,7 +15,6 @@ public class TestAnonymousClass13 extends IntegrationTest {
}
@Test
@NotYetImplemented
public
void
test
()
{
getClassNode
(
TestCls
.
class
);
}
...
...
jadx-core/src/test/java/jadx/tests/integration/invoke/TestConstructorInvoke.java
已删除
100644 → 0
浏览文件 @
d23f4ac1
package
jadx.tests.integration.invoke
;
import
org.junit.jupiter.api.Test
;
import
jadx.NotYetImplemented
;
import
jadx.core.dex.nodes.ClassNode
;
import
jadx.tests.api.IntegrationTest
;
import
static
jadx
.
tests
.
api
.
utils
.
JadxMatchers
.
containsOne
;
import
static
org
.
hamcrest
.
MatcherAssert
.
assertThat
;
public
class
TestConstructorInvoke
extends
IntegrationTest
{
void
test
(
String
root
,
String
name
)
{
ViewHolder
holder
=
new
ViewHolder
(
root
,
name
);
}
private
final
class
ViewHolder
{
private
ViewHolder
(
String
root
,
String
name
)
{
}
}
@Test
@NotYetImplemented
(
"Variable lost name from debug info"
)
public
void
test
()
{
ClassNode
cls
=
getClassNode
(
TestConstructorInvoke
.
class
);
String
code
=
cls
.
getCode
().
toString
();
assertThat
(
code
,
containsOne
(
indent
()
+
"ViewHolder holder = new ViewHolder(root, name);"
));
}
// Remove after fix above @NYI
@Test
public
void
test2
()
{
ClassNode
cls
=
getClassNode
(
TestConstructorInvoke
.
class
);
String
code
=
cls
.
getCode
().
toString
();
assertThat
(
code
,
containsOne
(
indent
()
+
"ViewHolder viewHolder = new ViewHolder(root, name);"
));
}
@Test
public
void
testNoDebug
()
{
noDebugInfo
();
ClassNode
cls
=
getClassNode
(
TestConstructorInvoke
.
class
);
String
code
=
cls
.
getCode
().
toString
();
assertThat
(
code
,
containsOne
(
indent
()
+
"ViewHolder viewHolder = new ViewHolder("
));
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录