MAGISK MODULE ❯ Universal SafetyNet Fix 1.1.0

Search This thread

kdrag0n

Senior Member
Feb 19, 2016
696
1,951
kdrag0n.dev
Universal SafetyNet Fix
Magisk module​

This is a universal fix for SafetyNet on devices with hardware attestation and unlocked bootloaders. It defeats both hardware attestation and the new SafetyNet CTS profile updates released on January 12, 2021. The only requirement is that you can pass basic attestation, which requires a valid combination of device and model names, build fingerprints, and security patch levels.

Passing basic attestation is mostly out-of-scope for this module; this module is meant to defy hardware attestation, as well as reported "basic" attestation that actually uses hardware under-the-hood. Nonetheless, it features a few basic attempts at helping pass basic attestation on some devices, especially older devices and devices running stock ROMs.

No device-specific features (such as the new Pixel-exclusive Google Assistant design or screen-off voice match) will be lost with this fix.

Android versions 8–11 are supported. Heavy OEM skins are not officially supported, but they may work depending on your luck and the particular ROM in question. Please do not report problems on such ROMs.

How does it work?
The way this workaround works is relatively low-level. An in-depth explanation, as well as source code and ROM changes, can be found on GitHub.

Ideally, this workaround should be incorporated in ROMs instead of overriding part of the ROM in a Magisk module. The ROM changes for it are linked above for ROM developers to use.

Downloads
Downloads and changelogs can be found on GitHub. The topmost release is the latest.

Telegram group
Source code

If this helped you, please consider donating to support development: recurring donation for sustainable support or buy me a coffee. Thank you for your support!
 
Last edited:

tylerdurden

Senior Member
Oct 13, 2010
301
643
Hamburg
Tested succesfully on Pixel 4a 5G, but Google Pay says "Your phone doesn't meet security requirements" even though PayPal can be set up.
Magisk Hide is activated.
 

zgfg

Senior Member
Oct 10, 2016
7,179
4,626
Thank you a lot, Universal SafetyNet Fix v1.1.0 working excellent on Xiaomi Mi 9T, Xiaomi.eu 21.1.6, MIUI 12.5 / Android 11 Beta

Device certified but not using Google Pay
 
Last edited:

thomas140

Senior Member
Jul 3, 2018
641
139
Johor
Safety net fix 1.0.2 worked for miui Eu 12.0.3.0 Android 10 for Poco F1.
Only that the ocbc bank Singapore app still able to detect the root and became unusable.
But I know that this doesn't relate to safetynet fix here because the issue already existed before the CTS false.
 

MoL_82

Senior Member
Aug 16, 2019
90
45
Tested on Samsung S9:
- 1.0.2 worked in MM, but Root Checker said 'cannot access GPS'.
- 1.1.0 fails ctsProfile in MM, but Root Checker now can access GPS, also returns ctsProfile fail.
 
  • Like
Reactions: ngodinhhoi

shchukax

Member
Jun 12, 2019
6
5
Massive thanks for this. Version 1.1.0 confirmed working on my device:
- Pixel 3, stock room
- Magisk 21.2, magisk manager 8.0.5
- Magisk hide enabled and magisk manager renamed

All banking apps and google pay work correctly, including contactless payments.
 

AndDiSa

Senior Member
Dec 2, 2009
3,641
4,886
Heidelberg
Tested on Huawei Mediapad M5 with EMUI 9.1.0 and Magisk 20.4:
- 1.1.0 fails ctsProfile in MM, basic integrity is ok
 

Drahy

Senior Member
Apr 27, 2012
462
65
I tried this on my Samsung Galaxy A6 (official samsung firmware patched with magisk) - and even version 1.1.0 causes bootloop when using zip inside Magisk Manager - Android 10
 

Antonio200

Member
Nov 26, 2020
15
0
Good morning. Working on Redmi Note 9 Pro xiaomi.eu 12.0.1 Android 10. No MagiskHide Props Config needed: basicIntegrity passed, ctsProfile passed, evalType BASIC.
Thank you so much
 
Last edited:

purgy

Senior Member
Aug 29, 2013
125
26
Sydney
Works on pixel 3a, last A10 patch, using magisk hide props config to force basic attestation. Was already using mhpc so not sure if it works without it. Fixed my CTS issue though, so thanks!
 

dr4go

Senior Member
Dec 17, 2010
442
365
Vienna
@kdrag0n Thank you so much for this awesome masterpiece!

I find it a bit interesting, that I experience a problem which nobody else seems to have reported so far. I'm using a Galaxy S10 (Exynos, G973F), rooted with latest canary Magisk, no EdXposed or whatsoever...

If I enable this module, no bootloop, basic attestation, CTS passes. "Yes", so I thought...

The problem now... My bank app tries to access the keystore and crashes. This does not happen without having this module enabled... I have attached a fully logcat and hope that you have some insights... 🙏🏻

EDIT1: re-attached file, didn't work on the first go.

EDIT2: oh... search for "easybank" or "keystore"

EDIT3: Android 11, One UI 3
 

Attachments

  • logcat_01-14-2021_11-15-06.zip
    70.1 KB · Views: 942
Last edited:

BenDavid

Member
Sep 29, 2016
27
8
POCO F1 user here. After flashing the module the phone stucks on the Google logo at boot.
The MHPC module didn't solve the problem either.

ROM: Pixel Experience 11 Beta (20201223)/Encrypted
 
  • Like
Reactions: srdrhl146

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Added to the list
    google play services for AR
    google pay
    google play store
    google play services

    universal safety fix module 2.2.1 active


    something that i saw... every restart google play services go out of denied list.
    Hiding Magisk app is irrelevant for Google apps (it may help only to some banking apps - those apps try to explore various methods to find or even guess about the root, eg, you may have locked Bootloader with stock firmware but if you just install Magisk APK they will falsely guess that your phone is rooted bcs why otherwise would one install Magisk APK)

    Google apps use SafetyNet where SafetyNet is the API provided by Google Play Services (aka GMS), hence no use of putting Services for AR or Playstore to DenyList - it's enough to put GMS, all Google apps use GMS

    But finally, USNF takes care of the Google Play Services and it removes GMS from DenyList - that was discussed and mentioned many times here, in the USNF thread and in the Magisk thread (old Magisk thread and the new Magisk+Zygisk thread)

    But cannot help you with Google Pay - check in the Magisk threads
    3
    Oh, and don't worry about GPS getting out of deny list with every restart. This has been the default behavior for me since Magisk 24, but it works.
    We usually rather call Google Play Services as GMS, due to it's package name (you see that package name when you add to DenyList):
    com.google.android.gms

    Disappearing from DenyList has nothing to do with Magisk v24 but this module USNF = Universal SafelyNet Fix removes GMS from DenyList (already mentioned in this thread couple of times)

    Go to:
    /data/adb/modules/safetynet-fix
    (where USNF installs - open eg module.prop text file)

    And open service.sh to find there:
    Code:
    # Remove Play Services from DenyList, otherwise the Zygisk module won't load
    magisk --denylist rm com.google.android.gms
    1
    Hello
    i have a LG G4 with A11 Havoc..

    Magisk app 24.3(24300) (27)
    package fyhmut.go
    Zygisk yes

    Magisk hided

    Added to the list
    google play services for AR
    google pay
    google play store
    google play services

    universal safety fix module 2.2.1 active

    removed data of google play services, google play store and google pay
    restarted...

    but no luck with google pay :(

    something that i saw... every restart google play services go out of denied list.

    Any suggestion or help?

    Thanks
    Had the same problem - all of a sudden yesterday - with Google Pay on my OnePlus 9 Pro. Did everything you did and more, even installing older versions, no luck for 3 hours.

    Finally, turns out it's the latest version of Google Play Services (I was naive enough to opt-in the beta testing program). Google Pay kept showing something like "Checking for updates, this may take few minutes".

    Uninstall Google Play Services updates, opt out of beta program if you're in, then re-apply the Google Pay process, and you'll be good to go.

    Oh, and don't worry about GPS getting out of deny list with every restart. This has been the default behavior for me since Magisk 24, but it works.
    1
    The denylist magisk does not work, I put a checkmark on "google services framework" leave the denylist, then go back and the checkmark is gone. Please help.
    Why hide Google stuff other than GPay?
    Hello! How can I hide the root from an app without adding it to Denylist?
    Generally you can't, unless some module or sandboxing app can do this without denylist...
    I just need to add an app through LSPosed for a module, and I can't do that anymore since I added it to Denylist, and if I remove it from Denylist, the app detects a root
    Are you saying you have LSP app in denylist?... But it has its own 'Parasitic' hidden manager solution that works well... use that... Or did you mean something else? PW
    1
    Thanks for the reply! I need to simultaneously hide root rights from the app and use a module in LSPosed to spoof phone data. But unfortunately I can only do one of these things. Either I substitute data with a LSposed module and root rights will be visible to the app or root rights will be hidden but I cannot use the LSposed module for spoofing :(

    here's an example
    So app is in denylist?... Still not clear... Do you really mean 'hide root rights' or hide the module?

    Have you tried Hide My Applist LSP module to hide 'faker' module from your app specifically?... Or am I still not understanding your issue?... PW
  • 255
    Universal SafetyNet Fix
    Magisk module​

    This is a universal fix for SafetyNet on devices with hardware attestation and unlocked bootloaders. It defeats both hardware attestation and the new SafetyNet CTS profile updates released on January 12, 2021. The only requirement is that you can pass basic attestation, which requires a valid combination of device and model names, build fingerprints, and security patch levels.

    Passing basic attestation is mostly out-of-scope for this module; this module is meant to defy hardware attestation, as well as reported "basic" attestation that actually uses hardware under-the-hood. Nonetheless, it features a few basic attempts at helping pass basic attestation on some devices, especially older devices and devices running stock ROMs.

    No device-specific features (such as the new Pixel-exclusive Google Assistant design or screen-off voice match) will be lost with this fix.

    Android versions 8–11 are supported. Heavy OEM skins are not officially supported, but they may work depending on your luck and the particular ROM in question. Please do not report problems on such ROMs.

    How does it work?
    The way this workaround works is relatively low-level. An in-depth explanation, as well as source code and ROM changes, can be found on GitHub.

    Ideally, this workaround should be incorporated in ROMs instead of overriding part of the ROM in a Magisk module. The ROM changes for it are linked above for ROM developers to use.

    Downloads
    Downloads and changelogs can be found on GitHub. The topmost release is the latest.

    Telegram group
    Source code

    If this helped you, please consider donating to support development: recurring donation for sustainable support or buy me a coffee. Thank you for your support!
    28
    ok so there is a solution

    get the magisk module riru

    after you get riru get LSPosed

    after you get LSPosed get xprivacylua (in the LSPosed app)

    select play services in the xprivacylua settings IN the LSPosed app

    AND in the xprivacylua app itself after you've restarted.

    clear play service data

    check safetynet in magisk - enjoy?

    I would reboot between each step just to be safe but I know it's necessary to load the xprivacylua module

    s/o to saitama_96 for discovering it or so I'm led to believe
    22
    I managed to fix the 3rd party app fingerprint issue on my Samsung w/ Android 10 (commented on this Github issue too). Basically the AOSP keystore is not fully compatible with the Samsung one so I decided to binary patch the one on my phone and ended up with this module. Now both fingerprint and SafetyNet works.
    Notes:
    - This disables key attestation for every app, idk if it breaks anything, nothing broke so far
    - Only change is the replaced system_sdk29/bin/keystore with the Samsung one (8 bytes modified)
    - Only works on Android 10
    - Might or might not work for you, use at your own risk.
    21
    It's in progress.

    Worth noting when @kdrag0n does publish the new Zygisk rewrite of USNF then gms and unstable will actually need to be removed from the DenyList for the module to function correctly, not added like some people are doing now to get previous USNF versions working.
    18
    v2.1.0 is officially released and open sourced now, so everyone can stop being ****ing babies. 😏👍