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

Development [RECOVERY][UNOFFICIAL] TWRP for ASUS ROG Phone 5 & ROG Phone 5S

Search This thread

TiklMiPickles

Senior Member
Mar 22, 2016
203
51
Installed and working, but for some reason, the button vibration is either causing the speakers to make a hissing sound, or it doing something terribly wrong to the vibration motors. I turned it off in settings and the sound went away.
 
Do you have USB debugging on and allowed the computer to use it? Otherwise I'm not too sure.

Turned on USB debugging, plugged my phone into the side port, allowed pc to use it when the popup came up, then followed the instructions.

Also just learned that if you flash the twrp. Img when you first do it it'll replace the system so don't do that.
So you mean if we gonna use TWRP, we must flash from pc again?
I mean if we don't flash twrp.img in TWRP

Also after I flash twrp.img what button combination to enter TWRP3, it is same button to enter recovery mode?
 

TiklMiPickles

Senior Member
Mar 22, 2016
203
51
So you mean if we gonna use TWRP, we must flash from pc again?
I mean if we don't flash twrp.img in TWRP

Also after I flash twrp.img what button combination to enter TWRP3, it is same button to enter recovery mode?
No, so once you do 'fastboot boot twrp.img' and it boots into twrp you are going to copy the twrp.img file over to your phone, then in twrp go to install > install image > choose the twrp.img > install recovery ramdisk. The command to boot literally only boot into the recovery image, it isn't actually flashed to the device yet at that point
 
No, so once you do 'fastboot boot twrp.img' and it boots into twrp you are going to copy the twrp.img file over to your phone, then in twrp go to install > install image > choose the twrp.img > install recovery ramdisk. The command to boot literally only boot into the recovery image, it isn't actually flashed to the device yet at that point
Oh I get it, then after I install it to recovery ramdisk then should I use "fix recovery bootloop" option or reboot the device normally?

Also I just try to install TWRP a couple minute ago and boot it for first time I hear something weird from my speaker when I press every option, turn off all vibration in settings and weird sound is gone, I don't know it is normal or not but it happen on my previous phone too
 

Madbullben

Senior Member
Feb 23, 2013
95
13
Colleagues, why after installation, the phone automatically goes into TWRP mode? Why is it not starting?
While I'm not 100% sure, I believe by flashing the twrp. Img it replaced the system img, so you no longer have something to boot into besides twrp. We need a recovery. Img to replace the recovery and not system.

I hope you did a backup before flashing? Otherwise you'll have to flash the original raw firmware and have a fresh device.

I was gonna do the same but luckily got told in a telegram group that would happen.
 
While I'm not 100% sure, I believe by flashing the twrp. Img it replaced the system img, so you no longer have something to boot into besides twrp. We need a recovery. Img to replace the recovery and not system.

I hope you did a backup before flashing? Otherwise you'll have to flash the original raw firmware and have a fresh device.

I was gonna do the same but luckily got told in a telegram group that would happen.

You wouldn't flash a complete raw firmware to replace the system, unless you managed to somehow break the bootloader or partitions. You would flash a stock system image just like you flashed TWRP

Known issues


Device-specific
  • To boot into system from TWRP, you need to flash stock boot.img. Fix Recovery Bootloop doesn't work
Did you actually install it or just boot into it? Once you are in twrp, you have to use twrp to install the recovery img. fastboot boot twrp.img only boots from the image, it doesn't install it.
No, so once you do 'fastboot boot twrp.img' and it boots into twrp you are going to copy the twrp.img file over to your phone, then in twrp go to install > install image > choose the twrp.img > install recovery ramdisk. The command to boot literally only boot into the recovery image, it isn't actually flashed to the device yet at that point

Maybe not in the OP, but the thread has all the necessary information. If you are unsure about how to do something and jump right into doing it without reading through the thread first and asking when you don't find an answer, you are either risking it all to write the guide or making a huge mistake.
 

Anubarak16

Senior Member
Oct 24, 2014
137
42
ASUS ROG Phone 5
using fastboot version 31.0.3-7562133
For whatever strange reasons

Code:
adb reboot bootloader
does not reboot to fastboot but into the bootloader where fastboot commands are not available for me.
I need to use

Code:
adb reboot fastboot
to go into fastboot mode, from there on
Code:
fastboot devices
will list my device. However

Code:
fastboot boot twrp.img
will show the following error
Code:
Sending 'boot.img' (98304 KB)                      OKAY [  0.343s]
Booting                                            FAILED (remote: 'Unrecognized command boot')
fastboot: error: Command failed

I also tried
Code:
fastboot reboot fastboot
as suggested here
Tried both ports, different USB-cables, different USB ports on my PC and I have the latest ADB drivers.
Can someone help me?

Edit: I highly doubt it but could this be something with the Ultimate edition?
Edit2: Yes the twrp.img file exists and it's the correct name and in the same path

Edit3: also tried "fastboot flash recovery twrp.img"
Code:
fastboot flash recovery twrp.img
Sending 'recovery' (98304 KB)                      OKAY [  2.238s]
Writing 'recovery'                                 FAILED (remote: 'No such file or directory')
fastboot: error: Command failed

Edit 4:
Just tried it with another pc and yet another cable on both ports... Still the very same error.
 
Last edited:

Madbullben

Senior Member
Feb 23, 2013
95
13
Just flashed twrp and then the boot.img but now I can't access anything at all, only thing I've got is the bootloader without recovery. Tried to boot into twrp using fastboot but says that it's failed to load boot.img.

I don't know what to do.
 

Madbullben

Senior Member
Feb 23, 2013
95
13
Everything I try is saying locked state or permission denied. Tried to change slots but says it's in a locked state. Looked at the bootloader state through fastboot and this is the results:
(bootloader) Verity mode: true
(bootloader) Device unlocked: true
(bootloader) Device critical unlocked: false
(bootloader) Charger screen enabled: true
(bootloader) Device authorized: false
(bootloader) Device authorized2: false

Does this mean that my bootloader is locked now? Anything I can do to fix it or am I now screwed?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 11
    Code:
    *** Disclaimer ***
    
    All flashing is done at your own risk!
    While nothing from this thread should break your device,
    don't come back here blaming anyone if it does!

    Introduction

    Team Win Recovery Project 3.x, or twrp3 for short, is a custom recovery built with ease of use and customization in mind. Its a fully touch driven user interface no more volume rocker or power buttons to mash. The GUI is also fully XML driven and completely theme-able. You can change just about every aspect of the look and

    Images



    Prerequisites

    Installation instructions

    Fastboot Install Method:
    You will need the platform-tools from the Android SDK on your computer. Find the Android command line tools section on the page linked and install the SDK tools package. From the SDK Manager, download only the platform-tools to get adb and fastboot binaries.

    Windows users will need proper drivers installed on their computer. You can try the Naked ADB drivers or the Universal ADB drivers if you don't already have a working driver installed

    On your device, go into Settings -> About and find the Build Number and tap on it 7 times to enable developer settings. Press back and go into Developer Options and enable USB debugging. From your computer, open a command prompt and type:
    Code:
    Code:
    adb reboot bootloader
    You should now be in fastboot mode.

    Download the correct image file and copy the file into the same folder as your adb and fastboot binaries. Rename the image to twrp.img and type:
    Code:
    Code:
    fastboot boot twrp.img

    Now you are booted into TWRP, but it is NOT permanently installed. To install it permanently, use the "Flash current TWRP" option in the Advanced menu. This will install the currently booted TWRP permanently to both slots. NOTE: If you were previously rooted, you will need to re-install the root apk/zip as the TWRP install will overwrite it!

    Device Changelog

    Current version: 3.5.2_11-2:
    3.5.2_11-2
    • Common version for all ROG 5 versions.
    • Fixed decryption issue
    3.5.2_11-0:

    Initial version (Tested only on ROG Phone 5S, need info about ROG Phone 5).



    Device Changelog


    Known issues

    Device-specific
    • USB-OTG not working
    • Battery Status not working

    Bug reporting

    If you have an issue, the first step is to post a recovery log so we can determine the cause of the issue. This is done in recovery using Advanced -> Copy Log, or adb pull /tmp/recovery.log. Once a log is uploaded we can determine how best to proceed. NOTE: Posts that are reporting bugs or issues without an accompanying recovery log will be ignored! Additionally, providing details about your device setup, including variant, firmware version, and exact steps to reproduce your issue will also be helpful in diagnosing the problem.

    If your issue is determined to be a bug, please consider posting it to our github issues log. It's pretty much impossible for us to keep up with the more than 40 threads that we have for the devices that we "directly" support. If you have a significant problem that cannot be answered in this thread, your best bet is to contact us via our website. If you see someone that's struggling, feel free to point it out to us. We need your help to help us keep track of all of our devices! Thanks!

    Additional Help/Support

    Live support is available on Zulip.

    Credits

    @Freak07 and @Captain_Throwback for advices
    @Qtr1st and @danfrid for testing
    5
    Here's my trip around the sun;

    Downloaded the file twrp-3.5.2_11-2zs673ks.img and renamed it to just twrp.img. (So it's easier to type in CMD).
    Placed it on the root of my C: Drive where I keep all my flash files.

    Shut down phone, Then Volume up and power to go to fastboot mode. That's the screen where it shows some options like Power On, Recovery Mode and Reboot. Just stay there, dont select anything.

    Connected the cable via side USB port and executed the following commands;

    0023.png


    First command to check connectivity, second command is to boot to TWRP.
    No flashing !! remember always; new TWRP cannot be flashed through fastboot because recovery is a part of the existing partition, not a separate one like it used to be on Android 8 and below.

    Once you execute the above command, be patient. Your phone will come back to bootloader screen making it look like it failed. Just wait, it will reboot again and it will go to TWRP. Now you can enter you pin code, and enter the recovery.
    I flashed a kernel, I cleared my dalvik cache .. everything went well.




    Now if you want to keep TWRP permanent;

    Copy the twrp.img to your phone memory, preferably downloads folder of the phone, and follow the above steps mentioned - again up to entering TWRP.

    In TWRP, select advanced, and you will see the below screen -

    Screenshot_2021-09-16-07-36-25 (Medium).png


    Select the option - Install Recovery Ramdisk and it will ask where your TWRP.img is, and point it to the file you earlier saved in the phone / downloads folder. This will flash TWRP within the kernel making it permanent along with your kernel.

    That's it, reboot and enjoy.

    EDIT : How to get to TWRP again;
    From CMD - send adb reboot recovery or
    shut down phone, Volume UP + Power .. In bootloader press volume down until you see recovery mode, and then press the power button once to select it.
    2
    Flashing a custom kernel also won't install / restore Magisk. The custom builds are meant to retain Magisk, but don't actually perform any of the installation.

    You can install TWRP over a custom kernel and the kernel will remain, but Magisk will be gone and need to be reinstalled. At this point, the app will only allow you to patch a supported image (img / tar, but also supports win without saying it) and the custom kernels include none of those. This means you need a Magisk recovery zip or need a backup of the kernel to patch with Magisk.

    You can also install a custom kernel over TWRP, but you would need to already have Magisk patched in after installing TWRP or install it after the kernel (see above).

    TL;DR

    The easiest way (for me) to install TWRP with a custom kernel was to
    boot and install TWRP
    make a backup of the boot
    reboot to system
    patch the boot in Magisk
    return to TWRP and install the patched boot image.
    That seems like a lot of unnecessary steps. If you already have Magisk installed, then you must have the Magisk apk somewhere already. That being the case, why not just:
    -Boot and install TWRP
    -Install Magisk apk in TWRP (this re-installs it after the TWRP install overwrites it)
    -Reboot to system and profit

    The custom kernel won't be affected at all, and you'll be restored to your previously rooted state. Fiddling around with patched boot images doesn't seem reasonable for such a simple operation. TWRP is supposed to make things easier, not more complicated.