Contents
Documentation for flashing Samsung phones.
Flashing Samsung Phones
Stock OS
Following different guides amongst others Flashing stock firmware onto a Samsung Galaxy S9+ (SM-G965F) on Ubuntu 18.04 using Heimdall.
Downloading Samsung firmware from official servers using samloader.
LineageOS
Following instructions on https://wiki.lineageos.org/devices/jfltexx/install, though, since a Windows machine is required according to the instructions, the instructions on https://wiki.lineageos.org/devices/ks01lte/install (Samsung Galaxy S4, different model) are followed using heimdall to flash partition images.
Prerequisites
Computer with
1. Heimdall
2. basic CLI utilties, i.e. curl, unzip, sha256sum
Stock OS
Additionally, python3 needs to be installed
Obtain factory image
Stock OS
The operating system to be installed is proprietary software from Samsung.
GT-I9505
Install samloader:
Get the latest firmware version:
1 samloader -m GT-I9505 -r DBT checkupdate
Download latest firmware version for specific region, we choose “DBT” for Germany:
A list of Country Specific Code (CSC) can be found here.
1 samloader -m GT-I9505 -r DBT download -v I9505XXUHPK2/I9505YBTHPK1/I9505XXUHPK2/I9505XXUHPK2 -O .
Decrypt firmware files:
1 samloader -m GT-I9505 -r DBT decrypt -v I9505XXUHPK2/I9505YBTHPK1/I9505XXUHPK2/I9505XXUHPK2 -V 4 -i GT-I9505_11_20170109205539_twvsagwmb6_fac.zip.enc4 -o GT-I9505_11_20170109205539_twvsagwmb6_fac.zip
Extract firmware files:
1 unzip "GT-I9505_11_20170109205539_twvsagwmb6_fac.zip" -d GT-I9509
Extract firmware partition files:
1 tar -xf *.tar.md5
LineageOS
GT-I9509
From their download page: https://download.lineageos.org/jfltexx
Download recovery image:
1 curl -LO "https://mirrorbits.lineageos.org/recovery/jfltexx/20221020/lineage-18.1-20221020-recovery-jfltexx.img"
And verify its checksum:
Download LineageOS installation package:
1 curl -LO "https://mirrorbits.lineageos.org/full/jfltexx/20221020/lineage-18.1-20221020-nightly-jfltexx-signed.zip"
And verify its checksum:
Reboot into download mode
GT-I9509
1. Unplug from USB and power off the phone.
2. Hold “Home” and both “Volume Down” and “Power”.
3. Press button that the onscreen instructions correlate to “Continue” and insert USB cable back into the device.
Flash factory image
Stock OS
GT-I9509
Check whether the device can be found:
1 heimdall detect
Dump the PIT file:
1 heimdall print-pit --no-reboot
Reboot into download mode, see section Reboot into download mode.
Flash firmware parition images:
1 heimdall flash \
2 --APNHLOS NON-HLOS.bin \
3 --MDM modem.bin \
4 --SBL1 sbl1.mbn \
5 --SBL2 sbl2.mbn \
6 --SBL3 sbl3.mbn \
7 --ABOOT aboot.mbn \
8 --RPM rpm.mbn \
9 --TZ tz.mbn \
10 --SYSTEM system.img.ext4 \
11 --CACHE cache.img.ext4 \
12 --BOOT boot.img \
13 --RECOVERY recovery.img \
14 --PERSDATA persdata.img.ext4 \
15 --HIDDEN hidden.img.ext4
A blue transfer bar will appear on the device showing the progress of partition images being flashed.
The device reboots into the system.
LineageOS
Check whether the device can be found:
1 heimdall detect
Flash recovery image
1. GT-I9509
- A blue transfer bar will appear on the device showing the progress of the partition image being flashed.
Reboot into recovery
1. GT-I9509
- Unplug the USB cable from the device.
Pull the device’s battery out and put it back in.
Hold “Volume Down” and “Power” buttons for 8~10 seconds until screen turns black & release buttons immediately when it does.
Hold “Volume Up” and both “Home” and “Power” & release “Power” button when phone vibrates, but keep holding the other two buttons.
Flash factory image
1. GT-I9509
- Check whether device can be found: Sideload LineageOS installation package:
If the sideload succeeded the screen output on the phone should read: Script succeeded: result was [1.000000].
Click back arrow in the top left of the screen and then “Reboot system now”.