[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] munjeni:
I'm sorry I'm unable to decompress packages, it looks like lzma but I have no idea how to unpack them, even I do not see in pseudo code where it is done. Here is updated tool, source code and log, need to be added decomplation function but I'm now unable to identify some things. Tool curently dumps compressed packages with included packages signature, metadata and sin header. I'm hope somebody help here.

Processing update_package_renamed

============= MAIN HEADER ==============

Unknown_1 = 0x1A4
Unknown_2 = 0x1
Unknown_3 = 0xA
Unknown_4 = 0x10000
Total Packages = 0xC

PACKAGE: 1
-----------
id = 0x0
size = 0xD9494
Unknown_1 = 0x0
Unknown_2 = 0x1A723EF
Unknown_3 = 0x0
Atribute = 0x2
Unknown_4 = 0x0
Unknown_6 = 0x1

PACKAGE: 2
-----------
id = 0x1
size = 0xC5B6A
Unknown_1 = 0x0
Unknown_2 = 0x14233E9
Unknown_3 = 0x0
Atribute = 0x2
Unknown_4 = 0x0
Unknown_6 = 0x1

PACKAGE: 3
-----------
id = 0x2
size = 0xF6
Unknown_1 = 0x0
Unknown_2 = 0x1
Unknown_3 = 0x0
Atribute = 0x6
Unknown_4 = 0x0
Unknown_6 = 0x1

PACKAGE: 4
-----------
id = 0x3
size = 0xFC
Unknown_1 = 0x0
Unknown_2 = 0x400
Unknown_3 = 0x0
Atribute = 0x6
Unknown_4 = 0x0
Unknown_6 = 0x1

PACKAGE: 5
-----------
id = 0x4
size = 0xFC
Unknown_1 = 0x0
Unknown_2 = 0x400
Unknown_3 = 0x0
Atribute = 0x6
Unknown_4 = 0x0
Unknown_6 = 0x1

PACKAGE: 6
-----------
id = 0x5
size = 0x19AE9
Unknown_1 = 0x0
Unknown_2 = 0x36328
Unknown_3 = 0x0
Atribute = 0x6
Unknown_4 = 0x0
Unknown_6 = 0x1

PACKAGE: 7
-----------
id = 0x7
size = 0xAC0ECF
Unknown_1 = 0x0
Unknown_2 = 0x59DD000
Unknown_3 = 0x0
Atribute = 0x2
Unknown_4 = 0x0
Unknown_6 = 0x1

PACKAGE: 8
-----------
id = 0x8
size = 0xF1
Unknown_1 = 0x0
Unknown_2 = 0x1000000
Unknown_3 = 0x0
Atribute = 0x2
Unknown_4 = 0x0
Unknown_6 = 0x1

PACKAGE: 9
-----------
id = 0x9
size = 0x123
Unknown_1 = 0x0
Unknown_2 = 0x5F000
Unknown_3 = 0x0
Atribute = 0x2
Unknown_4 = 0x0
Unknown_6 = 0x1

PACKAGE: 10
-----------
id = 0x10
size = 0x178CCC2F
Unknown_1 = 0x0
Unknown_2 = 0x38800000
Unknown_3 = 0x1
Atribute = 0x2
Unknown_4 = 0x0
Unknown_6 = 0x1

PACKAGE: 11
-----------
id = 0x11
size = 0xC1E7DF
Unknown_1 = 0x0
Unknown_2 = 0x60000000
Unknown_3 = 0x0
Atribute = 0x2
Unknown_4 = 0x0
Unknown_6 = 0x1

PACKAGE: 12
-----------
id = 0x12
size = 0x4B5
Unknown_1 = 0x0
Unknown_2 = 0x19000000
Unknown_3 = 0x0
Atribute = 0x2
Unknown_4 = 0x0
Unknown_6 = 0x1

============= PACKAGES DUMP ==============

package_1.bin (RedBend: Source signature 0xE795BC06)
package_2.bin (RedBend: Source signature 0x37FC907B)
package_3.bin (RedBend: Source signature 0x0)
package_4.bin (RedBend: Source signature 0x0)
package_5.bin (RedBend: Source signature 0x0)
package_6.bin (RedBend: Source signature 0x0)
package_7.bin (RedBend: Source signature 0xE28FB4BE)
package_8.bin (RedBend: Source signature 0x20CA8A49)
package_9.bin (RedBend: Source signature 0xB0E8DB3E)
package_10.bin (RedBend: Source signature 0x22DFC18E)
package_11.bin (RedBend: Source signature 0xF57FC58F)
package_12.bin (RedBend: Source signature 0x5271E4F4)

============= METADATA DUMP ==============

metadata.xml

========== SIN HEADER DUMP ===========

sin_header.sin

This link might be usefull -> https://asawicki.info/news_1368_lzma_sdk_-_how_to_use.html , found this string LzmaDec_DecodeToBuf inside fota-ua which is indication that incremental compression - decompression is used here.