• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[GUIDE] [CUSTOM] How to Install Custom ROM using ODIN without TWRP [PHH] [LineageOS]

Search This thread

kkoo

Member
May 14, 2008
23
50
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.
https://www.getdroidtips.com/how-to-unlock-bootloader-on-samsung-galaxy-phones/

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:

1. https://github.com/phhusson/treble_...ad/v219/system-quack-arm64-aonly-floss.img.xz (No bloat, Stock Android 10 with FOSS Apps replacements of Gapps, you can install your own on top, Like I use Google Maps (the only Gapp I use)
2. https://sourceforge.net/projects/an...7-UNOFFICIAL-treble_arm64_bvN.img.xz/download (Lineage OS 17.1 - this is vanilla, you will have to install an App store like F-Droid or Aurora from the .apk files using ADB [FYI] - This is what I use as my daily driver!

note* the proximity sensor doesn't work with the S10E and PHH based ROMs - https://github.com/phhusson/treble_experimentations/issues/592#issuecomment-519853332

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

  1. Get your phone Official Stock ROM - https://samfw.com/firmware/SM-G9700/TGY (this is the one for my phone)
  2. Extract the downloaded file (you'll have the BL, AP, CP, CSC) .TAR.MD5 files
  3. Using 7zip extract just the AP .tar.md5 (it'll have img.lz4 files: boot.img.lz4, vbmeta.img.lz4 & system.img.ext4.lz4)
  4. Download a clean vbmeta.img file from Google - https://dl.google.com/developers/android/qt/images/gsi/vbmeta.img
  5. Now we need to compress the vbmeta.img file (just downloaded from google) using LZ4.
  6. Go into the /bin folder inside the script zip file provided (or download LZ4 from https://github.com/lz4/lz4/releases)
  7. Run this command
    Code:
    lz4.exe -B6 --content-size vbmeta.img vbmeta.img.lz4
  8. Done with vbmeta.img (keep the vbmeta.img.lz4 file)
  9. Now download your favorite Custom ROM (https://github.com/phhusson/treble_...ad/v219/system-quack-arm64-aonly-floss.img.xz)
  10. Using 7zip extract the .img.xz file & Rename the file inside to system.img.ext4 (this is the system OS without lz4 compression)
  11. Now we need to compress the system.img.ext4 file (just renamed) using LZ4.
  12. Run this command
    Code:
    lz4.exe -B6 --content-size system.img.ext4 system.img.ext4.lz4
  13. Done with system.img.ext4 (keep the system.img.ext4.lz4 file)
  14. Want to Root the device? if yes continue on; if not skip to step 24
  15. Take the boot.img.lz4 extracted from the stock ROM (the AP.tar.md5 file)
  16. We need to decompress this file using LZ4.
  17. Run this command
    Code:
    lz4.exe -d boot.img.lz4 boot.img
  18. 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
  19. Take the patched file on your phone and transfer to your computer
  20. Rename the patched Magisk file to boot.img
  21. Now we need to compress the boot.img file (just renamed) using LZ4.
  22. Run this command
    Code:
    lz4.exe -B6 --content-size boot.img boot.img.lz4
  23. Done with the renamed Magisk patched (keep the boot.img.lz4 file)
  24. Replace the stock boot.img.lz4, vbmeta.img.lz4 & system.img.ext4.lz4 with the new customize files
  25. Extract the files from tar-md5-script-tool.zip
  26. Copy or Move all files below to the tar-md5-script-tool folder
  27. 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
  28. Now we are going to build the AP file to use with Odin
  29. Run the batch.bat file from the tar-md5-script-tool folder
  30. Once it finishes go to the /tar-md5-script-tool/temp-folder/
  31. Inside you will find the AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5
  32. Flash the BL, CP, CSC (use HOME_CSC) from your Stock ROM & AP (using AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5)
  33. Done

Thanks to @Alberbeast for reaching out and encouragement to help the community and S10e G9700 owners :good: ;)
 
Last edited:

pchetan2

Senior Member
Oct 15, 2012
299
36
Chennai
I am new to Samsung

Following OP doesnt trip knox and other Samsung stuff , correct ? Which means, I can reflash with Samsung stock rom with losing samsung functionality like samsung pay.
 

kkoo

Member
May 14, 2008
23
50
Following OP doesnt trip knox and other Samsung stuff , correct ? Which means, I can reflash with Samsung stock rom with losing samsung functionality like samsung pay.

You can always reflash back to Samsung Stock ROM. I don't use any Samsung App so never cared about knox, but I assume it does trip knox.

Does it work with us or canadian version of the snapdragon?

No it doesn't work with any North America Galaxy S10 as those have the bootloader locked!
 

Nobin118960

Member
Feb 4, 2015
16
1
Samsung Galaxy S10
If someone knows or provides a place where to upload a complete ROM I can upload the Complete AP.tar.md5 ROM for LOS 17.1 OS Rooted with Magisk and the Android Stock FOSS image just to use with Odin. Let me know! Thanks

You can upload your complete rom here https://androidfilehost.com/
Can you please explain why you use Aonly and ABonly both rom in this tutorial..? as I know only ABonly rom is for galaxy 10 series. maybe I am wrong but can you please explain it..
Thanks for your hard work Brother..
 

kkoo

Member
May 14, 2008
23
50
You can upload your complete rom here https://androidfilehost.com/
Can you please explain why you use Aonly and ABonly both rom in this tutorial..? as I know only ABonly rom is for galaxy 10 series. maybe I am wrong but can you please explain it..
Thanks for your hard work Brother..

Hey, sorry I already deleted the Windows VM with the complete ROM images.

Yes for my S10E Galaxy phone I use the Aonly ROM as this is what worked for me. Also I don't plan to use the functionality of an A/B ROM so to meet the extra things A/B gives are unnecessary. But like you probably assume, you can use any ROM or Phone you like. I based the tutorial on the Galaxy S10e because thats what I own.
 
  • Like
Reactions: Nobin118960

Morphine1

Senior Member
Sep 23, 2014
468
638
Andalusia.
Excited with this. I own a G9700 HK version, and I didn't even root it - been rooted since like 2012.
Miss custom roms and this thread completely encourages me to give it a shot for this device. Thank you.
 
  • Like
Reactions: kkoo

Top Liked Posts

  • There are no posts matching your filters.
  • 33
    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.
    https://www.getdroidtips.com/how-to-unlock-bootloader-on-samsung-galaxy-phones/

    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:

    1. https://github.com/phhusson/treble_...ad/v219/system-quack-arm64-aonly-floss.img.xz (No bloat, Stock Android 10 with FOSS Apps replacements of Gapps, you can install your own on top, Like I use Google Maps (the only Gapp I use)
    2. https://sourceforge.net/projects/an...7-UNOFFICIAL-treble_arm64_bvN.img.xz/download (Lineage OS 17.1 - this is vanilla, you will have to install an App store like F-Droid or Aurora from the .apk files using ADB [FYI] - This is what I use as my daily driver!

    note* the proximity sensor doesn't work with the S10E and PHH based ROMs - https://github.com/phhusson/treble_experimentations/issues/592#issuecomment-519853332

    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

    1. Get your phone Official Stock ROM - https://samfw.com/firmware/SM-G9700/TGY (this is the one for my phone)
    2. Extract the downloaded file (you'll have the BL, AP, CP, CSC) .TAR.MD5 files
    3. Using 7zip extract just the AP .tar.md5 (it'll have img.lz4 files: boot.img.lz4, vbmeta.img.lz4 & system.img.ext4.lz4)
    4. Download a clean vbmeta.img file from Google - https://dl.google.com/developers/android/qt/images/gsi/vbmeta.img
    5. Now we need to compress the vbmeta.img file (just downloaded from google) using LZ4.
    6. Go into the /bin folder inside the script zip file provided (or download LZ4 from https://github.com/lz4/lz4/releases)
    7. Run this command
      Code:
      lz4.exe -B6 --content-size vbmeta.img vbmeta.img.lz4
    8. Done with vbmeta.img (keep the vbmeta.img.lz4 file)
    9. Now download your favorite Custom ROM (https://github.com/phhusson/treble_...ad/v219/system-quack-arm64-aonly-floss.img.xz)
    10. Using 7zip extract the .img.xz file & Rename the file inside to system.img.ext4 (this is the system OS without lz4 compression)
    11. Now we need to compress the system.img.ext4 file (just renamed) using LZ4.
    12. Run this command
      Code:
      lz4.exe -B6 --content-size system.img.ext4 system.img.ext4.lz4
    13. Done with system.img.ext4 (keep the system.img.ext4.lz4 file)
    14. Want to Root the device? if yes continue on; if not skip to step 24
    15. Take the boot.img.lz4 extracted from the stock ROM (the AP.tar.md5 file)
    16. We need to decompress this file using LZ4.
    17. Run this command
      Code:
      lz4.exe -d boot.img.lz4 boot.img
    18. 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
    19. Take the patched file on your phone and transfer to your computer
    20. Rename the patched Magisk file to boot.img
    21. Now we need to compress the boot.img file (just renamed) using LZ4.
    22. Run this command
      Code:
      lz4.exe -B6 --content-size boot.img boot.img.lz4
    23. Done with the renamed Magisk patched (keep the boot.img.lz4 file)
    24. Replace the stock boot.img.lz4, vbmeta.img.lz4 & system.img.ext4.lz4 with the new customize files
    25. Extract the files from tar-md5-script-tool.zip
    26. Copy or Move all files below to the tar-md5-script-tool folder
    27. 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
    28. Now we are going to build the AP file to use with Odin
    29. Run the batch.bat file from the tar-md5-script-tool folder
    30. Once it finishes go to the /tar-md5-script-tool/temp-folder/
    31. Inside you will find the AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5
    32. Flash the BL, CP, CSC (use HOME_CSC) from your Stock ROM & AP (using AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5)
    33. Done

    Thanks to @Alberbeast for reaching out and encouragement to help the community and S10e G9700 owners :good: ;)
    10
    note* the proximity sensor doesn't work with the S10E and PHH based ROMs - https://github.com/phhusson/treble_e...ment-519853332

    This issue has actually been fixed a long time ago, you need to select "Enable extra sensors" in Treble settings though.
    4
    If someone knows or provides a place where to upload a complete ROM I can upload the Complete AP.tar.md5 ROM for LOS 17.1 OS Rooted with Magisk and the Android Stock FOSS image just to use with Odin. Let me know! Thanks
    4
    wow this is awesome:laugh: thank you so much @kkoo for the effort to create this guide, it's a life saver for those of us who can't use twrp and want to try aosp.

    Thanks again bro!
    2
    Following OP doesnt trip knox and other Samsung stuff , correct ? Which means, I can reflash with Samsung stock rom with losing samsung functionality like samsung pay.

    You can always reflash back to Samsung Stock ROM. I don't use any Samsung App so never cared about knox, but I assume it does trip knox.

    Does it work with us or canadian version of the snapdragon?

    No it doesn't work with any North America Galaxy S10 as those have the bootloader locked!