mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-01-30 17:51:37 -05:00
[app] request update ownership for newly installed apps
This way, when trying to update the app with another "store", the user will need to confirm a scary warning.
This commit is contained in:
committed by
Hans-Christoph Steiner
parent
dc4648b740
commit
2c394e4a99
@@ -60,6 +60,7 @@
|
||||
android:name="android.permission.QUERY_ALL_PACKAGES"
|
||||
tools:ignore="QueryAllPackagesPermission" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.ENFORCE_UPDATE_OWNERSHIP" />
|
||||
|
||||
<application
|
||||
android:name=".FDroidApp"
|
||||
|
||||
@@ -107,6 +107,14 @@ public class SessionInstallManager extends BroadcastReceiver {
|
||||
if (Build.VERSION.SDK_INT >= 33) {
|
||||
params.setPackageSource(PackageInstaller.PACKAGE_SOURCE_STORE);
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 34) {
|
||||
// Once the update ownership enforcement is enabled,
|
||||
// the other installers will need the user action to update the package
|
||||
// even if the installers have been granted the INSTALL_PACKAGES permission.
|
||||
// The update ownership enforcement can only be enabled on initial installation.
|
||||
// Set this to true on package update is a no-op.
|
||||
params.setRequestUpdateOwnership(true);
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user