本文整理汇总了Java中org.jf.dexlib2.iface.Field.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Field.getName方法的具体用法?Java Field.getName怎么用?Java Field.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jf.dexlib2.iface.Field
的用法示例。
在下文中一共展示了Field.getName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reField
import org.jf.dexlib2.iface.Field; //导入方法依赖的package包/类
@Override
protected Field reField(Field field) {
String name = field.getName();
String newType;
boolean isBasic = false;
boolean isArray = false;
if (field.getType().startsWith("[")) {
isArray = true;
}
if (basicType.containsKey(field.getType())) {
newType = field.getType();
isBasic = true;
} else {
newType = DefineUtils.getDalvikClassName(field.getType());
}
String defineClass = DefineUtils.getDalvikClassName(field.getDefiningClass());
return new ImmutableField(
reType,
classProcessor.filedProcess(defineClass, isBasic ? basicType.get(newType) : newType + (isArray ? "[]" : ""), name).fieldName,
isBasic ? newType :
DefineUtils.getDefineClassName(classProcessor.classProcess(isBasic ? basicType.get(newType) : newType).className, isArray),
field.getAccessFlags(),
field.getInitialValue(),
getAnnotation(field.getAnnotations()));
}
示例2: onSimpleEdit
import org.jf.dexlib2.iface.Field; //导入方法依赖的package包/类
@Override
protected Field onSimpleEdit(Field patch, PatcherAnnotation annotation, Field target, boolean inPlace) {
// Use the static field initializer value in source only
// if not renaming, given that the static constructor in
// source would only initialize it if not renamed.
// This makes behavior predictable across compilers.
EncodedValue value = inPlace ? target.getInitialValue() : null;
value = filterInitialValue(patch, value);
onSimpleRemove(patch, annotation, target);
Field patched = new BasicField(
patch.getDefiningClass(),
patch.getName(),
patch.getType(),
patch.getAccessFlags(),
value,
annotation.getFilteredAnnotations());
return super.onSimpleEdit(patched, annotation, target, inPlace);
}
示例3: getDeclaredFields
import org.jf.dexlib2.iface.Field; //导入方法依赖的package包/类
@Override
public FieldInfo[] getDeclaredFields() {
List<FieldInfo> result = new ArrayList<>();
Iterable<? extends Field> implFields = classDef.getFields();
for (Field field : implFields) {
FieldInfo fi = new FieldInfo();
fi.typeName = DexlibAdapter.getTypeName(field.getType());
fi.modifiers = field.getAccessFlags();
fi.annotations = convertAnnotations(field.getAnnotations());
fi.name = field.getName();
result.add(fi);
}
FieldInfo[] array = new FieldInfo[result.size()];
return result.toArray(array);
}
示例4: of
import org.jf.dexlib2.iface.Field; //导入方法依赖的package包/类
public static ImmutableField of(Field field) {
if (field instanceof ImmutableField) {
return (ImmutableField)field;
}
return new ImmutableField(
field.getDefiningClass(),
field.getName(),
field.getType(),
field.getAccessFlags(),
field.getInitialValue(),
field.getAnnotations());
}
示例5: makeSootField
import org.jf.dexlib2.iface.Field; //导入方法依赖的package包/类
/**
*
* @return the Soot equivalent of a field
*/
public static SootField makeSootField(Field f) {
String name = f.getName();
Type type = DexType.toSoot(f.getType());
int flags = f.getAccessFlags();
SootField sf = new SootField(name, type, flags);
if (Modifier.isFinal(flags))
DexField.addConstantTag(sf, f);
return sf;
}
示例6: onSimpleAdd
import org.jf.dexlib2.iface.Field; //导入方法依赖的package包/类
@Override
protected Field onSimpleAdd(Field patch, PatcherAnnotation annotation) {
EncodedValue value = filterInitialValue(patch, null);
return new BasicField(
patch.getDefiningClass(),
patch.getName(),
patch.getType(),
patch.getAccessFlags(),
value,
annotation.getFilteredAnnotations());
}
示例7: of
import org.jf.dexlib2.iface.Field; //导入方法依赖的package包/类
public static ImmutableField of(Field field) {
if (field instanceof ImmutableField) {
return (ImmutableField) field;
}
return new ImmutableField(
field.getDefiningClass(),
field.getName(),
field.getType(),
field.getAccessFlags(),
field.getInitialValue(),
field.getAnnotations());
}