other8026 Not entirely sure. There's something called a source stamp. Google signs something with one of their certificates, so it's possible to confirm an APK comes from Google Play and not some other source. It's being verified with SourceStampVerifier.
hemlockiv I actually did manage to spoof the install source
It turns out that's not the only thing that's going on when apps check if they were installed via Google Play Store, so setting the installer to Google Play when installing via ADB isn't enough
Thanks, I was worried there would be something like that.
In my case, though, I don't think it has anything to do with the veracity of the APK. I initially tried installing an app to a secondary profile directly from Play Store (because the secondary profile is logged in with a google account), then ADB install-existing to the main profile. It ran fine in that secondary profile, but not in the main one, where I am not logged into Play Store with a google account.
I did a little more testing, and I discovered that (at least for the app I was trying, "Multi App"/com.waxmoon.ma.gp) the Install Source didn't actually matter. What mattered was whether the Play Store app was installed and signed in. interestingly, when I uninstalled or disabled the Play Store, I didn't get any error messages about needing to reinstall my app thru Play Store; I only got the errors when Play Store was installed, but not logged in.
I assume this has something to do with Play Integrity, or some other Play Store API. I don't know if it's possible to block that connection for an app (in other words, make an app think Play Store isn't installed when it actually is)