本文整理了Java中com.googlecode.d2j.Field.<init>()
方法的一些代码示例,展示了Field.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Field.<init>()
方法的具体详情如下:
包路径:com.googlecode.d2j.Field
类名称:Field
方法名:<init>
暂无
代码示例来源:origin: pxb1988/dex2jar
@Override
public void visitEnum(String name, String desc, String value) {
objs.add(new Field(null, value, desc));
}
}
代码示例来源:origin: pxb1988/dex2jar
@Override
public void visitEnum(String name, String desc, String value) {
items.add(new Item(name, new Field(desc, value, desc)));
}
}
代码示例来源:origin: pxb1988/dex2jar
public static Field parseFieldAndUnescape(String owner, String part) throws RuntimeException {
int x = part.indexOf(':');
if (x < 0) {
throw new RuntimeException();
}
return new Field(owner, unEscapeId(part.substring(0, x)), unEscapeId(part.substring(x + 1)));
}
代码示例来源:origin: pxb1988/dex2jar
private Field getField(int id) {
fieldIdIn.position(id * 8);
int owner_idx = 0xFFFF & fieldIdIn.getShort();
int type_idx = 0xFFFF & fieldIdIn.getShort();
int name_idx = fieldIdIn.getInt();
return new Field(getType(owner_idx), getString(name_idx), getType(type_idx));
}
代码示例来源:origin: pxb1988/dex2jar
DexCodeVisitor code = dmv.visitCode();
code.visitRegister(3);
code.visitFieldStmt(Op.IGET, 0, 2, new Field(typeNameDesc, "idx", "I"));
代码示例来源:origin: pxb1988/dex2jar
new Field(typeNameDesc, "thiz", "Ljava/lang/Object;"), null).visitEnd();
dcv.visitField(DexConstants.ACC_PRIVATE | DexConstants.ACC_FINAL, new Field(typeNameDesc, "args", "[Ljava/lang/Object;"), null)
.visitEnd();
dcv.visitField(DexConstants.ACC_PRIVATE | DexConstants.ACC_FINAL, new Field(typeNameDesc, "idx", "I"), null)
.visitEnd();
DexCodeVisitor codeVisitor = mv.visitCode();
codeVisitor.visitRegister(4);
codeVisitor.visitFieldStmt(Op.IPUT_OBJECT, 1, 0, new Field(typeNameDesc, "thiz", "Ljava/lang/Object;"));
codeVisitor.visitFieldStmt(Op.IPUT_OBJECT, 2, 0, new Field(typeNameDesc, "args", "[Ljava/lang/Object;"));
codeVisitor.visitFieldStmt(Op.IPUT, 3, 0, new Field(typeNameDesc, "idx", "I"));
codeVisitor.visitStmt0R(Op.RETURN_VOID);
codeVisitor.visitEnd();
DexCodeVisitor code = mv.visitCode();
code.visitRegister(2);
code.visitFieldStmt(Op.IGET, 0, 1, new Field(typeNameDesc, "args", "[Ljava/lang/Object;"));
code.visitStmt1R(Op.RETURN_OBJECT, 0);
DexCodeVisitor code = mv.visitCode();
code.visitRegister(2);
code.visitFieldStmt(Op.IGET, 0, 1, new Field(typeNameDesc, "thiz", "Ljava/lang/Object;"));
code.visitStmt1R(Op.RETURN_OBJECT, 0);
code.visitEnd();
code.visitFieldStmt(Op.IGET, 0, 3, new Field(typeNameDesc, "thiz", "Ljava/lang/Object;"));
code.visitFieldStmt(Op.IGET, 1, 3, new Field(typeNameDesc, "args", "[Ljava/lang/Object;"));
code.visitFieldStmt(Op.IGET, 2, 3, new Field(typeNameDesc, "idx", "I"));
代码示例来源:origin: pxb1988/dex2jar
@Test
public void test() {
ASMifierFileV fv = new ASMifierFileV(new File("target/asmftest").toPath(), "a.b");
DexClassVisitor cv = fv.visit(ACC_PUBLIC, "La/f;", "Ljava/lang/Object;", null);
DexFieldVisitor f2v = cv.visitField(ACC_PUBLIC, new Field("La/f;", "abc", "I"), null);
f2v.visitEnd();
DexMethodVisitor mv = cv.visitMethod(ACC_PUBLIC | ACC_STATIC, new Method("La/f;", "zz", new String[0], "I"));
DexAnnotationAble pv = mv.visitParameterAnnotation(2);
DexAnnotationVisitor dav = pv.visitAnnotation("Leeeff;", Visibility.BUILD);
dav.visitEnd();
DexCodeVisitor dcv = mv.visitCode();
dcv.visitConstStmt(Op.FILL_ARRAY_DATA, 0, new int[] { 1, 2, 3 });
dcv.visitStmt0R(Op.RETURN_VOID);
dcv.visitEnd();
mv.visitEnd();
cv.visitEnd();
fv.visitEnd();
}
}
代码示例来源:origin: pxb1988/dex2jar
@Test
public static void i63(DexClassVisitor cv) {
DexMethodVisitor mv = cv.visitMethod(ACC_STATIC, new Method("La;", "b", new String[] {}, "V"));
if (mv != null) {
DexCodeVisitor code = mv.visitCode();
if (code != null) {
code.visitRegister(1);
DexLabel L1 = new DexLabel();
DexLabel L2 = new DexLabel();
code.visitLabel(L1);
code.visitFieldStmt(Op.SGET, 0, -1, new Field("La;", "f", "J"));
code.visitLabel(L2);
code.visitStmt0R(Op.RETURN_VOID);
code.visitEnd();
code.visitTryCatch(L1, L2, new DexLabel[] { L2 }, new String[] { "La;" });
}
mv.visitEnd();
}
}
}
代码示例来源:origin: pxb1988/dex2jar
code.visitConstStmt(CONST_STRING, 4, "");
code.visitLabel(L0);
code.visitFieldStmt(IGET, 2, 5, new Field("LJSResponseTest;", "className", "Ljava/lang/String;"));
code.visitJumpStmt(IF_EQZ, 2, -1, L8);
code.visitFieldStmt(IGET, 2, 5, new Field("LJSResponseTest;", "methodName", "Ljava/lang/String;"));
code.visitJumpStmt(IF_NEZ, 2, -1, L10);
code.visitLabel(L8);
code.visitFieldStmt(IGET, 3, 5, new Field("LJSResponseTest;", "className", "Ljava/lang/String;"));
code.visitMethodStmt(INVOKE_VIRTUAL, new int[] { 1, 2, 3 }, new Method("Lorg/json/JSONObject;", "put",
new String[] { "Ljava/lang/String;", "Ljava/lang/Object;" }, "Lorg/json/JSONObject;"));
code.visitFieldStmt(IGET, 3, 5, new Field("LJSResponseTest;", "methodName", "Ljava/lang/String;"));
code.visitMethodStmt(INVOKE_VIRTUAL, new int[] { 1, 2, 3 }, new Method("Lorg/json/JSONObject;", "put",
new String[] { "Ljava/lang/String;", "Ljava/lang/Object;" }, "Lorg/json/JSONObject;"));
code.visitFieldStmt(IGET, 3, 5, new Field("LJSResponseTest;", "result", "I"));
code.visitMethodStmt(INVOKE_VIRTUAL, new int[] { 1, 2, 3 }, new Method("Lorg/json/JSONObject;", "put",
new String[] { "Ljava/lang/String;", "I" }, "Lorg/json/JSONObject;"));
code.visitFieldStmt(IGET, 2, 5, new Field("LJSResponseTest;", "response", "Ljava/lang/Object;"));
code.visitJumpStmt(IF_EQZ, 2, -1, L3);
code.visitFieldStmt(IGET, 3, 5, new Field("LJSResponseTest;", "response", "Ljava/lang/Object;"));
code.visitMethodStmt(INVOKE_VIRTUAL, new int[] { 1, 2, 3 }, new Method("Lorg/json/JSONObject;", "put",
new String[] { "Ljava/lang/String;", "Ljava/lang/Object;" }, "Lorg/json/JSONObject;"));
code.visitJumpStmt(GOTO, -1, -1, L9);
code.visitLabel(L3);
代码示例来源:origin: pxb1988/dex2jar
Field f = new Field("La;", "theField", "S");
DexMethodVisitor mv = cv.visitMethod(ACC_PUBLIC, new Method("La;", "<init>", new String[] {}, "V"));
if (mv != null) {
代码示例来源:origin: pxb1988/dex2jar
code.visitFieldStmt(SGET_OBJECT, v0, -1, new Field("Ljava/lang/System;", "out", "Ljava/io/PrintStream;"));
code.visitLabel(try_start);
code.visitStmt1R(MONITOR_ENTER, v0);
代码示例来源:origin: pxb1988/dex2jar
@Test
public void test3() {
DexFileWriter w = new DexFileWriter();
DexClassVisitor cv = w.visit(0x1, "La/c;", null, new String[]{"Ljava/lang/Comparable;"});
cv.visitSource("c.java");
cv.visitAnnotation("LAnn;", Visibility.SYSTEM).visitEnd();
DexFieldVisitor fv = cv.visitField(ACC_PUBLIC | ACC_STATIC, new Field("La/c;", "a", "I"), 55);
fv.visitAnnotation("LE;", Visibility.RUNTIME).visitEnd();
fv.visitEnd();
DexMethodVisitor mv = cv.visitMethod(ACC_STATIC, new Method("La/c;", "bb", new String[]{"I"}, "V"));
mv.visitAnnotation("Laaa;", Visibility.RUNTIME).visitEnd();
DexAnnotationVisitor dav = mv.visitParameterAnnotation(0).visitAnnotation("Laaa;", Visibility.RUNTIME);
dav.visit("abc", true);
DexAnnotationVisitor dav2 = dav.visitArray("efg");
dav2.visit("", "123");
dav2.visit("", "456");
dav2.visitEnd();
dav.visitEnd();
DexCodeVisitor code = mv.visitCode();
code.visitRegister(2);
code.visitStmt0R(Op.RETURN_VOID);
code.visitEnd();
mv.visitEnd();
cv.visitEnd();
w.visitEnd();
w.toByteArray();
}
代码示例来源:origin: pxb1988/dex2jar
code.visitConstStmt(CONST_STRING, 8, "Could not parse passive host information.\nServer Reply: ");
code.visitFieldStmt(SGET_OBJECT, 5,-1, new Field("Lorg/apache/commons/net/ftp/FTPClient;", "__parms_pat",
"Ljava/util/regex/Pattern;"));
code.visitMethodStmt(INVOKE_VIRTUAL, new int[] { 5, 10 }, new Method("Ljava/util/regex/Pattern;",
"toString", new String[] {}, "Ljava/lang/String;"));
code.visitStmt1R(MOVE_RESULT, 5);
code.visitFieldStmt(IPUT, 5, 9, new Field("Lorg/apache/commons/net/ftp/FTPClient;", "__passiveHost",
"Ljava/lang/String;"));
code.visitConstStmt(CONST, 5, Integer.valueOf(4)); // int: 0x00000004 float:0.000000
code.visitFieldStmt(IPUT, 5, 9, new Field("Lorg/apache/commons/net/ftp/FTPClient;", "__passivePort",
"I"));
code.visitLabel(L1);
代码示例来源:origin: SparkInLee/dexdiff
@Override
public void visitEnum(String name, String desc, String value) {
objs.add(new Field(null, value, desc));
}
}
代码示例来源:origin: SparkInLee/dexdiff
@Override
public void visitEnum(String name, String desc, String value) {
items.add(new Item(name, new Field(desc, value, desc)));
}
}
代码示例来源:origin: SparkInLee/dexdiff
private Field getField(int id) {
fieldIdIn.position(id * 8);
int owner_idx = 0xFFFF & fieldIdIn.getShort();
int type_idx = 0xFFFF & fieldIdIn.getShort();
int name_idx = fieldIdIn.getInt();
return new Field(getType(owner_idx), getString(name_idx), getType(type_idx));
}
代码示例来源:origin: SparkInLee/dexdiff
case VALUE_FIELD:
FieldIdItem field = (FieldIdItem) encodeValue.value;
decodeValue = new Field(field.clazz.descriptor.stringData.string, field.name.stringData.string,
field.type.descriptor.stringData.string);
break;
case VALUE_ENUM:
FieldIdItem encodeField = (FieldIdItem) encodeValue.value;
decodeValue = new Field(encodeField.clazz.descriptor.stringData.string, encodeField.name.stringData.string,
encodeField.type.descriptor.stringData.string);
break;
代码示例来源:origin: SparkInLee/dexdiff
private BaseItem copyBaseItem(BaseItem item) {
BaseItem newItem = null;
if (item instanceof StringIdItem) {
newItem = mFw.cp.uniqString(((StringIdItem) item).stringData.string);
} else if (item instanceof FieldIdItem) {
FieldIdItem fieldIdItem = (FieldIdItem) item;
Field field = new Field(fieldIdItem.clazz.descriptor.stringData.string, fieldIdItem.name.stringData.string,
fieldIdItem.type.descriptor.stringData.string);
newItem = mFw.cp.uniqField(field);
} else if (item instanceof MethodIdItem) {
MethodIdItem methodIdItem = (MethodIdItem) item;
String[] parameters = new String[]{};
if (null != methodIdItem.proto.parameters && null != methodIdItem.proto.parameters.items) {
parameters = new String[methodIdItem.proto.parameters.items.size()];
int index = 0;
for (TypeIdItem typeIdItem : methodIdItem.proto.parameters.items) {
parameters[index++] = typeIdItem.descriptor.stringData.string;
}
}
Method method = new Method(methodIdItem.clazz.descriptor.stringData.string,
methodIdItem.name.stringData.string, parameters,
methodIdItem.proto.ret.descriptor.stringData.string);
newItem = mFw.cp.uniqMethod(method);
} else if (item instanceof TypeIdItem) {
newItem = mFw.cp.uniqType(((TypeIdItem) item).descriptor.stringData.string);
} else {
throw new IllegalArgumentException("type of idxItem in IndexedInsn unsupported.");
}
return newItem;
}
代码示例来源:origin: SparkInLee/dexdiff
private void writeField(DexClassVisitor cw, EncodedField encodedField) {
Field field = new Field(encodedField.field.clazz.descriptor.stringData.string,
encodedField.field.name.stringData.string, encodedField.field.type.descriptor.stringData.string);
Object decodeValue = null;
if (null != encodedField.staticValue) {
decodeValue = decodeValue(encodedField.staticValue);
}
DexFieldVisitor fw = cw.visitField(encodedField.accessFlags, field, decodeValue);
if (null != encodedField.annotationSetItem) {
for (AnnotationItem annotationItem : encodedField.annotationSetItem.annotations) {
EncodedAnnotation annotation = annotationItem.annotation;
DexAnnotationVisitor aw = fw.visitAnnotation(annotation.type.descriptor.stringData.string,
annotationItem.visibility);
writeAnnotation(aw, annotation);
aw.visitEnd();
}
}
fw.visitEnd();
}
内容来源于网络,如有侵权,请联系作者删除!