mirror of
https://github.com/revanced/smali.git
synced 2025-05-29 20:20:12 +02:00
- Fixed an issue when trying to set a null AnnotationDirectoryItem to a ClassDefItem
- Fixed an issue when interning a CodeItem with no debug info - Fixed an issue where the MapItem wasn't getting added to the dex file correctly when creating a dex file from scratch git-svn-id: https://smali.googlecode.com/svn/trunk@213 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
parent
81014659d9
commit
fdef6422d2
@ -209,8 +209,10 @@ public class ClassDefItem extends IndexedItem<ClassDefItem> {
|
||||
|
||||
public void setAnnotations(AnnotationDirectoryItem annotations) {
|
||||
this.classAnnotationsReferenceField.setReference(annotations);
|
||||
if (annotations != null) {
|
||||
annotations.setParent(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void setClassDataItem(ClassDataItem classDataItem) {
|
||||
this.classDataReferenceField.setReference(classDataItem);
|
||||
@ -261,12 +263,14 @@ public class ClassDefItem extends IndexedItem<ClassDefItem> {
|
||||
public int placeSection(int offset) {
|
||||
currentOffset = offset;
|
||||
|
||||
if (section.dexFile.getSortAllItems()) {
|
||||
//presort the list, to guarantee a unique ordering
|
||||
Collections.sort(section.items, new Comparator<ClassDefItem>() {
|
||||
public int compare(ClassDefItem classDefItem, ClassDefItem classDefItem1) {
|
||||
return classDefItem.getClassType().compareTo(classDefItem1.getClassType());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
for (ClassDefItem classDefItem: section.items) {
|
||||
classDefItem.offset = -1;
|
||||
|
@ -152,7 +152,7 @@ public class CodeItem extends OffsettedItem<CodeItem> {
|
||||
triesListField.copyTo(dexFile, copy.triesListField);
|
||||
|
||||
DebugInfoItem copyDebugInfo = copy.getDebugInfo();
|
||||
if (copy != null) {
|
||||
if (copyDebugInfo != null) {
|
||||
copyDebugInfo.setParent(copy);
|
||||
}
|
||||
}
|
||||
|
@ -588,7 +588,7 @@ public class DexFile
|
||||
return new MapItem(dexFile, index);
|
||||
}
|
||||
|
||||
public MapItem intern(DexFile dexFile, MapItem item) {
|
||||
public MapItem intern(MapItem item) {
|
||||
this.items.add(item);
|
||||
return item;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user