[Android Software Development] pndwal:
Actually, the real problem is device is not certified! 😜

https://support.google.com/android/answer/10248227

In the past, GSF and GApps could be sideload and work (even with bootloader locked).

https://miui.blog/any-devices/xiaomi-google-apps-installer/

Here's a guide / "GoogleInstaller" apk for Xiaomi:

https://xiaomifirmware.com/guides-and-tips/how-to-install-gapps-on-miui-china-developer-roms/

Further, a non-China region or 'Global' ROM could be flashed on bootloader locked devices successfully!

Since most manufacturers have come into line with Google requirements and now match signing for certified devices with certified ROMs, Verified Boot, by using device-mapper-verity (dm-verity), ensures that a certified ROM won't run (as certified) on an uncertified device with bootloader locked. (A certified ROM can, in fact, be made to run on such a BL locked uncertified device by using custom signing keys to sign images, but this will necessarily break Compatibility Test Suite, hence SafetyNet, pass).

Now however (since March 16 1018), Google is blocking side-loaded Google apps and services from working on non-certified devices failing SafetyNet.

As a gesture of goodwill toward custom modders, they have established a white list expressly to allow GApps to be used on these same devices as long as a Custom ROM is installed (although it seems to work also for stock 😉) by registering GSF ID. (Without this, GApps may be set up but users are prevented from registering a Google account to use them, or from downloading from PlayStore.)

https://www.google.com/android/uncertified/

XDA article:

https://www.xda-developers.com/how-to-fix-device-not-certified-by-google-error/

Nb. While such whitelisting is not generally needed for custom ROM or Magisk users employing spoofing techniques (My uncertified (China) Mi Pad 4 w/ unofficial LOS and spoofed certified fingerprint etc, has never shown the "Device is not certified by Google" warning or had issues downloading extra Google apps from PlayStore, and is not whitelisted), my educated guess is that this whitelist may well become essential for custom ROM users w/ uncertified devices wishing to to use GApps after final/full Hardware Keystore Attestation rollout.

It seems it's already necessarily for official LineageOS users (and those of other custom ROMs w/ strict stance on spoofing, eg. "that we will not intentionally circumvent an integrity check that Google has put in place for app developers") with China (uncertified) devices:

https://lineageos.org/Google-Play-Certification/

https://lineageos.org/Safetynet/

Xiaomi China ROMs:

The recently reported 'removal of GMS framework' (Google Mobile Services and Google Services Framework area closely related) from non-certified MIUI 12.5+ is confusing, and made me wonder how Xiaomi gets away with including them (not the complete GApps, but still proprietary code) at all! - Perhaps they simply do so because "this doesn’t break any (legal?) rules" as stated in the XDA article cited above.

Google Services should not have worked on these devices since March 2018 in any case, due to failed SafetyNet & unregistered GSF ID... Or am I missing something??

https://www.google.com/amp/s/droid....for-future-phones-running-miui-china-rom/amp/

I also read that low end China region devices will actively block GMS Installation (side-loading), but it appears Snapdragon 8xx devices may still come with GMS framework pre-installed.

https://www.notebookcheck.net/Xiaom...lation-on-China-ROM-smartphones.517804.0.html

😮 PW