本文整理了Java中org.jf.dexlib2.iface.Field.getInitialValue()
方法的一些代码示例,展示了Field.getInitialValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Field.getInitialValue()
方法的具体详情如下:
包路径:org.jf.dexlib2.iface.Field
类名称:Field
方法名:getInitialValue
[英]Gets the initial value for this field, if available. Only static field may have an initial value set, but are not required to have an initial value.
[中]获取此字段的初始值(如果可用)。只有静态字段可以设置初始值,但不需要设置初始值。
代码示例来源:origin: Tencent/tinker
field.getType(),
field.getAccessFlags(),
field.getInitialValue(),
field.getAnnotations()
);
代码示例来源:origin: JesusFreke/smali
EncodedValue initialValue = field.getInitialValue();
if (initialValue != null) {
dexPool.internEncodedValue(initialValue);
代码示例来源:origin: Sable/soot
Tag tag = null;
EncodedValue ev = sf.getInitialValue();
代码示例来源:origin: org.smali/dexlib2
@Override
public BuilderEncodedValue apply(BuilderField input) {
BuilderEncodedValue initialValue = input.getInitialValue();
if (initialValue == null) {
return BuilderEncodedValues.defaultValueForType(input.getType());
}
return initialValue;
}
};
代码示例来源:origin: KB5201314/ZjDroid
@Override
public BuilderEncodedValue apply(BuilderField input) {
BuilderEncodedValue initialValue = input.getInitialValue();
if (initialValue == null) {
return BuilderEncodedValues.defaultValueForType(input.getType());
}
return initialValue;
}
};
代码示例来源:origin: testwhat/SmaliEx
@Override
public BuilderEncodedValue apply(BuilderField input) {
BuilderEncodedValue initialValue = input.getInitialValue();
if (initialValue == null) {
return BuilderEncodedValues.defaultValueForType(input.getType());
}
return initialValue;
}
};
代码示例来源:origin: KB5201314/ZjDroid
@Override
public EncodedValue apply(Field input) {
EncodedValue initialValue = input.getInitialValue();
if (initialValue == null) {
return ImmutableEncodedValueFactory.defaultValueForType(input.getType());
}
return initialValue;
}
};
代码示例来源:origin: testwhat/SmaliEx
@Override
public boolean apply(Field input) {
EncodedValue encodedValue = input.getInitialValue();
return encodedValue != null && !EncodedValueUtils.isDefaultValue(encodedValue);
}
};
代码示例来源:origin: org.smali/dexlib2
@Override
public boolean apply(Field input) {
EncodedValue encodedValue = input.getInitialValue();
return encodedValue != null && !EncodedValueUtils.isDefaultValue(encodedValue);
}
};
代码示例来源:origin: testwhat/SmaliEx
@Nullable public EncodedValue getInitialValue() {
return RewriterUtils.rewriteNullable(rewriters.getEncodedValueRewriter(), field.getInitialValue());
}
代码示例来源:origin: org.smali/dexlib2
@Nullable public EncodedValue getInitialValue() {
return RewriterUtils.rewriteNullable(rewriters.getEncodedValueRewriter(), field.getInitialValue());
}
代码示例来源:origin: KB5201314/ZjDroid
@Nullable public EncodedValue getInitialValue() {
return RewriterUtils.rewriteNullable(rewriters.getEncodedValueRewriter(), field.getInitialValue());
}
代码示例来源: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: 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: 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: 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: testwhat/SmaliEx
Assert.assertNotNull(field.getInitialValue());
Assert.assertEquals(ValueType.FIELD, field.getInitialValue().getValueType());
FieldEncodedValue fieldEncodedValue = (FieldEncodedValue)field.getInitialValue();
Assert.assertEquals(classDef.getType(), fieldEncodedValue.getValue().getDefiningClass());
Assert.assertEquals("someField", fieldEncodedValue.getValue().getName());
Assert.assertNotNull(field.getInitialValue());
Assert.assertEquals(ValueType.FIELD, field.getInitialValue().getValueType());
fieldEncodedValue = (FieldEncodedValue)field.getInitialValue();
Assert.assertEquals(classDef.getType(), fieldEncodedValue.getValue().getDefiningClass());
Assert.assertEquals("V", fieldEncodedValue.getValue().getName());
Assert.assertNotNull(field.getInitialValue());
Assert.assertEquals(ValueType.FIELD, field.getInitialValue().getValueType());
fieldEncodedValue = (FieldEncodedValue)field.getInitialValue();
Assert.assertEquals(classDef.getType(), fieldEncodedValue.getValue().getDefiningClass());
Assert.assertEquals("I", fieldEncodedValue.getValue().getName());
代码示例来源: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 void writeTo(IndentingWriter writer, Field field, boolean setInStaticConstructor) throws IOException {
EncodedValue initialValue = field.getInitialValue();
int accessFlags = field.getAccessFlags();
内容来源于网络,如有侵权,请联系作者删除!