Packets

Begin Session

Request:

ValueArgument TypeInformation
0x6432-bit integerPacket type
0x0032-bit integerPacket’s command
dynamic32-bit integerProtocol version (Known: 0x00, 0x03, 0x04 and 0x05)

Response:

ValueArgument TypeInformation
0x6432-bit integerPacket type, would be 0xFF on failure
dynamic32-bit integerThe protocol version, modified

The modified version would be:

  • If the <Protocol Version> is 0, would return 0x20000
  • If the <Protocol Version> is lower than bootloader’s,
    • it would return (<Protocol Version> << 16) | 0x0
  • In other cases it would return:
    • (<Bootloader Protocol Version> << 16) | 0x0

(In a nutshell, 4 would be 0x40000)

Devices that do not support changing the packet size, send zero instead.
Consider it as a worst case scenario - Odin protocol version 1.
If it’s not the case, we can safely change the values:

  • Read/Write timeout for file transfer: 120000 (2 minutes)
  • Packet size for file transfer: 1048576 (1 MiB)
  • File transfer max sequence size: 30 (Packets)

Also, you can send raw LZ4 compressed data to the phone! If it is supported, it would return 0x48000 with the example above. Basically, it is a bitwise-or with 0x8000.

Flash count reset

Request:

ValueArgument TypeInformation
0x6432-bit integerPacket type
0x0132-bit integerPacket’s command

Response:

ValueArgument TypeInformation
0x6432-bit integerPacket type, would be 0xFF on failure
dynamic32-bit integerStatus code

Set Total Bytes

Request:

ValueArgument TypeInformation
0x6432-bit integerPacket type
0x0232-bit integerPacket’s command
dynamic64-bit integerTotal length, in bytes

Response:

ValueArgument TypeInformation
0x6432-bit integerPacket type, would be 0xFF on failure
0x0032-bit integerStatus code. Is always zero.

Set File Part size

Request:

ValueArgument TypeInformation
0x6432-bit integerPacket type
0x0532-bit integerPacket’s command
dynamic32-bit integerFile part size (in bytes)

Response:

ValueArgument TypeInformation
0x6432-bit integerPacket type, would be 0xFF on failure
0x0032-bit integerStatus code. Is always zero.

Erase userdata partition

WARNING! This will do a factory reset.
Request:

ValueArgument TypeInformation
0x6432-bit integerPacket type
0x0732-bit integerPacket’s command

Response:

ValueArgument TypeInformation
0x6432-bit integerPacket type, would be 0xFF on failure
dynamic32-bit integerStatus code of the Erase function

Enable T-Flash

Request:

ValueArgument TypeInformation
0x6432-bit integerPacket type
0x0832-bit integerPacket’s command

Response:

ValueArgument TypeInformation
0x6432-bit integerPacket type, would be 0xFF on failure
0x0032-bit integerStatus code. Is always zero.

Change device’s region code

Request:

ValueArgument TypeInformation
0x6432-bit integerPacket type
0x0932-bit integerPacket’s command
dynamicString, 3 bytesRegion Code

Response:

ValueArgument TypeInformation
0x6432-bit integerPacket type, would be 0xFF on failure
0x0032-bit integerStatus code. Is always zero.

End Session (0x67)

End Session

Request:

ValueArgument TypeInformation
0x6732-bit integerPacket type
0x0032-bit integerPacket’s command

Response:

ValueArgument TypeInformation
0x6732-bit integerPacket type, would be 0xFF on failure
0x0032-bit integerStatus code. Is always zero.

Reboot

Request:

ValueArgument TypeInformation
0x6732-bit integerPacket type
0x0132-bit integerPacket’s command

Response:

ValueArgument TypeInformation
0x6732-bit integerPacket type, would be 0xFF on failure
0x0032-bit integerStatus code. Is always zero.

Reboot into Odin

Reboots and sends you back into download mode.
Request:

ValueArgument TypeInformation
0x6732-bit integerPacket type
0x0232-bit integerPacket’s command

Response:

ValueArgument TypeInformation
0x6732-bit integerPacket type, would be 0xFF on failure
0x0032-bit integerStatus code. Is always zero.

Shutdown

This command doesn’t work on some devices.
Request:

ValueArgument TypeInformation
0x6732-bit integerPacket type
0x0332-bit integerPacket’s command

Response:

ValueArgument TypeInformation
0x6732-bit integerPacket type, would be 0xFF on failure
0x0032-bit integerStatus code. Is always zero.