本文整理汇总了Java中org.jf.dexlib2.util.TypeUtils.isWideType方法的典型用法代码示例。如果您正苦于以下问题:Java TypeUtils.isWideType方法的具体用法?Java TypeUtils.isWideType怎么用?Java TypeUtils.isWideType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jf.dexlib2.util.TypeUtils
的用法示例。
在下文中一共展示了TypeUtils.isWideType方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeParameters
import org.jf.dexlib2.util.TypeUtils; //导入方法依赖的package包/类
private static void writeParameters(IndentingWriter writer, Method method,
List<? extends MethodParameter> parameters,
baksmaliOptions options) throws IOException {
boolean isStatic = AccessFlags.STATIC.isSet(method.getAccessFlags());
int registerNumber = isStatic ? 0 : 1;
for (MethodParameter parameter : parameters) {
String parameterType = parameter.getType();
String parameterName = parameter.getName();
Collection<? extends Annotation> annotations = parameter.getAnnotations();
if (parameterName != null || annotations.size() != 0) {
writer.write(".param p");
writer.printSignedIntAsDec(registerNumber);
if (parameterName != null && options.outputDebugInfo) {
writer.write(", ");
ReferenceFormatter.writeStringReference(writer, parameterName);
}
writer.write(" # ");
writer.write(parameterType);
writer.write("\n");
if (annotations.size() > 0) {
writer.indent(4);
String containingClass = null;
if (options.useImplicitReferences) {
containingClass = method.getDefiningClass();
}
AnnotationFormatter.writeTo(writer, annotations, containingClass);
writer.deindent(4);
writer.write(".end param\n");
}
}
registerNumber++;
if (TypeUtils.isWideType(parameterType)) {
registerNumber++;
}
}
}
示例2: propagateParameterTypes
import org.jf.dexlib2.util.TypeUtils; //导入方法依赖的package包/类
private void propagateParameterTypes(int parameterStartRegister) {
int i=0;
for (MethodParameter parameter: method.getParameters()) {
if (TypeUtils.isWideType(parameter)) {
setPostRegisterTypeAndPropagateChanges(startOfMethod, parameterStartRegister + i++,
RegisterType.getWideRegisterType(parameter, true));
setPostRegisterTypeAndPropagateChanges(startOfMethod, parameterStartRegister + i++,
RegisterType.getWideRegisterType(parameter, false));
} else {
setPostRegisterTypeAndPropagateChanges(startOfMethod, parameterStartRegister + i++,
RegisterType.getRegisterType(classPath, parameter));
}
}
}
示例3: writeParameters
import org.jf.dexlib2.util.TypeUtils; //导入方法依赖的package包/类
private static void writeParameters(IndentingWriter writer, Method method,
List<? extends MethodParameter> parameters,
baksmaliOptions options) throws IOException {
boolean isStatic = AccessFlags.STATIC.isSet(method.getAccessFlags());
int registerNumber = isStatic?0:1;
for (MethodParameter parameter: parameters) {
String parameterType = parameter.getType();
String parameterName = parameter.getName();
Collection<? extends Annotation> annotations = parameter.getAnnotations();
if (parameterName != null || annotations.size() != 0) {
writer.write(".param p");
writer.printSignedIntAsDec(registerNumber);
if (parameterName != null && options.outputDebugInfo) {
writer.write(", ");
ReferenceFormatter.writeStringReference(writer, parameterName);
}
writer.write(" # ");
writer.write(parameterType);
writer.write("\n");
if (annotations.size() > 0) {
writer.indent(4);
AnnotationFormatter.writeTo(writer, annotations);
writer.deindent(4);
writer.write(".end param\n");
}
}
registerNumber++;
if (TypeUtils.isWideType(parameterType)) {
registerNumber++;
}
}
}
示例4: onSimpleEdit
import org.jf.dexlib2.util.TypeUtils; //导入方法依赖的package包/类
@Override
protected Method onSimpleEdit(Method patch, PatcherAnnotation annotation, Method target, boolean inPlace) {
if (!inPlace && NATIVE.isSet(patch.getAccessFlags() & target.getAccessFlags())) {
log(ERROR, "cannot rename native method");
}
MethodImplementation implementation = target.getImplementation();
if (isTaggedByLastParameter(patch, false)) {
List<? extends MethodParameter> parameters = patch.getParameters();
MethodParameter lastParameter = parameters.get(parameters.size() - 1);
int tagRegisterCount = (TypeUtils.isWideType(lastParameter) ? 2 : 1);
implementation = new BasicMethodImplementation(
implementation.getRegisterCount() + tagRegisterCount,
implementation.getInstructions(),
implementation.getTryBlocks(),
implementation.getDebugItems());
}
Method patched = new BasicMethod(
patch.getDefiningClass(),
patch.getName(),
patch.getParameters(),
patch.getReturnType(),
patch.getAccessFlags(),
annotation.getFilteredAnnotations(),
implementation);
return super.onSimpleEdit(patched, annotation, target, inPlace);
}
示例5: propagateParameterTypes
import org.jf.dexlib2.util.TypeUtils; //导入方法依赖的package包/类
private void propagateParameterTypes(int parameterStartRegister) {
int i = 0;
for (MethodParameter parameter : method.getParameters()) {
if (TypeUtils.isWideType(parameter)) {
setPostRegisterTypeAndPropagateChanges(startOfMethod, parameterStartRegister + i++,
RegisterType.getWideRegisterType(parameter, true));
setPostRegisterTypeAndPropagateChanges(startOfMethod, parameterStartRegister + i++,
RegisterType.getWideRegisterType(parameter, false));
} else {
setPostRegisterTypeAndPropagateChanges(startOfMethod, parameterStartRegister + i++,
RegisterType.getRegisterType(classPath, parameter));
}
}
}
示例6: writeParameters
import org.jf.dexlib2.util.TypeUtils; //导入方法依赖的package包/类
private static void writeParameters(IndentingWriter writer, Method method,
List<? extends MethodParameter> parameters,
baksmaliOptions options) throws IOException {
boolean isStatic = AccessFlags.STATIC.isSet(method.getAccessFlags());
int registerNumber = isStatic?0:1;
for (MethodParameter parameter: parameters) {
String parameterType = parameter.getType();
String parameterName = parameter.getName();
Collection<? extends Annotation> annotations = parameter.getAnnotations();
if (parameterName != null || annotations.size() != 0) {
writer.write(".param p");
writer.printSignedIntAsDec(registerNumber);
if (parameterName != null && options.outputDebugInfo) {
writer.write(", ");
ReferenceFormatter.writeStringReference(writer, parameterName);
}
writer.write(" # ");
writer.write(parameterType);
writer.write("\n");
if (annotations.size() > 0) {
writer.indent(4);
String containingClass = null;
if (options.useImplicitReferences) {
containingClass = method.getDefiningClass();
}
AnnotationFormatter.writeTo(writer, annotations, containingClass);
writer.deindent(4);
writer.write(".end param\n");
}
}
registerNumber++;
if (TypeUtils.isWideType(parameterType)) {
registerNumber++;
}
}
}
示例7: writeTo
import org.jf.dexlib2.util.TypeUtils; //导入方法依赖的package包/类
public void writeTo(IndentingWriter writer) throws IOException {
int parameterRegisterCount = 0;
if (!AccessFlags.STATIC.isSet(method.getAccessFlags())) {
parameterRegisterCount++;
}
writer.write(".method ");
writeAccessFlags(writer, method.getAccessFlags());
writer.write(method.getName());
writer.write("(");
for (MethodParameter parameter: methodParameters) {
String type = parameter.getType();
writer.write(type);
parameterRegisterCount++;
if (TypeUtils.isWideType(type)) {
parameterRegisterCount++;
}
}
writer.write(")");
writer.write(method.getReturnType());
writer.write('\n');
writer.indent(4);
if (classDef.options.useLocalsDirective) {
writer.write(".locals ");
writer.printSignedIntAsDec(methodImpl.getRegisterCount() - parameterRegisterCount);
} else {
writer.write(".registers ");
writer.printSignedIntAsDec(methodImpl.getRegisterCount());
}
writer.write('\n');
writeParameters(writer, method, methodParameters, classDef.options);
if (registerFormatter == null) {
registerFormatter = new RegisterFormatter(classDef.options, methodImpl.getRegisterCount(),
parameterRegisterCount);
}
AnnotationFormatter.writeTo(writer, method.getAnnotations());
writer.write('\n');
List<MethodItem> methodItems = getMethodItems();
for (MethodItem methodItem: methodItems) {
if (methodItem.writeTo(writer)) {
writer.write('\n');
}
}
writer.deindent(4);
writer.write(".end method\n");
}
示例8: writeTo
import org.jf.dexlib2.util.TypeUtils; //导入方法依赖的package包/类
public void writeTo(IndentingWriter writer) throws IOException {
int parameterRegisterCount = 0;
if (!AccessFlags.STATIC.isSet(method.getAccessFlags())) {
parameterRegisterCount++;
}
writer.write(".method ");
writeAccessFlags(writer, method.getAccessFlags());
writer.write(method.getName());
writer.write("(");
for (MethodParameter parameter: methodParameters) {
String type = parameter.getType();
writer.write(type);
parameterRegisterCount++;
if (TypeUtils.isWideType(type)) {
parameterRegisterCount++;
}
}
writer.write(")");
writer.write(method.getReturnType());
writer.write('\n');
writer.indent(4);
if (classDef.options.useLocalsDirective) {
writer.write(".locals ");
writer.printSignedIntAsDec(methodImpl.getRegisterCount() - parameterRegisterCount);
} else {
writer.write(".registers ");
writer.printSignedIntAsDec(methodImpl.getRegisterCount());
}
writer.write('\n');
writeParameters(writer, method, methodParameters, classDef.options);
if (registerFormatter == null) {
registerFormatter = new RegisterFormatter(classDef.options, methodImpl.getRegisterCount(),
parameterRegisterCount);
}
String containingClass = null;
if (classDef.options.useImplicitReferences) {
containingClass = method.getDefiningClass();
}
AnnotationFormatter.writeTo(writer, method.getAnnotations(), containingClass);
writer.write('\n');
List<MethodItem> methodItems = getMethodItems();
for (MethodItem methodItem: methodItems) {
if (methodItem.writeTo(writer)) {
writer.write('\n');
}
}
writer.deindent(4);
writer.write(".end method\n");
}