use of jadx.core.dex.nodes.RootNode in project jadx by skylot.
the class JadxClasspathTest method initClsp.
@Before
public void initClsp() throws IOException, DecodeException {
clsp = new ClspGraph();
clsp.load();
dex = mock(DexNode.class);
RootNode rootNode = mock(RootNode.class);
when(rootNode.getClsp()).thenReturn(clsp);
when(dex.root()).thenReturn(rootNode);
}
use of jadx.core.dex.nodes.RootNode in project jadx by skylot.
the class IntegrationTest method getClassNodeFromFile.
public ClassNode getClassNodeFromFile(File file, String clsName) {
JadxDecompiler d = new JadxDecompiler(args);
try {
d.loadFile(file);
} catch (JadxException e) {
e.printStackTrace();
fail(e.getMessage());
}
RootNode root = JadxInternalAccess.getRoot(d);
root.getConstValues().getResourcesNames().putAll(resMap);
ClassNode cls = root.searchClassByName(clsName);
assertThat("Class not found: " + clsName, cls, notNullValue());
assertThat(clsName, is(cls.getClassInfo().getFullName()));
if (unloadCls) {
decompile(d, cls);
} else {
decompileWithoutUnload(d, cls);
}
System.out.println("-----------------------------------------------------------");
System.out.println(cls.getCode());
System.out.println("-----------------------------------------------------------");
checkCode(cls);
compile(cls);
runAutoCheck(clsName);
return cls;
}
use of jadx.core.dex.nodes.RootNode in project jadx by skylot.
the class TypeMergeTest method initClsp.
@Before
public void initClsp() throws IOException, DecodeException {
ClspGraph clsp = new ClspGraph();
clsp.load();
dex = mock(DexNode.class);
RootNode rootNode = mock(RootNode.class);
when(rootNode.getClsp()).thenReturn(clsp);
when(dex.root()).thenReturn(rootNode);
}
use of jadx.core.dex.nodes.RootNode in project jadx by skylot.
the class ConvertToClsSet method main.
public static void main(String[] args) throws IOException, DecodeException {
if (args.length < 2) {
usage();
System.exit(1);
}
File output = new File(args[0]);
List<InputFile> inputFiles = new ArrayList<InputFile>(args.length - 1);
for (int i = 1; i < args.length; i++) {
File f = new File(args[i]);
if (f.isDirectory()) {
addFilesFromDirectory(f, inputFiles);
} else {
InputFile.addFilesFrom(f, inputFiles);
}
}
for (InputFile inputFile : inputFiles) {
LOG.info("Loaded: {}", inputFile.getFile());
}
RootNode root = new RootNode(new JadxArgs());
root.load(inputFiles);
ClsSet set = new ClsSet();
set.load(root);
set.save(output);
LOG.info("Output: {}", output);
LOG.info("done");
}
use of jadx.core.dex.nodes.RootNode in project jadx by skylot.
the class JadxDecompiler method parse.
void parse() throws DecodeException {
reset();
init();
root = new RootNode(args);
LOG.info("loading ...");
root.load(inputFiles);
root.initClassPath();
root.loadResources(getResources());
root.initAppResClass();
initVisitors();
}
Aggregations