mirror of
https://github.com/revanced/smali.git
synced 2025-05-29 04:10:13 +02:00
Implement toString for Method/Field/Proto references
This commit is contained in:
parent
17054d5c3d
commit
8081311d30
@ -32,6 +32,7 @@
|
|||||||
package org.jf.dexlib2.base.reference;
|
package org.jf.dexlib2.base.reference;
|
||||||
|
|
||||||
import org.jf.dexlib2.iface.reference.FieldReference;
|
import org.jf.dexlib2.iface.reference.FieldReference;
|
||||||
|
import org.jf.dexlib2.util.ReferenceUtil;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
@ -64,4 +65,8 @@ public abstract class BaseFieldReference implements FieldReference {
|
|||||||
if (res != 0) return res;
|
if (res != 0) return res;
|
||||||
return getType().compareTo(o.getType());
|
return getType().compareTo(o.getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override public String toString() {
|
||||||
|
return ReferenceUtil.getFieldDescriptor(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ package org.jf.dexlib2.base.reference;
|
|||||||
|
|
||||||
import com.google.common.collect.Ordering;
|
import com.google.common.collect.Ordering;
|
||||||
import org.jf.dexlib2.iface.reference.MethodProtoReference;
|
import org.jf.dexlib2.iface.reference.MethodProtoReference;
|
||||||
|
import org.jf.dexlib2.util.ReferenceUtil;
|
||||||
import org.jf.util.CharSequenceUtils;
|
import org.jf.util.CharSequenceUtils;
|
||||||
import org.jf.util.CollectionUtils;
|
import org.jf.util.CollectionUtils;
|
||||||
|
|
||||||
@ -63,4 +64,8 @@ public abstract class BaseMethodProtoReference implements MethodProtoReference {
|
|||||||
if (res != 0) return res;
|
if (res != 0) return res;
|
||||||
return CollectionUtils.compareAsIterable(Ordering.usingToString(), getParameterTypes(), o.getParameterTypes());
|
return CollectionUtils.compareAsIterable(Ordering.usingToString(), getParameterTypes(), o.getParameterTypes());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override public String toString() {
|
||||||
|
return ReferenceUtil.getMethodProtoDescriptor(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ package org.jf.dexlib2.base.reference;
|
|||||||
|
|
||||||
import com.google.common.collect.Ordering;
|
import com.google.common.collect.Ordering;
|
||||||
import org.jf.dexlib2.iface.reference.MethodReference;
|
import org.jf.dexlib2.iface.reference.MethodReference;
|
||||||
|
import org.jf.dexlib2.util.ReferenceUtil;
|
||||||
import org.jf.util.CharSequenceUtils;
|
import org.jf.util.CharSequenceUtils;
|
||||||
import org.jf.util.CollectionUtils;
|
import org.jf.util.CollectionUtils;
|
||||||
|
|
||||||
@ -70,4 +71,8 @@ public abstract class BaseMethodReference implements MethodReference {
|
|||||||
if (res != 0) return res;
|
if (res != 0) return res;
|
||||||
return CollectionUtils.compareAsIterable(Ordering.usingToString(), getParameterTypes(), o.getParameterTypes());
|
return CollectionUtils.compareAsIterable(Ordering.usingToString(), getParameterTypes(), o.getParameterTypes());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override public String toString() {
|
||||||
|
return ReferenceUtil.getMethodDescriptor(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,5 +58,5 @@ public abstract class BaseStringReference implements StringReference {
|
|||||||
@Override public int length() { return getString().length(); }
|
@Override public int length() { return getString().length(); }
|
||||||
@Override public char charAt(int index) { return getString().charAt(index); }
|
@Override public char charAt(int index) { return getString().charAt(index); }
|
||||||
@Override public CharSequence subSequence(int start, int end) { return getString().subSequence(start, end); }
|
@Override public CharSequence subSequence(int start, int end) { return getString().subSequence(start, end); }
|
||||||
@Override public String toString() { return getString(); }
|
@Override @Nonnull public String toString() { return getString(); }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user