Hello,
This would be a short & sweet guide on how to install a custom ROM on your Samsung using ODIN. I'm going to tailored this guide for the S10e G9700 HK version (is the phone I own) I'm a linux user but Odin only runs on Windows so this works 100% on a Windows 10 VM an of course native on Windows.
1. Who is this for?
For people that can't or don't want to install TWRP on their devices. For example TWRP doesn't work with the S10E Snapdragon G9700 the HK/CHG version.
2. Will this method work on my bootloader locked phone?
NO!
Bootloader locked phones are locked in hardware there's no way to flash anything but carriers ROMs to them. If you can unlock the bootloader this guide will work for you.
3. Can I use this only with the G9700 phone?
No you can use any device, but this guide is tailored to the s10e g9700; because the TWRP version for this phone doesnt work with Android10.
4. Why not use Heimdall and do the guide entirely on Linux?
I use Manjaro [Arch] linux and tried to get Heimdall to work but couldn't, so choose the path of least resistance, so ODIN and windows is what we got

.
5. Recommended ROMs?
I'm not a fan of Google Apps so my recommendations are these (2) ROMs:
6. If using a PHH based ROM from phhusoon set this to get Bluetooth Audio working?
Under Developer Options - toggle ON "Disable Bluetooth A2DP hardware offload"
Credit goes to (for their work)
@phhusson @AndyYan (Project Treble PHH & LineageOS PHH) &
@mkh.mourad (CMD Script)
https://forum.xda-developers.com/project-treble/trebleenabled-device-development
Requirements
Step-by-Step Process
- Get your phone Official Stock ROM - https://samfw.com/firmware/SM-G9700/TGY (this is the one for my phone)
- Extract the downloaded file (you'll have the BL, AP, CP, CSC) .TAR.MD5 files
- Using 7zip extract just the AP .tar.md5 (it'll have img.lz4 files: boot.img.lz4, vbmeta.img.lz4 & system.img.ext4.lz4)
- Download a clean vbmeta.img file from Google - https://dl.google.com/developers/android/qt/images/gsi/vbmeta.img
- Now we need to compress the vbmeta.img file (just downloaded from google) using LZ4.
- Go into the /bin folder inside the script zip file provided (or download LZ4 from https://github.com/lz4/lz4/releases)
- Run this command
Code:
lz4.exe -B6 --content-size vbmeta.img vbmeta.img.lz4
- Done with vbmeta.img (keep the vbmeta.img.lz4 file)
- Now download your favorite Custom ROM (https://github.com/phhusson/treble_...ad/v219/system-quack-arm64-aonly-floss.img.xz)
- Using 7zip extract the .img.xz file & Rename the file inside to system.img.ext4 (this is the system OS without lz4 compression)
- Now we need to compress the system.img.ext4 file (just renamed) using LZ4.
- Run this command
Code:
lz4.exe -B6 --content-size system.img.ext4 system.img.ext4.lz4
- Done with system.img.ext4 (keep the system.img.ext4.lz4 file)
- Want to Root the device? if yes continue on; if not skip to step 24
- Take the boot.img.lz4 extracted from the stock ROM (the AP.tar.md5 file)
- We need to decompress this file using LZ4.
- Run this command
Code:
lz4.exe -d boot.img.lz4 boot.img
- Transfer this boot.img file to a phone and run Magisk Manager (doesnt need to be a rooted phone) and patch the boot.img file
- Take the patched file on your phone and transfer to your computer
- Rename the patched Magisk file to boot.img
- Now we need to compress the boot.img file (just renamed) using LZ4.
- Run this command
Code:
lz4.exe -B6 --content-size boot.img boot.img.lz4
- Done with the renamed Magisk patched (keep the boot.img.lz4 file)
- Replace the stock boot.img.lz4, vbmeta.img.lz4 & system.img.ext4.lz4 with the new customize files
- Extract the files from tar-md5-script-tool.zip
- Copy or Move all files below to the tar-md5-script-tool folder
- Files are: (we don't need the meta-data folder with fota.zip)
boot.img.lz4
dqmdbg.img.ext4.lz4
dtbo.img.lz4
persist.img.ext4.lz4
recovery.img.lz4
system.img.ext4.lz4
userdata.img.ext4.lz4
vbmeta.img.lz4
vendor.img.ext4.lz4
- Now we are going to build the AP file to use with Odin
- Run the batch.bat file from the tar-md5-script-tool folder
- Once it finishes go to the /tar-md5-script-tool/temp-folder/
- Inside you will find the AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5
- Flash the BL, CP, CSC (use HOME_CSC) from your Stock ROM & AP (using AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5)
- Done
Thanks to
@Alberbeast for reaching out and en
Hello,
This would be a short & sweet guide on how to install a custom ROM on your Samsung using ODIN. I'm going to tailored this guide for the S10e G9700 HK version (is the phone I own) I'm a linux user but Odin only runs on Windows so this works 100% on a Windows 10 VM an of course native on Windows.
1. Who is this for?
For people that can't or don't want to install TWRP on their devices. For example TWRP doesn't work with the S10E Snapdragon G9700 the HK/CHG version.
2. Will this method work on my bootloader locked phone?
NO!
Bootloader locked phones are locked in hardware there's no way to flash anything but carriers ROMs to them. If you can unlock the bootloader this guide will work for you.
3. Can I use this only with the G9700 phone?
No you can use any device, but this guide is tailored to the s10e g9700; because the TWRP version for this phone doesnt work with Android10.
4. Why not use Heimdall and do the guide entirely on Linux?
I use Manjaro [Arch] linux and tried to get Heimdall to work but couldn't, so choose the path of least resistance, so ODIN and windows is what we got

.
5. Recommended ROMs?
I'm not a fan of Google Apps so my recommendations are these (2) ROMs:
6. If using a PHH based ROM from phhusoon set this to get Bluetooth Audio working?
Under Developer Options - toggle ON "Disable Bluetooth A2DP hardware offload"
Credit goes to (for their work)
@phhusson @AndyYan (Project Treble PHH & LineageOS PHH) &
@mkh.mourad (CMD Script)
https://forum.xda-developers.com/project-treble/trebleenabled-device-development
Requirements
Step-by-Step Process
- Get your phone Official Stock ROM - https://samfw.com/firmware/SM-G9700/TGY (this is the one for my phone)
- Extract the downloaded file (you'll have the BL, AP, CP, CSC) .TAR.MD5 files
- Using 7zip extract just the AP .tar.md5 (it'll have img.lz4 files: boot.img.lz4, vbmeta.img.lz4 & system.img.ext4.lz4)
- Download a clean vbmeta.img file from Google - https://dl.google.com/developers/android/qt/images/gsi/vbmeta.img
- Now we need to compress the vbmeta.img file (just downloaded from google) using LZ4.
- Go into the /bin folder inside the script zip file provided (or download LZ4 from https://github.com/lz4/lz4/releases)
- Run this command
Code:
lz4.exe -B6 --content-size vbmeta.img vbmeta.img.lz4
- Done with vbmeta.img (keep the vbmeta.img.lz4 file)
- Now download your favorite Custom ROM (https://github.com/phhusson/treble_...ad/v219/system-quack-arm64-aonly-floss.img.xz)
- Using 7zip extract the .img.xz file & Rename the file inside to system.img.ext4 (this is the system OS without lz4 compression)
- Now we need to compress the system.img.ext4 file (just renamed) using LZ4.
- Run this command
Code:
lz4.exe -B6 --content-size system.img.ext4 system.img.ext4.lz4
- Done with system.img.ext4 (keep the system.img.ext4.lz4 file)
- Want to Root the device? if yes continue on; if not skip to step 24
- Take the boot.img.lz4 extracted from the stock ROM (the AP.tar.md5 file)
- We need to decompress this file using LZ4.
- Run this command
Code:
lz4.exe -d boot.img.lz4 boot.img
- Transfer this boot.img file to a phone and run Magisk Manager (doesnt need to be a rooted phone) and patch the boot.img file
- Take the patched file on your phone and transfer to your computer
- Rename the patched Magisk file to boot.img
- Now we need to compress the boot.img file (just renamed) using LZ4.
- Run this command
Code:
lz4.exe -B6 --content-size boot.img boot.img.lz4
- Done with the renamed Magisk patched (keep the boot.img.lz4 file)
- Replace the stock boot.img.lz4, vbmeta.img.lz4 & system.img.ext4.lz4 with the new customize files
- Extract the files from tar-md5-script-tool.zip
- Copy or Move all files below to the tar-md5-script-tool folder
- Files are: (we don't need the meta-data folder with fota.zip)
boot.img.lz4
dqmdbg.img.ext4.lz4
dtbo.img.lz4
persist.img.ext4.lz4
recovery.img.lz4
system.img.ext4.lz4
userdata.img.ext4.lz4
vbmeta.img.lz4
vendor.img.ext4.lz4
- Now we are going to build the AP file to use with Odin
- Run the batch.bat file from the tar-md5-script-tool folder
- Once it finishes go to the /tar-md5-script-tool/temp-folder/
- Inside you will find the AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5
- Flash the BL, CP, CSC (use HOME_CSC) from your Stock ROM & AP (using AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5)
- Done
Thanks to
@Alberbeast for reaching out and encouragement to help the community and S10e G9700 owners :good:
Hello sir.I need your help.My phone is Samsung M12.My device does not have TWRP or any custom recovery.So i search this type of help by anyhow i want to flash gsi on my phone.So tried your method to flash GSI. I have created AP file as you said.But when i tried to flash it says,LZ4 is invalid what should i do sir.Please help me.i have given an attach file.Thank You.