[RECOVERY][OFFICIAL] TWRP for Galaxy S9 and S9+ (Exynos)

Search This thread

r0nr

Member
Jun 25, 2015
24
6
Galaxy S9+ exynos
- Original vodafone firmware (android 10)
- Latest TWRP: twrp-3.4.0-0-star2lte.img.tar
- Latest Magisk: Magisk-v21.1.zip
- Latest no-verity: no-verity-opt-encrypt-6.1.zip


1)
Question: What do I need to check below.
If I want to wipe to clean state, what can I check below in order wipe to clean state.
(Assuming I have a full backup ready so I can restore that backup)

[ ] Dalvik / ART Cache
[ ] Cache
[ ] System
[ ] Vendor
[ ] Data
[ ] Internal Storage
[ ] Preload

[ ] Micro SD card (I never wipe this)
[ ] USB OTG (I never wipe this)

In (some) other devices I could not wipe the "system" partition if I wanted to restore a backup which included the system partition.

It would end up in the device getting stuck in the boot animation. (samsung A5, 2016).
The only way to make it work is NOT to check the system partition and restore full backup (overwriting the existing system partition)
then the device would boot.

In other devices (moto g5) I could check all the items and restore a full backup.


2)
Question: What do I need to check below.
If want to restore a full backup are the items below checked correct?
(I backupped system image AND system, just in case. But I am restoring system image only, not system).

Take note of ODM image and ODM, do I need to check them both or is ODM image sufficient?

[v ] Boot (55 MB)
[ v] Recovery (64 MB)
[ v] Cache (0 MB)
[ ] System (4073 MB) <====== not checked, because "system image" is checked
[v ] Vendor (559 MB)
[ v] Data (excl. storage) (0 MB)
[ v] System Image (4400 MB)
[ v] Vendor Image (650 MB)
[ v] ODM Image (646 MB) <===== check this AND "ODM"?
[ v] Baseband (50 MB)
[ v] EFS (2 MB)
[ v] ODM (579 MB) <===== check this AND "ODM image"?



3)
Question: Did I take the correct path?
I have tested the following, which boots the backup

Step 1, Format Data first
(because of error: Failed to mount '/data' (Invalid argument) , when I try to wipe. Doing a Format Data first and then do a wipe seems to work)

Step 2, Wipe
Dalvik / ART Cache , Cache , System , Vendor , Data , Internal Storage , Preload

Step 3, Restore
Boot , Recovery , Cache , Vendor , Data , System Image , Vendor Image , ODM Image , Baseband , EFS
(Did NOT restore ODM only restored ODM Image).
 

Tarar

Senior Member
Aug 10, 2014
79
3
Islamabad
Did anyone try rooting with the latest TWRP 3.5.0_9-1 and One UI 2.5? I have tried disabling encryption with multiple files and no one seems to work. Here's what i have tried
Installed new stock firmware
Flashed TWRP lastest version
Formatted Data and rebooted into the recovery
Installed no-verity-opt-encrypt 6.1 Failed
Installed Disable DM Verity Forced encrypt 11-4-2020 Installed but upon rebooting, phone stuck in loop.
Can anyone help please?
 

Tom1369

Member
Nov 13, 2019
34
10
Munich
Did anyone try rooting with the latest TWRP 3.5.0_9-1 and One UI 2.5? I have tried disabling encryption with multiple files and no one seems to work. Here's what i have tried
...
Installed no-verity-opt-encrypt 6.1 Failed
...

I have recently tried to flash "no-verity-opt-encrypt 6.1" with TWRP 3.5.0_9-1 under Android 10 and also failed. Afterwards, I flashed TWRP 3.4.0.0, repeated my attempt with "no-verity-opt-encrypt 6.1" and succeeded. My conclusion is that TWRP 3.5.0_9-* is only suitable for Android firmware <9, while TWRP 3.5.0_10-* (once available) will be suitable for Android firmware 10. In the meantime I stick to TWRP 3.4.0.0. "One UI 2.5" seems to be based on Android 10.

Please also have a look at the release notes of TWRP 3.5.0.
 

falciatrice10

Senior Member
Feb 19, 2013
483
35
41
TUNIS
Hi guys
I tried to root my galaxy s9+ android 10
I downloaded a firmware from frija and made a clean installation
IMG_20210207_095117_HDR.jpg

I installed twrp
I made a full data wipe, but it givee errors

IMG_20210207_095437_HDR.jpg


I tried to install no-verity-opt-encrypt-6.1.zip but got error also

IMG_20210207_102836_HDR.jpg

finally i installed magisk, with no errors
Root checker says that root is ok.
Now my phone reboot many times a day for no reason

Do i need to redo the entire operations ? And how to avoid these errors (i tried 3 times with same result)
 

Attachments

  • IMG_20210207_095437_HDR.jpg
    IMG_20210207_095437_HDR.jpg
    608.3 KB · Views: 42

Tom1369

Member
Nov 13, 2019
34
10
Munich
I installed twrp
I made a full data wipe, but it givee errors

The errors referring to the "data" partition are probably due to the fact, that TWRP cannot (yet) read an encrypted data partition under Android 10 firmware. What revision of TWRP did you install?


This is the error I was referring to in my previous post.

As the frequent booting is concerned, I can only speculate on the reason. Nevertheless, for more experienced members it might be interesting to know, if you are talking about a boot loop or "just" random boot events.
 
  • Like
Reactions: falciatrice10

falciatrice10

Senior Member
Feb 19, 2013
483
35
41
TUNIS
The errors referring to the "data" partition are probably due to the fact, that TWRP cannot (yet) read an encrypted data partition under Android 10 firmware. What revision of TWRP did you install?



This is the error I was referring to in my previous post.

As the frequent booting is concerned, I can only speculate on the reason. Nevertheless, for more experienced members it might be interesting to know, if you are talking about a boot loop or "just" random boot events.

1. I flashed TWRP 3.5.0_9-1
2.
it's just a random restart .
 

Tom1369

Member
Nov 13, 2019
34
10
Munich
1. I flashed TWRP 3.5.0_9-1
2.
it's just a random restart .
Have you read the second and fourth paragraph of the TWRP 3.5.0 release notes?
For this release we are breaking down new support for devices based on android trees and device compatibility. For Pie and earlier devices, they will be built out of the android-9.0 branch. For devices that are released with Android Version 10, they will be supported under the android-10 branch.

You will notice a new version scheme. Devices that are built in the android-9 tree will be suffixed with 3.5.0_9. Devices built in the android-10 tree will be suffixed with 10 like 3.5.0_10. Each device tree update will have a final suffix for any updates made for the device like 3.5.0_10-1.

I think you should better use TWRP 3.4.0.0 with your Android 10 phone rather than TWRP 3.5.0_9-1 which is targeting Android <9. I am not an expert, but maybe afterwards your random restarts are gone. Crossing my fingers.
 
  • Like
Reactions: falciatrice10

Philipp_

Member
Nov 1, 2013
33
0
I installed TWRP over LOS recovery but TWRP now can't decrypt the phone. I put in the right pattern, but it still says "Unable to mount storage".

What can I do? Thanks
 

nightmare1942

Member
Nov 29, 2009
29
7
Hi guys,

I have a problem flashing TWRP.

I installed newest stock FW G965FXXUFFUE1 with ODIN 3.14.4.
Bootloader was already disabled (from before) and show it is in disabled state.
I downloaded TWRP 3.4.0-0 (because the 3.5.x are not working for A10 as mentioned above) and I tried to install it via ODIN in AP mode.

After pressing Start it fails with message "Only official released binaries are allowed to be flashed(RECOVERY)"

Why is this happening?


Edit:
Nevermind....It seems that the KG State was Prenormal even though the "OEM unlock" was showing in dev options.
 
Last edited:
  • Like
Reactions: Boombastical

Rustdroid

Senior Member
Just letting people know that if you have RMM prenormal on Android 10 it will be like that for good. I'm stuck on RMM prenormal on 10 and have waited over 168hours about 5 times before restarting device to check and would never change. 10 uses Knox guard instead of RMM, my KG state changes fine and gives me option to unlock bootloader but RMM always prenormal so can't flash anything.

hopefully Samsung fixes it one day for now I'm stuck on stock.
 
Last edited:

waynea

Member
Mar 3, 2020
19
3
Hi all
Hiya
need some help please with my S9 starlte
I flashed TWRP with Odin, apparently successfully and I can boot into recovery easily.
Booting to download mode shows FRP and OEM locks are OFF, Secure boot = enabled
I did not flash dm-verity or anything as i wanted to put Lineage OS on it

However if I then try to flash the Lineage ROM it throws the error
Failed to map file 'external_sd/lineage-18.1 (etc)
Error installing zip file 'external_sd/lineage-18.1 (etc)
plus..
failed to mount 'cpefs (RO file system) but I dont know whether this is significant
This looked like a TWRP error, but I have tried it with every version I can find for the S9 .

The stock meanwhile is stuck in a bootloop (and it still shows 'secured by knox' and cannot even turn it off, so im waiting for the battery to die!

Any ideas to fix? in theory I could reflash stock through Odin, but I sort of think the same issue will recur....(Iive posted this i=on the cross-dev thread, but actually i think it may be a TWRP exrts - but apologies for posting in two different placesl..)

UPDATE - using 3.4.0.0 I can successfully flash the ROM, that is TWRP does not error.
Previously I had cleared cache and dalvik and repaired the system parturition using the EXT2/EXT4 flip.
Buti still stuck in boot loop!
Any ideas appreciated
 
Last edited:

Rustdroid

Senior Member
Hi - yes, did wipe > format data, then reflashed the ROM followed by Gapps11 pico.
Still stuck I'm bootloop. Incidentally I see that the system partition is not mounted. But putting a tick on this box and reflashing makes no difference.. Still stuck in bootloop
It should be working, something must be wrong with the bootloader. try flashing a custom kernel or boot image. maybe try some other custom stock roms. i wouldn't flash stock android 10 with Odin, you might have problems with RMM like me. if you go to stock again flash a Oreo rom and don't update.
 

waynea

Member
Mar 3, 2020
19
3
Hmmm..I feel out of my depth now, how do I ho about flashing a custom bootloader or kernel?
Ive never done that before..
Can you point me to some download links please?
 
Last edited:

waynea

Member
Mar 3, 2020
19
3
Hmmm..I feel out of my depth now, how do I ho about flashing a custom bootloader or kernel?
Ive never done that before..
Can you point me to some download links please? And the steps to follow. Searching yields almost no usable results. And thanks for your patience..!
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 102
    Team Win Recovery Project
    Exynos variants such as International (F), International Dual(Hybrid)-SIM (F/DS), Korean (N) ONLY.
    In NO way it is compatible with Snapdragon variants including but not limited to American(U/U1/A/T/P/V), Chinese(0/8/6), Hong Kong(0), Japanese(SC-*), Canadian(W) variants.

    #include <std_disclaimer.h>

    home.png
    backupname.png


    Special Notes:
    1. READ THE GUIDE.
    2. KNOX will be tripped once you flashed custom binaries to your phone.
    (Your warranty may be voided. However, this may not affect you if your country, European Union, for example, forces Samsung to provide hardware warranty regardless of software status.)
    More Infos: https://en.m.wikipedia.org/wiki/Rooting_the_Android_operating_system
    3. Samsung Firmware OTA (aka System Updates) will no longer work once you flashed custom binaries.
    (You can flash custom ROMs if you want to keep the OS up-to-date.)
    4. It is HIGHLY UNRECOMMENDED to purchase any access to any kind of private forums, ROMs or Kernels.
    (DO NOT GET FOOLED.)
    5. You HAVE to use newer version of Odin (>3.13) if you want to flash stock ROMs.

    Download:
    Galaxy S9:
    https://twrp.me/samsung/samsunggalaxys9.html

    Galaxy S9+:
    https://twrp.me/samsung/samsunggalaxys9plus.html

    Sources:
    https://github.com/TeamWin

    Changelog:
    Check #2.

    Guide:
    Check #3.

    Official Telegram Group: - Discussion, Testing, Feedback and Support
    Invite Link

    Show your appreciation:
    Click Thanks!, Rate 5-star or/and Donate to me. ;)

    To contribute:
    TWRP Code Review
    Github pull requests will be ignored.


    XDA:DevDB Information
    TWRP for Galaxy S9 and S9+, Tool/Utility for the Samsung Galaxy S9+

    Contributors
    jesec
    Source Code: https://github.com/TeamWin


    Version Information
    Status: Stable

    Created 2018-03-15
    Last Updated 2018-08-15
    58
    Guides:

    Be aware that Android Verified Boot requires data (including those in internal storage) to be cleared after you unlocked bootloader and flash custom binaries. ("to protect user data, all state transitions wipe the data partitions and ask the user for confirmation before data is deleted." - https://source.android.com/security/verifiedboot/verified-boot)
    It is normal to get prompts like "Integrity verification failed. You have to reset the device to factory settings."
    However, this will only happen when there is "state transition" so only when you switch from locked to unlocked or vice versa.

    Since Android O, Samsung introduced a new security feature, Remote Mobile Manager (RMM) aka Remote Lock Control (RLC). This feature allows stronger theft protection but unfortunately it also imposes a burden on users like you.
    Samsung added a 7-day buffer period for enterprises or device owners to spot a missing/rogue device so they can use this feature to lock the device remotely.
    In this 7-day (Prenormal) period, you can NOT flash any custom binaries including but not limited to this TWRP. OEM Unlock option won't appear, either.
    (You will meet "custom binary blocked due to remaining installment balance" or "custom binary not allowed" error when you try)
    The 7-day timer will start/reset once you completed the setup wizard. After 7 days (168 hours), RLC service will send an inquiry to Samsung's server. If your device is "clean", the RMM state will become "Normal".
    Then you can enable "OEM Unlock" option and flash TWRP. Be careful, DO NOT reboot to a stock ROM before you flash patch in part 2 of this guide or you will have to go through another

    Whether you have RMM problem or not depends on your model, region and/or carrier.
    If you don't have any wait period to enable OEM Unlock option, congratulations but please do NOT mislead other people.
    NOT EVERYONE IS AS LUCKY AS YOU.
    If you don't have RMM problem when you get the device, it is unlikely that you will get any RMM problems later.
    But note that this problem applies to MAJORITY of people.

    Note that the special patch will freeze RMM, FRP and OEM lock state.
    This is an anti-stupid measure to prevent careless users from enabling security measures which are not compatible with custom binaries.

    Part 1 - HOW-TO FLASH TWRP:
    1. In your ROM, go to Settings -> About device. Tap 7 times on Build number to enable Developer options.
    2. Go to Settings, remove all Samsung and Google accounts and if your device is registered to an enterprise, de-register it.
    3. Go to Settings -> Developer options and enable OEM Unlock option.
    Notice: This is "state transition" mentioned eailier.
    NOTE: You will be asked to do a factory reset, that's normal.
    BUT DO NOT LET IT COMPLETE THE WHOLE RESET PROCESS.
    You should take a look at the whole guide and be prepared to use reboots as chances to flash or reboot into TWRP.
    4. Download and Install Samsung Mobile Phones Drivers.
    - Option 1: Download and Install Smart Switch for PC.
    - Option 2: Download and Install standalone driver package.
    5. Download and extract Odin (Samsung's Flash Tool) to your computer.
    6. Download a .tar image of TWRP.
    7. Reboot your device to download mode.
    - Hold [VOLUME DOWN] + [BIXBY] + [POWER] for approx. 15 seconds.
    - Read the warning carefully.
    - If you agree, press [VOLUME UP] to get into Download mode. If you don't agree, STOP.
    8. Open Odin and place that TWRP tar file in the [AP] slot.
    9. Connect your phone.
    10. Hold [VOLUME UP] + [BIXBY] + [POWER] on your phone and then press start on Odin.
    11. Wait for the phone to reboot. DO NOT release [VOLUME UP] + [BIXBY] + [POWER] or you may not reboot into TWRP.

    Part 2 - HOW-TO INITIALIZE TWRP:
    1. If you completed Part 1 successfully, you should be in TWRP now. At this point, you will reach the screen asking you if you want to allow system modifications.
    2. Select "Keep /system RO".
    3. Go to "Wipe" menu of TWRP and you will find "Format Data". Press "Format Data" and type "yes" to continue.
    4. Go to "Reboot" menu and Press "Recovery" to reboot TWRP.
    5. Download the special dm-verity and force encryption disabler zip on your computer.
    6. Transfer the zip to your phone.
    - Option 1: MTP: Connect your phone with computer and just copy the zip to internal storage. (similar to how you transfer files when in system.)
    - Option 2: ADB: Connect your phone with computer and run command "adb push /path/to/zip /sdcard/".
    - Option 3: External SD: Copy the zip to an external SD and then insert the card to your phone.
    7. Go to "Install" menu of TWRP and flash the zip.

    TWRP is initialized and fully functional at this stage.

    Now you may want to flash a root solution (Magisk, SuperSU, etc) or custom ROM but keep in mind that:
    1. This thread does NOT provide technical support to any root solution or ROM unless the problem is DIRECTLY related to TWRP and there is no other solution without modifying TWRP itself.
    Please contact developer of respective ROM or root solution for technical support.
    2. Samsung implemented security measures such as "Real-time Kernel Protection (RKP)" and "RKP Control Flow Protection". https://www.samsungknox.com/en/blog/real-time-kernel-protection-rkp
    Those security measures are intended to block control flows such as privilege escalation, memory kernel code modification, etc which are not authorized by Samsung.
    If those are not disabled, processes (such as daemon of root solutions) that violated those security rules will fall into deadlock.
    Deadlocked processes will then consume large amount of resources (leads to performance issues, battery drains) and eventually crash the system.
    Technically it is possible to disable those security measures by hex editing stock kernel but just simply flash a custom kernel is better in my opinion.
    TL;DR: Flash custom kernel before root or be screwed.
    31
    Changelog:

    Note that this page only includes device-specific changes. For global TWRP changes, go to twrp.me.

    Apr 18, 2018 (twrp-3.2.1-2):
    Refactor USB configurations (fixes ADB)
    Remove /cpefs from filesystem table (fixes /cpefs warning/error)
    Rebase Kernel to ARCC. (fixes I/O performance issues)
    Use correct OTG mount path
    Enable software encryption support (general AOSP only, Samsung method remain unsupported)

    Mar 16, 2018 (twrp-3.2.1-1):
    Add system_image, vendor_image
    Rename display name of /odm to "Carrier Configs"

    Mar 15, 2018:
    USB connection fixes

    Mar 14, 2018:
    Initial version
    11
    Changelog - Apr 18, 2018 (twrp-3.2.1-2):

    Refactor USB configurations (fixes ADB)
    Remove /cpefs from filesystem table (fixes /cpefs warning/error)
    Rebase Kernel to ARCC. (fixes I/O performance issues)
    Use correct OTG mount path
    Enable software encryption support (general AOSP only, Samsung method remain unsupported)

    I recommend everyone to update to this build.
    Note that for some reasons starlte (G960*) build does not show up on twrp website yet.
    Please download the build via this link: http://build.twrp.me/twrp-3.2.1-2-starlte.img.tar
    6
    YOu mean when you boot into download mode it says "OEM Lock OFF"

    After I turned OEM unlock on my phone was forced into a restart and a reset and when I go DL mode now I get the same "boot into download mode it says "OEM Lock OFF"" maybe this means OEM unlock is ON now we just cant see the switch anymore.

    Is this the case anyone?

    (I get fail when trying to flash TWRP however)
    @ jesec - I am writing to try to get past an apparent RMM issue.

    I previously had followed your guide and had everything working and was trying out a number of the ROM's On the last one, I had problems with Super SU, and reflashed it and also the original RMM zip. The ROM would not boot, and on trying to get to TWRP, it was gone - along with OEM unlock in dev. options. In download mode, both locks were on, and RMM was Prenormal.

    I ended up ODINing stock ROM, and apparently started the 7 day clock, After 7 days, OEM unlock showed up, so unlocked, but that led to its insisting that a factory reset be done, which resulted in RMM back to Prenormal, BUT both the unlocks show off.

    I wonder if you can point me to the next step - which right now getting RMM back to normal without messing the locks up again.

    In 7 days, will the RMM go back to normal, and if so - should I Odin from there (if the locks are still off), or will I have to risk OEM unlocking in Dev. mode and having it try to force another reset.

    Since you appear to be the S9+ RMM expert, I hope you will be able to guide me on this.

    If successful, does your new no-verity-opt-encrypt-samsung-1.0 zip replace the RMM-State_Bypass_Mesa zip and the no-verity-opt-encrypt-6.0-star zips i had used previously?
    Damn, so I booted to download mode, flashed with Odin, but it wouldn't go into TWRP. It kept coming up with the screen to reset device from hitting the OEM unlock in developer settings. Stupidly I booted up and hastily setup, now flashing in Odin fails, as the OEM unlock is gone again. Im sure I know the answer, but there's nothing I can do now for another week until the OEM unlock appears again is there? No app to find hidden menus or anything to try and find that OEM unlock option is there?
    I am similar situation.

    1. Oem unlock switched on in developer.
    2. Twrp Flash IN Odin success. First time.
    3. Didn't manage to install the additional flash for dm verity etc, and rebooted back to stock.
    4. Tried to flash Twrp again. Failed, says can only install official binaries.
    5. Going back to dev options, Oem unlock not visible. However in stock recovery it says Oem lock and Frp both OFF.

    does this mean I'm in jail, and have to wait 7 days?
    I am still waiting for 7 days to see I can see "OEM Unlock" in development page. From my understanding, if the option appear and I pick to set it. It will force me confirm to do a factory reset. It will be tedious to do phone setup after that. Hopefully it will not be requirement. Let's see in a few days.

    I will take the "reset" hit to be able to install custom rom. Will see.
    My problem that the reset left me with RMM statue Prenormal and OEM unlock setting gone.

    So no way to Odin TWRP or flash anything.

    Looking for a go around.

    Sent from my [device_name] using XDA-Developers Legacy app

    Please check the new RMM state section of the guide.
    It is normal for Samsung to force a reset when you toggle OEM Unlock option.
    BUT DO NOT BE TRICKED. You SHOULD NOT complete the whole reset process. (reset, let it reboot, BOOM RMM Prenormal is back and you are in 7-day jail again)
    Every reboot is a chance to flash TWRP or boot into TWRP. DO NOT ALLOW your device to boot into system before you boot into TWRP and flash the patch.
    (Use "VOL-DOWN" + "POWER" + "BIXBY" to boot into download mode, "VOL-UP" + "POWER" + "BIXBY" to boot into TWRP, "VOL-DOWN" + "POWER" to force a reboot)
    Then follow the guide.

    I have samsung s9 plus SM G965F
    I think my phone is demo phone.but i dont see any think like that.but main issue i dont see play store app.unable to install it from any source.2nd issue is i dont see screen and security option in my phone.
    3rd when i go to master reset through volume up+power+bixby button.
    Msg shows that MDM doesnot allow to factory reset.

    In developers mode OEM option not shown.

    And in downloading mode OEM is on frp on

    I cant remove my google account .

    Please read this thread and help what should i do now?

    There are two scenarios:
    1. The device is registered to an enterprise, thus regulated by the policy of that enterprise.
    2. The device is not supposed to be used by you. (demo device or stolen device)

    Either way, I can't help you with this problem. Please contact your seller or company for assistance.

    same model here, same story, after turning on OEM unlock the first reboot forced a reset, then after some system update a second reset, since then haven't had a reset yet, OEM unlock never went away.

    still wondering how to root this phone, I'm really baffled here. also, all the files are named 965F, can I use those to root 965N (256G)? please help!

    Yes you can. N has the almost same hardware as F. You should be able to flash any custom ROMs, Kernels, root solutions, etc branded for F on a N device.
    But keep in mind that you still need to use N specific modem/baseband and bootloader so you can't flash stock ROM of F on N.

    Is it possible to use full disk encryption based on dm-crypt with TWRP on the S9+ ?

    No, encryption is not supported and there is no plan to support it.
    Samsung use proprietary hardware disk encryption methods. There is no way to support that without proper sources.

    @jesec
    If you update TWRP and your work, please Edit Thread title with version or day release. More information is better for user.

    No. TWRP is not something that needs to be updated regularly. A thread title with recent dates may look great now but soon it will look like outdated as f*.
    TWRP is meant to be stable not "updated Apr 12 with EXCITING XXX".

    Is there any work being done to allow the Snapdragon S9 to use TWRP?

    The U variant of this device desperatley needs rooting.

    The Samsung bloatware is stifling. The hardware on this phone would greatly benefit from an AOSP rom.

    I don't have plan to support Snapdragon variant at this moment.