Self-update: install via PackageInstaller and clean up installer files #13
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/self-update"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Reworks the in-app self-update so that, after the user taps Update, the app downloads and installs the new version on its own where Android allows it, then removes the installer file and any leftovers.
PackageInstallersession instead ofACTION_VIEW+ FileProvider. On Android 12+ it setsUSER_ACTION_NOT_REQUIRED, so the update is silent once KaraTV is its own installer of record. The first update after an adb/file-manager sideload, and every update on Android ≤ 11, still shows the system confirmation.cache/updatesis cleared on app start and onMY_PACKAGE_REPLACED..apk.part) are removed on failure.size.canRequestPackageInstalls()andACTION_MANAGE_UNKNOWN_APP_SOURCESare API 26+.Installingstate and chip.res/xml/file_paths.xml.Testing
./gradlew :app:compileDebugKotlin :app:testDebugUnitTest :app:lintDebugpass; lint reports no NewApi findings.releases/latestserver:com.karatv.app.cache/updateswas removed afterwards.Known limitations