diff --git a/app/build.gradle b/app/build.gradle
index 32340f6dc..fcb782b94 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -33,13 +33,15 @@ android {
dimension "source"
manifestPlaceholders.storagePermission = "android.permission.MANAGE_EXTERNAL_STORAGE"
manifestPlaceholders.installPermission = "android.permission.REQUEST_INSTALL_PACKAGES"
+ manifestPlaceholders.updatesPermission = "android.permission.UPDATE_PACKAGES_WITHOUT_USER_ACTION"
buildConfigField "boolean", "GOOGLE_PLAY", "false"
}
google {
dimension "source"
isDefault true
manifestPlaceholders.storagePermission = "com.hiddenramblings.tagmo.BROWSER"
- manifestPlaceholders.installPermission = "com.hiddenramblings.tagmo.UPDATING"
+ manifestPlaceholders.installPermission = "com.hiddenramblings.tagmo.INSTALL"
+ manifestPlaceholders.updatesPermission = "com.hiddenramblings.tagmo.UPDATING"
buildConfigField "boolean", "GOOGLE_PLAY", "true"
}
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 673f1731d..9e6d7e0d4 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -17,6 +17,7 @@
+
diff --git a/app/src/main/java/com/hiddenramblings/tagmo/update/UpdateManager.kt b/app/src/main/java/com/hiddenramblings/tagmo/update/UpdateManager.kt
index dab7586fb..122b3cd41 100644
--- a/app/src/main/java/com/hiddenramblings/tagmo/update/UpdateManager.kt
+++ b/app/src/main/java/com/hiddenramblings/tagmo/update/UpdateManager.kt
@@ -135,6 +135,11 @@ class UpdateManager internal constructor(activity: BrowserActivity) {
val params = PackageInstaller.SessionParams(
PackageInstaller.SessionParams.MODE_FULL_INSTALL
)
+ if (!BuildConfig.GOOGLE_PLAY && Version.isTiramisu) {
+ params.setRequireUserAction(
+ PackageInstaller.SessionParams.USER_ACTION_NOT_REQUIRED
+ )
+ }
openSession(createSession(params))
}
val document = DocumentFile.fromSingleUri(applicationContext, apkUri)