mirror of
https://github.com/revanced/smali.git
synced 2025-05-08 10:24:31 +02:00
Sort the individual name/value pairs in an annotation by name
git-svn-id: https://smali.googlecode.com/svn/trunk@61 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
parent
9b649b5efc
commit
c7a1ff2452
@ -30,7 +30,8 @@ package org.JesusFreke.dexlib.EncodedValue;
|
||||
|
||||
import org.JesusFreke.dexlib.*;
|
||||
|
||||
public class AnnotationElement extends CompositeField<AnnotationElement> {
|
||||
public class AnnotationElement extends CompositeField<AnnotationElement>
|
||||
implements Comparable<AnnotationElement> {
|
||||
private final IndexedItemReference<StringIdItem> elementName;
|
||||
private final EncodedValue encodedValue;
|
||||
|
||||
@ -51,4 +52,8 @@ public class AnnotationElement extends CompositeField<AnnotationElement> {
|
||||
this.encodedValue = encodedValue
|
||||
};
|
||||
}
|
||||
|
||||
public int compareTo(AnnotationElement annotationElement) {
|
||||
return elementName.compareTo(annotationElement.elementName);
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,9 @@ import org.JesusFreke.dexlib.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.lang.reflect.Array;
|
||||
|
||||
public class AnnotationEncodedValueSubField extends CompositeField<AnnotationEncodedValueSubField>
|
||||
implements EncodedValueSubField<AnnotationEncodedValueSubField> {
|
||||
@ -71,6 +74,11 @@ public class AnnotationEncodedValueSubField extends CompositeField<AnnotationEnc
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int place(int offset) {
|
||||
Collections.sort(annotationElementList);
|
||||
return super.place(offset);
|
||||
}
|
||||
|
||||
public ValueType getValueType() {
|
||||
return ValueType.VALUE_ANNOTATION;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user