mirror of
https://github.com/revanced/smali.git
synced 2025-06-13 04:27:38 +02:00
Fixed an issue where the parent references were not being populated when interning an item
git-svn-id: https://smali.googlecode.com/svn/trunk@215 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
@ -109,9 +109,11 @@ public class AnnotationDirectoryItem extends OffsettedItem<AnnotationDirectoryIt
|
|||||||
|
|
||||||
public int place(int index, int offset)
|
public int place(int index, int offset)
|
||||||
{
|
{
|
||||||
Collections.sort(fieldAnnotationList);
|
if (!dexFile.getInplace()) {
|
||||||
Collections.sort(methodAnnotationList);
|
Collections.sort(fieldAnnotationList);
|
||||||
Collections.sort(parameterAnnotationList);
|
Collections.sort(methodAnnotationList);
|
||||||
|
Collections.sort(parameterAnnotationList);
|
||||||
|
}
|
||||||
return super.place(index, offset);
|
return super.place(index, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,6 +342,15 @@ public class ClassDataItem extends OffsettedItem<ClassDataItem> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void copyTo(DexFile dexFile, EncodedMethod copy) {
|
||||||
|
super.copyTo(dexFile, copy);
|
||||||
|
|
||||||
|
CodeItem codeItem = copy.codeItemReferenceField.getReference();
|
||||||
|
if (codeItem != null) {
|
||||||
|
codeItem.setParent(copy.methodReferenceField.getReference());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int getAccessFlags() {
|
public int getAccessFlags() {
|
||||||
return accessFlagsField.getCachedValue();
|
return accessFlagsField.getCachedValue();
|
||||||
}
|
}
|
||||||
|
@ -171,6 +171,20 @@ public class ClassDefItem extends IndexedItem<ClassDefItem> {
|
|||||||
return ((Integer)this.offset).compareTo(o.offset);
|
return ((Integer)this.offset).compareTo(o.offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void copyTo(DexFile dexFile, ClassDefItem copy) {
|
||||||
|
super.copyTo(dexFile, copy);
|
||||||
|
|
||||||
|
AnnotationDirectoryItem annotationDirectoryItem = copy.classAnnotationsReferenceField.getReference();
|
||||||
|
if (annotationDirectoryItem != null) {
|
||||||
|
annotationDirectoryItem.setParent(copy);
|
||||||
|
}
|
||||||
|
|
||||||
|
ClassDataItem classDataItem = copy.classDataReferenceField.getReference();
|
||||||
|
if (classDataItem != null) {
|
||||||
|
classDataItem.setParent(copy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void addField(ClassDataItem.EncodedField encodedField, EncodedValue initialValue) {
|
public void addField(ClassDataItem.EncodedField encodedField, EncodedValue initialValue) {
|
||||||
//fields are added in ClassDefItem instead of ClassDataItem because we need to grab
|
//fields are added in ClassDefItem instead of ClassDataItem because we need to grab
|
||||||
//the static initializers for StaticFieldInitialValues
|
//the static initializers for StaticFieldInitialValues
|
||||||
|
Reference in New Issue
Block a user