yashsingh1/xdaforums huggingface dataset:
[ASUS ROG Phone 5 / 5s] Madbullben:
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.
[ASUS ROG Phone 5 / 5s] Madbullben:
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?
[ASUS ROG Phone 5 / 5s] Madbullben:
All fixed
[ASUS ROG Phone 5 / 5s] Andrologic:
Works like a superstar. Bravo and thanks @mikalovtch
[ASUS ROG Phone 5 / 5s] Anubarak16:
Maybe it's a good idea to explain what you did in case someone is in your situation as well
[ASUS ROG Phone 5 / 5s] empty.cad:
Has anyone tried it on rog 5s pro?
[ASUS ROG Phone 5 / 5s] JazonX:
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;

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 -

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.
[ASUS ROG Phone 5 / 5s] JazonX:
You can try this without causing any permanent damage if you're BL Unlocked.

Just use the boot command and check whether it boots to TWRP.

if it doesn't, force reboot using Volume Down + Power, and stay away.
[ASUS ROG Phone 5 / 5s] Anubarak16:
Was someone of you able to do that with the Ultimate version? I keep getting errors and don't know why😅
[ASUS ROG Phone 5 / 5s] JazonX:
I'm on the ROG 5 - Ultimate WW Bro ...

I did TWRP already ...

What's the error ?
[ASUS ROG Phone 5 / 5s] Anubarak16:
Thank you... Seems it has to be an error with my device in that case. https://xdaforums.com/t/recovery-un...og-phone-5-rog-phone-5s.4333661/post-85639901

I'm totally out of ideas what to try next. I guess twrp won't be available for my phone but I don't know why. Is there something special that needs to be done before that's not mentioned? (except unlocking bootloader of course) I have the latest drivers installed, already flashed my boot image and have root permissions but I can't boot twrp
[ASUS ROG Phone 5 / 5s] JazonX:
Can you spare some more information about the device?

* CN or WW / Convert or Factory ROM ? Current firmware version

* Fastboot version you've mentioned, - not sure how to check. Mine is the latest from Google Platform tools. Did you get the same or is it minimal fastboot or something similar ?

* System -> Regulatory Labels -What's the Model Number ?

* If you got root access - What's the code in the file - Vendor / Factory / Country ?
[ASUS ROG Phone 5 / 5s] Anubarak16:
Goddammit it works now... I didn't know I had to install phone drivers twice.. Not only when the phone is attached normally but also a second time when the phone is in the bootloader after reboot command. Never had this issue before with any phone that it's considered as a totally different device after bootloader rebot.

Sorry for the trouble
[ASUS ROG Phone 5 / 5s] twistedumbrella:
I come from an era when every device was like that, so I always assume it can't be that when people post about the phone not being recognized.
[ASUS ROG Phone 5 / 5s] Alexio34:
Hi, is the twrp compatible with ZS673KS-1B013EU asus rog phone 5 ???
[ASUS ROG Phone 5 / 5s] mikalovtch:
It should be compatible.

Please check prerequisites and command to run recovery in OP
[ASUS ROG Phone 5 / 5s] Alexio34:
Thank you, but one other thing if I can, this twrp is permanent and I can reboot into it without pc or I need fastboot to boot in recovery??
[ASUS ROG Phone 5 / 5s] mikalovtch:
To keep TWRP permanent, you need to fastboot boot tarp firstly, and while in TWRP, choose Advanced ->Flash current TWRP, then TWRP will be installed. You will need to reinstall magisk if it was previously installed.
[ASUS ROG Phone 5 / 5s] Anubarak16:
In order to reduce those "how do I install it" questions it might be a good idea to pin a guide somewhere how to install it.

I bet most people won't go through all posts instead they just read the first one and end up wondering why nothing is installed.
[ASUS ROG Phone 5 / 5s] Alexio34:
Thank you very much, so if I want to flash a custom kernel, I’ll need to reflash twrp pressing flashing current twrp and then after that reinstall magisk? Thanks again
[ASUS ROG Phone 5 / 5s] Captain_Throwback:
Flashing a custom kernel doesn't affect TWRP or Magisk.
[ASUS ROG Phone 5 / 5s] Alexio34:
Ok thank you for all now I understand, bye
[ASUS ROG Phone 5 / 5s] twistedumbrella:
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

Edit: there was an even easier way

Have a copy of Magisk apk, the kernel zip from this thread, and the twrp image (just in case) on your sdcard.

Boot TWRP and do Advanced -> Flash current TWRP

Install Magisk through TWRP

Reboot to system

Install the kernel zip

You'll have all three installed and running
[ASUS ROG Phone 5 / 5s] Alexio34:
Thanks for explaining in details, this will be useful as mini guide, can anyone pin the answer, please?
[ASUS ROG Phone 5 / 5s] Captain_Throwback:
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.
[ASUS ROG Phone 5 / 5s] twistedumbrella:
Actually, I did not have the apk or know that TWRP could install it, but thanks for the extra ~45 seconds you'll save the next person if they have it.
[ASUS ROG Phone 5 / 5s] Captain_Throwback:
How did you install the Magisk app without the APK? Also, I think you underestimate how much time it'll take a "normal" user to patch a boot image and install it ;)
[ASUS ROG Phone 5 / 5s] twistedumbrella:
It restored when I did setup, but I usually 'adb install -r' and delete the once and done stuff. Haven't updated it recently, so there was no copy from that.

Also haven't used TWRP in at least 4 years.

Looks like you'd be better off installing the custom kernel before / after Magisk, even if it was already installed first. In addition to Magisk, any overlay.d scripts are discarded. On the 5, that is how you load the secondary display and sound drivers.
[ASUS ROG Phone 5 / 5s] twistedumbrella:
Comparing mikalovtch:main...AbandonedCart:patch-1 · mikalovtch/android_device_asus_I005D

Contribute to mikalovtch/android_device_asus_I005D development by creating an account on GitHub.

github.com

Boot TWRP

Install TWRP

Install Magisk

Install Kernel

Reboot

No issues, everything works.
[ASUS ROG Phone 5 / 5s] Captain_Throwback:
Not sure where this change would be? Nothing in TWRP should be affecting how modules get loaded in Android.

If there are any ramdisk changes done by the kernel, then it does make sense that they would be lost when repacking TWRP into the boot.img. There is some issue with the TWRP ramdisk not being available for the kernel module addon and some items aren't getting copied for the Magisk module. Working with @Freak07 on that presently.

Your change here doesn't make any sense. The code you changed is loading modules from the temporarily mounted vendor partition when TWRP is installed in the boot.img. Loading the modules from /vendor/lib/modules will just load them from the TWRP ramdisk, which is redundant with what already happens in init.recovery.qcom.rc. All of this is irrelevant anyway as that was just a temporary fix and has been deprecated in the official tree on the TeamWin repo.

Please check the official tree instead and if you have any changes to it, you can push to TWRP Gerrit for review.
[ASUS ROG Phone 5 / 5s] twistedumbrella:
The issue you are facing is that you aren't preserving magisk when the image tinkers with the boot to install TWRP.

In trying to look for that issue, I came across a typo that fixes loading modules.

I read across a few people reporting that installing TWRP broke all ability to install kernels from TWRP and have the helper module load. I did not find this to be the case and was reporting that.

I'm not entirely sure what point you are trying to make, but the reason the post was edited was that I realized the modules and magisk were unrelated. I'm sure you already figured that out, but I get what you are trying to accomplish.
[ASUS ROG Phone 5 / 5s] Captain_Throwback:
Yeah I thought I had posted that original reply before you edited the message, and then my second reply was only dealing with your pull request. But when I posted that, both replies got posted.

There isn't a typo in the script, though - /v/lib/modules is the correct path. /vendor/lib/modules is the TWRP ramdisk, and the same modules already attempt to get loaded from there in init.recovery.qcom.rc. If TWRP is booted, though, those modules may not match the installed kernel, which is why we temp mount vendor at /v (so as not to interfere with the TWRP ramdisk) and load the modules from there that should match the installed kernel.

So I'm still confused on your pull request, unless you're saying you understand what's happening there now.
[ASUS ROG Phone 5 / 5s] twistedumbrella:
You're loading the modules for use by TWRP, correct? The modules you load in that script are the ones in the TWRP ramdisk or you just happened to pick the same ones by complete coincidence. If that were the case, why load the tuxera that was dropped by Kirisakura or not load the others used by stock?

One of your other issues is a rather obnoxious sound that accompanies vibration and one of the modules you aren't loading is a sound driver. It didn't fix the issue to fix the typo, but there was no harm notifying you of it beyond the hostility.
[ASUS ROG Phone 5 / 5s] Captain_Throwback:
The modules are being loaded for use in TWRP, yes. But there are two different situations for which the modules are being loaded, requiring 2 different sets of modules:

- When TWRP is fastboot booted, the prebuilt kernel built with the TWRP image is used, and the modules in the TWRP ramdisk are loaded by default (via the insmod commands in init.recovery.qcom.rc). Those are the modules associated with the custom kernel built specifically for TWRP.

- When TWRP is permanently installed, and the user boots into recovery, the device boot.img kernel is used. The modules in the TWRP ramdisk may not load for that kernel, so the insmod commands for the TWRP ramdisk will fail. In that case, the load_modules script will run, which loads modules from the temporarily mounted device vendor partition, where the modules can be loaded that will match the boot.img kernel. Vendor is temp mounted at /v by the prepdecrypt script, so the modules are loaded from /v/lib/modules/$1.ko.

If the script loaded the modules from /vendor/lib/modules, that would just be attempting to load the same modules from the first bullet point, which would be redundant.

For the sound/vibration issue, I think that's an issue with the device tree, for which I already applied a fix to the official trees. Which device do you have, btw? Depending on whether you have a 5 or 5S, the vibration support in TWRP is different. The 5 uses TSPDRV and the 5S uses the aw8697_haptic driver (same as ZF8).

P.S. We only load the modules that are needed for TWRP to fully function, so there's no need to load any other modules besides the haptic and vibration and the exfat/NTFS support.

P.P.S. Not sure if you were insinuating that I was being hostile but I'm just trying to explain that the script is correct, and I'm getting a little frustrated that you keep saying it isn't.
[ASUS ROG Phone 5 / 5s] twistedumbrella:
I have a 5.

There is no need to load the secondary display module unless TWRP intends to use the rear display / touch. I haven't tracked down the actual purpose of the secondary sound driver.

I missed where it was loaded as "v" and... you can figure out the rest from what I was trying to verify.
[ASUS ROG Phone 5 / 5s] Captain_Throwback:
Good to know on the second touch driver. But we're not loading any sound driver at all.

Sinve you have a 5, your device needs the tspdrv support which isn't currently enabled in this tree. The official tree does have that support added, so that build should work fine for you. If you want to test one built with that support, you can try this build:

Captain Throwback ** PM w/o PERMISSION = BLOCK ** in ASUS ROG Phone 5/5s Global Discussion

Test TWRP for ROG Phone 5 (NOT 5S)

t.me
[ASUS ROG Phone 5 / 5s] twistedumbrella:
I am ok with disabling vibration, but thanks for the link.

Ah, you aren't loading sound. I'm so used to the two drivers being the fts_rog2 and sx932x that I didn't even realize it was aw8697 and the other indented line was fts_rog. This is what I get for looking at too many repositories at once.
[ASUS ROG Phone 5 / 5s] Ipedrot:
very good contribution .. I managed to do a firmware downgrade, I had tried many methods but only with this one I could do it. The but is that after installing the firmware it throws me an error when starting android with the message that the software is corrupt after this it sends me to recovery where I get several "no" and 1 "yes" I select yes and it reboot the phone and managed to start the phone. Is it normal for me to throw that error?
[ASUS ROG Phone 5 / 5s] zel-jko:
hi why do i get :

PS C:\Users\user> fastboot boot twrp.img

downloading 'boot.img'...

OKAY [ 2.176s]

booting...

FAILED (remote: Unrecognized command boot)

finished. total time: 2.192s

PS C:\Users\user> fastboot flash twrp.img

unknown partition 'twrp.img'

error: cannot determine image filename for 'twrp.img'
[ASUS ROG Phone 5 / 5s] Captain_Throwback:
You need to be in bootloader, not fastbootd.
[ASUS ROG Phone 5 / 5s] zel-jko:
I have rog5 i would try it, thanks
[ASUS ROG Phone 5 / 5s] zel-jko:
what command needs to be issued to go to bootloader and once in bootloader how is fastboot going to boot into twrp if adb does not see device (not in fastboot you said).Could someone please show exact steps!

Thanks in advance!
[ASUS ROG Phone 5 / 5s] Andrologic:
'fastboot reboot bootloader' or even easier: Just turn off the device and reboot with Vol Up + Power buttons until you land on the bootloader screens - that's it, you're in the Fastboot mode you need to be in for flashing.
[ASUS ROG Phone 5 / 5s] zel-jko:
i had driver problem its ok now, thankyou
[ASUS ROG Phone 5 / 5s] zel-jko:
thanks, driver problem- solved, thanks
[ASUS ROG Phone 5 / 5s] CaptianXLAB:
ROG Phone 5, Can't access internal storage at all from TWRP (shows as 0MB). Trying to decrypt didn't work after using my device pin as the password there. I have already rooted the phone with Magisk (using patched boot.img)

With file manager, I can see some stuff in root dir but still can't open /storage (shows as an empty folder)

Logs say "unable to mount storage", and "Failed to mount '/data' (Invalid argument)"

Does anyone else have this issue? Any fixes? (hope I don't have to clear all data)
[ASUS ROG Phone 5 / 5s] danfrid:
try install this version https://build.twrp.me/twrp-3.5.2_11-0-I005D.img
[ASUS ROG Phone 5 / 5s] CaptianXLAB:
Worked! THANKS! :D

It instantly asked for password first thing when TWRP started. Felt like it's frozen and not responding for about half a minute but worked afterwards. PIN worked just fine and internal storage shows up! Internal Storage is also accessible from Windows when using TWRP now. Perfect ^^
[ASUS ROG Phone 5 / 5s] PAWA9NN:
Sir can you please give me other link (google drive, mediafire) etc, this link isn't working, please it's urgent "twrp-3.5.2_11-0-I005D.img"
[ASUS ROG Phone 5 / 5s] PAWA9NN:
twrp-3.5.2_11-0-I005D.img, this link isn't working, please give another link
[ASUS ROG Phone 5 / 5s] Captain_Throwback:
The server is down right now. You'll have to wait until it's rebooted.
[ASUS ROG Phone 5 / 5s] LeonardoVNN:
I want to edit build.prop but it is read-only how can i fix it
[ASUS ROG Phone 5 / 5s] danfrid:
You have to use a magisk module (find or create yourself) instead of editing build.prop
[ASUS ROG Phone 5 / 5s] LeonardoVNN:
Can you guide me, but I'm a newbie so I'm not very familiar
[ASUS ROG Phone 5 / 5s] danfrid:
® Обсуждение модулей для Magisk - 4PDA

® Обсуждение модулей для Magisk, Обсуждение работы модулей для Magisk

4pda.to
[ASUS ROG Phone 5 / 5s] LeonardoVNN:
Thank you i will research about it
[ASUS ROG Phone 5 / 5s] JazonX:
Try this to make your system partition R/W

https://xdaforums.com/t/script-android-10-universal-mount-system-rw-super-rw-read-write.4247311/

Then do any edit you want.

However - I dont think there are any Build.prop edits that can actually make any difference.
[ASUS ROG Phone 5 / 5s] LeonardoVNN:
Thank you, I have successfully installed and used it
[ASUS ROG Phone 5 / 5s] GottModus:
hello dear "asus rog phone 5/5 Pro/5 Ultimate/5s/5s Pro" users..

(trasnlate from german via translator)

my asus is the "5s Pro"..

adb say's: EU_I005D no idea why not my adb says I005DS.. my phone is 1000% "5S Pro" with "s"

Terminal Emulator says me "true", if i will execute

"getprop ro.build.ab_update"

command [A/B partition check]..

I trust my adb and i will flash an "I005D" twrp image on this weekend:

( ~ first step, boot in img :

[adb pull Asus5sProTWRP.img /storage/emulated/0/ ,

adb reboot bootloader ,

fastboot boot Asus5sProTWRP.img

...

~ than install this img from this booted TWRP :

go to "advanced" than click on "install ramdisk recovery"

~ search for your "Asus5sProTWRP.img" from the internal SDcard and install this

~ reboot in recovery for check :

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.. finish

as described above from @JazonX

thanks for that !! ;) )

ok.. to my questions :

- the TWRP official page published a new image v 3.6.0_11-1.

what is better today (2022) ? should I choose that from TWRP, or the image from the "first post" from this therad ?

- has already had a "5s pro" user experience? if so, you had to run the "systemRW" script, or it worked without a script (read / write internal memory) ?

- there were problems ? Or is it as easy as I summarized it ?

- is there a "TWRP decryp code" on first boot ?

if yes, it is 1234 ?

thanks in advance .. :)

- GottModus
[ASUS ROG Phone 5 / 5s] chairman011:
Twrp won't boot for me after the latest firmware update. Gives me a black screen and phone boots back on but no twrp I never had this issue before putting into TWRP any advice anybody?
[ASUS ROG Phone 5 / 5s] danfrid:
the same problem

@Captain_Throwback can you help with fix?
[ASUS ROG Phone 5 / 5s] Captain_Throwback:
I don't have this device, and this isn't my thread.
[ASUS ROG Phone 5 / 5s] chairman011:
I'm going to try something later on today if it works I'll report back
[ASUS ROG Phone 5 / 5s] dolfn34:
@mikalovtch sorry seems the new update has broken twrp, any ideas to get it going again?
[ASUS ROG Phone 5 / 5s] chairman011:
So I managed to get one of the TWRP versions to boot but it did not ask me for a password and I do have a password on my phone so I didn't want to risk it didn't use it but yes I guess the newest update did break something hopefully we get a solution
[ASUS ROG Phone 5 / 5s] mikalovtch:
Hello! I will try to build new version tonight. I will publish it here to someone try because I don't have ROG Phone 5 or 5S.

Which version did boot?
[ASUS ROG Phone 5 / 5s] dolfn34:
Thank you. I can test with mine, although it's about 130am for me, I'll check in later this morning to test once I get a few hrs of sleep.. thanks for being so responsive on this!
[ASUS ROG Phone 5 / 5s] chairman011:
ZS673KS version I was just trying out anything this one booted but didn't ask for a pw
[ASUS ROG Phone 5 / 5s] chairman011:
I'm ready to test when it's ready
[ASUS ROG Phone 5 / 5s] mikalovtch:
Thanks. I'm building updated kernel at the moment. Will upload test image when twrp will be built.
[ASUS ROG Phone 5 / 5s] JazonX:
Thank you ! :)
[ASUS ROG Phone 5 / 5s] chairman011:
Thank you so much for your effort
[ASUS ROG Phone 5 / 5s] dolfn34:
Thank you!
[ASUS ROG Phone 5 / 5s] mikalovtch:
Could you send me build that has broken pw but booted please?

I have built some versions but tester told me that it doesn't boot
[ASUS ROG Phone 5 / 5s] chairman011:
Ok I'll send the link to my mega here in a few mins
[ASUS ROG Phone 5 / 5s] chairman011:
Here you go it boots up but it doesn't ask you for the password nor does it show internal memory but it's the only one that booted into it
[ASUS ROG Phone 5 / 5s] chairman011:
96 MB file on MEGA

mega.nz
[ASUS ROG Phone 5 / 5s] Red_M:
I have the ZS676KS version and I get a black screen on the latest version from twrp.me and it will only boot twrp on an older version of boot.img
[ASUS ROG Phone 5 / 5s] mikalovtch:
Version from this post will boot but has issue with decryption data partition. You can use sideload or USB OTG instead of /sdcard/

https://xdaforums.com/t/recovery-of...og-phone-5-rog-phone-5s.4333661/post-86497595

Still trying to get new version ASAP
[ASUS ROG Phone 5 / 5s] Red_M:
Is the twrp.me version not receiving updates from you?
[ASUS ROG Phone 5 / 5s] JazonX:
Thank you for your efforts !
[ASUS ROG Phone 5 / 5s] chairman011:
Safe to flash without pw?