[MODULE] [MOD] Universal SafetyNet Fix

Search This thread

cognitivedissonance

Senior Member
Jan 11, 2012
664
210
Patches to Android (Lucky Patcher Module), Pixelify, Pixelify uninstaller services, Shamiko, substratum, Systemless Hosts, Universal SafetyNet Fix, VIPER4Android FX repackagedhoch43, YouTube-latest ReVanced Extended, Zygisk - Enhanced mode for Storage Isolation, Zygisk - LSPosed, Zygisk - Sui.
Yes.
Yes, using The SELinux Switch (there is a chance that it probably doesn't work because of my kernel but searching around, it doesn't seems to exist a custom kernel to my device so).
No.

Still the same.


Google Wallet, Play Store, Play Integrity API Checker, yes.

Made everything you said (besides LineageOS, Gapps and flashing Magisk with TWRP using the zip file), cleaning the app data using App Manager and still the same.
FYI, the most likely culprit is LP, and the modded play store. Once I ditched those, I was able to pass the first two integrity checks. To be fair, I haven't tried reinstalling LP now that I'm passing, so you could still give that a go.
 

HoshiHikirai

New member
Mar 20, 2023
2
0
Is working on all aosp roms based after flash this, but not when use original module, but miui doesn't have this problem (not miui: mean safety check fails 1 of 2)

Idk why the original module safety check fails in all aosp roms (even with safety passed out of the box) but not in miui, but before that, i doesn't have any problem with original module, maybe its Google?
 

david003

Senior Member
Aug 8, 2020
220
133
For what it's worth, I've tried several times, but I'm unable to get it to work successfully with xiaomi.eu 14.0.1.0, installing magisk 25.2 and safetynetfix 2.4.0 mod 1.2. With Zygisk enabled, with or without enforcing.

YASNAC fails basic integrity and CTS profile match, and Integrity Checker fails device_integrity and basic_integrity.
 

Tomek0000

Senior Member
Jun 14, 2015
521
143

david003

If you did all ok, lets go back to magisk and check app list in it. It is possible the google play services is not checked. If you do it , and restart phone, or only start magisk again, it can be unchecked again (and CTS will fail as result). It is not fixable.
I replaced magisk to delta version and use SuList instead .
 

nickleby

Senior Member
Sep 28, 2008
355
134
Caracas
For what it's worth, I've tried several times, but I'm unable to get it to work successfully with xiaomi.eu 14.0.1.0, installing magisk 25.2 and safetynetfix 2.4.0 mod 1.2. With Zygisk enabled, with or without enforcing.

YASNAC fails basic integrity and CTS profile match, and Integrity Checker fails device_integrity and basic_integrity.
For me, safetynetfix is not enough, I have to use hideprops also and select a new fingerprint (that match the current Android version) to pass CTS profile.
 
  • Like
Reactions: ipdev

pndwal

Senior Member
For what it's worth, I've tried several times, but I'm unable to get it to work successfully with xiaomi.eu 14.0.1.0, installing magisk 25.2 and safetynetfix 2.4.0 mod 1.2. With Zygisk enabled, with or without enforcing.

YASNAC fails basic integrity and CTS profile match, and Integrity Checker fails device_integrity and basic_integrity.
Later USNF builds fro @Displax actually play better with custom ROMs that already integrate SNF (from @kdrag0n Proton project) or fixes from @Displax, but there can still be conflicts with custom ROMs that do this (eg XiaomiEU) and may also spoof additional prop values etc...

If the ROM's embedded SNF/spoofing is up to date and capable of passing PI deviceIntegrity w/o Magisk, when you install Magisk you should NOT install any USNF module... You only need to hide root from droidguard/attestation (com.google.android.gms.unstable) gms (Play Services) process by adding this in denylist (and main com.google.android.gms process for most A11+ devices)...

Otherwise you may need to upgrade ROM or wait for maintainer to update the integrated attestation... PW
 

pndwal

Senior Member
david003
If you did all ok, lets go back to magisk and check app list in it. It is possible the google play services is not checked. If you do it , and restart phone, or only start magisk again, it can be unchecked again (and CTS will fail as result). It is not fixable.
I replaced magisk to delta version and use SuList instead .
USNF hides attestation/droidguard (com.google.android.gms.unstable) gms (Play Services) process itself since Denylist breaks USNF's key functions, especially the injection of code in gms to register a fake keystore and cause the fallback to basic attestation... That's why if you add this to denylist it will kill USNF (deviceIntegrity will be failing) if Denylist is enforced until next boot when USNF will actually remove it from denylist for you!...

With Zygisk based USNF, simply don't add any gms (Google Play Services) processes to Denylist... PW
 

david003

Senior Member
Aug 8, 2020
220
133
Later USNF builds fro @Displax actually play better with custom ROMs that already integrate SNF (from @kdrag0n Proton project) or fixes from @Displax, but there can still be conflicts with custom ROMs that do this (eg XiaomiEU) and may also spoof additional prop values etc...

If the ROM's embedded SNF/spoofing is up to date and capable of passing PI deviceIntegrity w/o Magisk, when you install Magisk you should NOT install any USNF module... You only need to hide root from droidguard/attestation (com.google.android.gms.unstable) gms (Play Services) process by adding this in denylist (and main com.google.android.gms process for most A11+ devices)...

Otherwise you may need to upgrade ROM or wait for maintainer to update the integrated attestation... PW
Thanks. I tried this, reinstalling magisk without the USNF module and adding com.google.android.gms to the DenyList. It still failed, though. Hopefully things will get sorted out eventually. Until then I've been temporarily installing magisk to run backups and then uninstalling it.
 
  • Like
Reactions: pndwal

pndwal

Senior Member
Thanks. I tried this, reinstalling magisk without the USNF module and adding com.google.android.gms to the DenyList. It still failed, though. Hopefully things will get sorted out eventually. Until then I've been temporarily installing magisk to run backups and then uninstalling it.
Did you mean just com.google.android.gms process? Should be that + com.google.android.gms.unstable for most A11+ installations...And did you check S/N and PI results without Magisk?; That would indicate if inbuilt fixes are working... PW
 
  • Like
Reactions: david003

david003

Senior Member
Aug 8, 2020
220
133
Did you mean just com.google.android.gms process? Should be that + com.google.android.gms.unstable for most A11+ installations...And did you check S/N and PI results without Magisk?; That would indicate if inbuilt fixes are working... PW
I had added all of Google Play Services to the denylist, that includes com.google.android.gms and com.google.android.gms.unstable, and a lot of others. I tried again, and added just those 2 to the deny list, and it appears to have worked.

The integrity checks pass, both with unrooted xiaomi.eu, and with magisk with those 2 added to the deny list, without the USNF module.

My banking app still fails, though (it works with unrooted xiaomi.eu). But that's another issue. I suspect it's trying to check something else I haven't figured out, yet.

Thank you!
 

Attachments

  • screenshot-play-services-2023-03-28.jpg
    screenshot-play-services-2023-03-28.jpg
    24.6 KB · Views: 52
  • screenshot-yasnac-2023-03-28.jpg
    screenshot-yasnac-2023-03-28.jpg
    37 KB · Views: 53
  • screenshot-integrity-2023-03-28.jpg
    screenshot-integrity-2023-03-28.jpg
    18.9 KB · Views: 54

pndwal

Senior Member
I had added all of Google Play Services to the denylist, that includes com.google.android.gms and com.google.android.gms.unstable, and a lot of others. I tried again, and added just those 2 to the deny list, and it appears to have worked.
You shouldn't deny most Google stuff... You may have unexpected issues... Only we only need those two gms services added... If you hide Chrome components for example, you may break webview for other apps depending on Android version...
The integrity checks pass, both with unrooted xiaomi.eu, and with magisk with those 2 added to the deny list, without the USNF module.
👍 Good to know XiaomiEU has current SNF...
My banking app still fails, though (it works with unrooted xiaomi.eu). But that's another issue. I suspect it's trying to check something else I haven't figured out, yet.
Certainly is... An no surprise...

Can you say app?
Welcome... 😃 PW
 
  • Like
Reactions: david003

david003

Senior Member
Aug 8, 2020
220
133
You shouldn't deny most Google stuff... You may have unexpected issues... Only we only need those two gms services added... If you hide Chrome components for example, you may break webview for other apps depending on Android version...

👍 Good to know XiaomiEU has current SNF...

Certainly is... An no surprise...

Can you say app?

Welcome... 😃 PW
The banking app is BDO.
 

Attachments

  • screenshot-bdo-2023-03-28.jpg
    screenshot-bdo-2023-03-28.jpg
    26.9 KB · Views: 39

pndwal

Senior Member
The banking app is BDO.
Easy one:
IMG_20230328_143002.jpg

My device:
Xiaomi RN8T stock A11 MIUI,
Magisk Canary 25209,
Magisk App hidden in stub,
Latest Shamiko public release (for proper root hiding),
LSPosed Hide My AppList module configured to hide all apps associated with root,*
OEM unlocking disabled,*
USB debugging disabled,*
Developer options disabled.*

* = confirmed not needed for your app.

I suspect just using proper root hiding (Shamiko or other) should get you going... And maybe you haven't taken Hide the Magisk app option in Magisk app?... 🙂 PW
 
Last edited:

david003

Senior Member
Aug 8, 2020
220
133
Easy one:
View attachment 5874301
My device:
Xiaomi RN8T stock A11 MIUI,
Magisk Canary 25209,
Magisk App hidden in stub,
Latest Shamiko public release (for proper root hiding),
LSPosed Hide My AppList module configured to hide all apps associated with root,*
OEM unlocking disabled,*
USB debugging disabled,*
Developer options disabled.*

* = confirmed not needed for your app.

I suspect just using proper root hiding (Shamiko or other) should get you going... And maybe you haven't taken Hide the Magisk app option in Magisk app?... 🙂 PW
Thank you for trying all that. I'm still not able to get it to work. Magisk was hidden already. I added Shamiko, but it still failed. I also added LSPosed and Hide My AppList, but it still failed even with those.
 

pndwal

Senior Member
Thank you for trying all that. I'm still not able to get it to work. Magisk was hidden already. I added Shamiko, but it still failed. I also added LSPosed and Hide My AppList, but it still failed even with those.
Just checked and this app works for me w/o Shamiko hiding (ie with Denylist enforced)...

Please give device details; ROM, any custom recovery, any unusual mods...

Try with all modules other than USNF disabled (reboot and check still have PI deviceIntegrity)... And are you clearing app data before each test? App in denylist of course(?)...

Please show Momo and Ruru detector results... PW
 

Top Liked Posts

  • 1
    I tried Majisk Delta BTW & it seemed to have a mind of its own (some AI thingy going on i guess LOL), It seemed to popup anywhere everywhere and seemed like it was like device administrator LOL. I had to reflash to get it out. Hmm..chynaware?
    You are quoting my mail that was an answer to somebody what is Magisk Alpha and then you write about Magisk Delta?!

    MagiskmDelta and Magisk Alpha are totally different forks

    And Magisk Delta (you write in your mail) is not Chinese but Vietnamese developer

    Besides, I run Delta (again, Delta is not Alpha) on one of my phones and it is excellent. It has nothing AI. But you need to set it properly. If interested, please read the posts in XDA Magisk DELTA thread. There, you can also find where to download Delta, etc
  • 14
    Mod Info:

    Thread has been cleaned.
    Those insults aren't appreciated and condoned on XDA.
    Remember the humane and respectful approach, it's the better way 🙂

    Have a good one all of you 👍🏻

    Cheers,
    mrjuniork (FSM)
    7
    John Wu's magisk alpha? Canary is the only thing I have been comfortable trying. Also how to update from Canary to Alpha? Thx
    No, Alpha is not from TJW, it's not from the official Magisk channel

    Magisk Alpha is a fork by Chinese developers, contributors to the official Magisk development, where a subgroup of them also own the development of Shamiko and LSPosed modules (hence, they are not outsiders!!!)

    They have also developed Momo, and eg Native Test, hence no wonder that you cannot fully hide 'root' from those detectors

    However, they don't participate on XDA, they have TG channel exclusively in Chinese (and it's tricky to obtain the invitation link), and Alpha, as well as Shaniko and LSPosed (and Momo and Native Test aka Minotaur) are not open source projects.
    And, be aware that telemetry is built into the Alpha

    Bellow is the XDA thread about Alpha, if you have further questions please ask there (here it's OT), that other Alpha users (but not Alpha developers) could answer you:

    Btw, take a time to read through the thread. Although things are constantly changing, first few pages from the spring of 2022 are interesting from the historical point of view. Also, you will find different opinions about the closed source development, telemetry (later introduced), their forcing of Chinese on TG channel, user experiences when they tried to argue about something with them, etc

    In short, it's for mavericks, not for the ordinary Magisk users
    5
    I have a RPI 4 wit android tv lineage OS 20. Magisk 25.2 installed(later is not available atm) . I tried your module, but it does not pass CTS in YAsnac.

    basic integrety is passed.

    What are my options ?
    Try my module:

    Or try 1.3 version of Displax:
    5
    You can just say it, they're total @$$3$ on their telegram channel. Good luck if you have an issue or a question. You will either be completely ignored which is fine or you will be torn apart by about 3 billion Chinese followers. Don't even bother trying to use translate either, they all use different dialects...
    And this is why we discourage TG on XDA
    4
    Howdy do I just have a question cuz I haven't updated myself on stuff Ina bit lol I'm currently on the Motorola edge 2021 ( code name berlna) and I'm technically still using Magisk hide props config on stock rooted a13 using the moto edge 2020 (codename racer) fingerprint, do I need magisk hide props config anymore lol, on top of this module im using the magiskhide module from huskyDG, also on magisk beta 26.3
    Not sure why you needed MHPC fingerprint with stock ROM... are you using 'force basic ' function too?

    You can use this module without MHPC as it sets a (very old) fingerprint and mismatched model props targeting GMS droidguard/attestation process which is better than MHPC globally set props and also allows some devices to meet new Play Integrity APIs deviceIntegrity verdict... If Google doesn't enforce hardware backed server end basic only evaluationType for your device you may have deviceIntegrity with matching fingerprint/security patch values as set by MHPC, but it's likely you'd only pass old S/N ctsProfileMatch that way...

    The new USNF (and newer PIF) solutions with work fairly universally on their own and are better for the current PI API anyway... Nb. If not setting props globally for other purposes you should disable MHPC as sensitive prop function will still operate by default (ie. when module is active but not configured) and is duplicated in USNF anyway... 👀 PW
  • 180
    Universal SafetyNet Fix [MOD]
    Magisk module


    Hello. This is my modification [FORK] of the original Universal SafetyNet Fix module from @kdrag0n.
    Created for the (temporary?) restoration of working capacity in the conditions of constant change of verification algorithms from Google.
    If you can`t wait for update original kdrag0n`s project - feel free to use my little "experimental sandbox" :)


    Usage:
    1.
    Delete/disable/reset MagiskHidePropsConfig (if installed).
    2. Just install it over old Universal SafetyNet Fix (if present) and reboot device.
    3. You may be needed to wipe GMS data (not cache) if there is no result immediately.
    4. Make sure that your SELinux mode sets to Enforcing! Otherwise, run the setenforce 1 command.

    Сhecking the results:
    Play Integrity API: https://play.google.com/store/apps/details?id=gr.nikolasspyr.integritycheck
    SafetyNet API: https://play.google.com/store/apps/details?id=rikka.safetynetchecker


    Changelog:
    v2.4.0-MOD_2.0
    * Fix KernelSU support. You still need "ZygiskOnKernelSU".
    * Fix WiFi calling on some devices (and maybe other related issues) by moving changing *ro.product.first_api_level* from global namespace to GMS only.
    * Pass *MEETS_STRONG_INTEGRITY*. By default you need device that launched with Android 13+ or custom ROM that manipulate with *ro.product.first_api_level* (>= 33 / or `null` / or not present).
    If you want to play with it more complex - use separate inherited module (delete mine first): https://forum.xda-developers.com/t/module-play-integrity-fix.4607985/

    v2.4.0-MOD_1.3
    * Fix "stat /sys/fs/selinux" access time reading. Also removed archaic MIUI cross-region shenanigans. Thanks to PR by aviraxp!
    * Ignore props changing on Xiaomi.eu. This fixes randomly attestation failings. So strange ROM...
    * Added Riru version back. Remember that is need old MagiskHide support (and adding com.google.android.gms/com.google.android.gms.unstable to HideList) !
    * Added microG version. Note there is some strange behavior that GMS can crash while run SN attest more than 2 times in one session. Just do not do this. This behavior should not affect applications in real life.

    v2.4.0-MOD_1.2
    * Fix crash and endless tests loop/failing on Android < 9.0 (bug from original version 2.4.0).
    * Do not unpatch (revert) changes. To prevent possible tests failing after a while on some ROMs (cross conflicts).

    v2.4.0-MOD_1.1
    * Fix KeyStore hook desynchronization (tests randomly failing problem).

    v2.4.0-MOD_1.0
    * It is now based on top of original v2.4.0 codebase instead of v2.3.1, with adding new hiding algorithm for current realities and some code refreshing.

    Inherited module with forcing STRONG implementation: https://forum.xda-developers.com/t/module-play-integrity-fix.4607985/

    Downloads: at the bottom of this post or GitHub Releases
    Source code: GitHub
    32
    MOD updated to v.1.3 !
    • Fix "stat /sys/fs/selinux" access time reading. Also removed archaic MIUI cross-region shenanigans. Thanks to PR by aviraxp!
    • Ignore props changing on Xiaomi.eu. This fixes randomly attestation failings. So strange ROM...
    31
    MOD updated to v.2.0 !
    • Fix KernelSU support. You still need "ZygiskOnKernelSU".
    • Fix WiFi calling on some devices (and maybe other related issues) by moving changing *ro.product.first_api_level* from global namespace to GMS only.
    • Pass *MEETS_STRONG_INTEGRITY*. By default you need device that launched with Android 13+ or custom ROM that manipulate with *ro.product.first_api_level* (>= 33 / or `null` / or not present). If you want to play with it more complex - use separate "-STRONG" build. NOTE: Various system issues are possible on "-STRONG" build!
    Source code also published.
    Related commit for STRONG: https://github.com/Displax/safetynet-fix/commit/79f6ef22db5eeb717c57a9bd00ee90b8d7cd2201
    27
    New test build. Please test it hardly on many devices (especially on Pixel 7+).
    If you lucky enough - you should pass "STRONG_INTEGRITY", if no - you should simply pass default "DEVICE_INTEGRITY".
    I hope there will be no system problems with this build. But who knows...
    23
    LOL :ROFLMAO: 👀
    Just played a bit with the mod today...