Search in sources :

Example 1 with JsonMthMapping

use of jadx.core.codegen.json.mapping.JsonMthMapping in project jadx by skylot.

the class JsonMappingGen method addMethods.

private static void addMethods(ClassNode cls, JsonClsMapping jsonCls) {
    List<MethodNode> methods = cls.getMethods();
    if (methods.isEmpty()) {
        return;
    }
    jsonCls.setMethods(new ArrayList<>(methods.size()));
    for (MethodNode method : methods) {
        JsonMthMapping jsonMethod = new JsonMthMapping();
        MethodInfo methodInfo = method.getMethodInfo();
        jsonMethod.setSignature(methodInfo.getShortId());
        jsonMethod.setName(methodInfo.getName());
        jsonMethod.setAlias(methodInfo.getAlias());
        jsonMethod.setOffset("0x" + Long.toHexString(method.getMethodCodeOffset()));
        jsonCls.getMethods().add(jsonMethod);
    }
}
Also used : MethodNode(jadx.core.dex.nodes.MethodNode) MethodInfo(jadx.core.dex.info.MethodInfo) JsonMthMapping(jadx.core.codegen.json.mapping.JsonMthMapping)

Aggregations

JsonMthMapping (jadx.core.codegen.json.mapping.JsonMthMapping)1 MethodInfo (jadx.core.dex.info.MethodInfo)1 MethodNode (jadx.core.dex.nodes.MethodNode)1