When decompiling an apk using apktool, I found an array of doubles are converted to the code below. How does the apktool do that?
:array_0
.array-data 0x8
0xc7t 0x55t 0x9at 0xf4t 0x6dt 0x5bt 0x44t 0x40t
0xfet 0x6t 0xdat 0x35t 0x7et 0x5bt 0x44t 0x40t
0xd4t 0x57t 0x45t 0xf8t 0x59t 0x5bt 0x44t 0x40t
0xf6t 0xe8t 0xaat 0x3et 0x4et 0x5bt 0x44t 0x40t
0xc7t 0x55t 0x9at 0xf4t 0x6dt 0x5bt 0x44t 0x40t
.end array-data
Built a sample program and decompiled it. The numbers are doubles, one per row. Each double is encoded in IEEE754 format, with the LSB first. My array us defined as:
The resulting baksmali looks like this:
Since the IEEE754 representation of 1 is
0x3ff0000000000000, we can conclude that doubles are stored in little endian IEEE754.If all you want is to convert the numbers in your program, you can use an online converter (in this link with your first double already fed in).
Shachar