mirror of
https://github.com/revanced/smali.git
synced 2025-05-29 12:20:11 +02:00
Skip over inter-section blank space when annotating
This commit is contained in:
parent
df443569f2
commit
658dfb0880
@ -259,9 +259,11 @@ public abstract class DexBackedDexFile extends BaseDexBuffer implements DexFile
|
|||||||
AnnotatedBytes annotatedBytes = new AnnotatedBytes(width);
|
AnnotatedBytes annotatedBytes = new AnnotatedBytes(width);
|
||||||
HeaderItem.getAnnotator().annotateSection(annotatedBytes, this, 1);
|
HeaderItem.getAnnotator().annotateSection(annotatedBytes, this, 1);
|
||||||
|
|
||||||
|
annotatedBytes.skipTo(getStringIdItemOffset(0));
|
||||||
annotatedBytes.annotate(0, " ");
|
annotatedBytes.annotate(0, " ");
|
||||||
StringIdItem.getAnnotator().annotateSection(annotatedBytes, this, stringCount);
|
StringIdItem.getAnnotator().annotateSection(annotatedBytes, this, stringCount);
|
||||||
|
|
||||||
|
annotatedBytes.skipTo(getTypeIdItemOffset(0));
|
||||||
annotatedBytes.annotate(0, " ");
|
annotatedBytes.annotate(0, " ");
|
||||||
TypeIdItem.getAnnotator().annotateSection(annotatedBytes, this, typeCount);
|
TypeIdItem.getAnnotator().annotateSection(annotatedBytes, this, typeCount);
|
||||||
|
|
||||||
|
@ -61,6 +61,22 @@ public class AnnotatedBytes {
|
|||||||
this.outputWidth = width;
|
this.outputWidth = width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skips a portion of the binary output. This is equivalent to calling
|
||||||
|
* annotate(offset-cursor, "");
|
||||||
|
*
|
||||||
|
* @param offset The offset to skip to
|
||||||
|
*/
|
||||||
|
public void skipTo(int offset) {
|
||||||
|
if (offset < cursor) {
|
||||||
|
throw new IllegalArgumentException("skipTo can only skip forward");
|
||||||
|
}
|
||||||
|
int delta = offset - cursor;
|
||||||
|
if (delta != 0) {
|
||||||
|
annotate(delta, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an annotation of the given length at the current location.
|
* Add an annotation of the given length at the current location.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user