org.jf.dexlib2.dexbacked.raw.TypeListItem Java Examples

The following examples show how to use org.jf.dexlib2.dexbacked.raw.TypeListItem. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DexBackedMethod.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public List<String> getParameterTypes() {
    final int parametersOffset = getParametersOffset();
    if (parametersOffset > 0) {
        final int parameterCount = dexFile.readSmallUint(parametersOffset + TypeListItem.SIZE_OFFSET);
        final int paramListStart = parametersOffset + TypeListItem.LIST_OFFSET;
        return new FixedSizeList<String>() {
            @Nonnull
            @Override
            public String readItem(final int index) {
                return dexFile.getType(dexFile.readUshort(paramListStart + 2*index));
            }
            @Override public int size() { return parameterCount; }
        };
    }
    return ImmutableList.of();
}
 
Example #2
Source File: DexBackedMethodReference.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public List<String> getParameterTypes() {
    int protoIdItemOffset = getProtoIdItemOffset();
    final int parametersOffset = dexFile.readSmallUint(protoIdItemOffset + ProtoIdItem.PARAMETERS_OFFSET);
    if (parametersOffset > 0) {
        final int parameterCount = dexFile.readSmallUint(parametersOffset + TypeListItem.SIZE_OFFSET);
        final int paramListStart = parametersOffset + TypeListItem.LIST_OFFSET;
        return new FixedSizeList<String>() {
            @Nonnull
            @Override
            public String readItem(final int index) {
                return dexFile.getType(dexFile.readUshort(paramListStart + 2*index));
            }
            @Override public int size() { return parameterCount; }
        };
    }
    return ImmutableList.of();
}
 
Example #3
Source File: DexBackedMethod.java    From zjdroid with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public List<String> getParameterTypes() {
    final int parametersOffset = getParametersOffset();
    if (parametersOffset > 0) {
        final int parameterCount = dexFile.readSmallUint(parametersOffset + TypeListItem.SIZE_OFFSET);
        final int paramListStart = parametersOffset + TypeListItem.LIST_OFFSET;
        return new FixedSizeList<String>() {
            @Nonnull
            @Override
            public String readItem(final int index) {
                return dexFile.getType(dexFile.readUshort(paramListStart + 2*index));
            }
            @Override public int size() { return parameterCount; }
        };
    }
    return ImmutableList.of();
}
 
Example #4
Source File: DexBackedMethodReference.java    From zjdroid with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public List<String> getParameterTypes() {
    int protoIdItemOffset = getProtoIdItemOffset();
    final int parametersOffset = dexFile.readSmallUint(protoIdItemOffset + ProtoIdItem.PARAMETERS_OFFSET);
    if (parametersOffset > 0) {
        final int parameterCount = dexFile.readSmallUint(parametersOffset + TypeListItem.SIZE_OFFSET);
        final int paramListStart = parametersOffset + TypeListItem.LIST_OFFSET;
        return new FixedSizeList<String>() {
            @Nonnull
            @Override
            public String readItem(final int index) {
                return dexFile.getType(dexFile.readUshort(paramListStart + 2*index));
            }
            @Override public int size() { return parameterCount; }
        };
    }
    return ImmutableList.of();
}
 
Example #5
Source File: DexBackedMethod.java    From HeyGirl with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public List<String> getParameterTypes() {
    final int parametersOffset = getParametersOffset();
    if (parametersOffset > 0) {
        final int parameterCount = dexFile.readSmallUint(parametersOffset + TypeListItem.SIZE_OFFSET);
        final int paramListStart = parametersOffset + TypeListItem.LIST_OFFSET;
        return new FixedSizeList<String>() {
            @Nonnull
            @Override
            public String readItem(final int index) {
                return dexFile.getType(dexFile.readUshort(paramListStart + 2*index));
            }
            @Override public int size() { return parameterCount; }
        };
    }
    return ImmutableList.of();
}
 
Example #6
Source File: DexBackedMethodReference.java    From HeyGirl with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public List<String> getParameterTypes() {
    int protoIdItemOffset = getProtoIdItemOffset();
    final int parametersOffset = dexFile.readSmallUint(protoIdItemOffset + ProtoIdItem.PARAMETERS_OFFSET);
    if (parametersOffset > 0) {
        final int parameterCount = dexFile.readSmallUint(parametersOffset + TypeListItem.SIZE_OFFSET);
        final int paramListStart = parametersOffset + TypeListItem.LIST_OFFSET;
        return new FixedSizeList<String>() {
            @Nonnull
            @Override
            public String readItem(final int index) {
                return dexFile.getType(dexFile.readUshort(paramListStart + 2*index));
            }
            @Override public int size() { return parameterCount; }
        };
    }
    return ImmutableList.of();
}
 
Example #7
Source File: DexBackedMethod.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public List<String> getParameterTypes() {
    final int parametersOffset = getParametersOffset();
    if (parametersOffset > 0) {
        final int parameterCount = dexFile.readSmallUint(parametersOffset + TypeListItem.SIZE_OFFSET);
        final int paramListStart = parametersOffset + TypeListItem.LIST_OFFSET;
        return new FixedSizeList<String>() {
            @Nonnull
            @Override
            public String readItem(final int index) {
                return dexFile.getType(dexFile.readUshort(paramListStart + 2*index));
            }
            @Override public int size() { return parameterCount; }
        };
    }
    return ImmutableList.of();
}
 
Example #8
Source File: DexBackedMethodReference.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public List<String> getParameterTypes() {
    int protoIdItemOffset = getProtoIdItemOffset();
    final int parametersOffset = dexFile.readSmallUint(protoIdItemOffset + ProtoIdItem.PARAMETERS_OFFSET);
    if (parametersOffset > 0) {
        final int parameterCount = dexFile.readSmallUint(parametersOffset + TypeListItem.SIZE_OFFSET);
        final int paramListStart = parametersOffset + TypeListItem.LIST_OFFSET;
        return new FixedSizeList<String>() {
            @Nonnull
            @Override
            public String readItem(final int index) {
                return dexFile.getType(dexFile.readUshort(paramListStart + 2*index));
            }
            @Override public int size() { return parameterCount; }
        };
    }
    return ImmutableList.of();
}