private MethodHandle getMethodHandle(int i) { methodHandleIdIn.position(i * 8); int method_handle_type = methodHandleIdIn.getShort() & 0xFFFF; methodHandleIdIn.getShort();//unused int field_or_method_id = methodHandleIdIn.getShort() & 0xFFFF; switch (method_handle_type) { case MethodHandle.INSTANCE_GET: case MethodHandle.INSTANCE_PUT: case MethodHandle.STATIC_GET: case MethodHandle.STATIC_PUT: return new MethodHandle(method_handle_type, getField(field_or_method_id)); case MethodHandle.INVOKE_INSTANCE: case MethodHandle.INVOKE_STATIC: case MethodHandle.INVOKE_CONSTRUCTOR: case MethodHandle.INVOKE_DIRECT: case MethodHandle.INVOKE_INTERFACE: return new MethodHandle(method_handle_type, getMethod(field_or_method_id)); default: throw new RuntimeException(); } }
private int acceptField(ByteBuffer in, int lastIndex, DexClassVisitor dcv, Map<Integer, Integer> fieldAnnotationPositions, Object value, int config) { int diff = (int) readULeb128i(in); int field_access_flags = (int) readULeb128i(in); int field_id = lastIndex + diff; Field field = getField(field_id); // ////////////////////////////////////////////////////////////// DexFieldVisitor dfv = dcv.visitField(field_access_flags, field, value); if (dfv != null) { if ((config & SKIP_ANNOTATION) == 0) { Integer annotation_offset = fieldAnnotationPositions.get(field_id); if (annotation_offset != null) { try { read_annotation_set_item(annotation_offset, dfv); } catch (Exception e) { throw new DexException(e, "while accept annotation in field:%s.", field.toString()); } } } dfv.visitEnd(); } // ////////////////////////////////////////////////////////////// return field_id; }
private int acceptField(ByteBuffer in, int lastIndex, DexClassVisitor dcv, Map<Integer, Integer> fieldAnnotationPositions, Object value, int config) { int diff = (int) readULeb128i(in); int field_access_flags = (int) readULeb128i(in); int field_id = lastIndex + diff; Field field = getField(field_id); // ////////////////////////////////////////////////////////////// DexFieldVisitor dfv = dcv.visitField(field_access_flags, field, value); if (dfv != null) { if ((config & SKIP_ANNOTATION) == 0) { Integer annotation_offset = fieldAnnotationPositions.get(field_id); if (annotation_offset != null) { try { read_annotation_set_item(annotation_offset, dfv); } catch (Exception e) { throw new DexException(e, "while accept annotation in field:%s.", field.toString()); } } } dfv.visitEnd(); } // ////////////////////////////////////////////////////////////// return field_id; }