Skip to content

Commit

Permalink
Merge pull request #591 from chenxiaolong/update_ownership
Browse files Browse the repository at this point in the history
Add support for requesting update ownership on Android 14+
  • Loading branch information
Tobi823 authored Jun 8, 2024
2 parents 6418e69 + e39f324 commit 5a99bcc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions ffupdater/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
tools:ignore="ScopedStorage" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.ENFORCE_UPDATE_OWNERSHIP" />

<!-- Shizuku needs API 23, but I still want to use API 21-->
<uses-sdk tools:overrideLibrary="rikka.shizuku.api, rikka.shizuku.provider, rikka.shizuku.shared, rikka.shizuku.aidl" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ open class SessionInstaller(private val foreground: Boolean) : AppInstaller {
if (DeviceSdkTester.supportsAndroid7Nougat24()) params.setOriginatingUid(android.os.Process.myUid())
if (DeviceSdkTester.supportsAndroid8Oreo26()) params.setInstallReason(PackageManager.INSTALL_REASON_USER)
if (DeviceSdkTester.supportsAndroid12S31()) params.setRequireUserAction(USER_ACTION_NOT_REQUIRED)
if (DeviceSdkTester.supportsAndroid14U34()) params.setDontKillApp(true)
if (DeviceSdkTester.supportsAndroid14U34()) {
params.setDontKillApp(true)
// This only takes effect for initial installs, but is a no-op for updates.
params.setRequestUpdateOwnership(true)
}
allowAppReplacement(params)
return params
}
Expand Down

0 comments on commit 5a99bcc

Please sign in to comment.