[SafetyNet Fix][PoC] Pass SafetyNet after 2017-07-17 on Magisk V13

Search This thread

[email protected]

Senior Member
Nov 29, 2010
425
302
Bavaria
EDIT: Official fix is out, please follow this link: https://forum.xda-developers.com/showpost.php?p=73079059&postcount=25

Good evening,
since Google broke all our beloved SafetyNet passing phones I decided to have a look at it. Turns out they have extended their property scanning.
There is an easy fix BUT: I have no idea how this fix interferes with Magisks internal behavior. @topjohnwu Why are properties used for magisk internals?

SafetyNet checks now for these properties, so we have to delete them:
Code:
[init.svc.magisk_pfs]: [stopped]
[init.svc.magisk_pfsd]: [stopped]
[init.svc.magisk_service]: [stopped]
[persist.magisk.hide]: [1]

EDIT: @dimon222 had a look at magisk source and answered my question why these properties even exist:
BTW, I shortly check'd source of Magisk, it seems 3 of those flags are related to exit code after start of Magisk services on boot. Basically, they're automatically set by Android when service with such name is started.
I guess dev will probably rename those services to avoid detect or hide it somehow.
https://github.com/topjohnwu/Magisk/blob/master/scripts/init.magisk.rc

And the last flag is some internal for Magisk.
It feels like something serious, but I don't know if its only used during boot. Maybe if u reset it after boot, it won't be automatically reloaded by Magisk, and it will continue to use hide.
https://github.com/topjohnwu/Magisk/search?utf8=✓&q=MAGISKHIDE_PROP
Worth to check if SafetyNet apps are still working after that, not just SafetyNet check itself. Its quite possible that it won't hide, if it gets this property from global variable at realtime.

How to fix this:
1. This fix is only a temporary fix. You will have to apply it after every reboot.
2. Use a Terminal emulator app or adb to enter these commands.
3. Use resetprop to delete the properties - again: I have no idea how this interferes with magisk behavior!!!! Do this at your own risk:
Code:
su
resetprop --delete init.svc.magisk_pfs
resetprop --delete init.svc.magisk_pfsd
resetprop --delete init.svc.magisk_service
resetprop --delete persist.magisk.hide
Using Magisk Core mode? also execute this command:
Code:
resetprop --delete ro.magisk.disable


4. Optional/Not recommended: If you want to make this temporary fix more permanent, add all the required resetprop calls to a .sh file inside /magisk/.core/service.d/ and let magisk automatically execute the script for you every startup.

Troubleshooting if this didnt work:
Still doesnt work? Try this: https://forum.xda-developers.com/showpost.php?p=73056617&postcount=65
Check for other magisk properties using "getprop | grep magisk" and delete them as well (at your own risk!)


After deleting the properties SafetyNet check will pass again :)
Screenshot_20170717-001447.png
 

Attachments

  • Screenshot_20170717-001447.png
    Screenshot_20170717-001447.png
    102.4 KB · Views: 13,304
  • Screenshot_20170717-001421.png
    Screenshot_20170717-001421.png
    74.1 KB · Views: 13,413
Last edited:

tool666schism

Member
Jul 30, 2015
21
1
Interesting. I'm curious, how were you able to detect what safety net is actually detecting?

I haven't tried your fix as it's not super imperative for me to get safetynet passing for myself just curious what you are using to find this stuff out.

Either way thanks for the work :)
 
  • Like
Reactions: UserNamist

[email protected]

Senior Member
Nov 29, 2010
425
302
Bavaria
What kind of functionality do you still have after this? Does magisk manager crash? Do modules work? Does su work?
SU still works, Magisk hide seems to work as well (safetynet passes, so magiskhide has to work)
I don't use many modules, only AppSystemizer and this one still works

Can you please explain in detail that how to do it.

Thanks
You need to enter the commands either in a Terminal Emulator app on your phone or use adb to connect to your phone and then enter the commands.
Also keep in mind that the fix is only temporary, you need to apply the fix after every reboot.
 

collinjames

Senior Member
Jan 18, 2011
91
25
Good evening,
since Google broke all our beloved SafetyNet passing phones I decided to have a look at it. Turns out they have extended their property scanning.
There is an easy fix BUT: I have no idea how this fix interferes with Magisks internal behavior. @topjohnwu Why are properties used for magisk internals?

SafetyNet checks now for these properties:
Code:
[init.svc.magisk_pfs]: [stopped]
[init.svc.magisk_pfsd]: [stopped]
[init.svc.magisk_service]: [stopped]
[persist.magisk.hide]: [1]

How to fix this:
1. This fix is only a temporary fix. You will have to apply it after every reboot.
2. Use a Terminal emulator app or adb to enter these commands.
3. Use resetprop to delete the properties - again: I have no idea how this interferes with magisk behavior!!!! Do this at your own risk:
Code:
su
resetprop --delete init.svc.magisk_pfs
resetprop --delete init.svc.magisk_pfsd
resetprop --delete init.svc.magisk_service
resetprop --delete persist.magisk.hide

After deleting the properties SafetyNet check will pass again :)
Screenshot_20170717-001447.png

Worked for me! Thanks!
 

[email protected]

Senior Member
Nov 29, 2010
425
302
Bavaria
Is there a way to load commands from a txt or something like that? It's a bit of a bother to manually enter it every time we reboot.

You could store it in a .sh file on sdcard and execute the .sh file. (dont forget chmod +x)

It also might work to put the .sh file in /magisk/.core/service.d to let magisk automatically execute the script at startup, but im not sure if thats too early
 

Top Liked Posts

  • There are no posts matching your filters.
  • 161
    EDIT: Official fix is out, please follow this link: https://forum.xda-developers.com/showpost.php?p=73079059&postcount=25

    Good evening,
    since Google broke all our beloved SafetyNet passing phones I decided to have a look at it. Turns out they have extended their property scanning.
    There is an easy fix BUT: I have no idea how this fix interferes with Magisks internal behavior. @topjohnwu Why are properties used for magisk internals?

    SafetyNet checks now for these properties, so we have to delete them:
    Code:
    [init.svc.magisk_pfs]: [stopped]
    [init.svc.magisk_pfsd]: [stopped]
    [init.svc.magisk_service]: [stopped]
    [persist.magisk.hide]: [1]

    EDIT: @dimon222 had a look at magisk source and answered my question why these properties even exist:
    BTW, I shortly check'd source of Magisk, it seems 3 of those flags are related to exit code after start of Magisk services on boot. Basically, they're automatically set by Android when service with such name is started.
    I guess dev will probably rename those services to avoid detect or hide it somehow.
    https://github.com/topjohnwu/Magisk/blob/master/scripts/init.magisk.rc

    And the last flag is some internal for Magisk.
    It feels like something serious, but I don't know if its only used during boot. Maybe if u reset it after boot, it won't be automatically reloaded by Magisk, and it will continue to use hide.
    https://github.com/topjohnwu/Magisk/search?utf8=✓&q=MAGISKHIDE_PROP
    Worth to check if SafetyNet apps are still working after that, not just SafetyNet check itself. Its quite possible that it won't hide, if it gets this property from global variable at realtime.

    How to fix this:
    1. This fix is only a temporary fix. You will have to apply it after every reboot.
    2. Use a Terminal emulator app or adb to enter these commands.
    3. Use resetprop to delete the properties - again: I have no idea how this interferes with magisk behavior!!!! Do this at your own risk:
    Code:
    su
    resetprop --delete init.svc.magisk_pfs
    resetprop --delete init.svc.magisk_pfsd
    resetprop --delete init.svc.magisk_service
    resetprop --delete persist.magisk.hide
    Using Magisk Core mode? also execute this command:
    Code:
    resetprop --delete ro.magisk.disable


    4. Optional/Not recommended: If you want to make this temporary fix more permanent, add all the required resetprop calls to a .sh file inside /magisk/.core/service.d/ and let magisk automatically execute the script for you every startup.

    Troubleshooting if this didnt work:
    Still doesnt work? Try this: https://forum.xda-developers.com/showpost.php?p=73056617&postcount=65
    Check for other magisk properties using "getprop | grep magisk" and delete them as well (at your own risk!)


    After deleting the properties SafetyNet check will pass again :)
    Screenshot_20170717-001447.png
    113
    Thanks for the finding! Google really loves to sneak in some "goodies" while I was sleeping lol.

    The fix is fairly easy to implement, expect an official update soon.
    42
    Although @topjohnwu has said there is a fix coming. In the meantime I decided to make a Magisk Module that does this automatically on boot. Tested it out on my Moto X 2014 running LineageOS 14.1. If anyone else would like to try it, you can download it and view the source here.
    23
    Here is a quick copy pastable command that will remove any magisk properties. Make sure to run it as root (ex: typing su first).

    Code:
    getprop | grep magisk | cut -d'[' -f2 | cut -d']' -f1 | xargs -n1 resetprop --delete
    8
    Macrodoid template to import.
    Unzip zip, and import file into macrodoid
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone