Obtainium
Obtainium copied to clipboard
Figure Out Silent/Background Updates
This app is nearly exactly what I was just looking for, except I need unattended/background updates. I'm not an Android dev, what exactly would be required for you to be able to add this feature? I'm almost tempted to hire an Android dev that could build a Flutter plugin that would work for this project, because that would make this the perfect app updater 🤔
At a glance though, it seems like replacing install_plugin_v2 with flutter_install_app would provide the functionality you're looking for, is there a reason this plugin couldn't be used?
- Without user action (Android 12 or higher):
If set, user action will not be required when all of the following conditions are met:
- The app being installed targets API 30 or higher and is running on Android 12 or higher:
- The app is the installer of record of an existing version of the app (in other words, this install session is an app update) or the installer is updating itself.
- The installer declares the UPDATE_PACKAGES_WITHOUT_USER_ACTION permission.
AppInstaller.installApk('/sdcard/apk/app-debug.apk', actionRequired: false);
https://pub.dev/packages/flutter_install_app
Originally posted by @jonaharagon in https://github.com/ImranR98/Obtainium/issues/12#issuecomment-1255538404
This, Shizuku, is one thing Droidify uses. But I see in my Droidify settings that it isn't using this, rather session installer and still the updates are unattended. So not sure how he does it.
https://github.com/RikkaApps/Shizuku
The new plugin does work, and updates done while the app is in the foreground will not have a prompt starting from the next version. Unfortunately, trying to update from a background process is causing an error I haven't been able to figure out. I've made a new issue for that on the plugin repo (https://github.com/felipheallef/flutter-app-installer/issues/1), but this is parked until they respond.
Just leaving a note that this new plugin uses a permission that is not allowed for Play Store apps, which I guess is part of why Droidify, Neo-Store, etc. are not there. Took down the Play Store listing as it's not as important as having silent updates.
Nice, this is exciting
Just leaving a note that this new plugin uses a permission that is not allowed for Play Store apps, which I guess is part of why Droidify, Neo-Store, etc. are not there. Took down the Play Store listing as it's not as important as having silent updates.
Out of curiosity, what's that permission?
The one mentioned in this thread 👆
UPDATE_PACKAGES_WITHOUT_USER_ACTION
Apps like Neostore/Droidi-fy/GrapheneOS App Store, support unattended updates really well, if you want to have a look at their implementation.
Do those have the same limitations as the flutter plugin method above?
GraoheneOS probably achieves this by being a system app. The other two have been mentioned in this thread 👍
Those Apps are not Flutter-based as far as I know, so they probably just use the relevant Android API (the old one is PackageInstaller, idk about the new one). I used Flutter because learning Android would've been too big a time commitment, but I guess that comes with consequences 🥲
Either way, the plugin used right now does work, just not in background processes for some reason. Might be a Flutter limitation and not an issue with the plugin itself.
Ideas for implementation: Unattended background updates would be great and I'm anticipating users are probably going to be interested in 3 things I can think of:
-
Knowing what's been updated in the background. Requiring a menu/tab with a log of updates that can be cleared manually or after a specified period. Or a notification every time an apps are updated.
-
Knowing what changes were made to apps. Requiring a method to quickly view change logs/release notes See #42
and
- People may want the option to only do manual updates to certain apps. Requiring a toggle in per app settings and a universal toggle for all apps.
I'm not 100% certain, but I think this issue will be fixed once the changes from https://github.com/flutter/flutter/issues/13937 reach Flutter stable.
@S7venLights regarding your suggestions:
- There is already code to notify users about which apps were updated in the background. I'll just uncomment/enable it when (if?) this issue is fixed.
- For the manual update for specific Apps option, you can make a separate issue for that when this one is resolved.
The new plugin mentioned above has a dealbreaker - see #46. Switching back to the old one; this issue is blocked for now..
It actually did work for me. With the latest version I got the prompts back but before the update worked just fine as well.
It worked with 1 or even 2 apps sometimes, but would choke with larger numbers at least for me. May need to eventually look into learning enough to write my own Flutter plugin for this, or waiting for someone else to :(
I may be mistaken, but I think Protonmail just installed silently. I opened protonmail in Obtanium, clicked download but the android update dialogue never showed. But it has updated 🤔
You probably already had the new update installed, so obtainium just skipped installation and incremented the version number. The installer plugin hasn't been updated in over a year so I don't see how it could do that.
Hey I have a question. Im not sure if it falls under the same category but some apps require a user choice (such as package architecture differences). Would it be possible to have Obtanium remember the selection and therefore not ask the user?
I've Also wondered about this but I don't imagine there's a standardized way across all of Github to tell which architecture the apk is just from the file name hosted on Github. Obtainium would have to download all the APKs to read the architecture and that would be inefficient.
This may actually be a barrier to silent background updates if the plugin is ever updated.
What I meant was once the user had chosen a package, it will always opt for that same one.
Packages are not guaranteed to be the same between apps or even between releases, so any method to save these choices would be unreliable. Also the APK selection is not an architecture selection (APKs are often divided by arch, but no always - some apps have different APKs for the play store VS f-droid for nonfree dependencies, etc.).
Yes Im aware that theres more than one reason for multiple versions. That was just an example.
Perhaps if there was a way for the user to set a regular expression per app for which APK to select. That way it's in our hands to control and adjust it when things change.
So Obtainium automatically selects the APK that contains ARM in the title or Free, etc. If it fails to find that expression, then it simply notifies the user to select as usual. If it works, it would save time and clicks.
But up to you, I don't feel like this is a pressing issue.
DarQ is a flutter app that uses Shizuku.
AppManager installs apps in the background via local ADB (unfortunately not Shizuku and doesn't auto detect port); the prompt includes version number/name of the old and new version, as well as a list of added/removed activities and checks for trackers. The app provides a large amount of other functionality as well, though I personally only use it for background installs.
Edit: AppManager also has some method to initiate installs via intent using a secret token rather than opening the apk with it. This would be nice as an option as well.
Appmanager is a great project, im[]agine it also had obtainium features
Newer versions of Android allow you to silently update apps that you installed, using a normal supported API. Using something like Shizuku or ADB seems like overkill for something like this (and more difficult than the normal API method).
There's a new APK installer plugin available (44 days old): https://github.com/playbott/android_package_installer Seems to be broken right now though, will keep an eye on it.
Is it possible to add silent installations with root permissions, like fdroid? Maybe a toggle in the settings to choose silent installation method (when other methods are available). I think having Root and Shizuku as options would be nice.
Love the app, by the way. Thank you.
I think firstly his focus in this app is security and root would undermine that, however, as an optional feature maybe it isn't a concern. Also read two messages up.
But also, this app is built with flutter plugins and implementation would depend on if those plugins exist.
I have read the overkill part. I was only offering my perspective as another user of this app. To me, convenience takes priority. But I also recognize that not everyone would think the same. Thus I suggested a toggle.
I'm not an app developer myself, so I apologize if I happened to have asked for too much.