yashsingh1/xdaforums huggingface dataset:
[Magisk] ipdev:
Did you try deleting adb completely. ?

The Big Hammer option in my previous post.

Example with stock redfin-rq3a.210805.001.a1 boot image installed.

[ip@lost p5]$ fastboot boot twrp-3.5.0-0-test8-redfin.img
Sending 'boot.img' (98304 KB) OKAY [ 4.498s]
Booting (bootloader) boot.img missing cmdline or OS version
OKAY [ 2.330s]
Finished. Total time: 6.894s
[ip@lost p5]$ adb shell
adb: no devices/emulators found
[ip@lost p5]$ adb shell
redfin:/ # ls -la /data/adb
total 63
drwx------ 6 root root 3452 1970-09-05 19:48 .
drwxrwx--x 49 system system 4096 2021-08-08 16:48 ..
drwxr-xr-x 2 root root 3452 1970-09-05 19:48 magisk
-rw------- 1 root root 40960 1970-09-05 19:48 magisk.db
drwxr-xr-x 2 root root 3452 1970-09-05 19:48 modules
drwxr-xr-x 2 root root 3452 1970-09-05 19:48 post-fs-data.d
drwxr-xr-x 2 root root 3452 1970-09-05 19:48 service.d
redfin:/ #
redfin:/ # rm -rf /data/adb
redfin:/ # ls -la /data/adb
ls: /data/adb: No such file or directory
1|redfin:/ # exit
[ip@lost p5]$ adb reboot bootloader
[ip@lost p5]$ fastboot boot magisk_patched-23000-redfin-rq3a.210805.001.a1-boot.img
Sending 'boot.img' (98304 KB) OKAY [ 4.607s]
Booting (bootloader) boot.img missing cmdline or OS version
OKAY [ 1.471s]
Finished. Total time: 6.258s
[ip@lost p5]$

The reason I load the boot images using fastboot boot instead of flashing it to the device, is for just this reason.

If the image I am testing does not work, the working boot image is still installed and will be loaded on the reboot if the device is in a boot-loop.

By installing fastboot flash boot the boot image that I am testing, if it goes into a boot-loop it will keep loading the broken boot image.

Maybe after enough reboot it will dump out to recovery (Rescue Party) or the bootloader.

Hope that makes sense. 🙃

Cheers. :cowboy:
[Magisk] dcarvil:
I see the above consistently in your posts. I think this means you have two different versions of adb installed, and you invoke both at different times. Delete the older version.

I don't do Windows, so I can't tell you how to find the location. I'm sure someone else here can tell you.
[Magisk] ipdev:
The Pixel 5 stock kernel does not include touch drivers.

The kernel TWRP is built with includes touch drivers.

By booting the TWRP image, we are using the kernel TWRP is built with so touch works.

If we install TWRP, we are now using the stock kernel so touch will not work.

The workaround is to use a custom kernel.

Add Magisk to that..

The boot image gets unpacked, modified and repacked three times.

Replace the stock kernel with custom kernel.

Replace stock recovery with TWRP.

Add the Magisk bits.

Now try to figure out an issue (Why doesn't this or that work?).

Is it the kernel? - Is it TWRP? - Magisk? - Combination of two or all three patched together?

I am not opposed to custom kernels. I have used quite a few over the years.

Now, I just generally stay with stock kernel that the system (ROM) I am running was built with.

I am not opposed to installing TWRP, I have it installed on a lot of devices.

I have only appreciation for the kernel devs and the whole TWRP team. :D

I get lost easily in their world(s). ;)

Cheers. :cowboy:
[Magisk] J.Michael:
@AquilaDroid When you "fastboot boot TWRP", do you see TWRP on your device? Does it have a file explorer function?

I see you repeatedly deleting files that someone thought might be interfering with Magisk, but I never see a display showing whether those files ever existed, or whether they are now gone.
[Magisk] zgfg:
Maybe a stupid question (actually I asked/commented yesterday) - are you sure that all suggested adb commands work without root (i.e. if I understand his case with latest updates correctly, without TWRP and without Magisk)?
[Magisk] J.Michael:
I don't understand, if the twrp.img contains a kernel, if you flash the twrp.img over the recovery partition, then when you boot to recovery, isn't that the kernel that will be running?

I understand the convenience of booting without changing the recovery partition.
[Magisk] AquilaDroid:
I just finished going through it again. Yes, TWRP did appear on my device and I went into file explorer and deleted /data/adb and (and checked to see that it was gone), then fastboot boot magisk patched boot.img. It bootlooped again and then came up (with the old version) after rebooting.
[Magisk] J.Michael:
@73sydney If we're airing arbitrary personal obsessions, I would advise against ever creating a directory named "Android" in the root directory of a filesystem: Android makes one in every filesystem (device; drive) it sees, whether you want it or not. [Spoiler alert: I do not]
[Magisk] zgfg:
He was talking about PC, with Windows , to create and use a folder c:/Android (or something similar, but short and without spaces), for Android related tools and stuff
[Magisk] jons99:
twrp doesn't include the kernel and you need to flash a costum kernel with touch driver that will load the driver before twrp boots
[Magisk] J.Michael:
That's what I'm talking about. I run android-x86 on my desktop computer. Later, in Windows, I see that every drive has an "Android" directory. (All right, maybe not every drive. I'll check later. Bt at least the FAT-formatted partition.) When I complained to the person who built android-x86, he said that was just Android, that it might want that partition, so it always creates it. There's not much in it, it's not eating up a lot of space, but it offends my delicate sensibilities.

Given that that directory may contain things not of your making, I think it's a bad idea to put your own stuff in it.
[Magisk] zgfg:
Not many users run android-x86, specially I doubt that the user for whom it was advised does run
[Magisk] J.Michael:
That is certainly reinforcing my not understanding. What kernel is involved in booting other than the kernel in the image being booted?

How does

fastboot boot twrp.img​

differ from

fastboot flash recovery twrp.img​

reboot​

?
[Magisk] AquilaDroid:
Yes, I've seen that. I searched on adb.exe and found some really old versions. Think it's gone away for now and just to be sure that wasn't influencing the outcome of flashing I tried the routine again with the same results. It does clean up the output though <G>.
[Magisk] jons99:
in the pixel devices we don't have a recovery partition so the recovery magisk and the kernel are flashed into the boot partition and need to live side by side in the same partition
[Magisk] zgfg:
fastboot boot forces ONE TIME booting to the given img (in this case, TWRP)

fastboot flash FLASHES, which means that it (TWRP) WILL STAY, until flashed over by something else

How about the kernel (if needed for TWRP), IDK - P.S. Sorry, I see now, that was probably also your doubt/question
[Magisk] zgfg:
All that theory I know well.

I was simply asking (if he does not boot to TWRP and since he has bootloop when booting with Magisk), how would he run adb commands from PC, accessing /data/adb - that you were insisting for him (instead of TWRP)

Or am I missing something (maybe, is he now supposed to use TWRP and thus to have root for adb)?!
[Magisk] ipdev:
Recovery is build along with a system (ROM) build.

TWRP is normally based on a Omni, Linage and recently AOSP.

You replace the (Omni, Lineage, AOSP) recovery bits with the TWRP goodies. ;)

Then build the base rom and TWRP is built instead of the ROM's recovery.

^^^ A little over simplifying the above. ^^^

When recovery is a separate partition, it includes a kernel and is a mini-system that is self contained.

When recovery lives in boot, it is part of the boot image.

Recovery uses the same kernel as system (ROM).

It is still a mini-system but, not quite as self contained.

When TWRP is installed, it only replaces the recovery part of the boot image on the device.

The TWRP image is a boot image that contains TWRP recovery and the kernel of the base system (ROM) that it was built with.

When booting the TWRP boot image, we are using the kernel from the base system (ROM) instead of the installed stock kernel.

Hope it helps more than confuse. 🙃

Cheers. :cowboy:
[Magisk] ipdev:
Every command I suggested, I double checked and tested before I suggested it. ;)

I did not suggest one that was above permission in the current state of device.

For commands that needed higher permissions..

I stated to boot twrp-3.5.0-0-test8-redfin.img first.

I did point out why some commands failed.

I did not suggest using the command when the device was in that state. ;)

Cheers. :cowboy:
[Magisk] ipdev:
Don't forget about case-sensitive systems. :p

Spaces suck on unix/linux based systems.

This includes you macOS guys and gals. ;)

You have escape \ special characters like spaces.

$ fastboot boot Aquila\ magisk_patched-23000_59UWF.img

I have not been a Windows user for quite awhile.

I boot into Win 7 Pro if/when needed. ;)

You should add platform-tools to your $PATH.

This will allow you call the commands from any directory you are in.

Did a quick search and found this article about modifying Windows PATH.

Architect Ryan - Add to the PATH on Windows 10 - webSite - Link

Cheers all. :cowboy:

PS.

There is no problem calling a full path, I do it quite a bit. ;)

Note: I have seen issues in different threads about using /User/Desktop/

Normally it was recommended to make a directory on C:\ and move the files there.

Doubt this has anything to do with your boot issue since you can flash and boot the stock image.
[Magisk] 73sydney:
Most people arent running android on their desktop, hence theres no c:\android...it was just an obvious way to name a folder

Call it c:\notandroid if you like :)
[Magisk] 73sydney:
Adding to path is good and all, but after years on helpdesks i tend to avoid sending people there, because theyre one keystroke/button press from possible heartache if they delete something there :) As someone who has tried to direct the average punter over a phone call sometimes i would have more faith in, and ask the punters cat, to do the steps :)

@AquilaDroid

Just a quick mention that youre still typing far more than you need (and i hate extra work, after 30+ years of typing)

fastboot boot "C:\platform-tools\twrp-3.5.0-0-test8-redfin.img"

could be:

fastboot boot twrp-3.5.0-0-test8-redfin.img
[Magisk] AquilaDroid:
Yes, but I'm not "typing" it. I drag and drop the file into the command prompt window. I'd still be entering the first query here if I had to type all the ambiguous stuff that I was making you all comb through!

I'm just about ready (tomorrow) to install TWRP on the phone and install Magisk from there. If anyone has any cautions to watch out for I'd love to hear them before the fact! Thanks to all of you for forcing my old brain to work so hard!
[Magisk] ipdev:
Still a command should be global. ;)

Cheers. :cowboy:
[Magisk] 73sydney:
Phew, glad to know youre not typing it at least :)

Id expect that level of pedantry from @pndwal

If he had posted that i might have felt the need to hunt him down at his favourite coffee place

But its okay coming from you :)
[Magisk] pndwal:
Maybe that's why I liked the comment 😛 ... n who are you calling a pedant? ... Didn't you start down that road? 🤭

... But I thank you for another attempt at levity. I've found they often fall flat here...

I do think@AquilaDroid's done us all a favour here; I'm learning a lot, enjoying some tech discussion from those with real experience for once!... Hope all are benefiting... maybe it's just my pedant mind. 😜

So I bit! ... As you wished.

And if anyone takes this OT too seriously / thinks it's spam, think again! That's not spam! ... THIS is spam:

Bite that! ... with coffee at your favourite cafe. PW
[Magisk] J.Michael:
As I understand it, you don't need to install TWRP to use it to install Magisk: You have been successfully booting TWRP without installing it. While TWRP is running, you can use it to install a Magisk .zip.
[Magisk] pndwal:
... Just in case, ensure Magisk App isn't hidden (unhide / restore in settings). Can't remember how you got App...

I second that.

Reading back, I think @ipdev suggested 'boot to' as opposed to 'install' TWRP (ie. to boot partition) for good reason... especially since you're patching installed boot image concerned on A/B device. PW
[Magisk] maybeme2:
I can no longer find magisk.zip on topjohnwu's website.

I need to find magisk.zip to install through twrp because when I root through magisk manager it removes my previously installed twrp recovery. And if I reinstall twrp recovery it removes root. Catch 22!

So where can I find and download the latest magisk.zip to install through twrp?

Thank you.
[Magisk] AquilaDroid:
MOD EDIT: OT removed

I'm getting ready to do the TWRP install of Magisk, but need the phone to actually be a phone for awhile.

Here's the plan

Boot into recovery

Fastboot boot twrp-3.5.0-0-test8-redfin.img

In TWRP on device do what????

Thanks for making this so much more bearable..

(I'll be offline for a few hours.)
[Magisk] pndwal:
Rename App to .zip

Read official Installation Instructions! 😜 ... Here you go:

https://topjohnwu.github.io/Magisk/install.html#custom-recovery 👍 PW
[Magisk] pndwal:
Take your pick!

Delete that database and try booting to safe mode then system, delete whole adb folder in /data and try same, or rename Magisk App to uninstall.zip, flash and try same! PW
[Magisk] maybeme2:
T

Thank you.

Thank you. I had trouble finding these instructions. So thanks for the link.

The instructions say:

"It is very difficult to accurately detect the device’s information in custom recovery environments. Due to this reason, installing Magisk through custom recoveries on modern devices is no longer recommended. If you face any issues, please use the Patch Image method as it is guaranteed to work 100% of the time."

But the patch method did not work for me because, though it rooted the phone, it removed my installed twrp recovery. That is why I was searching for the zip file to install via twrp. I wonder if topjohnwu is aware of this.

Thanks for the help.
[Magisk] pndwal:
So guess you have A/B device? TWRP in boot, not recovery? ... Did you patch / flash stock boot image?

I don't have such a device, but I'm assuming that if you wish to keep TWRP you need to patch TWRP-patched boot image with Magisk to get TWRP & Magisk-patched image (or similar process). Best to check forums for your device.

And yes, John would be aware of these requirements; he just avoids those methods as they get messier with each architecture change Google makes!

Of course, you can simply boot to (not install) compatible TWRP using PC ADB Fastboot (discussed here in very recent posts) and use this for flashing ROMs etc

Or flash image with TWRP back, use Fastboot to boot to (not install) system with Magisk patched image, then take Direct Install method. Should patch / boot existing boot image with TWRP.

Others with A/B devices may have clearer ideas. PW
[Magisk] maybeme2:
I 'think' I figured out why magisk removed my twrp installation. I patched the boot.img instead of the recovery.img.

If that is so, where do I find the recovery.img to patch? I am not that knowledgeable. Is it on the phone? Is it the twrp.img? How do I access it to patch it?

Sorry for my ignorance.

Yes I have an A B slot phone. My phone's support thread are very inactive and I can't get help there.
[Magisk] maybeme2:
I don't know where to find the twrp patched image. If it's on the phone I can't access.it till I'm rooted.
[Magisk] pndwal:
You should only patch recovery if ramdisk = no... and I believe this only applies to A-only devices. PW
[Magisk] pndwal:
I imagine you downloaded or made it when you previously installed TWRP...

Can you say device / ROM, give Magisk App screenshot... And read official Magisk Installation Instruction carefully! PW
[Magisk] maybeme2:
I'm guessing it must br the twrp img I downloaded that's specific to my phone.

I'll try magisk patching that tarp.img.

I can't do it now but will later today. I hope that works and does not brick my phone.
[Magisk] pndwal:
Sounds right. Did you originally install by fastboot flash boot xxx.img (not fastboot flash recovery xxx.img)?

Is this a Pixel or what?

Edit:

I just read official instructions for a TWRP on a Pixel 2xl.

It said DON'T flash image!.... fastboot boot twrp.img

Then use TWRP to flash a separately downloaded twrp.zip file to both (automatic) boot partitions. (This will patch stock boot images with TWRP)

Other A/B devices may be similar, I don't know.

... You'll need to boot to Magisk-patched image and take Direct Install, or patch and flash a TWRP backup of boot image w/ TWRP...

If bricks, just use Fastboot to flash back un-patched image.

Also, if you had Magisk installed previously, disable all modules first, and ensure App is not hidden (unhide / restore in settings). PW
[Magisk] maybeme2:
Device: Moto G7 (river)

Rom: Android 10

OK, im a newbie. I can't tell you how grateful I am for your help. I wish you were here in person. I'd pay you to fix this mess.

1. How do I disable all modules?

Also, I can't find the Magisk part that shows which apps have superuser and which don't. Where is it?

2. Here's what I did so far

I'm sorry for being so unknowlegeable, but I am a relative newbie end user and way over my head.

Here's what I did. The phone is a rooted moto G7 (has 2 slots). I updated its android 9 to 10 as follows:

1. I downloaded android 10 ROM version according to mybuild number from:

lolinet mirrors - firmware, software, iso etc.

lolinet mirrors - powered by h5ai

mirrors.lolinet.com

It was

RIVER_RETAIL_10_QPUS30.52-33-11_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip

2. I flashed it to the phone using fastboot.

3. I then installed twrp which is now a

2 step procedure

(img for temorary install and then zip for permanent install). It installed permanently properly.

4. I installed Magisk manager apk which I obtained from the Google Play store.

5. I then obtained the boot.img from

RIVER_RETAIL_10_QPUS30.52-33-11_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip

and patched it using the installed Magisk manager

6. I flashed the magisk patched boot.img using fastboot.

Rebooted.

I was rooted, but

twrp recovery was gone

.

I am assuming I should have patched the

twrp-3.5.1_10-0-river.img

and flashed that to the phone instead. Correct?

But, twrp install is a 2 step procedure now. And twrp.img only installs twrp temporarily. so?

What would be the correct sequence to do things now?

I am really not an android expert.

(I need twrp to create nandroid backups).
[Magisk] 73sydney:
fwiw, i never install TWRP on my Pixel 2XL, i always fastboot it

some have claimed to have no issues installing it, ive had a different experience along with many...generally in our devices ROM threads we advise people to NOT install TWRP, but just fastboot it when needed.

Usual Note: to avoid root detection for some apps, notably banking, you will of course always want to remove the TWRP folder on /sdcard after using TWRP
[Magisk] pndwal:
I ammended some notes above after checking official TWRP guide for pixel 2xl (A/B) device...

Nb. Many just boot to it (don't install) when needed as @73sydney mentioned above to avoid a number of issues these days.

I don't think patching twrp.img as supplied would work... I'm guessing you could have taken a TWRP backup including boot image which would have included TWRP, located and patched boot image in Magisk App (can rename backup bootxxx.win file to .img file or leave as .win) and that should have worked... Also, could boot (only) your Magisk patched image to get root which allows additional Direct install method which will patch current boot image (with TWRP) and that should work too.... but both are guesses. PW
[Magisk] maybeme2:
Thank you for taking the time to help. I really appreciate it.

I know I can't install twrp after magisk because every time I've tried it twrp unrooted the phone. That's the catch 22.

I only need root for 2 things. Twrp and titanium backup. I had them both in android 9 on this phone. I wish I didn't move to android 10.....

Thank you very much for all your help.
[Magisk] martyfender:
The last I knew, the official Magisk is not available in the Google Play Store. It is only available from topjohn wu's git hub site.
[Magisk] maybeme2:
My error.

That must be where I got it from.
[Magisk] 73sydney:
You can just fastboot TWRP when needed as mentioned a few times

Also Titanium Backup is a terrible piece of crud

If you want a backup solution that does apps & data, and doesnt even require TWRP to restore apps, you might like Migrate

[APP][ROOT][5.0+][1st Nov 2020] Migrate - custom ROM migration tool

Jumping from one custom ROM to another can be a challenging task. So I decided to make an app to simplify the process. Introducing Migrate! Migrate-GPE (v4.0) is on Google Play It was temporarily suspended. Read more here...

xdaforums.com

and how i use it to make my life easy (as i flash ROMs often) here:

https://xdaforums.com/t/app-root-5-...stom-rom-migration-tool.3862763/post-85209583

Migrate.... i dont flash ROMs without it <-- i really need a graphic for this, and an endorsement deal...even though its free :)
[Magisk] pndwal:
... Sorry mate; I actually misread the pixel TWRP page; it's just like yours, but adds "Installing TWRP at this time will remove root if you are currently rooted."... There you go!

https://twrp.me/motorola/motorolamotog7.html

https://twrp.me/google/googlepixel2xl.html

I've edited previous posts again.

I gave two methods to patch boot image (w/ TWRP) with Magisk that should work above; I think setting up with TWRP installed again (unrooted) and booting (fastboot boot only) system w/ Magisk-patched image you made to take Direct install is best. PW
[Magisk] pndwal:
Floating menu at bottom (only appears if you have root, ie Not Magisk Installed - N/A):

Modules - puzzle-piece icon, toggle any modules off and reboot.

Superuser (and MagiskHide list) - shield icon.

👀 PW
[Magisk] maybeme2:
Yes titanium backup isn't what it used to be. I've used both tibu and twrp for years. But it looks like I need to find alternatives.

Booting twrp temporarily is an option. But it requires being by a PC.

I will look into migrate. Any other options?
[Magisk] 73sydney:
Yup fastbooting does require being connected to a PC, but usually if youre needing TWRP level access, things are bad, or your flashing, or transferring stuff off...you'd normally not be a million miles from a PC...

When Titanium burnt me badly for the last time about 4 years ago i departed to MyBackup Pro (not free)

Then i found Migrate a ways back and been using that ever since, cant beat the rpice either (free)

For alternates, @flar2 of kernels and other fame is currently working on his own backup utility, its in beta and perhaps won't be free at the end of that cycle, but worth giving it a crack if you like:

https://xdaforums.com/t/app-appdash-tag-sort-backup-beta.4302581/

If anything it promises to be over-engineered, he does good work
[Magisk] J.Michael:
I remember reading someone's description of how he was able to "flash" something using only his phone. It wasn't recently, so you'll have to go back three years. I don't remember what he was "flashing", so it might not be the full power of having fastboot without a PC. And it might have required having a USB cable, even though there was nothing on the other end of the cable.

I just found fastboot Miui w/o PC. It looks scary. Don't do any of it until you're sure you understand it.

And I found running adb/fastboot on another android device, which may be useful, but still requires a second computer.