mirror of
https://github.com/revanced/smali.git
synced 2025-05-29 04:10:13 +02:00
Providing listings of indexed item values in DexBackedDexFile.
This commit is contained in:
parent
7b89cbdf6b
commit
9d07f53741
@ -91,4 +91,84 @@ public class DexBackedDexFile implements DexFile {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set<String> getStrings() {
|
||||||
|
final int stringCount = dexBuf.getStringCount();
|
||||||
|
|
||||||
|
return new FixedSizeSet<String>() {
|
||||||
|
@Override
|
||||||
|
public String readItem(int index) {
|
||||||
|
return dexBuf.getString(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int size() {
|
||||||
|
return stringCount;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<String> getTypes() {
|
||||||
|
final int typeCount = dexBuf.getTypeCount();
|
||||||
|
|
||||||
|
return new FixedSizeSet<String>() {
|
||||||
|
@Override
|
||||||
|
public String readItem(int index) {
|
||||||
|
return dexBuf.getType(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int size() {
|
||||||
|
return typeCount;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<String> getProtos() {
|
||||||
|
final int protoCount = dexBuf.getProtoCount();
|
||||||
|
|
||||||
|
return new FixedSizeSet<String>() {
|
||||||
|
@Override
|
||||||
|
public String readItem(int index) {
|
||||||
|
return dexBuf.getProto(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int size() {
|
||||||
|
return protoCount;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<String> getFields() {
|
||||||
|
final int fieldCount = dexBuf.getFieldCount();
|
||||||
|
|
||||||
|
return new FixedSizeSet<String>() {
|
||||||
|
@Override
|
||||||
|
public String readItem(int index) {
|
||||||
|
return dexBuf.getField(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int size() {
|
||||||
|
return fieldCount;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<String> getMethods() {
|
||||||
|
final int methodCount = dexBuf.getMethodCount();
|
||||||
|
|
||||||
|
return new FixedSizeSet<String>() {
|
||||||
|
@Override
|
||||||
|
public String readItem(int index) {
|
||||||
|
return dexBuf.getMethod(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int size() {
|
||||||
|
return methodCount;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -245,6 +245,10 @@ public class DexBuffer {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getStringCount() {
|
||||||
|
return stringCount;
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public String getOptionalType(int typeIndex) {
|
public String getOptionalType(int typeIndex) {
|
||||||
if (typeIndex == -1) {
|
if (typeIndex == -1) {
|
||||||
@ -268,6 +272,21 @@ public class DexBuffer {
|
|||||||
return getString(stringIndex);
|
return getString(stringIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getTypeCount() {
|
||||||
|
return typeCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
public String getProto(int typeIndex) {
|
||||||
|
int protoOffset = getProtoIdItemOffset(typeIndex);
|
||||||
|
int stringIndex = readSmallUint(protoOffset);
|
||||||
|
return getString(stringIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getProtoCount() {
|
||||||
|
return protoCount;
|
||||||
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public String getField(int fieldIndex) {
|
public String getField(int fieldIndex) {
|
||||||
int fieldOffset = getFieldIdItemOffset(fieldIndex);
|
int fieldOffset = getFieldIdItemOffset(fieldIndex);
|
||||||
@ -285,6 +304,10 @@ public class DexBuffer {
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getFieldCount() {
|
||||||
|
return fieldCount;
|
||||||
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public String getMethod(int methodIndex) {
|
public String getMethod(int methodIndex) {
|
||||||
int methodOffset = getMethodIdItemOffset(methodIndex);
|
int methodOffset = getMethodIdItemOffset(methodIndex);
|
||||||
@ -317,6 +340,10 @@ public class DexBuffer {
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getMethodCount() {
|
||||||
|
return methodCount;
|
||||||
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public String getReference(int referenceType, int referenceIndex) {
|
public String getReference(int referenceType, int referenceIndex) {
|
||||||
switch (referenceType) {
|
switch (referenceType) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user