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

The following examples show how to use org.jf.dexlib2.dexbacked.raw.ProtoIdItem. 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: 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 #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: 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 #4
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 #5
Source File: DexBackedDexFile.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
public int getProtoIdItemOffset(int protoIndex) {
	if(this.type == DexFileDataType.MEMORYTYPE){
		return protoStartOffset + protoIndex*ProtoIdItem.ITEM_SIZE;
	}
    if (protoIndex < 0 || protoIndex >= protoCount) {
        throw new InvalidItemIndex(protoIndex, "Proto index out of bounds: %d", protoIndex);
    }
    return protoStartOffset + protoIndex*ProtoIdItem.ITEM_SIZE;
}
 
Example #6
Source File: DexBackedDexFile.java    From zjdroid with Apache License 2.0 5 votes vote down vote up
public int getProtoIdItemOffset(int protoIndex) {
	if(this.type == DexFileDataType.MEMORYTYPE){
		return protoStartOffset + protoIndex*ProtoIdItem.ITEM_SIZE;
	}
    if (protoIndex < 0 || protoIndex >= protoCount) {
        throw new InvalidItemIndex(protoIndex, "Proto index out of bounds: %d", protoIndex);
    }
    return protoStartOffset + protoIndex*ProtoIdItem.ITEM_SIZE;
}
 
Example #7
Source File: DexBackedDexFile.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
public int getProtoIdItemOffset(int protoIndex) {
	if(this.type == DexFileDataType.MEMORYTYPE){
		return protoStartOffset + protoIndex*ProtoIdItem.ITEM_SIZE;
	}
    if (protoIndex < 0 || protoIndex >= protoCount) {
        throw new InvalidItemIndex(protoIndex, "Proto index out of bounds: %d", protoIndex);
    }
    return protoStartOffset + protoIndex*ProtoIdItem.ITEM_SIZE;
}
 
Example #8
Source File: DexBackedDexFile.java    From HeyGirl with Apache License 2.0 5 votes vote down vote up
public int getProtoIdItemOffset(int protoIndex) {
	if(this.type == DexFileDataType.MEMORYTYPE){
		return protoStartOffset + protoIndex*ProtoIdItem.ITEM_SIZE;
	}
    if (protoIndex < 0 || protoIndex >= protoCount) {
        throw new InvalidItemIndex(protoIndex, "Proto index out of bounds: %d", protoIndex);
    }
    return protoStartOffset + protoIndex*ProtoIdItem.ITEM_SIZE;
}
 
Example #9
Source File: DexBackedMethodReference.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public String getReturnType() {
    int protoIdItemOffset = getProtoIdItemOffset();
    return dexFile.getType(dexFile.readSmallUint(protoIdItemOffset + ProtoIdItem.RETURN_TYPE_OFFSET));
}
 
Example #10
Source File: DexBackedMethod.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
private int getParametersOffset() {
    if (parametersOffset == -1) {
        parametersOffset = dexFile.readSmallUint(getProtoIdItemOffset() + ProtoIdItem.PARAMETERS_OFFSET);
    }
    return parametersOffset;
}
 
Example #11
Source File: DexBackedMethod.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public String getReturnType() {
    return dexFile.getType(dexFile.readSmallUint(getProtoIdItemOffset() + ProtoIdItem.RETURN_TYPE_OFFSET));
}
 
Example #12
Source File: DexBackedMethodReference.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public String getReturnType() {
    int protoIdItemOffset = getProtoIdItemOffset();
    return dexFile.getType(dexFile.readSmallUint(protoIdItemOffset + ProtoIdItem.RETURN_TYPE_OFFSET));
}
 
Example #13
Source File: DexBackedMethod.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
private int getParametersOffset() {
    if (parametersOffset == -1) {
        parametersOffset = dexFile.readSmallUint(getProtoIdItemOffset() + ProtoIdItem.PARAMETERS_OFFSET);
    }
    return parametersOffset;
}
 
Example #14
Source File: DexBackedMethod.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public String getReturnType() {
    return dexFile.getType(dexFile.readSmallUint(getProtoIdItemOffset() + ProtoIdItem.RETURN_TYPE_OFFSET));
}
 
Example #15
Source File: DexBackedMethodReference.java    From zjdroid with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public String getReturnType() {
    int protoIdItemOffset = getProtoIdItemOffset();
    return dexFile.getType(dexFile.readSmallUint(protoIdItemOffset + ProtoIdItem.RETURN_TYPE_OFFSET));
}
 
Example #16
Source File: DexBackedMethod.java    From zjdroid with Apache License 2.0 4 votes vote down vote up
private int getParametersOffset() {
    if (parametersOffset == -1) {
        parametersOffset = dexFile.readSmallUint(getProtoIdItemOffset() + ProtoIdItem.PARAMETERS_OFFSET);
    }
    return parametersOffset;
}
 
Example #17
Source File: DexBackedMethod.java    From zjdroid with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public String getReturnType() {
    return dexFile.getType(dexFile.readSmallUint(getProtoIdItemOffset() + ProtoIdItem.RETURN_TYPE_OFFSET));
}
 
Example #18
Source File: DexBackedMethodReference.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public String getReturnType() {
    int protoIdItemOffset = getProtoIdItemOffset();
    return dexFile.getType(dexFile.readSmallUint(protoIdItemOffset + ProtoIdItem.RETURN_TYPE_OFFSET));
}
 
Example #19
Source File: DexBackedMethod.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
private int getParametersOffset() {
    if (parametersOffset == -1) {
        parametersOffset = dexFile.readSmallUint(getProtoIdItemOffset() + ProtoIdItem.PARAMETERS_OFFSET);
    }
    return parametersOffset;
}
 
Example #20
Source File: DexBackedMethod.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public String getReturnType() {
    return dexFile.getType(dexFile.readSmallUint(getProtoIdItemOffset() + ProtoIdItem.RETURN_TYPE_OFFSET));
}