Permanent fix for Bluetooth battery drain on stock 7.1 N108 - Nextbit Robin

I found a permanent fix for the Bluetooth battery drain bug on stock 7.1, the last n108 release.
Root is required for this fix.
First, go to developer settings and enable Bluetooth hci Snoop log. Reboot. Then disable the Bluetooth hci log. Reboot.
Next, using a root file explorer (I used ES file explorer), navigate to /system/etc/Bluetooth/
Open bt_stack.conf
Near the top is "BtSnoopConfigFromFile=false"
Change it to true, then make sure the following two lines are set to false.
BtSnoopLogOutput=false
BtSnoopExtDump=false
Save the file and reboot.
After some browsing on the nextbit forums, someone had identified that the Bluetooth Snoop hci log was being written to the root directory of /sdcard/, causing significant battery drain. Their solution was to toggle the Bluetooth log on in developer settings, reboot, turn it off, then reboot again. It would always turn itself back on though. This prevents that.
(Bluetooth hci log is a file where android literally records all Bluetooth traffic information, which as you might imagine is CPU and I/o intensive. Normally used by devs for troubleshooting).
I decided to go back to stock due to constant bugs and freezes with the lineage 14.1 builds. Battery life has even been a little better on stock, with rock solid stability.
This prevents the battery drain aspect, but the battery settings still has a reporting error that attributes much more drain to Bluetooth than it should. I'm still getting 3-4hrs screen on time with lots of Bluetooth use after this fix. Better battery stats will provide accurate drain stats.

This is excellent information - thanks for posting - however, I get stuck when trying to save the proposed changes to bt_stack.conf; the file is read-only and I cannot figure out how to change it to allow me to save the changes. How did you do that on the stock ROM?

Bleser said:
This is excellent information - thanks for posting - however, I get stuck when trying to save the proposed changes to bt_stack.conf; the file is read-only and I cannot figure out how to change it to allow me to save the changes. How did you do that on the stock ROM?
Click to expand...
Click to collapse
Is your phone rooted? I used ES File explorer with "root mode" enabled. You can only make changes to the file with a root elevated program. There is also solid file explorer and root file explorer as other options that may work. I should have mentioned root is required.
I believe ES file explorer changes the permission automatically when in root mode, to allow changes. Other apps may require manually changing the permissions of the BT config file.
I did also run 'hide magisk manager" in the magisk settings.

boxes said:
Is your phone rooted? I used ES File explorer with "root mode" enabled. You can only make changes to the file with a root elevated program. There is also solid file explorer and root file explorer as other options that may work. I should have mentioned root is required.
I believe ES file explorer changes the permission automatically when in root mode, to allow changes. Other apps may require manually changing the permissions of the BT config file.
Click to expand...
Click to collapse
Hi @boxes,
No, it is not rooted. I will try ES File explorer. Thanks!

Bleser said:
Hi @boxes,
No, it is not rooted. I will try ES File explorer. Thanks!
Click to expand...
Click to collapse
You will need to be rooted to do this. If you root with magisk, then you can still pass the safetynet check.
Rooting the robin is very easy luckily.
Follow these steps to unlock the bootloader and flash TWRP.
https://forum.xda-developers.com/nextbit-robin/general/guide-install-twrp-root-robin-t3334171
(Use this TWRP rather than the one on that thread-)
https://forum.xda-developers.com/ne...recovery-twrp-3-0-0-0-touch-recovery-t3334152
Then download magisk from here-
https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
Also download the magisk manager APK. Flash magisk from TWRP then install magisk manger in android.

boxes said:
Is your phone rooted? I used ES File explorer with "root mode" enabled. You can only make changes to the file with a root elevated program. There is also solid file explorer and root file explorer as other options that may work. I should have mentioned root is required.
I believe ES file explorer changes the permission automatically when in root mode, to allow changes. Other apps may require manually changing the permissions of the BT config file.
Click to expand...
Click to collapse
boxes said:
You will need to be rooted to do this. If you root with magisk, then you can still pass the safetynet check.
Rooting the robin is very easy luckily.
Follow these steps to unlock the bootloader and flash TWRP.
https://forum.xda-developers.com/nextbit-robin/general/guide-install-twrp-root-robin-t3334171
(Use this TWRP rather than the one on that thread-)
https://forum.xda-developers.com/ne...recovery-twrp-3-0-0-0-touch-recovery-t3334152
Then download magisk from here-
https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
Also download the magisk manager APK. Flash magisk from TWRP then install magisk manger in android.
Click to expand...
Click to collapse
Thanks again for your help!

boxes said:
I found a permanent fix for the Bluetooth battery drain bug on stock 7.1, the last n108 release.
Root is required for this fix.
First, go to developer settings and enable Bluetooth hci Snoop log. Reboot. Then disable the Bluetooth hci log. Reboot.
Next, using a root file explorer (I used ES file explorer), navigate to /system/etc/Bluetooth/
Open bt_stack.conf
Near the top is "BtSnoopConfigFromFile=false"
Change it to true, then make sure the following two lines are set to false.
BtSnoopLogOutput=false
BtSnoopExtDump=false
Save the file and reboot.
After some browsing on the nextbit forums, someone had identified that the Bluetooth Snoop hci log was being written to the root directory of /sdcard/, causing significant battery drain. Their solution was to toggle the Bluetooth log on in developer settings, reboot, turn it off, then reboot again. It would always turn itself back on though. This prevents that.
(Bluetooth hci log is a file where android literally records all Bluetooth traffic information, which as you might imagine is CPU and I/o intensive. Normally used by devs for troubleshooting).
I decided to go back to stock due to constant bugs and freezes with the lineage 14.1 builds. Battery life has even been a little better on stock, with rock solid stability.
This prevents the battery drain aspect, but the battery settings still has a reporting error that attributes much more drain to Bluetooth than it should. I'm still getting 3-4hrs screen on time with lots of Bluetooth use after this fix. Better battery stats will provide accurate drain stats.
For extra security you can change the permissions of the .conf file to read only for all groups.
Click to expand...
Click to collapse
Bless you! I should have looked into this earlier but never got around to it, having just left Bluetooth off except when charging. Will see if I can do a bind mount over the file with Magisk so I can leave the system image read-only.
---------- Post added 3rd July 2018 at 12:00 AM ---------- Previous post was 2nd July 2018 at 11:57 PM ----------
In the process of looking this up, I discovered a Magisk module to fix the Bluetooth config problem already exists:
https://forum.xda-developers.com/apps/magisk/module-disable-bluetooth-hci-snoop-log-t3680223
You do not need to edit your system image, just install Magisk and then use Magisk Manager to install this module.

iscaela said:
Bless you! I should have looked into this earlier but never got around to it, having just left Bluetooth off except when charging. Will see if I can do a bind mount over the file with Magisk so I can leave the system image read-only.
---------- Post added 3rd July 2018 at 12:00 AM ---------- Previous post was 2nd July 2018 at 11:57 PM ----------
In the process of looking this up, I discovered a Magisk module to fix the Bluetooth config problem already exists:
https://forum.xda-developers.com/apps/magisk/module-disable-bluetooth-hci-snoop-log-t3680223
You do not need to edit your system image, just install Magisk and then use Magisk Manager to install this module.
Click to expand...
Click to collapse
I tried that and it didn't work for me, I replied to the thread a while back. At least with magisk v16.
Are you concerned about passing the safetynet check? I ran the check in magisk manager and passed, both ctsProfile:true and basicIntegrity:true
I'm still able to download apps from the play store that block rooted/modified devices. Magisk is masking the changes perhaps.
edit: I tinkered with magisk, enabling "hide magisk manager" and now it wont pass safetynet check. So I reinstalled magisk manager. This time I didnt "hide magisk manager", but I enabled "magisk core only mode" and checked the box for "Magisk Hide" and "Systemless Hosts" (I use adaway), now it passes the safetynet check again.

boxes said:
I tried that and it didn't work for me, I replied to the thread a while back. At least with magisk v16.
Are you concerned about passing the safetynet check? I ran the check in magisk manager and passed, both ctsProfile:true and basicIntegrity:true
I'm still able to download apps from the play store that block rooted/modified devices. Magisk is masking the changes perhaps.
Click to expand...
Click to collapse
After installing the module, I had to turn "Enable Bluetooth HCI snoop log" on in "Developer options", reboot, and turn it back off again, but it seems to have worked and /sdcard/btsnoop_hci.log stopped growing in size.
The file was also not recreated after I deleted it and rebooted one more time. So I think the extra steps are necessary whether using the module or editing the original file in the system image (there's lingering config data which could in theory be handled in the module as well if ).
boxes said:
edit: I tinkered with magisk, enabling "hide magisk manager" and now it wont pass safetynet check. So I reinstalled magisk manager. This time I didnt "hide magisk manager", but I enabled "magisk core only mode" and checked the box for "Magisk Hide" and "Systemless Hosts" (I use adaway), now it passes the safetynet check again.
Click to expand...
Click to collapse
I've had Magisk installed since I first got the phone and except for a brief period in mid 2017, SafetyNet checks have been passing with "Magisk Hide" alone, without selecting "core only mode" (which disables modules). I'm also using "Systemless hosts" for AdAway.

@iscaela
How long has it been since you did that? Just the process of enabling/disabling in dev options would fix it for a day or two in my experience.

boxes said:
@iscaela
How long has it been since you did that? Just the process of enabling/disabling in dev options would fix it for a day or two in my experience.
Click to expand...
Click to collapse
Just over 12 hours today. I've rebooted twice recently and it's stayed the same. I doubt there's a time component to it reverting, the config loading is pretty simple.
Interestingly, bluedroid is still listening on port 8872 as documented at https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/master/doc/btsnoop_net.md but isn't producing any traces.

iscaela said:
Just over 12 hours today. I've rebooted twice recently and it's stayed the same. I doubt there's a time component to it reverting, the config loading is pretty simple.
Interestingly, bluedroid is still listening on port 8872 as documented at https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/master/doc/btsnoop_net.md but isn't producing any traces.
Click to expand...
Click to collapse
So the most recent reboot did enable the setting and created /sdcard/btsnoop_hci.log again. The reason appears to be the module leaves BtSnoopConfigFromFile=false.
I'm going to update the module to edit this and report back.

Looks like the updated Magisk module works, I've posted it to the other thread:
https://forum.xda-developers.com/ap...bluetooth-hci-snoop-log-t3680223/post76987430

Related

[PROTIP] How to get SuperSu, Xposed App Settings and other apps that dont open to run

Some apps like supersu or xposed app settings dont open on firetv.
Apparently this is caused by the app theme which the firetv is missing. So its unable to open those apps with incompatible themes.
To fix those apps and make em run, you need the xposed module “Holo Themer“.
Its very important that you take the version 3.0 because with all newer versions you might get bottles bootloops when the module is enabled.
Even with that 3.0. you might get a bootloop, but there is a fix for that:
https://forum.xda-developers.com/fire-tv/general/protip-how-to-fix-bootloop-caused-t3552052
The theme which is working fine for me is the “Material Dark“ one.
Enjoy your Supersu settings and xposed settings etc.
zroice said:
Some apps like supersu or xposed app settings dont open on firetv.
Apparently this is caused by the app theme which the firetv is missing. So its unable to open those apps with incompatible themes.
To fix those apps and make em run, you need the xposed module “Holo Themer“.
Its very important that you take the version 3.0 because with all newer versions you might get bottles bootloops when the module is enabled.
Even with that 3.0. you might get a bootloop, but there is a fix for that:
https://forum.xda-developers.com/fire-tv/general/protip-how-to-fix-bootloop-caused-t3552052
The theme which is working fine for me is the “Material Dark“ one.
Enjoy your Supersu settings and xposed settings etc.
Click to expand...
Click to collapse
I hope this works & that it might be implementable outside of XPosed some how.
Do you know if this will also fix the ES File Explorer "Sorry, test failed. This feature cannot run on your device" bug too ?
More info on it here: https://forum.xda-developers.com/showpost.php?p=71704440&postcount=15
Wonder if this will let us change settings in SuperSU to be able to get ES File Explorer Root to work correctly ???
well you can change super su settings with that fix.
xposed is necessary
zroice said:
well you can change super su settings with that fix.
xposed is necessary
Click to expand...
Click to collapse
Was finally able to try it & it let me update the included SuperSU. And that fixed all my ES File Explorer Root option failing problems. So thanks. This option did the trick. Which actually makes sense since when we first rooted our FTV1's doing a normal update in SuperSU when that popped up was part of the process. Will include more details over in the ES File Explorer thread. :good:
Thanks again for sharing this.
FYI, I do deactivate the Holo Themer module to lessen the device random rebooting. So it's good to only have it active on as needed basis.
Big thanks for this info. I can finally change su settings from prompt to grant permission for rooted apps.
blue1978 said:
Big thanks for this info. I can finally change su settings from prompt to grant permission for rooted apps.
Click to expand...
Click to collapse
But make sure you keep it deactivated or you will start to see multiple random restarts to your device. Only turn it on when needed. Which shouldn't be often. Also turning it on/off requires a reboot too.
Y314K said:
But make sure you keep it deactivated or you will start to see multiple random restarts to your device. Only turn it on when needed. Which shouldn't be often. Also turning it on/off requires a reboot too.
Click to expand...
Click to collapse
I didn't have any issues leaving it enabled.

Help writing files to /system

First, this is my setup.
Running stock rooted with elemental x kernel.
OS - Jan Patch
Magisk - v16.2
Magisk Manager - v5.6.4
Elemental X- P2-1.05
Twrp - latest
I did search as best I can on these forums but found just bits and pieces and still no solution. If there is one mods please delete and I'll search again.
So my issue is at some point I could no longer overwrite files to my system. I do have a modified host that I did awhile back and that sticks. But I can no longer overwrite that and others. I have es file pro and it can't do it. When I check permissions for system to be rw it switches back to ro when I go back into permissions. I have root browser by jrummy and that lets me change files but it doesn't stick after reboot. I also un checked the radio button avb/dm-verity in Magisk Manager but it too doesn't stick when I back out of app and go back in. Did I not do something correctly when installing Magisk? In Magisk thread it says your /system will only be modified if root is installed to /system. But doesn't explain how to do that. Sorry for long post, hopefully someone can point me in the right direction.
Edit:
Solved.
I got it, I think those two radio buttons are settings for when you update magisk or patch boot. They were both selected by default, so I unchecked them and installed magisk v16.0 through the manager and now I can write to system. Es File Explorer still not working but at least the other file manager is. Mods you can delete this thread.

Root access issue.

So I booted twrp.img and installed magisk 17.1 and updated to magisk 17.2 beta and root is there via root checker. However, regardless of what file explorer I tried to use I cannot replace or delete files in vendor/libs or anywhere in the system folder. Can someone explained to me why and how I can overwrite files in vendor/lib?
Is the file explorer showing root permissions in Magisk? I've started running in to a similar issue recently myself. It seems random but I can view and edit some files in the root partition but there are others where I am denied access. Before a couple of weeks ago I didn't have this issue. I'm not sure when the problem started but from what I have read FX file explorer and there dedicated root addon will work. I haven't had a chance to check for myself though.
I have the same issue. I can't save my edits in build.prop.
user557 said:
I have the same issue. I can't save my edits in build.prop.
Click to expand...
Click to collapse
Worked for me on stock October security patch with Magisk 17.2 and Total Commander. I use Google's default Kernel.
What has worked for me in the past was to uncheck the two radio buttons on magisk main screen. {The two advanced items} then I would press the install button right below. After doing that I would be able to change files in directories I once couldn't. Worth a shot
Fe Mike said:
What has worked for me in the past was to uncheck the two radio buttons on magisk main screen. {The two advanced items} then I would press the install button right below. After doing that I would be able to change files in directories I once couldn't. Worth a shot
Click to expand...
Click to collapse
Thanks for the info. It works! :good:

Help reinstall magisk

It's been a while since I last rooted my 7t. Current oos 10.3.6. Magisk manager v8.0.3. Magisk was 20.4 I think.
So fetch rewards app detected root. I went to add the app to the magisk hide, cleared fetch rewards storage and still root was detected. Tried to run the rename option in the magisk settings but it appears to hang during the process. Phone screen timed out and when I get back into it, the hide magisk manager status pop up was still there. Rebooted the phone, went back to magisk manager. While magisk manager shows it's still installed, magisk is not. Safety net checks still passed.
To reinstall magisk, I need to get the patched oos image, correct?
Thanks
Hi
Think from the magisk manager app you would just install to inactive slot and reboot?
Refer to the Magisk root for 7T thread for patched boot image and instructions.
When I installed a root checker, it showed that I'm still rooted.
All this started when I used the Magisk function to repackage magisk's file name in an attempt to hide it from Fetch Rewards.
noodlenoggan said:
When I installed a root checker, it showed that I'm still rooted.
All this started when I used the Magisk function to repackage magisk's file name in an attempt to hide it from Fetch Rewards.
Click to expand...
Click to collapse
Ok I don't know what I'm missing but I can't seem to find that fetch rewards app in my play store to install and test at my end. Second, Magisk isn't installed according to you manager screenshot... So I'm at a loss. But their are threads better able to assist your efforts to have Magisk root up and running first cause I not knowledgeable enough to state why your root check detects root yet the manager does not indicate root installed.
But I'll hopefully be of more help and provide you this:
https://forum.xda-developers.com/oneplus-7t/how-to/guide-how-to-root-oneplus-7t-twrp-t3979307
So I'll copy and paste from the link above:
HOW TO UPDATE a ROM and KEEP ROOT:
Before all Disable all magisk modules
Be sure to use Canary Magisk Manager and Canary Magisk (debug)
You can update a stock rom from phone settings with local upgrade:
- Update the Rom WITHOUT REBOOT;
- Open Magisk Manager;
- In Magisk Manager, click on Install/Install/Direct Install;
- Again in Magisk Manager, click on Install/Install/Inactive Slot;
- Reboot.
So from thier I'd assume you need only the following:
- Open Magisk Manager;
- In Magisk Manager, click on Install/Install/Direct Install;
- Again in Magisk Manager, click on Install/Install/Inactive Slot;
But I am unsure so please verify b4 attempting.
Or may be someone else can confirm here?
Good luck and please consider letting me know how you made out. Thanks
I jumped on the xda magisk support forum and was able to sort out the whole mess I was in.
The android app is called Fetch - Receipts Scanner by Fetch Rewards. It's in Google store.
Hopefully for anyone else that is in the same situation will find their solution as I did below.
What I learned from the Magisk forum and closer examination of my phone were:
- Magisk and Magisk Manager are two separate components. Magisk handles the root and Magisk Manager handles additional root related features. Magisk Manager is not required to have a rooted phone continued to be rooted. I was not aware of this.
- When the repackaging routine was started, Magisk Manager did indeed repackaged and installed itself. There was not indication that the process completed successfully as the spinning progress icon did not stop. I had renamed it MagMan as part of the repackaging routing and was expecting the original icon Magisk icon to show for MagMan. Sorry, I had not read the Magisk Manager instructions and simply made a lot of assumptions of the repackaged process. What happened was that I assumed Magisk Manager would just switch over the new name as part of the repackaging routine. Also I didn't pay close enough attention that the new repackaged app, MagMan, which was literally next to Magisk Manager mainly because it had a generic Android icon instead of the Magisk Manager icon and was overlooked. This whole entire time, I was focusing on the original Magisk Manager app and icon but all of the functionality of Magisk Manager now resided in MagMan. I've uninstalled the original Magisk Manager app and now use the repackaged version.
The Fetch Rewards app was added to the Magisk Hide section via MagMan and it's now working properly.
Thanks for following up.
noodlenoggan said:
Thanks
Click to expand...
Click to collapse
Sweet - glad you have success. Enjoy
I just did more or less the same thing... Hid Magisk manager... Forgot... Flashed full update no prob... Installed new Magisk Manager (along with the previously hidden install of Magisk manager).
Then finally figured out to uninstall the hidden Magisk manager... Then, Magisk manager and was able to install Magisk Root. All good now lol. Glad your up and running.
This worked for me yesterday, but make sure to reboot the phone after doing the "hide magisk" option in Magisk Manager settings. The name also does not have to be "MagMan" it can be anything of your choice.
I also noticed that the proxy app (with blank icon) might not open but if it fails to open just force close it and try again, that seemed to make it open for me.
noodlenoggan said:
I jumped on the xda magisk support forum and was able to sort out the whole mess I was in.
The android app is called Fetch - Receipts Scanner by Fetch Rewards. It's in Google store.
Hopefully for anyone else that is in the same situation will find their solution as I did below.
What I learned from the Magisk forum and closer examination of my phone were:
- Magisk and Magisk Manager are two separate components. Magisk handles the root and Magisk Manager handles additional root related features. Magisk Manager is not required to have a rooted phone continued to be rooted. I was not aware of this.
- When the repackaging routine was started, Magisk Manager did indeed repackaged and installed itself. There was not indication that the process completed successfully as the spinning progress icon did not stop. I had renamed it MagMan as part of the repackaging routing and was expecting the original icon Magisk icon to show for MagMan. Sorry, I had not read the Magisk Manager instructions and simply made a lot of assumptions of the repackaged process. What happened was that I assumed Magisk Manager would just switch over the new name as part of the repackaging routine. Also I didn't pay close enough attention that the new repackaged app, MagMan, which was literally next to Magisk Manager mainly because it had a generic Android icon instead of the Magisk Manager icon and was overlooked. This whole entire time, I was focusing on the original Magisk Manager app and icon but all of the functionality of Magisk Manager now resided in MagMan. I've uninstalled the original Magisk Manager app and now use the repackaged version.
The Fetch Rewards app was added to the Magisk Hide section via MagMan and it's now working properly.
Thanks for following up.
Click to expand...
Click to collapse
This worked for me yesterday on Android 9 (OP5T), but make sure to reboot the phone after doing the "hide magisk" option in Magisk Manager settings. The name of the proxy app also does not have to be "MagMan" it can be anything of your choice.
I also noticed that sometimes the proxy app didn't open and if this occurred I just force closed it and then it seemed to work. Anyways good luck hope it works for someone else

How To Guide How to root and pass SafetyNet on XQ-BT52 62.0.A.3.163

How to root and pass SafetyNet on Sony Xperia 10 III (XQ-BT52)​Tested on firmware 62.0.A.3.163.
Disclaimer:
This guide assumes you're familiar with the concepts of rooting, Magisk, SafetyNet, fastboot, adb and so on. I will explain why things are done but if I explained everything it would become too long.
This guide is limited to getting root and apps working on the stock Sony ROM. It doesn't cover installing other ROMs.
You can mess up your phone if you don't know what you're doing. This is not a beginner's guide.
Before you do anything else, do these preparations:
Make sure your device is updated to the latest firmware. Getting updates after you unlock the bootloader will be more complicated.
Use XperiFirm to grab a copy of your current firmware (after you've updated it). It can run on Linux too, either via Mono or in a virtual machine. It's basically just a downloader, it doesn't need any fancy hardware access.
Screenshot everything under Settings > System.
Open the dialer and enter *#*#7378423#*#*. Screenshot everything in the service submenus.
Unlock developer options (tap Settings > About > Build number 7 times) then find it under Settings > System > Advanced. Activate USB debugging. Activate OEM unlocking.
Install the Android SDK Platform Tools. On Linux they're most likely in a package provided by your distro.
Copy the screenshots to your PC because the phone will be reset at some point.
Boot into fastboot by turning the phone off, then connect it to PC via USB, and press POWER and VOLUME UP together. The phone led will turn blue. On PC run fastboot devices and make sure it lists your phone and has the serial number you got from the service menu.
Unlocking the bootloader:
This is the point of no return as far as warranty is concerned!
This will factory reset the phone! Make sure you got everything you needed off it.
Obtain the unlock code (you will need the IMEI of the 1st SIM slot).
Boot into fastboot, check again that fastboot devices lists the phone.
Issue the unlock command using the code you got earlier: fastboot oem unlock 0x<unlock code here>
Reboot the phone (you can say fastboot reboot). It will say "can't check for corruption" and "erasing" a couple of times but will eventually boot up to the factory setup.
Enabling Magisk & root:
Download the latest Magisk apk to the phone and install it. Right now that means v24+.
Open boot_X-FLASH-ALL-8A63.sin from the original firmware with any archive manager (it's a tar.xz), 7zip will work fine.
Extract boot.000, rename it to boot.img and put it on the phone.
Open the Magisk app, next to "Magisk" tap "install", choose "Select and patch a file", pick the "boot.img" file.
Download the patched img to PC (will be next to boot.img called something like magisk_patched-24100_MKPRJ.img).
Boot into fastboot, check again that fastboot devices lists the phone.
Flash the patched boot image: fastboot flash boot magisk_patched-24100_MKPRJ.img
Must say OKAY. Can then reboot the phone (you can say fastboot reboot).
Open the Magisk app again, it should say "installed" now next to "Magisk". Also the Superuser and Modules buttons should now be enabled.
Go into Magisk settings and activate "Hide the Magisk app". This is NOT MagiskHide, it does not hide Magisk from other apps, it hides the Magisk Manager app from other apps. More on this later.
Go into Magisk settings and activate Zygisk. This is a built-in replacement for Riru going forward.
Reboot!
Install a root checker app and verify that you get a prompt from Magisk to give root and that the checker says it got root.
Important changes about Magisk:
Riru is now obsolete. It has been replaced by a feature built-into Magisk called Zygisk (which is essentially Riru running in Zygote). It is strongly recommended to go into Magisk settings and activate Zygisk (even if you don't use Riru modules). Do not install Riru anymore. All modules that needed Riru should have Zygisk versions by now unless they're abandoned.
Magisk no longer maintains a module repository, To find and install modules install Fox's Magisk Module Manager. It's a dedicated module management app that supports the old Magisk repo as well as new ones. Inside Magisk you can still enable/disable/remove/install manually and can also update if the module has an update URL, so you can do without Fox if you get your modules directly from their XDA or GitHub pages.
MagiskHide has been replaced by a new feature called Deny list (it's in Magisk settings). It's much more powerful because the apps & processes added to the deny list will be completely excluded from anything based on Magisk so it's impossible for them to detect leaks anymore. On the downside, excluded apps can't be affected by any Magisk or LSPosed modules (LSPosed will grey out such apps and say "it's on the deny list".) This feature should be used sparingly (see below) because Magisk still does a good job of evading detection.
Passing SafetyNet:
Install YASNAC to check your SafetyNet status. At this point you're probably not passing either Basic or CTS check.
Go into Magisk settings. Enable "Enforce deny list". Enter "Configure deny list", find Google Services, check it, expand it, and select only the process ending in .gms and the one ending in .gms.unstable.
Reboot. Check YASNAC. At this point you should be passing Basic check but probably not CTS.
Install Universal SafetyNet Fix (aka USNF) by kdrag0n in Magisk. (Some GIS ROMs already include what this module does, so if you install a GIS ROM you may not need it.) This module hijacks the CTS verification and drops an error which causes the Google service to fall back to Basic verification, which we already fixed in the previous step.
Reboot. Check YASNAC. At this point you should be passing both Basic and CTS. That's it!
You may need to clear storage & cache for Google Play & Services. Go to Settings > Apps & notifications > See all apps, select "All apps", find them in the list, clear storage/cache and reboot. After that try searching for a restricted app such as Netflix on the Play store, if it shows up in results you're all good.
Remember to also add to deny list other apps that try to detect if you're using root, like banking apps.
Other SafetyNet related fixes:
People using non-stock GIS ROMs will probably need module MagiskHide Props Config by Didgeridoohan. This will install a props command line util that you can use (as root) to force Basic attestation, apply extra Magisk hiding techniques, spoof device fingerprint, change the way fingerprinting is checked, or even impersonate another device altogether. Install, reboot, enter adb shell, type su to go root (will need to grant root to shell on the phone when prompted), then run props and follow the options.
People running extra-stubborn banking apps (or other apps that try to detect root extra-hard) that don't work even when added to the Magisk deny list can try module Shamiko by LSPosed. This module adds extra hiding techniques for the apps on the deny list. Please note that Shamiko will disable the Magisk "enforce deny list" option but that's ok, that's an extra feature, the deny list is in effect even without it.
Working apps and modules​Please note that this list is limited to stuff that I personally use. I can't and won't install other stuff to test it.
Root apps:
AFWall(+): Works, but configure it to use its own internal busybox and iptables. Applying rules fails occasionally and you need to retry.
Call Recorder by skvalex: Recording works out of the box, no fiddling required with either headset of mic recording.
JuiceSSH, Termux etc. and other terminal apps: No issues getting root with su.
Busybox: you can install zgfg's module which exposes Magisk's internal Busybox to the rest of the system (bonus: will be updated with Magisk); or you can install osm0sys's module which contains a standalone separate Busybox. As of now both of them provide Busybox 1.34.
MyBackup Pro: Works fine. Used it to transfer 15k+ SMS messages from Android 8.
Solid Explorer: Can access root partitions without issues.
Tasker: No issues.
Titanium Backup: Works but will hang when restoring APKs whose target API doesn't support the ROM's Android version (ie. APKs you can't install directly either).
OAndBackupX: Modern alternative to Titanium, works perfectly.
XPERI+: Version 6 works well and allows you to remap the assistant button and has another couple of features. Version 7 crashes.
Magisk modules:
AFWall Boot AntiLeak
Backup
Builtin BusyBox
Magisk Bootloop Protector
MagiskHide Props Config
Shamiko
SQLite for ARM aarch64 devices
Systemless Hosts (comes with Magisk, enable it in settings)
Universal SafetyNet Fix
Zygisk LSPosed
LSPosed modules:
App Settings Reborn: Works well. May require a couple of reboots before the targeted apps start showing the modifications.
Disable Flag Secure: com.varuns2002 is working, sort of. Please read the module's page. Apps got wise to rooted devices ignoring FLAG_SECURE so now they use hardware DRM or detect screenshots and show you something else (Netflix). So it works only in older versions of apps, or apps that haven't bothered to detect screenshots.
GravityBox [R]: Everything I tried works perfectly.
Physical Button Master Control: The module works as intended, the companion config app has some issues, hopefully they'll be solved soon.
XPrivacyLua: Works perfectly. No issues with SafetyNet.
Not working:
...
Other tested and working Root Apps:
AdAway
Fox's Magisk Module Manager
Franco Kernel Manager
Termux
Not testet yet:
Call Recorder
FolderSync
Total Commander
Vanced Manager
WireGuard
Other tested and working Magisk modules:
1Controller - 1 Module to support all Controllers
Call Recorder - SKVALEX
F-Droid Privileged Extension
Move Certificates (version by Androidacy)
Other tested and working LSPosed modules:
BubbleUPnP AudioCast

Categories

Resources