org.jf.dexlib2.dexbacked.util.FixedSizeSet Java Examples

The following examples show how to use org.jf.dexlib2.dexbacked.util.FixedSizeSet. 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: DexBackedDexFile.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public Set<? extends DexBackedClassDef> getClasses() {
	return new FixedSizeSet<DexBackedClassDef>() {
        @Nonnull
        @Override
        public DexBackedClassDef readItem(int index) {
            return new DexBackedClassDef(DexBackedDexFile.this, getClassDefItemOffset(index));
        }

        @Override
        public int size() {
            return classCount;
        }
    };
}
 
Example #2
Source File: DexBackedClassDef.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public Set<String> getInterfaces() {
    final int interfacesOffset = dexFile.readSmallUint(classDefOffset + ClassDefItem.INTERFACES_OFFSET);
    if (interfacesOffset > 0) {
        final int size = dexFile.readSmallUint(interfacesOffset);
        return new FixedSizeSet<String>() {
            @Nonnull
            @Override
            public String readItem(int index) {
                return dexFile.getType(dexFile.readUshort(interfacesOffset + 4 + (2*index)));
            }

            @Override public int size() { return size; }
        };
    }
    return ImmutableSet.of();
}
 
Example #3
Source File: DexBackedDexFile.java    From zjdroid with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public Set<? extends DexBackedClassDef> getClasses() {
	return new FixedSizeSet<DexBackedClassDef>() {
        @Nonnull
        @Override
        public DexBackedClassDef readItem(int index) {
            return new DexBackedClassDef(DexBackedDexFile.this, getClassDefItemOffset(index));
        }

        @Override
        public int size() {
            return classCount;
        }
    };
}
 
Example #4
Source File: DexBackedClassDef.java    From zjdroid with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public Set<String> getInterfaces() {
    final int interfacesOffset = dexFile.readSmallUint(classDefOffset + ClassDefItem.INTERFACES_OFFSET);
    if (interfacesOffset > 0) {
        final int size = dexFile.readSmallUint(interfacesOffset);
        return new FixedSizeSet<String>() {
            @Nonnull
            @Override
            public String readItem(int index) {
                return dexFile.getType(dexFile.readUshort(interfacesOffset + 4 + (2*index)));
            }

            @Override public int size() { return size; }
        };
    }
    return ImmutableSet.of();
}
 
Example #5
Source File: DexBackedDexFile.java    From HeyGirl with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public Set<? extends DexBackedClassDef> getClasses() {
	return new FixedSizeSet<DexBackedClassDef>() {
        @Nonnull
        @Override
        public DexBackedClassDef readItem(int index) {
            return new DexBackedClassDef(DexBackedDexFile.this, getClassDefItemOffset(index));
        }

        @Override
        public int size() {
            return classCount;
        }
    };
}
 
Example #6
Source File: DexBackedClassDef.java    From HeyGirl with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public Set<String> getInterfaces() {
    final int interfacesOffset = dexFile.readSmallUint(classDefOffset + ClassDefItem.INTERFACES_OFFSET);
    if (interfacesOffset > 0) {
        final int size = dexFile.readSmallUint(interfacesOffset);
        return new FixedSizeSet<String>() {
            @Nonnull
            @Override
            public String readItem(int index) {
                return dexFile.getType(dexFile.readUshort(interfacesOffset + 4 + (2*index)));
            }

            @Override public int size() { return size; }
        };
    }
    return ImmutableSet.of();
}
 
Example #7
Source File: DexBackedDexFile.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public Set<? extends DexBackedClassDef> getClasses() {
	return new FixedSizeSet<DexBackedClassDef>() {
        @Nonnull
        @Override
        public DexBackedClassDef readItem(int index) {
            return new DexBackedClassDef(DexBackedDexFile.this, getClassDefItemOffset(index));
        }

        @Override
        public int size() {
            return classCount;
        }
    };
}
 
Example #8
Source File: DexBackedClassDef.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public Set<String> getInterfaces() {
    final int interfacesOffset = dexFile.readSmallUint(classDefOffset + ClassDefItem.INTERFACES_OFFSET);
    if (interfacesOffset > 0) {
        final int size = dexFile.readSmallUint(interfacesOffset);
        return new FixedSizeSet<String>() {
            @Nonnull
            @Override
            public String readItem(int index) {
                return dexFile.getType(dexFile.readUshort(interfacesOffset + 4 + (2*index)));
            }

            @Override public int size() { return size; }
        };
    }
    return ImmutableSet.of();
}