Skip to content

v2.7.0: Samsung page, Samsung firmware tools (nothing written to a phone) - #27

Merged
ifoknr merged 6 commits into
masterfrom
feature/samsung-firmware
Oct 19, 2026
Merged

ifoknr merged 6 commits into
masterfrom
feature/samsung-firmware

Conversation

@ifoknr

@ifoknr ifoknr commented Oct 19, 2026

Copy link
Copy Markdown
Owner

A new Samsung page. It works on Samsung firmware files and never talks to a phone in Download mode; flashing stays with Odin. Download mode (PIT, drivers) is stage 2, on its own branch later.

What it does

  • Open AP, BL, CP, CSC and HOME_CSC. They can be the .tar.md5 files, the folder they are in, or the zip a firmware site gives (unpacked next to it first).
  • MD5: each file is checked against its MD5 line. A file that doesn't match is shown as damaged, and nothing is taken from it.
  • About the firmware: model, build (PDA), bootloader binary, build date, Android version and CSC, all read from the file names.
  • Firmware against the phone, read over adb from the phone in Android:
    • model;
    • bootloader binary: an older one is a Block, since the phone would refuse it with SW REV CHECK FAIL;
    • Android version;
    • CSC (region);
    • a note that CSC wipes the phone while HOME_CSC keeps the data;
    • parts that come from different firmware.
  • Extract the selected images with LZ4 undone. Files are streamed, so a 9 GB super never sits in memory. The output is checked against what the LZ4 frame records: header checksum, block checksums, content size and content xxHash32. .part files are removed on failure. An extracted super can be opened in Image Tools.
  • Root with Magisk:
    • builds a small tar with init_boot (or boot) and vbmeta, still LZ4, instead of the whole 8 GB AP;
    • sends it to the phone's Download folder over adb;
    • once Magisk has patched it, fetches magisk_patched-….tar and checks that its boot image carries Magisk.
  • Check a Magisk file and Tar for Odin, which packs any images into a .tar.md5 with its MD5 line.

Tests

  • Core (17 new, 322 in total):
    • xxHash32 against reference vectors;
    • the streaming LZ4 decoder against the existing decoder on lz4-CLI fixtures, plus damaged and cut-short frames;
    • a real Samsung-style AP made with lz4, tar -H ustar and md5sum -t;
    • MD5 failure on a damaged file;
    • an entry over 8 GiB with a base-256 size;
    • build numbers and file names;
    • firmware against the phone: same model, older binary, other model or maker, newer binary, older Android, other CSC;
    • the Magisk tar and the patched-tar check.
  • Checked by hand: GNU tar reads the tars written here, the real lz4 -d accepts the SampleGen frames, and every MD5 line matches.
  • E2E (screenshots.ps1, run against the sample firmware SampleGen now writes, with FakeAdb playing a Galaxy S23 Ultra):
    • all five files MD5-checked;
    • the comparison says the firmware suits the phone;
    • boot images extracted byte for byte;
    • Magisk tar built and sent, and the patched tar fetched and found to carry Magisk.

Generated by Claude Code

ifoknr and others added 5 commits October 19, 2026 20:05
… images out, build the tars Magisk and Odin use

Reads AP, BL, CP, CSC and HOME_CSC (.tar.md5, a folder, or the zip they came in) and checks
each file against its MD5 line. Images are taken out with LZ4 undone, streamed so a 9 GB
super never sits in memory, and checked against what the LZ4 frame records. The firmware is
compared with the phone over adb: model, bootloader binary (an older one is refused, as the
phone would refuse it), Android version and CSC, with a note that CSC wipes the phone.

Root with Magisk builds a small tar of init_boot (or boot) and vbmeta, sends it to the phone,
and fetches and checks magisk_patched-….tar. Tar for Odin packs any images into a .tar.md5.
Nothing talks to a phone in Download mode; flashing stays with Odin.
… the firmware zip

The actions sit under the contents list, so the model and build no longer wrap letter by
letter and sizes are not cut. The file dialog took only three of the five long names, so the
end-to-end test now opens the zip a firmware site gives, which also covers unpacking it.
…; Odin is next

The README says what is new in 2.6 and 2.7, has a section on the Samsung page with its
screenshot, and says Odin (flashing from Download mode) comes next.
@ifoknr ifoknr changed the title Samsung page: Samsung firmware tools (stage 1, nothing written to a phone) v2.7.0: Samsung page, Samsung firmware tools (nothing written to a phone) Oct 19, 2026
@ifoknr
ifoknr marked this pull request as ready for review October 19, 2026 20:27
@ifoknr
ifoknr merged commit ad18676 into master Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant