use of com.android.dx.cf.direct.DirectClassFile in project RocooFix by dodola.
the class ClassReferenceListBuilder method addRootsV2.
public void addRootsV2(String name) {
if (name.endsWith(CLASS_EXTENSION)) {
classNames.add(name.substring(0, name.length() - CLASS_EXTENSION.length()));
}
if (name.endsWith(CLASS_EXTENSION)) {
DirectClassFile classFile;
try {
classFile = path.getClass(name);
addDependencies(classFile);
} catch (FileNotFoundException e) {
// throw new IOException("Class " + name +
// " is missing form original class path " + path, e);
}
}
}
use of com.android.dx.cf.direct.DirectClassFile in project RocooFix by dodola.
the class ClassReferenceListBuilder method addClassWithHierachy.
private void addClassWithHierachy(String classBinaryName) {
if (classNames.contains(classBinaryName)) {
return;
}
try {
DirectClassFile classFile = path.getClass(classBinaryName + CLASS_EXTENSION);
classNames.add(classBinaryName);
CstType superClass = classFile.getSuperclass();
if (superClass != null) {
addClassWithHierachy(superClass.getClassType().getClassName());
}
TypeList interfaceList = classFile.getInterfaces();
int interfaceNumber = interfaceList.size();
for (int i = 0; i < interfaceNumber; i++) {
addClassWithHierachy(interfaceList.getType(i).getClassName());
}
} catch (FileNotFoundException e) {
// Ignore: The referenced type is not in the path it must be part of the libraries.
}
}
use of com.android.dx.cf.direct.DirectClassFile in project RocooFix by dodola.
the class ClassReferenceListBuilder method addSupperClass.
public void addSupperClass(String name) {
if (name.endsWith(CLASS_EXTENSION)) {
classNames.add(name.substring(0, name.length() - CLASS_EXTENSION.length()));
}
if (name.endsWith(CLASS_EXTENSION)) {
DirectClassFile classFile;
try {
classFile = path.getClass(name);
CstType superClass = classFile.getSuperclass();
if (superClass != null) {
String superClassName = superClass.getClassType().getClassName();
classNames.add(superClassName);
}
} catch (FileNotFoundException e) {
// throw new IOException("Class " + name +
// " is missing form original class path " + path, e);
}
}
}
use of com.android.dx.cf.direct.DirectClassFile in project bazel by bazelbuild.
the class Dexing method parseClassFile.
public static DirectClassFile parseClassFile(byte[] classfile, String classfilePath) {
DirectClassFile result = new DirectClassFile(new ByteArray(classfile), classfilePath, /*strictParse*/
false);
result.setAttributeFactory(StdAttributeFactory.THE_ONE);
// triggers the parsing
result.getMagic();
return result;
}
use of com.android.dx.cf.direct.DirectClassFile in project buck by facebook.
the class Main method parseClass.
private DirectClassFile parseClass(String name, byte[] bytes) {
DirectClassFile cf = new DirectClassFile(bytes, name, args.cfOptions.strictNameCheck);
cf.setAttributeFactory(StdAttributeFactory.THE_ONE);
// triggers the actual parsing
cf.getMagic();
return cf;
}
Aggregations