mirror of
https://github.com/revanced/smali.git
synced 2025-05-28 11:50:12 +02:00
Add padding if needed
git-svn-id: https://smali.googlecode.com/svn/trunk@418 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
parent
4da483a55b
commit
3c48a886bd
@ -50,10 +50,15 @@ public class ArrayDataPseudoInstruction extends Instruction {
|
||||
throw new RuntimeException("There are not a whole number of " + elementWidth + " byte elements");
|
||||
}
|
||||
|
||||
//write out padding, if necessary
|
||||
if (out.getCursor() % 4 != 0) {
|
||||
out.writeShort(0);
|
||||
}
|
||||
|
||||
int elementCount = encodedValues.length / elementWidth;
|
||||
|
||||
out.writeByte(0x00);
|
||||
out.writeShort(0x03);
|
||||
out.writeByte(0x03);
|
||||
out.writeShort(elementWidth);
|
||||
out.writeInt(elementCount);
|
||||
out.write(encodedValues);
|
||||
|
@ -50,6 +50,11 @@ public class PackedSwitchDataPseudoInstruction extends Instruction {
|
||||
"The maximum number of switch elements is 65535");
|
||||
}
|
||||
|
||||
//write out padding, if necessary
|
||||
if (out.getCursor() % 4 != 0) {
|
||||
out.writeShort(0);
|
||||
}
|
||||
|
||||
out.writeByte(0x00);
|
||||
out.writeByte(0x01);
|
||||
out.writeShort(targets.length);
|
||||
|
@ -58,6 +58,11 @@ public class SparseSwitchDataPseudoInstruction extends Instruction {
|
||||
"The maximum number of switch elements is 65535");
|
||||
}
|
||||
|
||||
//write out padding, if necessary
|
||||
if (out.getCursor() % 4 != 0) {
|
||||
out.writeShort(0);
|
||||
}
|
||||
|
||||
out.writeByte(0x00);
|
||||
out.writeByte(0x02);
|
||||
out.writeShort(targets.length);
|
||||
|
Loading…
x
Reference in New Issue
Block a user