ImranR98 / Obtainium

Get Android app updates straight from the source.
https://obtainium.imranr.dev
GNU General Public License v3.0
5.93k stars 140 forks source link

Resend pending update notifications after reboot for better reliability and security #1482

Open pxlkng opened 3 months ago

pxlkng commented 3 months ago

Currently "update available" notifications only get sent once.

Consider the following scenario:

I consider this an issue especially in time-sensitive scenarios where an update may fix a security vulnerability in an app; the notifications should be reliable. This already happened to me multiple times.

My suggestion is to resend still pending update notifications after the phone was rebooted and Obtainium starts up again. (By just sending out a notification for every pending app update, ignoring if they have already been sent, when Obtainium starts for the first time, once)

This would make sure that the user keeps being reliably notified about available updates.

ImranR98 commented 3 months ago

I don't think this is realistic. We would have to maintain a list of currently-posted notifications, and keep it in sync at all times - this would likely require running Obtainium in the background constantly (instead of a few seconds every 15 minutes as we do now).

As far as I know, restoring notifications on reboot isn't something most apps do - it would make more sense for Android to build this in rather than for each app to implement it.

pxlkng commented 3 months ago

@ImranR98 I think there was a misunderstanding.

I don't see why you would have to do such a complex thing for this.

Obtainium does already check for updates right on first startup. But Obtanium will never notify about the same app update twice. Only once. It remembers updates that have already been found and will not notify about those again.

I'm only requesting that on Obtainium's first run you ignore that and notify about every update, just as if they would have been found for the first time. (Basically forgetting which updates had been found pre-reboot, no new list or anything)

The only thing you would have to implement for that, for example, is to have the update-notification dispatch logic on Obtainium's first run ignore the list of updates that already have been found and send out a new update notification for every one regardless. That should be a simple non-invasive addition. Nothing more. Everything else stays untouched. No restoring notifications from a list or keeping in sync or having Obtainium run constantly. Thats not what I was going for.

Please reconsider this as it would be a huge reliability and security improvement. Otherwise please help me understand why this feature is too difficult or unrealistic to implement in your opinion.

Thank you for making Obtainium.

ImranR98 commented 3 months ago

I see what you mean now. Your approach is definitely a lot more doable than what I was thinking, but the downside is that we're not really restoring only the notifications that the user missed - we're re-sending all notifications for all apps that have an update available, regardless of whether or not the user has already seen and dismissed those notifications before.

I guess it could be an optional setting - leave it up to the user.

ImranR98 commented 3 months ago

The background task would also need a way to tell whether or not it is the first one after a reboot, which is probably possible but I haven't checked.

pxlkng commented 3 months ago

I see what you mean now. Your approach is definitely a lot more doable than what I was thinking, but the downside is that we're not really restoring only the notifications that the user missed - we're re-sending all notifications for all apps that have an update available, regardless of whether or not the user has already seen and dismissed those notifications before.

I guess it could be an optional setting - leave it up to the user.

That's true, though I think the cases in which a user is purposefully dismissing an update (without just procrastinating or ignoring it for the moment) are probably relatively rare, so even in those cases reminding them about the update probably isn't a bad thing and keeps them from forgetting that they skipped one.

And I agree, a setting for this is a great idea, always keep the user in charge. I feel like it would be a good default to have it enabled though.

DwainZwerg commented 3 months ago

we're re-sending all notifications for all apps that have an update available, regardless of whether or not the user has already seen and dismissed those notifications before.

That's what the "Skip update notifications" toggle is for. Of course, you could also add the toggle "Skip update notification for this release", but I don't think this is really necessary.