[MODs, I know I have answered this before, but I felt it should be pushed into the main forum so everyone can see the answer. As this is a revised answer, please delete the OLD thread first! (please...)
Ok, so I've been asked a couple of times what knox really is. I've also read this question around the forum many, many times.
I hope this is the final answer that everyone can accept.
So let's start at the beginning... literally, the beginning. Right when you power on, Knox begins it's initial processes. You see, QualComm launched it's own SDK, and with this SDK, you can create your own, Hardware Level binaries, that do not actually run inside of Android. Instead, you can Have them run at initial boot with the other QualComm softwares/firmwares simultaneously. Think of the old "Binary Counter" prior to the Knox Generation.
This poses the question, "What is Samsung Knox?" There are several parts to this answer.
First, Knox describes itself as a type of container. Android, applications, almost every peice of software (to include partitions!) runs inside of the Knox container. Each and every application, process, task, etc, can be licensed to be run inside of this container. There are actually two containers, the secure boot, and the User/Industry/Commercial/Government container.
The secure boot, SELinux for Android, and TIMA (TrustZone-based Kernel Integrity Measurement Architecture) all work together to prevent unauthorized OS/Startup Software from loading, unauthorized changes to the kernel, and unauthorized changes to the operating system itself.
I have nicknamed this the "Tier 1 container." As it precedes, OS start up, but launches after the QualComm proprietary blend.
Second, it behaves as an Application-Specific container as well! (I call this the Tier 2 container). That's right, Knox is a service, a Software Development Kit! Did I just blow your mind? Cool...
You see, Samsung thought it would be cool to reach out to the widest Demographic possible. John Doe, Jane Smith, Fortune 500, the DoD, Government entities, and all kinds of Businesses.
How it works is, a random developer, or company will sign up- and pay, for access to the SDK. Like any other closed software, they receive a license/key to use and operate the kit. Once the app or software is developed, they submit it to Samsung, and receive a license to allow it to run inside of Knox.
So why do this?
Knox allows companies to create apps that the end-user has no real authority over. The user might be able to update/edit documents, media, or maybe fill out a DA or DD form, but he or she will not have control of the app itself. Knox allows each app to have it's own configuration. An example would be that your an IT/IS professional, and you work for multiple companies as an adviser. Each company gives you it's own Knox licensed app so you can pull network stats for each network. Each app will have it's own VPN settings, security settings, password, user availabilty, and more.
Any type of intrusion or intercession to Knox, Knox's policies, or Apps (within the Knox Container) will set off a warning system. This we know as "Knox Notifications." As I've told other users, I don't think that Samsung reports us to AT&T or whomever just because we root our phones, or constantly troll on 4chan, but I do think that it is possible for a given company, or business to create an app that can log just such events.
Knox is its own kind of "asec" container. For more info on this, see the "Works Cited" below.
As for the supported devices, again I will point you to the "Works Cited" below.
If you still have questions after reading this, please visit the SamsungKnox.com page. As this was meant as a brief, quick glance article.
Works Cited:
https://www.samsungknox.com/en
What is Samsung Knox?
What is a Knox Container?
What's the Difference Between Knox and Virtualization?
What's the difference between the Knox license, and the Knox SDK license?
Which Devices are Currently Supported?
Two things to take away from this:
(1) We've obtained root, which means Knox securities can be defeated.
(2) Commands, scripts, and/or binaries can be passed to, ran within, or be exploited by, Knox.
Let's see how far we can smash it into the ground.
For those of us with unlocked or rooted devices, I have some bad news to report. Some very, very bad news!!!
John Wu, @topjohnwu, the creator of Magisk, just confirmed that the current SafetyNet CTS Profile error issue is probably permanent, and that it's unlikely to be fixed anytime soon because Google has significantly strengthened SafetyNet. He's confirmed that Google is now utilizing hardware-backed cryptography, specifically hardware-level key attestation, leveraging the device CPU's Trusted Execution Environment (TEE) for additional security.
John Wu's Twitter Post on SafetyNet Failure Issue
If you know a little about cryptography, you will appreciate that, if properly implemented, hardware-backed cryptography is almost IMPOSSIBLE to break. This means that all of our previous SafetyNet fixes will now be obsolete since Google will now be rigorously checking the validity of the source of our cryptographic keys.
What is Android Keystore Key Attestation
Google is now verifying that the cryptographic keys it relies on to validate our devices are kept in a secure, hardware-backed keystore on each device, making key extraction near-impossible, and nullifying all our previous validation hacks. This will, for example, prevent spoofing of device certification (CTS Profile) as we currently do with our custom ROMs, and our devices will now appear in the Play Store app as "not certified."
What this means is that the unrestricted freedom we once enjoyed with our custom ROMs has now come to an end. It's easy for us hobbyists to feel victimized by Google, but we're not the target since we're a very small minority of the more than 2 billion Android users worldwide. The aim, instead, is to protect the security of the Android platform by restricting the activities of hackers and criminals who use rooted or otherwise-compromised Android devices to perpetrate their criminal activities.
Unfortunately, it's no longer business as usual. I don't know how this will end, but I don't see it ending well for us in the custom ROM community. To repeat John's final words of his twitter post, "Let's face it. Fun is over guys."
No more bank apps, no more Netflix on rooted. What a sad really don't want say good bye to rooted nor those apps
Thanhbat said:
No more bank apps, no more Netflix on rooted. What a sad really don't want say good bye to rooted nor those apps
Click to expand...
Click to collapse
Hi Thanhbat. I feel sad too. This is not a good situation. Presently, all we can do is wait and see what happens, and hope for the best. People are actively trying to find a solution, but right now it doesn't look good.
Hi to all i've Magisk installed on my device and i have not this problem. This appear randomly on some device or this is someting that will happend in the near future?
I Use a Redminote 7 Global, with last global firmware and pixelexperience.
Dust3k said:
Hi to all i've Magisk installed on my device and i have not this problem. This appear randomly on some device or this is someting that will happend in the near future?
I Use a Redminote 7 Global, with last global firmware and pixelexperience.
Click to expand...
Click to collapse
Wait until March security patch come
SafetyNet FIX https://forum.xda-developers.com/apps/magisk/safetynet-fix-google-update-march-2020-t4063679
Hello together,
I have described everything here .... Chrome, GPay, McDonalds, Pokemon are working for me - at the moment
https://xiaomi.eu/community/threads/...droid-q.52556/
https://xiaomi.eu/community/threads/...y-false.53400/
Regards Kater
PixelPro said:
For those of us with unlocked or rooted devices, I have some bad news to report. Some very, very bad news!!!
John Wu, @topjohnwu, the creator of Magisk, just confirmed that the current SafetyNet CTS Profile error issue is probably permanent, and that it's unlikely to be fixed anytime soon because Google has significantly strengthened SafetyNet. He's confirmed that Google is now utilizing hardware-backed cryptography, specifically hardware-level key attestation, leveraging the device CPU's Trusted Execution Environment (TEE) for additional security.
John Wu's Twitter Post on SafetyNet Failure Issue
If you know a little about cryptography, you will appreciate that, if properly implemented, hardware-backed cryptography is almost IMPOSSIBLE to break. This means that all of our previous SafetyNet fixes will now be obsolete since Google will now be rigorously checking the validity of the source of our cryptographic keys.
What is Android Keystore Key Attestation
Google is now verifying that the cryptographic keys it relies on to validate our devices are kept in a secure, hardware-backed keystore on each device, making key extraction near-impossible, and nullifying all our previous validation hacks. This will, for example, prevent spoofing of device certification (CTS Profile) as we currently do with our custom ROMs, and our devices will now appear in the Play Store app as "not certified."
What this means is that the unrestricted freedom we once enjoyed with our custom ROMs has now come to an end. It's easy for us hobbyists to feel victimized by Google, but we're not the target since we're a very small minority of the more than 2 billion Android users worldwide. The aim, instead, is to protect the security of the Android platform by restricting the activities of hackers and criminals who use rooted or otherwise-compromised Android devices to perpetrate their criminal activities.
Unfortunately, it's no longer business as usual. I don't know how this will end, but I don't see it ending well for us in the custom ROM community. To repeat John's final words of his twitter post, "Let's face it. Fun is over guys."
Click to expand...
Click to collapse
https://youtu.be/LiQor-mXNq8
Play Integrity API
What is Play Integrity?
Play Integrity is an API that is used by applications to determine device compatibility and security state. It has replaced SafetyNet for the most part, with a deadline of January 2025, when Google's SafetyNet servers will go offline. Apps that continue to exclusively depend on SafetyNet will no longer work once this happens. Most developers have already migrated to Play Integrity.
How is Play Integrity different from SafetyNet?
In many ways, it's very similar. It uses many of the same checks as SafetyNet, but the responses have been made a bit simpler.
Is Play Integrity the same as Play Protect?
No. Play Integrity provides users with the ability to verify device compatibility and security, much like SafetyNet did. Play Protect is a part of the Play Store that ensures that your device is certified, and helps to protect against malware. The Play Protect certification result does depend on your DEVICE_INTEGRITY result, but it is possible to pass Play Protect while failing Play Integrity, and vice versa, see here.
Why does this matter?
Like SafetyNet, apps use this API to determine a device's compatibility and security state. Failing verdicts may limit your ability to use those apps.
My device passes SafetyNet but I can't use Google Pay/other apps.
Don't rely on SafetyNet as a good assessment of your device's compatibility and security. It is possible to pass SafetyNet, but fail Play Integrity. Make sure you are specifically checking your device's Play Integrity verdicts.Rooted Pixel 5 on stock firmware: USNF 2.3.1 shows SafetyNet Pass using YASNAC, but device fails Play Integrity DEVICE_INTEGRITY check.
How do I know if my device is passing Play Integrity checks?
To check Play Integrity status, you can do so through the Play Store.Tap the Profile icon in the upper right, go to Settings > About > Tap Play Store version 8 times. This unlocks developer mode in the Play Store.Now go to Settings > General > Developer options > Check integrity.If you prefer a clear visual indicator, you can use this app:
Play Integrity API Checker - Apps on Google Play
Get info about your Device Integrity through the Play Intergrity API
play.google.com
GithubThis app not only checks Play Integrity verdicts, but checks for traces of root, Magisk, and Xposed:
TB Checker - Safetynet & Root - Apps on Google Play
All in one tools check android devices
play.google.com
If you're a nerd and you want to see key attestation details, use this:
Key Attestation Demo - Apps on Google Play
Demo for Key Attestation feature of the Android system.
play.google.com
GithubWhat can I do to fix it?
It depends on your device and software state.Fixing this requires artificial measures - either you'll have to use a Magisk module, or the fixes in the module must be baked into the ROM you're using.
If you are on the OEM ROM, or a custom ROM that hasn't been "fixed", you can use the USNF Displax Mod to pass BASIC and DEVICE verdicts. This "tricks" Play Integrity into thinking that the device is not capable of hardware backed attestation, which will force a fallback to basic attestation. You MUST be rooted with Magisk to use this module. Unrooting will still fail.
If you are on a custom ROM that has Play Integrity fixes baked in, you should already be passing. Please refer to that ROM's thread for support.
You shouldn't need to use MagiskHide Props Config with this module, even if you're on a custom ROM.Note: There is no solution that can be flashed in recovery.For support with this Magisk module, see this thread.
Do I need to pass STRONG integrity?
This is ultimately up to the individual app developer. We don't know which ones may require this result, we only know which ones don't. Google, coincidentally, is not one of these - to use GPay/Wallet, you only need BASIC and DEVICE.Please note that the only attestation requriements Google can enforce is for thier own apps. They cannot require any third party app to use hardware backed attestation. That's the whole point of providing the Play Integrity API - it's simply a means for developers to determine how secure your device is.
It's also worth noting that many if not most "security intensive" apps out there rely on third party security engines that often look for additional signs a device might be modified; see the next point below.If you are having problems with a specific app, chances are that app uses its own root detection methods; you may need to use additional modules such as Shamiko. You can post in this thread for help.I'm passing BASIC and DEVICE but an app is still detecting root. What do I do?
Some apps may implement their own root detection methods. Oddly enough, it seems that Google has documented a means for app developers to verify crytographic hardware keys without using Play Integrity at all,Other methods of root detection may include:
checking for the presence of a SU binary
checking for the presence of a root manager app such as Magisk or SuperSu
checking for traces of Zygisk / Xposed / LSPosed
checking for permissive SELinux
chekcing whether USB Debugging is enabled
It's a game of cat and mouse with these, as the methods they use are not always clear. Please be aware that this thread is ONLY intended for support with passing Play Integrity, and questions regarding hiding root for individual apps should be referred to the this thread.
Spoiler: Boring Technical details:
What causes a device to fail Play Integrity checks?It depends on your Android version and device state:
Locked bootloader with stock firmware running Android 7.1.2 or older will only pass BASIC and DEVICE. STRONG will never pass.
Locked bootloader with stock firmware running Android 8.0 or newer should pass all 3
Unlocked bootloader with unrooted stock firmware will fail all 3. STRONG will never pass.
Unlocked bootloader with Magisk rooted stock firmware will fail all 3 unless specific Magisk modules are used. STRONG will never pass.
Unlocked bootloader with custom firmware will fail all 3 (unless fixes are baked in). STRONG will never pass.
Versions of Android prior to 8.0 will only pass BASIC_INTEGRITY and DEVICE_INTEGRITY even if unmodified. Hardware backed attestation was introduced in Android 8.0; previous versions are not capable.What do the verdicts mean?The three elements in Play Integrity are:
MEETS_DEVICE_INTEGRITY: Corresponds to SafetyNet ctsProfileMatch. The app is running on an Android device powered by Google Play services. The device passes system integrity checks and meets Android compatibility requirements. (Device profile matches that of a device that has passed Compatibility Test Suite) A device that fails this will appear as Uncertified in Play Store.
MEETS_BASIC_INTEGRITY: Corresponds to SafetyNet basicIntegrity. The app is running on a device that passes basic system integrity checks. The device may not meet Android compatibility requirements and may not be approved to run Google Play services. For example, the device may be running an unrecognized version of Android, may have an unlocked bootloader, or may not have been certified by the manufacturer. Most devices should pass this, even if they're rooted.
MEETS_STRONG_INTEGRITY: Corresponds to SafetyNet HARDWARE_BACKED evaluationType. The app is running on an Android device powered by Google Play services and has a strong guarantee of system integrity such as a hardware-backed proof of boot integrity. The device passes system integrity checks and meets Android compatibility requirements. An unlocked bootloader will ALWAYS fail this label because boot integrity cannot be verified, meaning that hardware backed attestation methods cannot be used.
This table shows the relationship between SafetyNet and Play Integrity responses:
Spoiler: Device integrity verdict mapping
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
The most fundamental change is this: Play Integrity, by default, uses hardware methods to verify BASIC and DEVICE integrity, but also uses the same hardware methods as proof of boot and system integrity. What this means is that Play Integrity uses stronger (and unbreakable!) methods as "proof" of the BASIC and DEVICE verdicts, and uses the availability of these hardware backed methods to determine the STRONG_INTEGRITY verdict.These hardware methods include hardware-backed key attestation as well as Verified Boot to verify that a device has not been tampered with. It is not possible to pass STRONG integrity on an unlocked and/or modified device, or a pre Android 8 device. (Notable exception being devices with broken keystores such as ASUS ROG) << Google recently revoked ASUS ROG keys, this device won't pass STRONG even on a locked bootloaderFortunately, we have the ability to force a basic attestation method that prevents the use of hardware checks, meaning it is possible to partially pass. Universal SafetyNet Fix MOD by @Displax does this:(Response from Play Integrity Checker on my rooted Pixel 5 with Universal SafetyNet Fix MOD by Displax)
As far as how this is going to affect us in the future, it's up to the app developers to decide what results they want. In most cases, all they care about is BASIC and DEVICE. But if they really want to ensure that they're running on a trusted platform, they can require STRONG attestation, which cannot be spoofed or bypassed. BASIC and DEVICE can, because they use the same mechanisms that SafetyNet did. The million dollar question is whether they ever will. It is worth noting that SafetyNet always provided the means for developers to force hardware backed evaluation types; none did, including Google. The same seems to still be true; most app developers require DEVICE verdict, "secure" apps require BASIC and DEVICE, but none are known to require STRONG.For those interested in the timeline:
Spoiler: Play Integrity migration timeline
For the majority of us, this does not matter, unless you're using an old app that has not migrated to Play Integrity. For app developers, this means that new apps must use Play Integrity.
For more information, please read the discussion in this thread.
zgfg said:
But new devices have originally been released with A11 (or A12).
Hence, it's not possible to spoof A10 on those devices just by 'downgrading' the Android version
Then we come to the 'suggestions' to spoof fingerprints from a 'close device' (where A10 or earlier stock ROM was available) - but that just opens a Pandora box with who knows what kind of problems, because the same fingerprints are also used by system apps and services to drive various components:
- go to MHPC thread and find people who experimented with the same and lost fingerprint or the whole touch
- on another phone it could be camera or who knows what
- not to mention that spoofed CTS fingerprints may screw OTA and therefore brick the system
Click to expand...
Click to collapse
Yup... But this is what the @Displax mod solution is doing however, but targeting GMS... Also his USNF PR...
Also interesting:
This kills two rabbits:
• fix old SN CTS profile check on some weird Custom ROMs
• bypass Integrity (MEETS_DEVICE_INTEGRITY) for now.
Click to expand...
Click to collapse
https://github.com/kdrag0n/safetynet-fix/pull/207#issue-1317290126
@kdragon is taking interest... He's concerned about fingerprint mismatch issues too:
Have you noticed any features acting up with the old fingerprint?
Ideally, I think this should be scoped to Play Integrity code by identifying methods it calls near the beginning and end of integrity checks, and adding hooks to set and restore the fingerprint. I feel like setting a fingerprint that doesn't match the system in so many ways is bound to cause an issue somewhere.
Click to expand...
Click to collapse
So @Displax says it's "for now" / and is "just quick example (and core resolve) with temp fix for impatient people))... But need more testing with various devices." He agreed:
We need separate target hook for this (if feasible) - will be more polite solution...
Target process (one of?) "com.android.vending/com.google.android.finsky.integrityservice.IntegrityService"
Click to expand...
Click to collapse
https://github.com/kdrag0n/safetynet-fix/pull/207#issuecomment-1195951660
PW
pndwal said:
Yup... But this is what the @Displax mod solution is doing however, but targeting GMS...
Click to expand...
Click to collapse
Yeah, that's the point - he uses Zygisk to limit CTS prints only to GMS - therefore if you use getprop you won't see the CTS prints being changed (like if you would use MHCP for changing the prints)
See that USNF is Zygisk type module, MHCP is not - hence MHCP cannot filter the props changes only to particular app/process
Therefore, other apps (like camera, Samsung store, etc) are not troubled - they still see the proper props values
Some Insight on the New Cat and Mouse Game...
Since many are asking:
vMAC said:
Is there a fix for this? ... Can't pass MEETS_STRONG_INTEGRITY.
Click to expand...
Click to collapse
I'm posting this WOT.
I predict some will like it, some won't... You've been warned!
FWIW, Play Integrity MEETS_STRONG_INTEGRITY is akin to SafetyNet Evaluation type HARDWARE with CTS Profile match...
Banks could have used this before (w/ S/N API) but haven't as it would have excluded too many users/devices/customers... Nothing has actually changed with new PI API; MEETS_STRONG_INTEGRITY will exclude the same group, so it's doubtful they'll rush to require this verdict...
Basically, the means to enforce Hardware key-backed Attestation has already been here w/ either of these attestations, but banks don't want to exclude all those w/Android 7 and below, or many w/ broken keymaster 3+ implementations in Android 8+ devices (CTS Profile match with HARDWARE Evaluation type / MEETS_STRONG_INTEGRITY won't pass with locked bootloader), eg most OnePlus devices (nb. Keymaster may have been fixed in OnePlus devices launched with Android 12+)...
I'm guessing the banks may well leverage this at some point if the time arrives when they feel there is a sufficient critical mass of devices w/ working hardware-backed keymaster (ie w/ hardware keystore, A8+) to trade against the number of modded (bootloader unlocked) devices in use especially if they deem Google slow to close the fallback-to-basic-attestation loophole that has allowed modders to bypass hardware based attestation to CTS Profile match enforcement (by triggering fallback to BASIC Evaluation type as well as bypassing enforcement) and also to allow its counterpart, MEETS_DEVICE_INTEGRITY verdict. (Nb. This verdict should not properly be obtained on modded devices, and it requires the same attestations as S/N as well as the same tricks to trigger fallback to BASIC attestation and bypass enforcement) The incentive to use this foolproof means is also certainly being weighed constantly against the cost / need to use their own custom means of sophisticated 'root' detection...
Google also, as other authorities have commented, appears to be waiting for some 'acceptable' percentile / critical mass of such devices in use to be reached also, before they swing the 'big hammer' that is Hardware-backed Key Attestation enforcement and that will definitely spell the endgame for modders' use of bank apps, and possibly for OnePlus users and others whose devices have broken keymaster*
*Nb. There are exceptions, eg Asus ROG Phone 3, where broken keymaster actually results in PI MEETS_STRONG_INTEGRITY and S/N CTS Profile match with Evaluation type HARDWARE regardless of bootloader status instead of the converse...
It seems likely to me that OnePlus and other devices with broken keymaster can be spared if Google do prevent on-device triggering of fallbacks to basic attestation use simply by using device info contained in the cryptographic attestation sent to Google servers instead of userspace model props etc now used, to bypass enforcement at the server end. If they do this it would be a concession as modded OnePlus etc may then still be able to pass CTS Profile match / DEVICE_INTEGRITY while other modern modded devices won't...
This would, however, be a way to swing the hammer a bit sooner, and either way, as can be seen from the above, they may be forced to do this once banks do indicate a willingness to enforce
MEETS_STRONG_INTEGRITY in order to stop a landslide that would prevent all stock locked Android 7 and lower devices using bank apps etc... Or maybe they'll just let the landslide go and force bank app users to upgrade devices...
Hopefully this gives some insight regarding what pressures may finally force Google to properly deploy (ie. strictly enforce) Hardware-based Key Attestation on devices that support it...
Personally, I think Google has exercised great restraint, possibly out of some regard for the modding community since I can't see any other compelling reason not to have properly enforced CTS Profile match with HARDWARE Evaluation type where supported or Hardware attested MEETS_DEVICE_INTEGRITY sooner, unless the matter of ensuring that the API properly sees hardware identifiers (ie. these cannot be spoofed, which I believe would again require cryptographic server-side attestation that the device doesn't indicate the presence of hardware keystore) for bypassing hardware attestation enforcement in devices launched with Android 7 and earlier is proving difficult (but I'm fairly sure this mechanism will be a simple matter for Google and probably already in place)...
It may well be that Google is benevolently holding off but is using/will use MEETS_STRONG_INTEGRITY uptake data as tha natural indicator of the banks propensity for reliable HKA... My bet is that if Google doesn't have immediate plans to move to srtict HKA enforcement for MEETS_DEVICE_INTEGRITY, then they will when the banks themselves move to use the even stricter MEETS_STRONG_INTEGRITY verdict...
pndwal said:
Since many are asking:
I've posted some information about Play Integrity MEETS_STRONG_INTEGRITY being akin to SafetyNet Evaluation type HARDWARE with CTS Profile match, but since it became a WOT, I put it here:
https://forum.xda-developers.com/t/magisk-general-support-discussion.3432382/post-87274009
PW
Click to expand...
Click to collapse
I've been meaning to ask....Since Google is replacing SafetyNet with Play Integrity, is it safe to assume that there will come a day when app developers (particularly Google) remove SafetyNet support from their apps, at which point those of us with root will be unable to force "legacy" attestation as with the modified USNF? Of course this will mean that all versions of Android prior to the implementation of HA/TEE will be excluded as well, but it's not uncommon for developers to stop supporting older platforms.
pndwal said:
Some Insight on the New Cat and Mouse Game...
Since many are asking:
I'm posting this WOT.
I predict some will like it, some won't... You've been warned!
FWIW, Play Integrity MEETS_STRONG_INTEGRITY is akin to SafetyNet Evaluation type HARDWARE with CTS Profile match...
Banks could have used this before (w/ S/N API) but haven't as it would have excluded too many users/devices/customers... Nothing has actually changed with new PI API; MEETS_STRONG_INTEGRITY will exclude the same group, so it's doubtful they'll rush to require this verdict...
Basically, the means to enforce Hardware key-backed Attestation has already been here w/ either of these attestations, but banks don't want to exclude all those w/Android 7 and below, or many w/ broken keymaster 3+ implementations in Android 8+ devices (CTS Profile match with HARDWARE Evaluation type / MEETS_STRONG_INTEGRITY won't pass with locked bootloader), eg most OnePlus devices (nb. Keymaster may have been fixed in OnePlus devices launched with Android 12+)...
I'm guessing the banks may well leverage this at some point if the time arrives when they feel there is a sufficient critical mass of devices w/ working hardware-backed keymaster (ie w/ hardware keystore, A8+) to trade against the number of modded (bootloader unlocked) devices in use especially if they deem Google slow to close the fallback-to-basic-attestation loophole that has allowed modders to bypass hardware based attestation to CTS Profile match enforcement (by triggering fallback to BASIC Evaluation type as well as bypassing enforcement) and also to allow its counterpart, MEETS_DEVICE_INTEGRITY verdict. (Nb. This verdict should not properly be obtained on modded devices, and it requires the same attestations as S/N as well as the same tricks to trigger fallback to BASIC attestation and bypass enforcement) The incentive to use this foolproof means is also certainly being weighed constantly against the cost / need to use their own custom means of sophisticated 'root' detection...
Google also, as other authorities have commented, appears to be waiting for some 'acceptable' percentile / critical mass of such devices in use to be reached also, before they swing the 'big hammer' that is Hardware-backed Key Attestation enforcement and that will definitely spell the endgame for modders' use of bank apps, and possibly for OnePlus users and others whose devices have broken keymaster*
*Nb. There are exceptions, eg Asus ROG Phone 3, where broken keymaster actually results in PI MEETS_STRONG_INTEGRITY and S/N CTS Profile match with Evaluation type HARDWARE regardless of bootloader status instead of the converse...
It seems likely to me that OnePlus and other devices with broken keymaster can be spared if Google do prevent on-device triggering of fallbacks to basic attestation use simply by using device info contained in the cryptographic attestation sent to Google servers instead of userspace model props etc now used, to bypass enforcement at the server end. If they do this it would be a concession as modded OnePlus etc may then still be able to pass CTS Profile match / DEVICE_INTEGRITY while other modern modded devices won't...
This would, however, be a way to swing the hammer a bit sooner, and either way, as can be seen from the above, they may be forced to do this once banks do indicate a willingness to enforce
MEETS_STRONG_INTEGRITY in order to stop a landslide that would prevent all stock locked Android 7 and lower devices using bank apps etc... Or maybe they'll just let the landslide go and force bank app users to upgrade devices...
Hopefully this gives some insight regarding what pressures may finally force Google to properly deploy (ie. strictly enforce) Hardware-based Key Attestation on devices that support it...
Personally, I think Google has exercised great restraint, possibly out of some regard for the modding community since I can't see any other compelling reason not to have properly enforced CTS Profile match with HARDWARE Evaluation type where supported or Hardware attested MEETS_DEVICE_INTEGRITY sooner, unless the matter of ensuring that the API properly sees hardware identifiers (ie. these cannot be spoofed, which I believe would again require cryptographic server-side attestation that the device doesn't indicate the presence of hardware keystore) for bypassing hardware attestation enforcement in devices launched with Android 7 and earlier is proving difficult (but I'm fairly sure this mechanism will be a simple matter for Google and probably already in place)...
It may well be that Google is benevolently holding off but is using/will use MEETS_STRONG_INTEGRITY uptake data as tha natural indicator of the banks propensity for reliable HKA... My bet is that if Google doesn't have immediate plans to move to srtict HKA enforcement for MEETS_DEVICE_INTEGRITY, then they will when the banks themselves move to use the even stricter MEETS_STRONG_INTEGRITY verdict...
Click to expand...
Click to collapse
Would you consider possibly boiling this down to a fairly simpler explanation that we can sticky? It's likely this will be the topic of quite repetitive questions going forward.
I tried to explain it somewhat simply here, please let me know how far I missed the mark
V0latyle said:
I've been meaning to ask....Since Google is replacing SafetyNet with Play Integrity, is it safe to assume that there will come a day when app developers (particularly Google) remove SafetyNet support from their apps,
Click to expand...
Click to collapse
I put info about this originally here:
https://forum.xda-developers.com/t/magisk-module-universal-safetynet-fix-2-3-1.4217823/post-87188299
Google is urging Devs to do just that; S/N API was already depreciated in June with 'full turndown' slated for June 2024... banks are urged to move to PI asap, and at least before the June 2023 migration deadline. If they do, their older versions will continue to function with S/N API till June 2024. If they don't, these will cease to gat needed attestations from June 2023.
V0latyle said:
at which point those of us with root will be unable to force "legacy" attestation as with the modified USNF?
Click to expand...
Click to collapse
No, the new API includes all of the same device state checks and app processees use either one or the other, (although GPay seemed to use one for the app info and the other for card setup... but I'm betting it's only due to progressive changes...) so S/N turnoff won't matter...
You'll notice that if CTS Profile match fails for example, Device Integrity will fail also... The new API is a little stricter, especially for A11+ devices but @Displax's new USNF covers new enforcement bypass needed for these devices... The old bypasses are also still needed... And an official Pull Request is pending. (My Android 10 device doesn't need any change from official USNF)
V0latyle said:
Of course this will mean that all versions of Android prior to the implementation of HA/TEE will be excluded as well, but it's not uncommon for developers to stop supporting older platforms.
Click to expand...
Click to collapse
This is the point of what I just posted; if Google swings the enforce HKA if supported for MEETS_DEVICE_INTEGRITY hammer first, banks likely won't move to MEETS_STRONG_INTEGRITY sparing pre A8 stock devices... If they don't, eventually banks will implement MEETS_STRONG_INTEGRITY which will exclude customers using pre A8 devices... Either way it's game over for modders at that point... At least that's what my deduction says!
See official dates, info, links from here:
https://developer.android.com/training/safetynet/deprecation-timeline
PW
V0latyle said:
I've been meaning to ask....Since Google is replacing SafetyNet with Play Integrity, is it safe to assume that there will come a day when app developers (particularly Google) remove SafetyNet support from their apps, at which point those of us with root will be unable to force "legacy" attestation as with the modified USNF? Of course this will mean that all versions of Android prior to the implementation of HA/TEE will be excluded as well, but it's not uncommon for developers to stop supporting older platforms.
Click to expand...
Click to collapse
That's something we can only speculate about.
Frankly, Google did not need Play Integrity - they could have simply forced CTS Profile checking through TEE (same thing as STRONG now) - but they didn't (yet)
Per specification, Google is not the final Judge. It only provides info how your device passes the Play Integrity API levels
If you are developer of a banking app, it is up to you would you allow DEVICE integrity, or would you require STRONG. Not even your banking app but better the banking server should make the final judgement (upon being passed the PI API test results)
Again, frankly, bankers could have already been checking do you pass CTS Profile with HARDWARE_BACKED or only BASIC, and allow only the first ones (they can also read that info with the old SafetyNet)
Btw, bankers (developers) can employ a more complex logic. Based on your phone model to require STRONG (new phones) or allow DEVICE (for older phones) - but it requires more work on their side
Wow.. another thread ... Perhaps we could condense this in @Didgeridoohan's GPay thread?
Anyway, since you asked me to critique:
V0latyle said:
The reason for this is that Google is sunsetting the SafetyNet and Play Protect certifications
Click to expand...
Click to collapse
I hadn't heard about Play Protect depreciation (it's still there currently, and Play Store is already using Play Integrity API!), but SafetyNet is already deprecated...
V0latyle said:
in favor of the new Play Integrity API, which uses 3 fields:
MEETS_DEVICE_INTEGRITY
The app is running on an Android device powered by Google Play services. The device passes system integrity checks and meets Android compatibility requirements. This is replacing SafetyNet's ctsProfile. This is what USNF fixes.
MEETS_BASIC_INTEGRITY
The app is running on a device that passes basic system integrity checks. The device may not meet Android compatibility requirements and may not be approved to run Google Play services. For example, the device may be running an unrecognized version of Android, may have an unlocked bootloader, or may not have been certified by the manufacturer. This is replacing SafetyNet's basicIntegrity, and means that Play Services has not detected root.
MEETS_STRONG_INTEGRITY
The app is running on an Android device powered by Google Play services and has a strong guarantee of system integrity such as a hardware-backed proof of boot integrity. The device passes system integrity checks and meets Android compatibility requirements.
This is replacing SafetyNet's Hardware Attestation, and uses the Android system's Trusted Execution Environment to guarantee process security. This will not pass with an unlocked bootloader, and cannot be spoofed as it specifically relies on hardware security; unlocking the bootloader "breaks" TEE.
The workaround for this is the modded USNF module by @Displax which forces the system to use the old SafetyNet API instead of Play Integrity.
Click to expand...
Click to collapse
Um, no...
It simply allows PI MEETS_DEVICE_INTEGRITY verdict in Android 11+ (generally), by creating a fingerprint prop SDK-level (and possibly other) mismatch that triggers bypassing of Hardware keystore attestation enforcement... The original USNF fallback trigger (fake keystone registration) and enforcement bypass (altered Model prop) are also needed for MEETS_DEVICE_INTEGRITY verdict, and these alone are enough for many devices (pre-Android 11 generally).
V0latyle said:
I imagine at some point in the future when SafetyNet is completely retired, app developers (especially large ones like Google) will eventually remove support for SafetyNet in their apps, which will mean that anyone whose device does not pass Play Integrity will not be able to use the app. This will include everyone running versions of Android older than 8.0, when TEE was implemented.
Click to expand...
Click to collapse
Hardware keystore and hardware TEE have been around at least since Android 6, but keymaster could not reliably verify the key pairs were in hardware... This was strengthened in Android 7 Keymaster 2 attesting to hardware backed keys, but only Android 8's Keymaster 3, with ID attestation allowing the device to provide proof of hardware identifiers, such as serial number or IMEI, was considered an attestation strong enough for HKA in android..
The other points are treated in my post above. PW
V0latyle said:
Would you consider possibly boiling this down to a fairly simpler explanation that we can sticky? It's likely this will be the topic of quite repetitive questions going forward.
I tried to explain it somewhat simply here, please let me know how far I missed the mark
Click to expand...
Click to collapse
You may also see this answer (we are all talking the same things, maybe with slightly different words):
https://forum.xda-developers.com/t/...agisk-discussion-thread.3906703/post-87274309
I admit it's a little hard to wrap my brain around this.
My understanding of the Play Integrity API was originally that in order to meet Play Integrity as a whole, devices would have to meet the BASIC, DEVICE, and STRONG integrity. I didn't know the apps looked at those qualities directly - I thought Play Integrity checked these, and if any of them was false, Play Integrity would report that integrity is compromised.
I promise I'm not being obtuse...
So the way it REALLY works is that the API is a method by which the apps can check these properties; it doesn't rely on a Google specific process (because AOSP)
Which means I still don't quite understand...how does the modded USNF allow apps such as GPay and Wallet to ignore the MEETS_STRONG_INTEGRITY?
It's clear to me that almost any device should return MEETS_BASIC_INTEGRITY, and that we have to use workarounds such as USNF to be able to return MEETS_DEVICE_INTEGRITY, and that we will never be able to return MEETS_STRONG_INTEGRITY because of HKA vs unlocked bootloaders.
V0latyle said:
I admit it's a little hard to wrap my brain around this.
My understanding of the Play Integrity API was originally that in order to meet Play Integrity as a whole, devices would have to meet the BASIC, DEVICE, and STRONG integrity. I didn't know the apps looked at those qualities directly - I thought Play Integrity checked these, and if any of them was false, Play Integrity would report that integrity is compromised.
I promise I'm not being obtuse...
So the way it REALLY works is that the API is a method by which the apps can check these properties; it doesn't rely on a Google specific process (because AOSP)
Which means I still don't quite understand...how does the modded USNF allow apps such as GPay and Wallet to ignore the MEETS_STRONG_INTEGRITY?
It's clear to me that almost any device should return MEETS_BASIC_INTEGRITY, and that we have to use workarounds such as USNF to be able to return MEETS_DEVICE_INTEGRITY, and that we will never be able to return MEETS_STRONG_INTEGRITY because of HKA vs unlocked bootloaders.
Click to expand...
Click to collapse
Here (again) link to Google's doc:
Overview of the Play Integrity API | Google Play | Android Developers
developer.android.com
Pay attention to verdict - but better spend 15 minutes to read the whole
And in YASNAC, you can also read the JSON with eg details was the CTS Profile checked on TEE or not (= STRONG integrity for the be PI API)
zgfg said:
Frankly, Google did not need Play Integrity - they could have simply forced CTS Profile checking through TEE (same thing as STRONG now) - but they didn't (yet)...
Click to expand...
Click to collapse
FWIW, the real reason for the change was to provide an inclusive Integrity solution that
helps protect your apps and games from potentially risky and fraudulent interactions, allowing you to respond with appropriate actions to reduce attacks and abuse such as fraud, cheating, and unauthorized access.
Click to expand...
Click to collapse
by combining existing SafetyNet attestation in Device Integrity fields with the new Application integrity and Account details fields in a single API.
PW
V0latyle said:
I admit it's a little hard to wrap my brain around this.
My understanding of the Play Integrity API was originally that in order to meet Play Integrity as a whole, devices would have to meet the BASIC, DEVICE, and STRONG integrity. I didn't know the apps looked at those qualities directly - I thought Play Integrity checked these, and if any of them was false, Play Integrity would report that integrity is compromised.
I promise I'm not being obtuse...
So the way it REALLY works is that the API is a method by which the apps can check these properties; it doesn't rely on a Google specific process (because AOSP)
Which means I still don't quite understand...how does the modded USNF allow apps such as GPay and Wallet to ignore the MEETS_STRONG_INTEGRITY?
It's clear to me that almost any device should return MEETS_BASIC_INTEGRITY, and that we have to use workarounds such as USNF to be able to return MEETS_DEVICE_INTEGRITY, and that we will never be able to return MEETS_STRONG_INTEGRITY because of HKA vs unlocked bootloaders.
Click to expand...
Click to collapse
Apps can use MEETS_DEVICE_INTEGRITY by default, using any distribution channel. Registration with Google Play allows use of MEETS_BASIC_INTEGRITY and MEETS_STRONG_INTEGRITY in addition...
Flow chart:
PW
zgfg said:
Here (again) link to Google's doc:
Overview of the Play Integrity API | Google Play | Android Developers
developer.android.com
Pay attention to verdict - but better spend 15 minutes to read the whole
And in YASNAC, you can also read the JSON with eg details was the CTS Profile checked on TEE or not (= STRONG integrity for the be PI API)
Click to expand...
Click to collapse
I have read this and keep going back but I'm no developer and my general understanding of Android is less than elementary
pndwal said:
Apps can use MEETS_DEVICE_INTEGRITY by default, using any distribution channel. Registration with Google Play allows use of MEETS_BASIC_INTEGRITY and MEETS_STRONG_INTEGRITY in addition...
Click to expand...
Click to collapse
This is where it's still confusing to me. Because according to that statement, it sounds like developers can choose what guarantee of security they want...but
pndwal said:
Flow chart:
PW
Click to expand...
Click to collapse
This makes it sound like Play Integrity is not so much a framework as it is a service, meaning at some point app developers will have no choice?
Or am I right on both accounts, but app developers can either call the Play Integrity API, or they can call the device security fields alone?
@ipdev @pndwal @zgfg @TraderJack I know it's a lot of work, but could you please move your posts on Play Integrity into this thread as described above? The idea is to have one thread to discuss this topic, as well as a place to point other users to should they have questions. If someone would like to volunteer their post, I can copy/paste into the OP so we have an up front explanation of what Play Integrity is, how it works, and what it means for rooted/modded users.
V0latyle said:
@ipdev @pndwal @zgfg @TraderJack I know it's a lot of work, but could you please move your posts on Play Integrity into this thread as described above? The idea is to have one thread to discuss this topic, as well as a place to point other users to should they have questions. If someone would like to volunteer their post, I can copy/paste into the OP so we have an up front explanation of what Play Integrity is, how it works, and what it means for rooted/modded users.
Click to expand...
Click to collapse
Is it possible to move the posts without copy-pasting them?
I mean it is if I mark it is Report and ask you to move - but then it's more work for you. Hence some other way?
zgfg said:
Is it possible to move the posts without copy-pasting them?
I mean it is if I mark it is Report and ask you to move - but then it's more work for you. Hence some other way?
Click to expand...
Click to collapse
No, only moderators can move posts (and we have forum specific moderators so it wouldn't be me lol)
Else, you can copy/paste and request the old post be deleted
V0latyle said:
I have read this and keep going back but I'm no developer and my general understanding of Android is less than elementary
Click to expand...
Click to collapse
X2
V0latyle said:
This is where it's still confusing to me. Because according to that statement, it sounds like developers can choose what guarantee of security they want...
Click to expand...
Click to collapse
Well Hardware evaluationTypes are used if available by default even if just calling Device_Integrity. That's why @kdragon uses both fake keystone (causes exception which triggers fall back to basic attestation) and altered Model prop (mismatch causes enforcement of a Hardware based verdict to be bypassed, ie. the forced basic attestation becomes acceptable)...
The statement "JSON ... details was the CTS Profile checked on TEE or not (= STRONG integrity for the be PI API)" may be misleading; really, MEETS_STRONG_INTEGRITY only indicates a passing STRONG_INTEGRITY verdict using hardware TEE; of course, unlocked devices will fail to return MEETS_STRONG_INTEGRITY and there will be no indication whether hardware TEE was used or not in PI, unlike old S/N attestation... Conversely, CTS Profile will be checked in TEE (ie. we see S/N HARDWARE evaluationType) to attest to DEVICE_INTEGRITY if it's available by default (ie. on A8+ devices), but if it fails there is no indication from PI API that hardware TEE was used, and no indication if hardware was used if it succeeds either unless STRONG_INTEGRITY succeeds also...
Don't confuse evaluationType with the choice of verdict type; Devs can choose any of three levels for verdict but cannot choose evaluationType used; Hardware will be used if it's available for that type unless userspace tricks are used to spoof device and cause fallbacks...
V0latyle said:
but
This makes it sound like Play Integrity is not so much a framework as it is a service, meaning at some point app developers will have no choice?
Click to expand...
Click to collapse
It's an API, (Application Programming Interface) requiring server-end support by Google; I gave you the dates / link a couple of times now for 'Migration deadline' & 'Full turndown' of S/N API at which point there will be no choice but to use PI API...
V0latyle said:
Or am I right on both accounts, but app developers can either call the Play Integrity API, or they can call the device security fields alone?
Click to expand...
Click to collapse
Sorry, are you referring to Play Integrity response labels?... These are all part of Play Integrity, of course!?
Main signals (responses) are defined as:
- Application integrity
- Account details
- Device integrity
For Device integrity, device_recognition_verdict is called.
By default, this can have one of the following labels:
MEETS_DEVICE_INTEGRITY
or
No labels (a blank value)
If you opt in to receive additional labels in Device integrity, device_recognition_verdict can have the following additional labels:
MEETS_BASIC_INTEGRITY
or
MEETS_STRONG_INTEGRITY
and for emulators only
MEETS_VIRTUAL_INTEGRITY
These 'fields' are all called via the Device Integrity API.
https://developer.android.com/google/play/integrity/verdict
PW
PS. Just did this on 140 min flight from Broken Hill to Sydney... Just landed...
I am not sure about the Google Pay Magisk Discussion Thread but, posts (including mine) related to Play Integrity in the Universal SafetyNet Fix 2.3.1 thread seem to start around Post # 1,796.
All the posts about Play Integrity (that are not related to the USNF module) would have to be moved and kept in order to this thread.
I am not sure how easy that would be to do, since a lot of the discussion included linked posts in the responses.
Maybe @mrjuniork has an idea of the best and easiest way to do it?
Cheers.
PS.
Sorry to ping you mrjuniork.
I might be wrong but, it looks like you will be the one who gets stuck moving the posts.