Package com.litecoding.smali2java.entity.smali

Examples of com.litecoding.smali2java.entity.smali.MethodRef


    Instruction instruction = instructions.get(0); //TODO: fix for super(CONST, ...)
    List<SmaliCodeEntity> args = instruction.getArguments();
   
    if("invoke-direct".equals(instruction.getOpcodeData().getName())) {
      //maybe this() or super() call
      MethodRef methodRef = (MethodRef) args.get(args.size() - 1);
     
      if(methodRef.isConstructor()) {
        //this is this() or super() call
        MethodCall methodCall = new MethodCall(MethodCall.CALL_DIRECT,
            methodRef.getClassName(),
            methodRef.getName());
        Renderable entity = methodCall;
       
        methodCall.setConstructorCall(true);
        if(smaliClass.getSuperClassName().equals(methodRef.getClassName()))
          methodCall.setSuperCall(true);
        else
          methodCall.setThisCall(true);
       
        RegisterGroup regGroup = (RegisterGroup) args.get(0);
View Full Code Here


  }

  @SuppressWarnings("unchecked")
  @Override
  public Object visit(Rule_smaliMethodRef rule) {
    MethodRef ref = EntityFactory.createCommonMethodRef();
    for(Rule innerRule : rule.rules) {
      if(innerRule instanceof Rule_className)
        ref.setClassName(innerRule.spelling);
      else if(innerRule instanceof Rule_qualifier)
        ref.setName(innerRule.spelling);
      else if(innerRule instanceof Rule_smaliConstructorName) {
        ref.setName(innerRule.spelling);
        ref.setConstructor(true);
      } else if(innerRule instanceof Rule_classMethodProto) {
        List<Param> protoParams = (List<Param>)innerRule.accept(this);
        ref.setReturnType(protoParams.remove(0).getType());
        smaliClass.addImport(ref.getReturnType());
        for(Param param : protoParams) {
          ref.addParam(param);
          smaliClass.addImport(param.getType());
        }
      }
    }
    return ref;
View Full Code Here

TOP

Related Classes of com.litecoding.smali2java.entity.smali.MethodRef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.