Skip to content

2.2.0

Latest

Choose a tag to compare

@topjohnwu topjohnwu released this 25 Sep 06:42

Features

  • Resumable Downloads: Firmware downloads now save to .part files with embedded metadata and bitfield tracking, allowing seamless resumption; added -f/--force to restart from scratch (#29).
  • Automatic PIT Flashing: Removed --repartition; PIT files are now automatically committed whenever available (from archives or --pit), matching Odin4 behavior.
  • Dynamic Partition Validation: Implemented pre-flight capacity checks (opcode 0x6a) and automatic super_used_size detection from raw, sparse, and LZ4 super.img metadata. This allows flashing super partition without repartitioning.
  • Device Diagnostics: Added hardware specification inspection in samloader detect using pre-handshake DVIF and opcode 0x69 TLV dumps (with --json output).
  • Extended Flash Controls:
    • --csc-code <CODE>: Configure persistent device sales code via opcode 0x64.
    • -e, --erase: Perform low-level USERDATA NAND block wiping via opcode 0x64.
    • --redownload: Reboot directly back into Download Mode via opcode 0x67.
  • Legacy .enc2 Support: Added download and MD5-derived AES decryption for older Samsung firmware packages.

Bug Fixes & Reliability

  • USB Connection Stability: Replaced disruptive USB bus resets with clear_halt and a non-blocking IN buffer drain, resolving FAILunknown command errors on Snapdragon UEFI and timeouts on newer tablets (#27, #37).
  • Odin4 Protocol Alignment:
    • Matched official Zero-Length Packet (ZLP) rules: eliminated ZLPs during chunk streaming and limited control ZLPs to legacy devices ("Gadget Serial").
    • Fixed slice transfer state by sending init packets before every sequence and rounding raw slice announcements to 128 KB boundaries.
    • Added uncompressed size reporting for LZ4 transfer announcements.
  • Error Handling: Introduced LokeError to map bootloader negative status codes and prevent silent failures.
  • Manifest Validation: Correctly propagate corrupted archive and manifest errors (download-list.txt, super_used_size.txt) instead of ignoring them (#39).
  • Download Metrics: Fixed EMA speed and ETA calculation spikes when resuming partial downloads.

Architecture & Performance

  • Session & Flashing Pipeline: Split connection lifecycle into OdinConnection (handshake) and OdinSession (protocol), orchestrated via a fluent FlashManager builder.
  • Zero-Copy & Memory Optimizations: Lazily memory-map only partitions selected for flashing and eliminate heap allocations in packet serialization using stack buffers and Cow<[u8]>.
  • Global Progress Reporter: Streamlined CLI callbacks through a process-wide FlashProgress reporter and added real-time MD5 verification progress.
  • Portability & Mocks: Fixed Linux compilation (libc), expanded mock USB device profiles (SM-F968B, GT-I9305), aligned protocol terminology with Odin4/LOKE, and pruned unused dependencies and derives.

Full Changelog: 2.1.0...2.2.0