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

SafetyNet Suddenly Fails

Search This thread

borisSweden

Senior Member
May 10, 2021
109
5
i disagree with the entire concept of SafetyNet. If I can log into a banking website on my Windows PC from an administrator account, then I should be able to log into the same system from my phone as an administrator. I don't blame John for taking a job at google, but if google suddenly succeeds in causing every single rooted device to permanently fail safetynet, then I will most definitely blame him.

Can you be more specific regarding the steps to pass safetynet with the latest canary version as you described? Thanks.
I don't have that problem as our bank,ID and payment app doesn't care about ROOT. Its all encryption and passwords. I don't remember where I got the tutorial but it'd either on XDA or Github. I use MicroG so it wouldn't work for me.
 

jaccydan

Senior Member
Jun 15, 2021
67
4
Samsung Galaxy S20
That is strange. If you lost root, it's likely because of the system update, not because of a magisk installation.

I just tried to upgrade to the Canary version. I was able to continue to pass safetynet - UNTIL I activated Zygisk to use the new app hiding feature. Then I failed safety net. This is actually an exception - I would expect that most people would fail. On newer phones, with hardware attestation, I'm pretty sure that magiskhide is still necessary.

I'm not sure you should listen to me because I may have messed you up. But you can try the following. I'm not 100% sure if it'll work.

enable developer settings and enable usb debugging. Connect the phone to the computer. Download minimal adb from here. run the following commands:

adb devices (this checks to see that the device is properly connected for adb debugging)
adb reboot fastboot (this reboots the device in fastboot mode)
fastboot flash --slot a boot {path and filename of magiskpatched boot.img file)

i don't know if this will work. but it might be worth a try to specify the specific slot you want it reinstalled to.

Hi @gfrank227. Yes I was just about to do an adb fastboot installation of say, Magisk v.22, but I've never used adb before just TWRP, so am doing a bit of reading.

I have tried to simply flash Magisk.zip via TWRP, but I am not getting any resulting app on my phone to complete the installation once I reboot. Then I have tried installing the apk first then flashing the zip, but nothing is showing in the app.

So I assume I need to use the boot.img adb method.

The problem I have is that I don't know where to obtain the "boot.img" from??

I will be working from either of these 2 methods:

re. 'Patching Images'


OR

'Method 2'


Which do you think would be the best guide for me to follow?

Thanks.

Thank you for the adb tools link, I was wondering where I could get something like that from. :)

Thanks, appreciated.
 
Last edited:

gfrank227

Senior Member
Feb 12, 2018
137
17
Moto G8 Plus
Hi @gfrank227. Yes I was just about to do an adb fastboot installation of say, Magisk v.22, but I've never used adb before just TWRP, so am doing a bit of reading.

I have tried to simply flash Magisk.zip via TWRP, but I am not getting any resulting app on my phone to complete the installation once I reboot. Then I have tried installing the apk first then flashing the zip, but nothing is showing in the app.

So I assume I need to use the boot.img adb method.

The problem I have is that I don't know where to obtain the "boot.img" from??

I will be working from either of these 2 methods:

re. 'Patching Images'


OR

'Method 2'


Which do you think would be the best guide for me to follow?

Thanks.

Thank you for the adb tools link, I was wondering where I could get something like that from. :)

Thanks, appreciated.
Are these specific to your phone model?

You get the boot.img from a stock rom image. If you have a Motorola device I can give you specific instructions. But I'm not sure about other devices.
 

jaccydan

Senior Member
Jun 15, 2021
67
4
Samsung Galaxy S20
Yes I thought the boot.img might be a phone specific thing. I have a Samsung S20 Ultra 5G SM-G9880 Hong Kong Variant, and I've done a search but not finding anything. I will have to look harder.
 

monsiu

Senior Member
Oct 12, 2021
70
1
27
www.monsiu.codes
i disagree with the entire concept of SafetyNet. If I can log into a banking website on my Windows PC from an administrator account, then I should be able to log into the same system from my phone as an administrator. I don't blame John for taking a job at google, but if google suddenly succeeds in causing every single rooted device to permanently fail safetynet, then I will most definitely blame him.

Can you be more specific regarding the steps to pass safetynet with the latest canary version as you described? Thanks.
lol you saw how he rant when everyone called him a traitor and threatened to side with google and actively f everyone using "hide"
 

gfrank227

Senior Member
Feb 12, 2018
137
17
Moto G8 Plus
lol you saw how he rant when everyone called him a traitor and threatened to side with google and actively f everyone using "hide"
yes, I saw that. Honestly. He has to make a living, so I can't blame him for taking the job. But he should have passed the project along to someone who could do it properly.

Can you recommend a forked magisk version that maintains hide but is going to be actively maintained an developed?
 

jaccydan

Senior Member
Jun 15, 2021
67
4
Samsung Galaxy S20
Are these specific to your phone model?

You get the boot.img from a stock rom image. If you have a Motorola device I can give you specific instructions. But I'm not sure about other devices.
Well I downloaded the stock files compatible to my device, and I got a load of Odin type files?? No file labelled boot.img.

Does this assume I have to use Odin? Won't that wipe all my phone data?

S20 Stock Image Files.jpg


Wouldn't know how to proceed with this in terms of what I want to do with rooting with Magisk..although i have used Odin before so that in itself wouldn't be an issue if it can safely be done that way. Which one of these files to use, who knows??

This all seems to be going off on a tangent from just using adb.

UPDATE: Found this ~


"Rename file.tar.md5 to file.tar and unzip" (in order to get boot.img).

I'm assuming that would be the HOME.tar.md5??
 
Last edited:

monsiu

Senior Member
Oct 12, 2021
70
1
27
www.monsiu.codes
yes, I saw that. Honestly. He has to make a living, so I can't blame him for taking the job. But he should have passed the project along to someone who could do it properly.

Can you recommend a forked magisk version that maintains hide but is going to be actively maintained an developed?
his true origin story......hahaha but yea i mean if i was as smart as the guy i would definately work for a company as google. it honestly can not get better than that.

He should have just step down from the project and handed it to someone else with whom he worked on the project with cause now he works for security at google and this magisk hide actively messes with his line of work and he is frustrated as f as google has been on his back for it.

He should just have hung up the towel the moment he went for his first day at work.

cant you just uninstall and revert to the previous version....the man hinted on a way to bypass the safetynet and even said something about denylist which some newly made modules can be used to "hide"

But i do not think development has begun....and its just confusing on why he is developing for magisk but still removing things
 

jaccydan

Senior Member
Jun 15, 2021
67
4
Samsung Galaxy S20
Are these specific to your phone model?

You get the boot.img from a stock rom image. If you have a Motorola device I can give you specific instructions. But I'm not sure about other devices.

UPDATE:

Downloaded LZ4 program and used the context menu to 'decode' i.e. unzip the boot.img.lz4.
It appears I have produced a boot.img file. I have highlighted where it says it's 0 KB tho. I have other unrelated iso files and they don't show as 0 KB! I did a search and this can be an issue, but don't know how to fix it if it needs fixing.

The same 0 KB thing happens if I try opening boot.img.lz4 with LZ4.exe using the context menu.


boot img inside.jpg

boot img inside 2.jpg


UPDATE:

Just clicked on Install in Magisk and then 'Select and Patch a File', then selected that boot.img and it came back as 'Installation Failed, Invalid Input File'. Most likely because it has 0 KB's.

Got to try to find a way to unzip the boot.img.lz4 file correctly. Was looking at a Git lz4 program instead to unzip but haven't yet worked out the cmd commands for it. As soon as I get a valid boot.img file I think I can root the phone again.
 
Last edited:

gfrank227

Senior Member
Feb 12, 2018
137
17
Moto G8 Plus
UPDATE:

Downloaded LZ4 program and used the context menu to 'decode' i.e. unzip the boot.img.lz4.
It appears I have produced a boot.img file. I have highlighted where it says it's 0 KB tho. I have other unrelated iso files and they don't show as 0 KB! I did a search and this can be an issue, but don't know how to fix it if it needs fixing.

The same 0 KB thing happens if I try opening boot.img.lz4 with LZ4.exe using the context menu.


View attachment 5442113
View attachment 5442115

UPDATE:

Just clicked on Install in Magisk and then 'Select and Patch a File', then selected that boot.img and it came back as 'Installation Failed, Invalid Input File'. Most likely because it has 0 KB's.

Got to try to find a way to unzip the boot.img.lz4 file correctly. Was looking at a Git lz4 program instead to unzip but haven't yet worked out the cmd commands for it. As soon as I get a valid boot.img file I think I can root the phone again.
I am not familiar with this specific encryption method. You can try winrar and see if that can read it.
 

jaccydan

Senior Member
Jun 15, 2021
67
4
Samsung Galaxy S20
This did it in the end:
..and I had a successful boot.img file with data on it. I then patched that file in magisk and then transferred it via minimal adb to my PC ready for adb fastboot flashing.

I am so close to getting this magisk_patched.img onto the phone in order to root it. As stated, I have been trying to use the minimal adb program you posted, however I had been running into adb driver issues (exclamation marks) which I seem to now have sorted:

Device Manager.jpg


My phone is however not being recognised in device manager when I manually put the phone into download mode and plug it into the PC..

download mode.jpg
'Download mode'

..the driver entries shown above disappear. The driver entries only reappear when the phone is plugged in and in normal charging/file transfer mode:

If and when I can sort this out I should be able to get my device (when it's in download mode), recognised in minimal adb (and device manager), in order to flash that patched magisk file I now have on my PC. I will keep searching for a solution.

Any helpful suggestions welcomed.
 
Last edited:

gfrank227

Senior Member
Feb 12, 2018
137
17
Moto G8 Plus
This did it in the end:
..and I had a successful boot.img file with data on it. I then patched that file in magisk and then transferred it via minimal adb to my PC ready for adb fastboot flashing.

I am so close to getting this magisk_patched.img onto the phone in order to root it. As stated, I have been trying to use the minimal adb program you posted, however I had been running into adb driver issues (exclamation marks) which I seem to now have sorted:

View attachment 5442649

My phone is however not being recognised in device manager when I manually put the phone into download mode and plug it into the PC..

View attachment 5442659 'Download mode'

..the driver entries shown above disappear. The driver entries only reappear when the phone is plugged in and in normal charging/file transfer mode:

If and when I can sort this out I should be able to get my device (when it's in download mode), recognised in minimal adb (and device manager), in order to flash that patched magisk file I now have on my PC. I will keep searching for a solution.

Any helpful suggestions welcomed.
What's your phone model?
 

gfrank227

Senior Member
Feb 12, 2018
137
17
Moto G8 Plus
This did it in the end:
..and I had a successful boot.img file with data on it. I then patched that file in magisk and then transferred it via minimal adb to my PC ready for adb fastboot flashing.

I am so close to getting this magisk_patched.img onto the phone in order to root it. As stated, I have been trying to use the minimal adb program you posted, however I had been running into adb driver issues (exclamation marks) which I seem to now have sorted:

View attachment 5442649

My phone is however not being recognised in device manager when I manually put the phone into download mode and plug it into the PC..

View attachment 5442659 'Download mode'

..the driver entries shown above disappear. The driver entries only reappear when the phone is plugged in and in normal charging/file transfer mode:

If and when I can sort this out I should be able to get my device (when it's in download mode), recognised in minimal adb (and device manager), in order to flash that patched magisk file I now have on my PC. I will keep searching for a solution.

Any helpful suggestions welcomed.
ensure that usb debugging is enabled. You probably already tried this, but Samsung's adb drivers are here. There's some info i found regarding google adb drivers as well; it referenced a youtube video that I didn't watch but might be helpful. It is here.
 

jaccydan

Senior Member
Jun 15, 2021
67
4
Samsung Galaxy S20
ensure that usb debugging is enabled. You probably already tried this, but Samsung's adb drivers are here. There's some info i found regarding google adb drivers as well; it referenced a youtube video that I didn't watch but might be helpful. It is here.
I have adb drivers installed and there are no errors. I ran Driver Booster and it showed the drivers were from 2017 and it installed the latest (as shown).

Driver Booster.jpg


However, still no luck with the way I put the phone into download mode and the drivers immediately disappear in device manager.

I just tried trying to boot into recovery mode from adb, but it done the same thing.

I saw these posts regarding this issue and I couldn't find a way to adb shell setprop, because my settings showed that it was the opposite of what the guy said it should be for 'device allowing ADB access in recovery mode'. And apparently you have to be rooted anyway in order to make value changes. :rolleyes:

Not sure with the bottom comment if adb sideload can be used for .img files (just zips I think). Would prefer to still try to carry out the normal adb fastboot command for the patched magisk file, and get this phone recognized by the drivers when in download mode so I can do it.

recovery mode issues.jpg
 
Last edited:

jaccydan

Senior Member
Jun 15, 2021
67
4
Samsung Galaxy S20
ensure that usb debugging is enabled. You probably already tried this, but Samsung's adb drivers are here. There's some info i found regarding google adb drivers as well; it referenced a youtube video that I didn't watch but might be helpful. It is here.
Thanks @gfrank227 for helping. I have enabled USB debugging on the phone, and I downloaded some Samsung adb drivers - which were later updated by Driver Booster software (see my other post). I initially used the manual driver installation method as shown in the youtube video you referenced.

My adb drivers look good now, but are disappearing when I plug phone in in download mode, and reappearing when the phone is plugged in normally in charging/MTP mode. Thus I can't carry out that adb magisk patch to root the phone. So close tho. We need to figure out why this is happening.
 

gfrank227

Senior Member
Feb 12, 2018
137
17
Moto G8 Plus
Thanks @gfrank227 for helping. I have enabled USB debugging on the phone, and I downloaded some Samsung adb drivers - which were later updated by Driver Booster software (see my other post). I initially used the manual driver installation method as shown in the youtube video you referenced.

My adb drivers look good now, but are disappearing when I plug phone in in download mode, and reappearing when the phone is plugged in normally in charging/MTP mode. Thus I can't carry out that adb magisk patch to root the phone. So close tho. We need to figure out why this is happening.
Check out this forum. Sounds like your exact problem.

 

jaccydan

Senior Member
Jun 15, 2021
67
4
Samsung Galaxy S20
You have to uninstall from the magisk app, reboot, install old magisk 23 then fastboot flash the patched boot img from that version of magisk.

I now have the v.23 patch.img as advised, but the problem lies in that when I put my phone into download mode the adb drivers disappear from the device manager which means my phone ceases to be recognized and I therefore cannot fastboot flash the patched file to the phone.

This happens in minimal adb:

adb error.jpg


In any case, if i search for 'adb devices' nothing comes up.
 
I now have the v.23 patch.img as advised, but the problem lies in that when I put my phone into download mode the adb drivers disappear from the device manager which means my phone ceases to be recognized and I therefore cannot fastboot flash the patched file to the phone.

This happens in minimal adb:

View attachment 5443425

In any case, if i search for 'adb devices' nothing comes up.
Did you reenable oem unlock in developer options after msm? And usb debugging?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    OK. I set up the XPrivacyLua with the assistance of this youtube video.


    I only watched the video once and set it up using the google play store app. but after reading your response, I set it up using the "google play services" process, and now my phone passes safetynet again.

    Hope this helps someone. :)
    1
    OK. I set up the XPrivacyLua with the assistance of this youtube video.


    I only watched the video once and set it up using the google play store app. but after reading your response, I set it up using the "google play services" process, and now my phone passes safetynet again.

    Hope this helps someone. :)
    Its work for me is poco x3 pro , thanks
    1
    You can still spoof Safety Net on Pie but later Android version you need, Gapps, GPlayServices, Universal Safety Net fix, manual fingerprinting change with MagiskHideprop, no MicroG, Riru, Riru Hide and of course Magisk. for now it fixes the server side Safety Net test.

    On the other hand, JohnW is actively trying to make Android stop not security based apps stop using Safety Net. Pokemon and McDonalds shouldnt use that API.
    i disagree with the entire concept of SafetyNet. If I can log into a banking website on my Windows PC from an administrator account, then I should be able to log into the same system from my phone as an administrator. I don't blame John for taking a job at google, but if google suddenly succeeds in causing every single rooted device to permanently fail safetynet, then I will most definitely blame him.

    Can you be more specific regarding the steps to pass safetynet with the latest canary version as you described? Thanks.