Package org.jf.baksmali.formatter
Class BaksmaliWriter
java.lang.Object
java.io.Writer
org.jf.dexlib2.formatter.DexFormattedWriter
org.jf.baksmali.formatter.BaksmaliWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
A specialized version of DexFormattedWriter that handles quoting
simple names containing spaces.
-
Field Summary
FieldsFields inherited from class org.jf.dexlib2.formatter.DexFormattedWriter
writer -
Constructor Summary
ConstructorsConstructorDescriptionBaksmaliWriter(Writer writer) BaksmaliWriter(Writer writer, String classContext) Constructs a new BaksmaliWriter -
Method Summary
Modifier and TypeMethodDescriptionvoiddeindent(int indentAmount) voidindent(int indentAmount) protected voidwriteAnnotation(AnnotationEncodedValue annotation) Write the givenAnnotationEncodedValue.voidwriteAnnotationElements(Collection<? extends AnnotationElement> annotationElements) protected voidwriteArray(ArrayEncodedValue array) Write the givenArrayEncodedValue.protected voidwriteBooleanEncodedValue(BooleanEncodedValue encodedValue) voidwriteCallSite(CallSiteReference callSiteReference) Write the givenCallSiteReference.protected voidwriteCharEncodedValue(CharEncodedValue encodedValue) protected voidwriteClass(CharSequence type) protected voidwriteDoubleEncodedValue(DoubleEncodedValue encodedValue) voidwriteEncodedValue(EncodedValue encodedValue) Write the givenEncodedValue.protected voidwriteEnum(EnumEncodedValue encodedValue) voidwriteFieldDescriptor(FieldReference fieldReference) Write the field descriptor for the givenFieldReference.protected voidwriteFloatEncodedValue(FloatEncodedValue encodedValue) protected voidwriteIntegralValue(long value, Character suffix) voidwriteMethodDescriptor(MethodReference methodReference) Write the method descriptor for the givenMethodReference.voidwriteSignedIntAsDec(int value) voidwriteSignedIntOrLongTo(long val) voidwriteSignedLongAsDec(long value) voidwriteSimpleName(CharSequence simpleName) Writes the given simple name.voidwriteSimpleName(CharSequence simpleName, boolean quoted) Writes the given simple name, potentially quoting it if requested.voidwriteUnsignedIntAsDec(int value) voidwriteUnsignedLongAsHex(long value) Methods inherited from class org.jf.dexlib2.formatter.DexFormattedWriter
append, append, append, close, flush, write, write, write, write, write, writeMethodHandle, writeMethodProtoDescriptor, writeQuotedString, writeReference, writeShortFieldDescriptor, writeShortMethodDescriptor, writeTypeMethods inherited from class java.io.Writer
nullWriter
-
Field Details
-
classContext
-
buffer
protected final char[] buffer
-
-
Constructor Details
-
BaksmaliWriter
-
BaksmaliWriter
Constructs a new BaksmaliWriter- Parameters:
writer- TheIndentingWriterto write toclassContext- If provided, the class will be elided from any field/method descriptors whose containing class match this instance's classContext.
-
-
Method Details
-
writeMethodDescriptor
Description copied from class:DexFormattedWriterWrite the method descriptor for the givenMethodReference.- Overrides:
writeMethodDescriptorin classDexFormattedWriter- Throws:
IOException
-
writeFieldDescriptor
Description copied from class:DexFormattedWriterWrite the field descriptor for the givenFieldReference.- Overrides:
writeFieldDescriptorin classDexFormattedWriter- Throws:
IOException
-
writeClass
- Overrides:
writeClassin classDexFormattedWriter- Throws:
IOException
-
writeSimpleName
Description copied from class:DexFormattedWriterWrites the given simple name.- Overrides:
writeSimpleNamein classDexFormattedWriter- Parameters:
simpleName- The simple name to write.- Throws:
IOException
-
writeSimpleName
Writes the given simple name, potentially quoting it if requested.The simple name will be quoted with backticks if quoted is true
A simple name should typically be quoted if it is meant to be human readable, and it contains spaces.
- Parameters:
simpleName- The simple name to write. See: https://source.android.com/devices/tech/dalvik/dex-format#simplename- Throws:
IOException
-
writeEncodedValue
Description copied from class:DexFormattedWriterWrite the givenEncodedValue.- Overrides:
writeEncodedValuein classDexFormattedWriter- Throws:
IOException
-
writeBooleanEncodedValue
- Throws:
IOException
-
writeIntegralValue
- Throws:
IOException
-
writeCharEncodedValue
- Throws:
IOException
-
writeFloatEncodedValue
- Throws:
IOException
-
writeDoubleEncodedValue
- Throws:
IOException
-
writeEnum
- Throws:
IOException
-
writeAnnotation
Write the givenAnnotationEncodedValue.- Overrides:
writeAnnotationin classDexFormattedWriter- Throws:
IOException
-
writeAnnotationElements
public void writeAnnotationElements(@Nonnull Collection<? extends AnnotationElement> annotationElements) throws IOException - Throws:
IOException
-
writeArray
Write the givenArrayEncodedValue.- Overrides:
writeArrayin classDexFormattedWriter- Throws:
IOException
-
writeCallSite
Description copied from class:DexFormattedWriterWrite the givenCallSiteReference.- Overrides:
writeCallSitein classDexFormattedWriter- Throws:
IOException
-
indentingWriter
-
writeUnsignedLongAsHex
- Throws:
IOException
-
writeSignedLongAsDec
- Throws:
IOException
-
writeSignedIntAsDec
- Throws:
IOException
-
writeUnsignedIntAsDec
- Throws:
IOException
-
writeSignedIntOrLongTo
- Throws:
IOException
-
indent
public void indent(int indentAmount) -
deindent
public void deindent(int indentAmount)
-