solrudev / Ackpine

Android package installer library
https://solrudev.github.io/Ackpine/
Apache License 2.0
53 stars 7 forks source link

Background APK updating #52

Closed apkinvestigation closed 5 months ago

apkinvestigation commented 6 months ago

Could this library be used to update apks in the background without any user interactions?

It looks like it should now be possible using the features: https://developer.android.com/about/versions/12/features#automatic-app-updates

Also can this be used to update ones own app silently using those same features?

I've been tinkering around with your SimpleInstaller where that functionality doesn't seem to be supported because of its use of notifications to then have the activity trigger a session.commit, but I'm hoping it might be possible in this library, though I'm unclear how I'd trigger that behavior.

Thanks for writing libraries trying to reduce the complexity/edge cases around the packageinstaller, there seems to be many pitfalls with it (especially around different os versions).

solrudev commented 6 months ago

@apkinvestigation Yes, it's certainly possible. This option is mentioned in docs: https://solrudev.github.io/Ackpine/configuration/#users-confirmation

Library's user is responsible for moving to and reliably maintaining the work in background/foreground service.

Activity starts from background are restricted, so I'll rewrite handling of IMMEDIATE confirmation for Android's PackageInstaller sessions to directly call Session.commit().

apkinvestigation commented 6 months ago

Could you have also used a notification to get around the limitation on starting activity's from the background?

https://developer.android.com/guide/components/activities/background-starts

solrudev commented 6 months ago

@apkinvestigation What do you mean exactly? Heads-up notification is displayed when using DEFERRED confirmation, which is the default. It is explained on the docs page linked above.

solrudev commented 5 months ago

@apkinvestigation Do you have any questions left?

solrudev commented 5 months ago

Closing due to inactivity.