本文整理了Java中org.jf.dexlib2.iface.Field.getType()
方法的一些代码示例,展示了Field.getType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Field.getType()
方法的具体详情如下:
包路径:org.jf.dexlib2.iface.Field
类名称:Field
方法名:getType
[英]Gets the type of this field.
[中]获取此字段的类型。
代码示例来源:origin: CalebFenton/simplify
if ((fieldFlags & Opcodes.ACC_SYNTHETIC) != 0 && (fieldFlags & Opcodes.ACC_PRIVATE) != 0 && (fieldFlags & Opcodes.ACC_STATIC) != 0 && (fieldFlags & Opcodes.ACC_FINAL) != 0 && field.getType().charAt(0) == '[') {
valuesFieldName = field.getName();
break;
代码示例来源:origin: CalebFenton/simplify
private void visitFields(Iterable<? extends Field> fields, ClassWriter classWriter,
int classAccessFlags) {
for (Field field : fields) {
/*
* It's possible to declare a Smali interface with private fields. Android doesn't seem to mind, but
* the Java class loader will complain. To get around this, just set them public, which is what they
* should be anyway.
*/
int fieldAccessFlags = field.getAccessFlags();
if ((classAccessFlags & Opcodes.ACC_INTERFACE) != 0) {
if ((fieldAccessFlags & Opcodes.ACC_PRIVATE) != 0) {
fieldAccessFlags &= ~Opcodes.ACC_PRIVATE;
fieldAccessFlags |= Opcodes.ACC_PUBLIC;
}
}
String name = field.getName();
String desc = field.getType();
String signature = null;
Object value = null;
classWriter.visitField(fieldAccessFlags, name, desc, signature, value);
}
}
代码示例来源:origin: Sable/soot
/**
*
* @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 = Scene.v().makeSootField(name, type, flags);
DexField.addConstantTag(sf, f);
return sf;
}
}
代码示例来源:origin: Sable/soot
/**
* Loads a single field from a dex file
*
* @param declaringClass
* The class that declares the method to load
* @param annotations
* The worker object for handling annotations
* @param field
* The field to load
*/
protected void loadField(SootClass declaringClass, DexAnnotation annotations, Field sf) {
if (declaringClass.declaresField(sf.getName(), DexType.toSoot(sf.getType()))) {
return;
}
SootField sootField = DexField.makeSootField(sf);
sootField = declaringClass.getOrAddField(sootField);
annotations.handleFieldAnnotation(sootField, sf);
}
代码示例来源:origin: Tencent/tinker
field.getDefiningClass(),
field.getName(),
field.getType(),
field.getAccessFlags(),
field.getInitialValue(),
代码示例来源:origin: testwhat/SmaliEx
static int getTypeAsPrimitiveType(Field field) {
return getPrimitiveType(field.getType().charAt(0));
}
代码示例来源:origin: testwhat/SmaliEx
@Override
public EncodedValue apply(Field input) {
EncodedValue initialValue = input.getInitialValue();
if (initialValue == null) {
return ImmutableEncodedValueFactory.defaultValueForType(input.getType());
}
return initialValue;
}
};
代码示例来源:origin: org.smali/dexlib2
@Override
public EncodedValue apply(Field input) {
EncodedValue initialValue = input.getInitialValue();
if (initialValue == null) {
return ImmutableEncodedValueFactory.defaultValueForType(input.getType());
}
return initialValue;
}
};
代码示例来源:origin: com.taobao.android/dex_patch
@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()));
}
代码示例来源:origin: KB5201314/ZjDroid
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());
}
代码示例来源:origin: testwhat/SmaliEx
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());
}
代码示例来源:origin: org.smali/dexlib2
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());
}
代码示例来源:origin: wala/WALA
public DexIField(Field encodedField, DexIClass klass) {
//public DexIField(EncodedField encodedField) {
eField = encodedField;
myClass = klass;
String fieldName = eField.getName();
name = Atom.findOrCreateUnicodeAtom(fieldName);
String fieldType = eField.getType();
TypeName T = DexUtil.getTypeName(fieldType);
TypeReference type = TypeReference.findOrCreate(myClass.getClassLoader().getReference(), T);
myFieldRef = FieldReference.findOrCreate(myClass.getReference(), name, type);
}
代码示例来源:origin: com.ibm.wala/com.ibm.wala.dalvik
public DexIField(Field encodedField, DexIClass klass) {
//public DexIField(EncodedField encodedField) {
eField = encodedField;
myClass = klass;
String fieldName = eField.getName();
name = Atom.findOrCreateUnicodeAtom(fieldName);
String fieldType = eField.getType();
TypeName T = DexUtil.getTypeName(fieldType);
TypeReference type = TypeReference.findOrCreate(myClass.getClassLoader().getReference(), T);
myFieldRef = FieldReference.findOrCreate(myClass.getReference(), name, type);
}
代码示例来源:origin: com.tencent.tinker/tinker-patch-lib
field.getDefiningClass(),
field.getName(),
field.getType(),
field.getAccessFlags(),
field.getInitialValue(),
代码示例来源:origin: KB5201314/ZjDroid
writer.write(field.getName());
writer.write(':');
writer.write(field.getType());
if (initialValue != null) {
writer.write(" = ");
代码示例来源:origin: testwhat/SmaliEx
writer.write(field.getName());
writer.write(':');
writer.write(field.getType());
if (initialValue != null) {
writer.write(" = ");
代码示例来源:origin: org.smali/baksmali
writer.write(field.getName());
writer.write(':');
writer.write(field.getType());
if (initialValue != null) {
writer.write(" = ");
代码示例来源:origin: com.taobao.android/dex_patch
writer.write(field.getName());
writer.write(':');
String clazz = TypeGenUtil.newType(field.getType());
writer.write(clazz);
if (initialValue != null) {
内容来源于网络,如有侵权,请联系作者删除!