Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Quincy379
jadx
提交
6ddb0036
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,发现更多精彩内容 >>
提交
6ddb0036
编写于
12月 22, 2014
作者:
Y
YASME-Tim
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added style decoding and a first decoding for data type 17.
上级
0f7ca8ce
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
4 deletion
+57
-4
build.gradle
build.gradle
+1
-0
jadx-cli/src/main/java/jadx/cli/JadxCLI.java
jadx-cli/src/main/java/jadx/cli/JadxCLI.java
+3
-1
jadx-core/src/main/java/jadx/core/xmlgen/BinaryXMLParser.java
...-core/src/main/java/jadx/core/xmlgen/BinaryXMLParser.java
+53
-3
未找到文件。
build.gradle
浏览文件 @
6ddb0036
...
...
@@ -41,6 +41,7 @@ subprojects {
}
dependencies
{
compile
'com.google.android:android:4.1.1.4'
compile
'org.slf4j:slf4j-api:1.7.7'
testCompile
'ch.qos.logback:logback-classic:1.1.2'
...
...
jadx-cli/src/main/java/jadx/cli/JadxCLI.java
浏览文件 @
6ddb0036
...
...
@@ -8,15 +8,17 @@ import java.io.File;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
jadx.core.xmlgen.BinaryXMLParser
;
//
import jadx.core.xmlgen.BinaryXMLParser;
public
class
JadxCLI
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
JadxCLI
.
class
);
public
static
void
main
(
String
[]
args
)
throws
JadxException
{
/*
BinaryXMLParser bxp = new BinaryXMLParser(args[0],args[1]);
bxp.parse();
System.exit(4);
*/
try
{
JadxCLIArgs
jadxArgs
=
new
JadxCLIArgs
();
if
(
processArgs
(
jadxArgs
,
args
))
{
...
...
jadx-core/src/main/java/jadx/core/xmlgen/BinaryXMLParser.java
浏览文件 @
6ddb0036
...
...
@@ -11,6 +11,14 @@ import java.io.IOException;
import
java.io.UnsupportedEncodingException
;
import
java.io.PrintWriter
;
import
java.lang.reflect.Field
;
import
java.util.HashMap
;
import
java.util.Map
;
import
android.R.style
;
//import android.content.res.Resources;
public
class
BinaryXMLParser
{
private
byte
[]
bytes
;
private
String
[]
strings
;
...
...
@@ -21,6 +29,7 @@ public class BinaryXMLParser {
private
int
numtabs
=-
1
;
private
boolean
wasOneLiner
=
false
;
PrintWriter
writer
;
Map
<
Integer
,
String
>
styleMap
=
null
;
public
BinaryXMLParser
(
String
xmlfilepath
,
String
xmloutfilepath
)
{
//System.out.println(xmlfilepath);
try
{
...
...
@@ -48,6 +57,16 @@ public class BinaryXMLParser {
}
catch
(
FileNotFoundException
fnfe
)
{
die
(
"FILE NOT FOUND"
);
}
catch
(
IOException
ioe
)
{
die
(
"IOE"
);
}
count
=
0
;
styleMap
=
new
HashMap
<
Integer
,
String
>();
if
(
null
==
styleMap
)
die
(
"null==styleMap"
);
for
(
Field
f
:
android
.
R
.
style
.
class
.
getFields
())
{
try
{
styleMap
.
put
(
f
.
getInt
(
f
.
getType
()),
f
.
getName
());
}
catch
(
IllegalAccessException
iae
)
{
die
(
"IAE"
);
}
}
}
public
void
parse
()
{
...
...
@@ -182,7 +201,7 @@ public class BinaryXMLParser {
int
classIndex
=
cInt16
(
bytes
,
count
);
//System.out.println("startNS: classIndex: " + classIndex);
int
styleIndex
=
cInt16
(
bytes
,
count
);
//
System.out.println("startNS: styleIndex: " + styleIndex);
if
(
styleIndex
!=
0
)
System
.
out
.
println
(
"startNS: styleIndex: "
+
styleIndex
);
if
(
"manifest"
.
equals
(
strings
[
startNSName
]))
writer
.
print
(
" xmlns:\""
+
nsURI
+
"\""
);
if
(
attributeCount
>
0
)
writer
.
print
(
" "
);
for
(
int
i
=
0
;
i
<
attributeCount
;
i
++)
{
...
...
@@ -213,8 +232,39 @@ public class BinaryXMLParser {
if
(
attrValData
==
0
)
writer
.
print
(
"false"
);
else
if
(
attrValData
==
1
||
attrValData
==-
1
)
writer
.
print
(
"true"
);
else
writer
.
print
(
"UNKNOWN_BOOLEAN_TYPE"
);
}
else
if
(
attrValDataType
==
0x1
)
writer
.
print
(
"0x"
+
Integer
.
toHexString
(
attrValData
));
else
writer
.
print
(
"UNKNOWN_DATA_TYPE_"
+
attrValDataType
);
}
else
if
(
attrValDataType
==
0x1
)
{
if
(
attrValData
<
0x7f000000
)
{
//System.out.println("0x"+Integer.toHexString(attrValData));
//System.out.println(styleMap.get(attrValData));
//System.out.println(android.R.style.class);
writer
.
print
(
"@*"
);
if
(
attributeNS
!=
-
1
)
writer
.
print
(
nsPrefix
+
":"
);
writer
.
print
(
"style/"
+
styleMap
.
get
(
attrValData
).
replaceAll
(
"_"
,
"."
));
}
else
{
writer
.
print
(
"0x"
+
Integer
.
toHexString
(
attrValData
));
}
}
else
{
/*
//System.out.println("ai["+i+"] ns: " + attributeNS);
//if(attributeNS!=-1) System.out.println("ai["+i+"] Sns: " + strings[attributeNS]);
//System.out.println("ai["+i+"] name: " + attributeName);
if(attributeName!=-1) System.out.println("ai["+i+"] Sns: " + strings[attributeName]);
System.out.println("ai["+i+"] rawval: " + attributeRawValue);
if(attributeRawValue!=-1) System.out.println("ai["+i+"] Sns: " + strings[attributeRawValue]);
System.out.println("ai["+i+"] dt: " + attrValDataType);
System.out.println("ai["+i+"] d: " + attrValData);
*/
if
(
"configChanges"
.
equals
(
strings
[
attributeName
]))
{
if
(
attrValData
==
1152
)
writer
.
print
(
"orientation"
);
else
if
(
attrValData
==
4016
)
writer
.
print
(
"keyboard|keyboardHidden|orientation|screenLayout|uiMode"
);
else
if
(
attrValData
==
176
)
writer
.
print
(
"keyboard|keyboardHidden|orientation"
);
else
if
(
attrValData
==
160
)
writer
.
print
(
"keyboardHidden|orientation"
);
else
writer
.
print
(
"UNKNOWN_DATA_"
+
Integer
.
toHexString
(
attrValData
));
}
else
{
writer
.
print
(
"UNKNOWN_DATA_TYPE_"
+
attrValDataType
);
}
}
writer
.
print
(
"\""
);
if
((
i
+
1
)<
attributeCount
)
writer
.
print
(
" "
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录