core: update android files to 5.1 (fix #58)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
ext.jadxClasspath = 'clsp-data/android-4.3.jar'
|
||||
ext.jadxClasspath = 'clsp-data/android-5.1.jar'
|
||||
|
||||
apply plugin: "info.solidsoft.pitest"
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -114,7 +114,6 @@ public class ClsSet {
|
||||
try {
|
||||
out.putNextEntry(new ZipEntry(CLST_PKG_PATH + "/" + CLST_FILENAME));
|
||||
save(out);
|
||||
out.closeEntry();
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
|
||||
@@ -63,7 +63,10 @@ public class ConvertToClsSet {
|
||||
if (file.isDirectory()) {
|
||||
addFilesFromDirectory(file, inputFiles);
|
||||
}
|
||||
if (file.getName().endsWith(".dex")) {
|
||||
String fileName = file.getName();
|
||||
if (fileName.endsWith(".dex")
|
||||
|| fileName.endsWith(".jar")
|
||||
|| fileName.endsWith(".apk")) {
|
||||
inputFiles.add(new InputFile(file));
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -31,6 +31,7 @@ import org.slf4j.LoggerFactory;
|
||||
public class BinaryXMLParser extends CommonBinaryParser {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(BinaryXMLParser.class);
|
||||
private static final String ANDROID_R_STYLE_CLS = "android.R$style";
|
||||
|
||||
private CodeWriter writer;
|
||||
private String[] strings;
|
||||
@@ -51,8 +52,13 @@ public class BinaryXMLParser extends CommonBinaryParser {
|
||||
|
||||
public BinaryXMLParser(RootNode root) {
|
||||
try {
|
||||
for (Field f : AndroidR.style.class.getFields()) {
|
||||
styleMap.put(f.getInt(f.getType()), f.getName());
|
||||
try {
|
||||
Class rStyleCls = Class.forName(ANDROID_R_STYLE_CLS);
|
||||
for (Field f : rStyleCls.getFields()) {
|
||||
styleMap.put(f.getInt(f.getType()), f.getName());
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
LOG.error("R class loading failed", th);
|
||||
}
|
||||
// add application constants
|
||||
for (DexNode dexNode : root.getDexNodes()) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package jadx.core.xmlgen;
|
||||
|
||||
import jadx.core.utils.exceptions.JadxException;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import java.io.InputStream;
|
||||
@@ -17,7 +19,7 @@ import org.w3c.dom.NodeList;
|
||||
public class ManifestAttributes {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ManifestAttributes.class);
|
||||
|
||||
private static final String MANIFEST_ATTR_XML = "/attrs_manifest.xml";
|
||||
private static final String MANIFEST_ATTR_XML = "/android/attrs_manifest.xml";
|
||||
|
||||
private enum MAttrType {
|
||||
ENUM, FLAG
|
||||
@@ -52,6 +54,9 @@ public class ManifestAttributes {
|
||||
InputStream xmlStream = null;
|
||||
try {
|
||||
xmlStream = ManifestAttributes.class.getResourceAsStream(MANIFEST_ATTR_XML);
|
||||
if (xmlStream == null) {
|
||||
throw new JadxException(MANIFEST_ATTR_XML + " not found in classpath");
|
||||
}
|
||||
DocumentBuilder dBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
doc = dBuilder.parse(xmlStream);
|
||||
} finally {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user