mirror of
https://github.com/revanced/smali.git
synced 2025-05-03 08:04:28 +02:00
Using tempBuf when writing encoded floats and doubles. Otherwise, output dex file gets corrupted.
This commit is contained in:
parent
fcd1286d41
commit
9393c08e36
@ -238,11 +238,11 @@ public class DexWriter extends OutputStream {
|
|||||||
|
|
||||||
int index = 3;
|
int index = 3;
|
||||||
do {
|
do {
|
||||||
buf[index--] = (byte)((intValue & 0xFF000000) >>> 24);
|
tempBuf[index--] = (byte)((intValue & 0xFF000000) >>> 24);
|
||||||
intValue <<= 8;
|
intValue <<= 8;
|
||||||
} while (intValue != 0);
|
} while (intValue != 0);
|
||||||
writeEncodedValueHeader(valueType, 4-index);
|
writeEncodedValueHeader(valueType, 4-index);
|
||||||
write(buf, index+1, 4-index);
|
write(tempBuf, index+1, 4-index);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeEncodedDouble(int valueType, double value) throws IOException {
|
public void writeEncodedDouble(int valueType, double value) throws IOException {
|
||||||
@ -250,11 +250,11 @@ public class DexWriter extends OutputStream {
|
|||||||
|
|
||||||
int index = 7;
|
int index = 7;
|
||||||
do {
|
do {
|
||||||
buf[index--] = (byte)((longValue & 0xFF00000000000000L) >>> 56);
|
tempBuf[index--] = (byte)((longValue & 0xFF00000000000000L) >>> 56);
|
||||||
longValue <<= 8;
|
longValue <<= 8;
|
||||||
} while (longValue != 0);
|
} while (longValue != 0);
|
||||||
writeEncodedValueHeader(valueType, 7-index);
|
writeEncodedValueHeader(valueType, 7-index);
|
||||||
write(buf, index+1, 7-index);
|
write(tempBuf, index+1, 7-index);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeString(String string) throws IOException {
|
public void writeString(String string) throws IOException {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user