Enabled downloading/updating any/all apps in the background with a service, fixed many issues with download, install, uninstall

I have been using AuroraStore as my primary app store for a long time because I am on Huawei. I noticed many issues with downloading/updating apps and I fixed them.

List of changes:

  • Updating apps is done in a separate foreground service so that AuroraStore doesn't need to be open for updating of any/all apps to work
  • Enable fetching of app download urls in the background (AppDetailsActivity.kt)
  • Force granting of all permissions in OnboardingActivity.kt by disabling finish until PermissionsFragment.kt notifies successfully granted permissions
  • Every app downloaded is fetched with a unique, random but saved and constant groupID based on appID and versionCode (prevents install issues with updated apps while keeping history)
  • Implement service based install for new downloads (integrated in the UpdateService.kt and the AppDetailsActivity.kt)
  • Add own notification group for UpdateService.kt and extract all required UpdateService.kt strings
  • Add ability to pass file list to service installer for more advanced, non-system service installers
  • Save downloaded files in getExternalFilesDir by default for more useful file list for more advanced, non-system service installers without compromising security because of Android's restrictions on the Android/data directory

List of fixes:

  • Fix double install calls by finishing the implementation of the install queue
  • Fix issues with ServiceInstaller (uninstall calls wrong bus event, service connection was not detached properly)
  • Fix AppInstaller spawning useless instances by preserving the original instance of every instantiated installer type (fixes wrongly started or concurrent installs/uninstalls)
  • Prevent multiple calls for install by using ThreadPoolExecutor (applied only to ServiceInstaller.kt)
  • Fix timer issues in the UpdateService.kt
  • Handle currently installing apps better by saving them in multi-thread proof list in UpdateService.kt
  • Fix Uninstall menu option not showing/hiding on install/uninstall in AppDetailsActivity.kt

Here I am attaching two short videos, which should demonstrate how the new background download/install/update service works: AuroraStoreInstall AuroraStoreUpdate

I would be really happy if you accept my merge request and even happier if you mention me in a contributors list - Konstantin Touev!
Made with a ️ in Bulgaria!

Merge request reports

Loading