SonicHANDY archive file format (v8.x)

SonicHANDY archive file (.shy-arh extension) is a UTF-16 encoded XML file.

Here is the overall file syntax:

    <?xml version="1.0" encoding="UTF-16"?>
    <SonicHANDY>
        <Version>version</Version>
        <Data>data</Data>
        <Hash>hash</Hash>
    </SonicHANDY>

<SonicHANDY> is a root element for the whole file.
version designates a version of program which created the file. Example: 8.7.29
hash is the SHA-256 hash value for the data field.

data field contains actual data:

    ...

    <Data>
        <Phonebook>phonebook</Phonebook>
        <Message>message1</Message>
        <Message>message2</Message>
        <Message>message3</Message>
        ...
    </Data>

    ...

<Phonebook> element

phonebook contains phonebook contacts (name+number) saved automatically when the file was created:

    ...
    
    <Phonebook>
        <Contact>contact1</Contact>
        <Contact>contact2</Contact>
        ...
    </Phonebook>
    
    ...
    ...
    
    <Contact>
        <Name>name</Name>
        <Number>number</Number>
    </Contact>
    
    ...
name is the name for the contact, and number is the number associated with the name. Multiple numbers for a contact are created by means of multiple <Contact> elements with the same name.

<Message> element

<Message> element:

    ...
    
    <Message>
        <Timestamp>timestamp</Timestamp>
        <Type>type</Type>
        <From>from</From>
        <To>to</To>
        <IMSI>imsi</IMSI>
        <Status>status</Status>
        <Body>body</Body>
        <Time>time</Time>
        <TimeOfSave>timeofsave</TimeOfSave>
        <PDU>pdu</PDU>
        <PDUHash>pduhash</PDUHash>
    </Message>
    
    ...
timestamp is a timestamp of the message, eg. when the message was received. For outgoing messages sent from the device this is usually zeroed out. Same as time field, but in different format. Example: 2008-08-01 15:48:20.
type indicates whether message is ingoing or outgoing: in or out.
from field is only for ingoing messages, and indicates a phone number from which this message was sent.
to field is only for outgoing messages, and indicates a phone number to which this message was sent.
imsi indicates imsi of the card used for sending this message.
status indicates status of the message: new or normal.
body contains text of the message.
time is a timestamp of the message, eg. when the message was received. For outgoing messages sent from the device this is usually zeroed out. Same as timestamp field, but in different format:
    ...
    
    <Time>
        <Year>year</Year>
        <Month>month</Month>
        <Day>day</Day>
        <Hour>hour</Hour>
        <Minute>minute</Minute>
        <Second>second</Second>
    </Time>
    
    ...
timeofsave is a timestamp of the moment when the message was saved. Useful when other timestamps are zeroed out, to indicate approximate date/time when the message was sent (for outgoing messages sent from the device):
    ...
    
    <TimeOfSave>
        <Year>year</Year>
        <Month>month</Month>
        <Day>day</Day>
        <Hour>hour</Hour>
        <Minute>minute</Minute>
        <Second>second</Second>
    </TimeOfSave>
    
    ...
pdu contains PDU of the message.
pduhash contains SHA-256 hash for the pdu field of this message.