本文整理了Java中org.jf.dexlib2.iface.Method.getReturnType()
方法的一些代码示例,展示了Method.getReturnType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Method.getReturnType()
方法的具体详情如下:
包路径:org.jf.dexlib2.iface.Method
类名称:Method
方法名:getReturnType
[英]Gets the return type of this method.
[中]获取此方法的返回类型。
代码示例来源:origin: JesusFreke/smali
@Nonnull @Override public String getReturnType() {
return method.getReturnType();
}
代码示例来源:origin: CalebFenton/simplify
private String buildDescriptor(Method method) {
StringBuilder sb = new StringBuilder();
sb.append('(');
method.getParameterTypes().forEach(sb::append);
sb.append(')');
sb.append(method.getReturnType());
return sb.toString();
}
代码示例来源:origin: CalebFenton/simplify
private void visitMethod(ClassDef classDef, Method method, MethodVisitor mv) {
mv.visitCode();
String methodName = method.getName();
if (methodName.equals("<clinit>")) {
visitClInitStub(mv);
} else if (methodName.equals("<init>")) {
visitInitStub(classDef, mv);
} else if (methodName.equals("hashCode") && method.getReturnType().equals("I")) {
visitCallObjectHashCode(mv);
} else {
visitMethodStub(mv);
}
// Do this at the end so ASM can calculate max stack and locals sizes
mv.visitMaxs(0, 0);
mv.visitEnd();
}
代码示例来源:origin: Tencent/tinker
method.getName(),
method.getParameters(),
method.getReturnType(),
method.getAccessFlags(),
method.getAnnotations(),
代码示例来源:origin: JesusFreke/smali
public static void writeEmptyMethodTo(IndentingWriter writer, Method method,
BaksmaliOptions options) throws IOException {
writer.write(".method ");
writeAccessFlags(writer, method.getAccessFlags());
writer.write(method.getName());
writer.write("(");
ImmutableList<MethodParameter> methodParameters = ImmutableList.copyOf(method.getParameters());
for (MethodParameter parameter: methodParameters) {
writer.write(parameter.getType());
}
writer.write(")");
writer.write(method.getReturnType());
writer.write('\n');
writer.indent(4);
writeParameters(writer, method, methodParameters, options);
String containingClass = null;
if (options.implicitReferences) {
containingClass = method.getDefiningClass();
}
AnnotationFormatter.writeTo(writer, method.getAnnotations(), containingClass);
writer.deindent(4);
writer.write(".end method\n");
}
代码示例来源:origin: Sable/soot
/**
* Retrieve the SootMethod equivalent of this method
*
* @return the SootMethod of this method
*/
public SootMethod makeSootMethod(final Method method) {
int accessFlags = method.getAccessFlags();
// get the name of the method
String name = method.getName();
List<SootClass> thrownExceptions = getThrownExceptions(method);
List<Type> parameterTypes = getParameterTypes(method);
// retrieve the return type of this method
Type returnType = DexType.toSoot(method.getReturnType());
// Build soot method by all available parameters
SootMethod sm = declaringClass.getMethodUnsafe(name, parameterTypes, returnType);
if (sm == null) {
sm = Scene.v().makeSootMethod(name, parameterTypes, returnType, accessFlags, thrownExceptions);
}
// if the method is abstract or native, no code needs to be transformed
int flags = method.getAccessFlags();
if (Modifier.isAbstract(flags) || Modifier.isNative(flags)) {
return sm;
}
if (Options.v().oaat() && declaringClass.resolvingLevel() <= SootClass.SIGNATURES) {
return sm;
}
// sets the method source by adding its body as the active body
sm.setSource(createMethodSource(method));
return sm;
}
代码示例来源:origin: JesusFreke/smali
writer.write(method.getReturnType());
writer.write('\n');
代码示例来源:origin: testwhat/SmaliEx
@Override @Nonnull public String getReturnType() {
return method.getReturnType();
}
代码示例来源:origin: org.smali/dexlib2
@Override @Nonnull public String getReturnType() {
return method.getReturnType();
}
代码示例来源:origin: org.smali/dexlib2
@Nonnull @Override public String getReturnType() {
return method.getReturnType();
}
代码示例来源:origin: KB5201314/ZjDroid
@Override @Nonnull public String getReturnType() {
return method.getReturnType();
}
代码示例来源:origin: com.taobao.android/dex_patch
private String getMethodFullName(Method method) {
StringBuilder stringBuilder = new StringBuilder();
String methodName = method.getName();
stringBuilder.append(methodName).append("(");
for (CharSequence c:method.getParameterTypes()){
stringBuilder.append(c);
}
stringBuilder.append(")").append(method.getReturnType());
return stringBuilder.toString();
}
代码示例来源:origin: KB5201314/ZjDroid
private boolean methodSignaturesMatch(@Nonnull Method a, @Nonnull Method b) {
return (a.getName().equals(b.getName()) &&
a.getReturnType().equals(b.getReturnType()) &&
a.getParameters().equals(b.getParameters()));
}
代码示例来源:origin: TACIXAT/CFGScanDroid
public ControlFlowGraph(Method method) {
this(getFlatMethod(method));
String definingClass = method.getDefiningClass();
this.identifier = definingClass + "." + method.getName() + "()" + method.getReturnType();
// this.identifier = definingClass.substring(definingClass.lastIndexOf("/")+1) + method.getName() + "(" + method.getReturnType() + ")";
this.identifier = this.identifier.replace(";", "");
this.shortIdentifier = identifier.substring(definingClass.lastIndexOf("/")+1);
}
代码示例来源:origin: testwhat/SmaliEx
private void listClassVtable(ClassProto classProto) throws IOException {
List<Method> methods = classProto.getVtable();
String className = "Class " + classProto.getType() + " extends " + classProto.getSuperclass() +
" : " + methods.size() + " methods\n";
System.out.write(className.getBytes());
for (int i = 0; i < methods.size(); i++) {
Method method = methods.get(i);
String methodString = i + ":" + method.getDefiningClass() + "->" + method.getName() + "(";
for (CharSequence parameter : method.getParameterTypes()) {
methodString += parameter;
}
methodString += ")" + method.getReturnType() + "\n";
System.out.write(methodString.getBytes());
}
System.out.write("\n".getBytes());
}
代码示例来源:origin: org.smali/baksmali
private void listClassVtable(ClassProto classProto) throws IOException {
List<Method> methods = classProto.getVtable();
String className = "Class " + classProto.getType() + " extends " + classProto.getSuperclass() +
" : " + methods.size() + " methods\n";
System.out.write(className.getBytes());
for (int i = 0; i < methods.size(); i++) {
Method method = methods.get(i);
String methodString = i + ":" + method.getDefiningClass() + "->" + method.getName() + "(";
for (CharSequence parameter : method.getParameterTypes()) {
methodString += parameter;
}
methodString += ")" + method.getReturnType() + "\n";
System.out.write(methodString.getBytes());
}
System.out.write("\n".getBytes());
}
代码示例来源:origin: com.taobao.android/dex_patch
private static List<Method> reDexMethods(@Nonnull ClassDef classDef) {
List<Method> taintedMethods = Lists.newArrayList();
for (Method method : classDef.getMethods()) {
MethodImplementation implementation = method.getImplementation();
MutableMethodImplementation mutableImplementation = new MutableMethodImplementation(implementation);
taintedMethods.add(new ImmutableMethod(
method.getDefiningClass(),
method.getName(),
method.getParameters(),
method.getReturnType(),
method.getAccessFlags(),
method.getAnnotations(),
mutableImplementation));
}
return taintedMethods;
}
代码示例来源:origin: KB5201314/ZjDroid
public static ImmutableMethod of(Method method) {
if (method instanceof ImmutableMethod) {
return (ImmutableMethod)method;
}
return new ImmutableMethod(
method.getDefiningClass(),
method.getName(),
method.getParameters(),
method.getReturnType(),
method.getAccessFlags(),
method.getAnnotations(),
method.getImplementation());
}
代码示例来源:origin: testwhat/SmaliEx
public static ImmutableMethod of(Method method) {
if (method instanceof ImmutableMethod) {
return (ImmutableMethod)method;
}
return new ImmutableMethod(
method.getDefiningClass(),
method.getName(),
method.getParameters(),
method.getReturnType(),
method.getAccessFlags(),
method.getAnnotations(),
method.getImplementation());
}
代码示例来源:origin: org.smali/dexlib2
public static ImmutableMethod of(Method method) {
if (method instanceof ImmutableMethod) {
return (ImmutableMethod)method;
}
return new ImmutableMethod(
method.getDefiningClass(),
method.getName(),
method.getParameters(),
method.getReturnType(),
method.getAccessFlags(),
method.getAnnotations(),
method.getImplementation());
}
内容来源于网络,如有侵权,请联系作者删除!