Package org.jf.dexlib2.writer.pool
Class DexPool
- java.lang.Object
-
- org.jf.dexlib2.writer.DexWriter<java.lang.CharSequence,StringReference,java.lang.CharSequence,TypeReference,MethodProtoReference,FieldReference,MethodReference,org.jf.dexlib2.writer.pool.PoolClassDef,CallSiteReference,MethodHandleReference,Annotation,java.util.Set<? extends Annotation>,TypeListPool.Key<? extends java.util.Collection<? extends java.lang.CharSequence>>,Field,org.jf.dexlib2.writer.pool.PoolMethod,ArrayEncodedValue,EncodedValue,AnnotationElement,StringPool,TypePool,ProtoPool,FieldPool,MethodPool,ClassPool,CallSitePool,MethodHandlePool,TypeListPool,AnnotationPool,AnnotationSetPool,EncodedArrayPool>
-
- org.jf.dexlib2.writer.pool.DexPool
-
public class DexPool extends DexWriter<java.lang.CharSequence,StringReference,java.lang.CharSequence,TypeReference,MethodProtoReference,FieldReference,MethodReference,org.jf.dexlib2.writer.pool.PoolClassDef,CallSiteReference,MethodHandleReference,Annotation,java.util.Set<? extends Annotation>,TypeListPool.Key<? extends java.util.Collection<? extends java.lang.CharSequence>>,Field,org.jf.dexlib2.writer.pool.PoolMethod,ArrayEncodedValue,EncodedValue,AnnotationElement,StringPool,TypePool,ProtoPool,FieldPool,MethodPool,ClassPool,CallSitePool,MethodHandlePool,TypeListPool,AnnotationPool,AnnotationSetPool,EncodedArrayPool>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
DexPool.DexPoolSectionProvider
-
Nested classes/interfaces inherited from class org.jf.dexlib2.writer.DexWriter
DexWriter.InternalEncodedValueWriter, DexWriter.SectionProvider
-
-
Field Summary
-
Fields inherited from class org.jf.dexlib2.writer.DexWriter
annotationDirectorySectionOffset, annotationSection, annotationSectionOffset, annotationSetRefSectionOffset, annotationSetSection, annotationSetSectionOffset, callSiteSection, callSiteSectionOffset, classDataSectionOffset, classIndexSectionOffset, classSection, codeSectionOffset, debugSectionOffset, encodedArraySection, encodedArraySectionOffset, fieldSection, fieldSectionOffset, hasHiddenApiRestrictions, hiddenApiRestrictionsOffset, mapSectionOffset, MAX_POOL_SIZE, methodHandleSection, methodHandleSectionOffset, methodSection, methodSectionOffset, NO_INDEX, NO_OFFSET, numAnnotationDirectoryItems, numAnnotationSetRefItems, numClassDataItems, numCodeItemItems, numDebugInfoItems, opcodes, protoSection, protoSectionOffset, stringDataSectionOffset, stringIndexSectionOffset, stringSection, typeListSection, typeListSectionOffset, typeSection, typeSectionOffset
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DexWriter.SectionProvider
getSectionProvider()
void
internClass(ClassDef classDef)
Interns a class into this DexPoolvoid
mark()
Creates a marked state that can be returned to by calling reset() This is useful to rollback the last added class if it causes a method/field/type overflowvoid
reset()
Resets to the last marked state This is useful to rollback the last added class if it causes a method/field/type overflowprotected void
writeEncodedValue(DexWriter.InternalEncodedValueWriter writer, EncodedValue encodedValue)
static void
writeTo(java.lang.String path, DexFile input)
static void
writeTo(DexDataStore dataStore, DexFile input)
-
Methods inherited from class org.jf.dexlib2.writer.DexWriter
getFieldReferences, getMethodReferences, getTypeReferences, hasOverflowed, hasOverflowed, writeTo, writeTo
-
-
-
-
Constructor Detail
-
DexPool
public DexPool(Opcodes opcodes)
-
-
Method Detail
-
getSectionProvider
@Nonnull protected DexWriter.SectionProvider getSectionProvider()
- Specified by:
getSectionProvider
in classDexWriter<java.lang.CharSequence,StringReference,java.lang.CharSequence,TypeReference,MethodProtoReference,FieldReference,MethodReference,org.jf.dexlib2.writer.pool.PoolClassDef,CallSiteReference,MethodHandleReference,Annotation,java.util.Set<? extends Annotation>,TypeListPool.Key<? extends java.util.Collection<? extends java.lang.CharSequence>>,Field,org.jf.dexlib2.writer.pool.PoolMethod,ArrayEncodedValue,EncodedValue,AnnotationElement,StringPool,TypePool,ProtoPool,FieldPool,MethodPool,ClassPool,CallSitePool,MethodHandlePool,TypeListPool,AnnotationPool,AnnotationSetPool,EncodedArrayPool>
-
writeTo
public static void writeTo(@Nonnull DexDataStore dataStore, @Nonnull DexFile input) throws java.io.IOException
- Throws:
java.io.IOException
-
writeTo
public static void writeTo(@Nonnull java.lang.String path, @Nonnull DexFile input) throws java.io.IOException
- Throws:
java.io.IOException
-
internClass
public void internClass(ClassDef classDef)
Interns a class into this DexPool- Parameters:
classDef
- The class to intern
-
mark
public void mark()
Creates a marked state that can be returned to by calling reset() This is useful to rollback the last added class if it causes a method/field/type overflow
-
reset
public void reset()
Resets to the last marked state This is useful to rollback the last added class if it causes a method/field/type overflow
-
writeEncodedValue
protected void writeEncodedValue(@Nonnull DexWriter.InternalEncodedValueWriter writer, @Nonnull EncodedValue encodedValue) throws java.io.IOException
- Specified by:
writeEncodedValue
in classDexWriter<java.lang.CharSequence,StringReference,java.lang.CharSequence,TypeReference,MethodProtoReference,FieldReference,MethodReference,org.jf.dexlib2.writer.pool.PoolClassDef,CallSiteReference,MethodHandleReference,Annotation,java.util.Set<? extends Annotation>,TypeListPool.Key<? extends java.util.Collection<? extends java.lang.CharSequence>>,Field,org.jf.dexlib2.writer.pool.PoolMethod,ArrayEncodedValue,EncodedValue,AnnotationElement,StringPool,TypePool,ProtoPool,FieldPool,MethodPool,ClassPool,CallSitePool,MethodHandlePool,TypeListPool,AnnotationPool,AnnotationSetPool,EncodedArrayPool>
- Throws:
java.io.IOException
-
-