use of jadx.core.dex.nodes.DexNode in project jadx by skylot.
the class Deobfuscator method process.
private void process() {
preProcess();
if (DEBUG) {
dumpAlias();
}
for (DexNode dexNode : dexNodes) {
for (ClassNode cls : dexNode.getClasses()) {
processClass(dexNode, cls);
}
}
postProcess();
}
use of jadx.core.dex.nodes.DexNode in project jadx by skylot.
the class FinishTypeInference method visit.
@Override
public void visit(MethodNode mth) {
if (mth.isNoCode()) {
return;
}
boolean change;
int i = 0;
do {
change = false;
for (BlockNode block : mth.getBasicBlocks()) {
for (InsnNode insn : block.getInstructions()) {
if (PostTypeInference.process(mth, insn)) {
change = true;
}
}
}
i++;
if (i > 1000) {
break;
}
} while (change);
// last chance to set correct value (just use first type from 'possible' list)
DexNode dex = mth.dex();
for (BlockNode block : mth.getBasicBlocks()) {
for (InsnNode insn : block.getInstructions()) {
SelectTypeVisitor.visit(dex, insn);
}
}
// check
for (BlockNode block : mth.getBasicBlocks()) {
for (InsnNode insn : block.getInstructions()) {
CheckTypeVisitor.visit(mth, insn);
}
}
}
use of jadx.core.dex.nodes.DexNode in project jadx by skylot.
the class TypeInference method visit.
@Override
public void visit(MethodNode mth) throws JadxException {
if (mth.isNoCode()) {
return;
}
DexNode dex = mth.dex();
for (SSAVar var : mth.getSVars()) {
// inference variable type
ArgType type = processType(dex, var);
if (type == null) {
type = ArgType.UNKNOWN;
}
var.setType(type);
// search variable name
String name = processVarName(var);
var.setName(name);
}
// fix type for vars used only in Phi nodes
for (SSAVar sVar : mth.getSVars()) {
PhiInsn phi = sVar.getUsedInPhi();
if (phi != null) {
processPhiNode(phi);
}
}
}
use of jadx.core.dex.nodes.DexNode in project jadx by skylot.
the class ExportGradleProject method skipGeneratedClasses.
private void skipGeneratedClasses() {
for (DexNode dexNode : root.getDexNodes()) {
List<ClassNode> classes = dexNode.getClasses();
for (ClassNode cls : classes) {
String shortName = cls.getClassInfo().getShortName();
if (IGNORE_CLS_NAMES.contains(shortName)) {
cls.add(AFlag.DONT_GENERATE);
LOG.debug("Skip class: {}", cls);
}
}
}
}
Aggregations