@Nonnull @Override public Iterable<? extends DexBackedMethod> getMethods() { return Iterables.concat(getDirectMethods(), getVirtualMethods()); }
@Nonnull @Override public Iterable<? extends DexBackedField> getFields() { return Iterables.concat(getStaticFields(), getInstanceFields()); }
@Nonnull @Override public String getDefiningClass() { return classDef.getType(); } @Override public int getAccessFlags() { return accessFlags; }
@Nonnull public Iterable<? extends DexBackedMethod> getDirectMethods(final boolean skipDuplicates) { if (directMethodCount > 0) { DexReader reader = dexFile.readerAt(getDirectMethodsOffset()); final AnnotationsDirectory annotationsDirectory = getAnnotationsDirectory(); final int methodsStartOffset = reader.getOffset();
@Nonnull @Override public Iterable<? extends DexBackedField> getStaticFields() { return getStaticFields(true); }
int interfacesLength = getInterfaces().size(); if (interfacesLength > 0) { AnnotationsDirectory directory = getAnnotationsDirectory(); if (!AnnotationsDirectory.EMPTY.equals(directory)) { size += 4 * 4; //4 uints in annotations_directory_item for (DexBackedField dexBackedField : getFields()) { size += dexBackedField.getSize(); for (DexBackedMethod dexBackedMethod : getMethods()) { size += dexBackedMethod.getSize();
@Nonnull @Override public Iterable<? extends DexBackedMethod> getVirtualMethods() { return getVirtualMethods(true); }
@Nonnull @Override public Iterable<? extends DexBackedMethod> getDirectMethods() { return getDirectMethods(true); }
@Nonnull @Override public Iterable<? extends DexBackedField> getInstanceFields() { return getInstanceFields(true); }
if (DexDiffer.getDalvikClassName(dexBackedClassDef.getType()).equals(outterClassName)) { oldDexBackClassDef = dexBackedClassDef; if (DexDiffer.getDalvikClassName(dexBackedClassDef.getType()).equals(outterClassName)) { newDexBackClassDef = dexBackedClassDef; disassemble(newTemp, newDexBackClassDef); Iterable<? extends DexBackedMethod> oldDexBackedMethods = oldDexBackClassDef.getMethods(); Iterable<? extends DexBackedMethod> newDexBackedMethods = newDexBackClassDef.getMethods(); boolean find = false; for (DexBackedMethod dexBackedMethod : newDexBackedMethods) {
@Nonnull public Iterable<? extends DexBackedMethod> getVirtualMethods(final boolean skipDuplicates) { if (virtualMethodCount > 0) { DexReader reader = dexFile.readerAt(getVirtualMethodsOffset()); final AnnotationsDirectory annotationsDirectory = getAnnotationsDirectory(); final int methodsStartOffset = reader.getOffset();
@Nonnull public Iterable<? extends DexBackedField> getInstanceFields(final boolean skipDuplicates) { if (instanceFieldCount > 0) { DexReader reader = dexFile.readerAt(getInstanceFieldsOffset()); final AnnotationsDirectory annotationsDirectory = getAnnotationsDirectory(); final int fieldsStartOffset = reader.getOffset();
public static void getClassAnnotaionPrepareClasses(DexBackedClassDef classDef, Set<String> prepareclasses,DexDiffInfo dexDiffInfo){ if (classDef.getType().equals(modifyClasses.getType())){ if (classDef.getAnnotations()!= null){ Set<? extends DexBackedAnnotation>annotations = classDef.getAnnotations(); for (DexBackedAnnotation annotation:annotations){ String type = annotation.getType();
@Nonnull @Override public Set<? extends DexBackedAnnotation> getAnnotations() { return getAnnotationsDirectory().getClassAnnotations(); }
@Nonnull @Override public DexBackedClassDef readItem(int index) { return new DexBackedClassDef(DexBackedDexFile.this, getClassDefItemOffset(index)); }
private int getVirtualMethodsOffset() { if (virtualMethodsOffset > 0) { return virtualMethodsOffset; } DexReader reader = dexFile.readerAt(getDirectMethodsOffset()); DexBackedMethod.skipMethods(reader, directMethodCount); virtualMethodsOffset = reader.getOffset(); return virtualMethodsOffset; }
private int getDirectMethodsOffset() { if (directMethodsOffset > 0) { return directMethodsOffset; } DexReader reader = dexFile.readerAt(getInstanceFieldsOffset()); DexBackedField.skipFields(reader, instanceFieldCount); directMethodsOffset = reader.getOffset(); return directMethodsOffset; }
ClassDiffInfo classDiffInfo) throws PatchException { Map<String, DexBackedField> baseFieldMaps = Maps.newHashMap(); for (DexBackedField backedField : baseClassDef.getFields()) { baseFieldMaps.put(ReferenceUtil.getFieldDescriptor(backedField), backedField); for (DexBackedField newField : newClassDef.getFields()) { FieldDiffInfo fieldDiffInfo = new FieldDiffInfo(); fieldDiffInfo.setBackedField(newField);
@Nonnull @Override public Iterable<? extends DexBackedField> getStaticFields() { return getStaticFields(true); }
int interfacesLength = getInterfaces().size(); if (interfacesLength > 0) { AnnotationsDirectory directory = getAnnotationsDirectory(); if (!AnnotationsDirectory.EMPTY.equals(directory)) { size += 4 * 4; //4 uints in annotations_directory_item for (DexBackedField dexBackedField : getFields()) { size += dexBackedField.getSize(); for (DexBackedMethod dexBackedMethod : getMethods()) { size += dexBackedMethod.getSize();