installing apps with low targetSdkVersion
Android 14 has started to block the install of apps with a targetSdkVersion lower than a value hardcoded in the ROM. By default, that is currently SDK 23. Reading through those apps with min SDK < 23 gives clear examples of functionality that the newer restrictions have broken: they often say something like "the API needed no longer works on higher targetSdkVersion". A popular force that drives users to F-Droid is when Google Play restricts something that they want. The first big influx we saw was when AdAway was kicked out of Play. There are many ideas for how we can support this. Then we can have the best of both worlds: enforced min SDK by default with user control if they want the extra functionality.
how?
PackageManager.INSTALL_BYPASS_LOW_TARGET_SDK_BLOCK is @hide but it could be used by Privileged Extension for sure, and maybe even SessionInstaller. Looks like supporting that would mean porting Privileged Extension to use the Session installer API. I think that's something we want to do anyway. Aurora Services (their PrivExt) was already using Session Installer, as well as @cdesai's proof of concept for F-Droid PrivExt.
@cdesai suggested:
Also wanted to add that when somebody is using PrivExt they're either rooted or running a custom OS, there's easier ways to tweak this for the latter, by modifying the constant in the source. And when rooted, there's other ways to modify it, but given that it's compiled in, nothing too easy.
Actually from what I can tell
INSTALL_BYPASS_LOW_TARGET_SDK_BLOCKwon't work with PrivExt.
If the bypass flag is set, but not running as system root or shell then remove the flag
Even as system apps, PrivExt or F-Droid don't run as the system user.
Funny enough, this should work with Shizuku, which doesn't even need root, just shell.
Shizuku is interesting but has a murky license https://github.com/RikkaApps/Shizuku/issues/69
Came of out of this discussion: #2692 (comment 1601551215)