ImranR98 / Obtainium

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

Alpha 0.6.2-8 Feedback #60

Closed S7venLights closed 2 years ago

S7venLights commented 2 years ago

Using alpha version shared in issue #14.

Obtanium downloaded all APKS flawlessly and applied their app icons, Nice!

In an attempt to mark all apps as installed I used the select all then βœ… icons. But that didn't work. Then I performed that install all function, two apps were out of date. They now reflect in Obtanium as being on the latest version but they aren't actually updated [I assume this is just a once off Error due to the switch to the alpha version]. To remedy, I tried swipe down refresh but I got an error pop-up saying something about Null... I restarted the app and did a refresh again with no error. But the apps still don't detect updates so I had to remove and redownload them since the 'Mark as uninstalled' option is gone. Once I did this they updated properly πŸ‘

S7venLights commented 2 years ago

During the initial install all switch to 0.6.2 two apps gave an error to the effect of, unable to update as a newer version is not available (I can't remember the exact wording ). They now show as update available but if I try install them obtainiam says 'cant install older version'. These are the two apps: https://github.com/AndBible/and-bible (I had beta installed and pre-release update was off)

https://github.com/darshan-/Battery-Indicator-Pro (Github release is behind F-droid version)

Marking apps as up to date resolved this issue.

S7venLights commented 2 years ago

Will test update checking in the week.

ImranR98 commented 2 years ago

Thanks for the feedback!

Some points to note:

If there are any more unexpected errors, please take a screenshot or copy/paste.

S7venLights commented 2 years ago

I think you misunderstood my feedback a bit but no worries the issues I shared were not bugs so much as side effects of switching to the new detect method.

EG: I didn't add F-droid as a source in Obtanium. I did have https://github.com/darshan-/Battery-Indicator-Pro as a source in my Obtanium app list. But battery indicator was actually installed originally from Droidify F-droid.

Fdroid has v12 of battery indicator hosted while github releases only has v10. So that's why Obtanium couldn't update it. I guess it's kinda a bug that Obtanium shows it as update available in that case. In the case that github releases are older than the installed version, perhaps obtaniam should show them as up to date by default??

ImranR98 commented 2 years ago

Can't do that as we don't know what the real version of an App is until the APK is downloaded. The version displayed in the App is a version string from GitHub, which may be different. So we can't compare the two until install time.

S7venLights commented 2 years ago

Okay, it's no big issue at least

ImranR98 commented 2 years ago

Not sure if anyone else has encountered this, sometimes Apps say update available even though there isn't, because the version string gets overwritten. Only happens in the background process (of course). Not sure why yet, and it doesn't happen consistently. will have to look into it.

ImranR98 commented 2 years ago

Small improvements, still haven't fixed the issue above (or know what causes it) but it should happen with fewer Apps: app-release-0.6.3-beta.zip

S7venLights commented 2 years ago

Testing update notifications without launching the app:

Monday I was on wifi all day and got no notifications. I know there was one update available half way through the day.

Yesterday (Tuesday) I had Wifi on most of the day. At some point I saw a notification 'checking for updates' but around the same time I lost signal. When I got signal again the notification quickly changed to 'error checking for updates, failed to lookup api.github.com' But it seems only because the vpn was still connecting. This seems to happen every time, then the update only checks again three hours later. Obtanium fails too quickly when trying to re-check updates when Wi-fi comes on. Perhaps some form of delay, connectivity check or a certain amount of retry attempts could be implemented. Come to think of it… I have actually excluded Obtanium from the VPN, so it's not tunnelled but perhaps androids block connection without VPN feature still blocks Obtanium while the VPN connects. I'm using InviZiblePro connecting to Tor if that helps.

This morning I turned on the phone and got a 'Checking for updates' notification but shortly after putting on Wi-fi and just after the VPN was connecting and did in fact connect: 'Error checking for updates connection refused'

This is related to Issue #47

S7venLights commented 2 years ago

I'll install 0.6.3 and keep testing

S7venLights commented 2 years ago

On 0.6.3 Yesterday I had wifi on all day with no notification. Last night I turned off Wi-fi but left the phone on. When I turned on the Wifi now I got a: 'Error checking for updates - connection refused' again. Same issue as before, VPN was still connecting.

S7venLights commented 2 years ago

I just got a checking for updates πŸ”” Then it went away. I know there are 2 updates available

S7venLights commented 2 years ago

Just got a πŸ”” 'Error checking for updates - Connection refused' But this time while having a working connection to internet and VPN

ImranR98 commented 2 years ago

Yep, I've also had this twice now with perfectly working connection. It also seems to cause that issue I mentioned earlier. Can't seem to reproduce the issue in the dev emulator though, very frustrating.

ImranR98 commented 2 years ago

Sometimes it's 'hostname not found', sometimes something like 'software connection abort', and apparently it can be 'connection refused' too. Seemingly always in the background update checking.

S7venLights commented 2 years ago

Hmm… what can I test for you? I have only tested background updates without launching the app so far, should I test launching and refreshing?

ImranR98 commented 2 years ago

Not sure tbh. There's no reason to get a connection error when there is an active internet connection, so I'm not sure what the problem is (maybe related to #55). I guess we could just quietly handle these errors by waiting 15 minutes and trying again (like it already handles rate limit errors), but there are 3 different error objects to track down so that will be tricky.

In the meantime, there's a new release which hopefully fixes that version string issue I ran into earlier: app-release-0.6.4.zip If I don't get the version string error, I'll release this version because the connection error seems not to be related to the recent changes from 0.6.0, so can be dealt with separately (issue #47) later.

S7venLights commented 2 years ago

The thing is the current release (non alpha) was notifying successfully in the background. So maybe it's worth testing 0.6 a bit longer

S7venLights commented 2 years ago

I opened Obtanium now and had a number of updates to do. I clicked update all. The apps downloaded successfully but after 3 installs the rest failed to continue. In order to update the rest, I then had to backup(export obtanium) and remove all apps restart obtanium and import apps. This may have been a once of thing though due to one app or since I changed the default apk launcher to 'always package installer' in the middle of the updates.

PS: a reboot is required between exports and imports or the app fails to update, you may want to automate this or give a warning.

PPS I changed the update interval to 2hours for future testing.

I know the current issues may be frustrating but don't stress, the app is doing great so far.

ImranR98 commented 2 years ago

Interesting, my notifications and import/export seem to work fine. But I don't have that many Apps, will continue to test.

ImranR98 commented 2 years ago

Could you give more details about the error you mentioned above? What error did you get when the installs failed, and why wouldn't it let you update without re-importing? Also was this on the latest 0.6.4

ImranR98 commented 2 years ago

Slight changes: app-release-0.6.5.zip

Might help with some issues

S7venLights commented 2 years ago

Was on 0.6.3, the update fail was a silent error but as I said, I think it's isolated incident due to me changing android defaults during install, don't worry about that.

"Why wouldn't it let me update without re-importing" As a result of that android error Obtanium thought the apps were up to date but they weren't.

I'll update to 0.6.5 now.

ImranR98 commented 2 years ago

Meanwhile, I'm still having that weird issue with App versions being changed in the background. Only happens on my phone (not the emulator) and only sometimes. Still no clue what causes it but there are a couple small changes in this version that might help:
app-release-0.6.6.zip

Will see about adding logging to the next release so people who have issues can attach logs and hopefully make it easier to track down bugs.

S7venLights commented 2 years ago

So I've had no update notifications lately but opened the app now and without refreshing, I see it shows updates for some apps that Octodroid didn't notify me about so that's nice but it's also showing updates for some apps that were supposedly updated by obtanium already. Namely: https://github.com/tw-hx/Signal-Android https://github.com/organicmaps/organicmaps https://github.com/meganz/android

Also I keep marking https://github.com/darshan-/Battery-Indicator-Pro As updated but it keeps resetting to update available (Since the github version is older than the F-droid).

I updated all apps, and got an error in app that I could only read by repeating the process a few times: platform exception invalid package parse error, Storage/emulated/0… LibreCamera APK null

I restarted Obtanium, redownloaded updates, and got the same error I then excluded https://github.com/iakmds/librecamera from update selection

And updates worked but only 3/6 or so apps actually installed which to me confirms that some of the apps showing updates were actually already updated.

Not sure why librecamera won't work.

S7venLights commented 2 years ago

Perhaps my Obtanium is also changing app versions in the background and falsely detecting some updates

ImranR98 commented 2 years ago

So I've had no update notifications lately but opened the app now and without refreshing, I see it shows updates for some apps that Octodroid didn't notify me about so that's nice but it's also showing updates for some apps that were supposedly updated by obtanium already. Namely: https://github.com/tw-hx/Signal-Android https://github.com/organicmaps/organicmaps https://github.com/meganz/android ... And updates worked but only 3/6 or so apps actually installed which to me confirms that some of the apps showing updates were actually already updated.

Yes, that's the same issue I'm having. Was able to narrow down what happens - the installedVersion is being reset to null - still looking into why. This is also the reason for many update notifications being missed.

It's most likely happening because I'm using a Flutter plugin to detect installed Apps, and it's possible that plugin works well in the foreground process but not in the background. Worst case I'll just disable that detection for background processes - it should not make a difference for most users. The one downside is that users who uninstall an App between beckground update checks (without opening Obtainium in the foreground at any point) will still be notified of updates for that App even though it is not installed.

Also I keep marking https://github.com/darshan-/Battery-Indicator-Pro As updated but it keeps resetting to update available (Since the github version is older than the F-droid).

Better not to add an App to Obtainium if a different App (F-Droid) is already used to manage it.

ImranR98 commented 2 years ago

Regarding Librecamera, I just downloaded the APK from GitHub (through the browser) and tried installing it on my phone, and got an "invalid package" error. So it looks like this is not an Obtainium issue.

S7venLights commented 2 years ago

Okay glad you found the what, hope you can spot the why

ImranR98 commented 2 years ago

Wasn't able to figure out the why (my theory is the plugin takes time to initialize asynchronously and that causes problems), but I've worked around the problem. This new version should not have it: app-release-0.6.7.zip

If there are no unexpected problems, I'll fix a few more issues like #64 and #67 and release this.

S7venLights commented 2 years ago

Gotta love & hate a good workaround πŸ˜…

ImranR98 commented 2 years ago

Lol, I'm half expecting it to still fail though πŸ€¦β€β™‚οΈ

I've only halfway implemented the originally intended workaround because that avoids the problem mentioned earlier:

... users who uninstall an App between beckground update checks (without opening Obtainium in the foreground at any point) will still be notified of updates for that App even though it is not installed.

Might still have to finish the job and live with that compromise.

ImranR98 commented 2 years ago

Yep, the problem is still there, I just had to wait a bit longer to see it (been using this version since last night). If you haven't downloaded it don't bother.

S7venLights commented 2 years ago

I have… I'm still testing background update checks so not launching the app

S7venLights commented 2 years ago

See I got a weird Error πŸ””. 26min ago: Error checking for Updates Connection Reset by Peer (Mega)

ImranR98 commented 2 years ago

See I got a weird Error bell. 26min ago: Error checking for Updates Connection Reset by Peer (Mega)

That means the App Source (GitHub I guess) decided to close the connection. It may be a one-off thing. Does it happen every time for that App?

S7venLights commented 2 years ago

No, never seen it before

ImranR98 commented 2 years ago

Ok I promise* it should be fixed with this one: app-release-0.6.8.zip

*Maybe

S7venLights commented 2 years ago

Haha I'll install now, what did you find/do? By the way just got a failed host lookup api.github πŸ”” 5min ago

ImranR98 commented 2 years ago

When Apps load, Obtainium checks to see if they are installed on the phone. If they are, it corrects any discrepancies between the real install status of each App and its internally stored install status. For some reason, this would sometimes fail in the background, causing all Apps to be marked as "not installed". I just disabled that detection and correction for background processes.

As for the failed host lookup errors, yeah I get those too sometimes even with a good connection. No idea what the cause is since it seems random. May have to work around those too eventually but since they are not that frequent, I'll release the changes made so far this weekend.

ImranR98 commented 2 years ago

Okay, I think this is ready for release: app-release-0.6.0-42.zip Aside from the switch to package IDs as App IDs, and the addition of icons, it also has a few other bugfixes like #64, #66, #67.

For some reason Obtainium was using the master branch of Flutter which is unstable (don't remember ever switching to it). so I've switched to the stable branch which should hopefully help with some of the more random glitches. I already noticed some weird UI issues I had are no longer there. It does mean some material UI elements like switches will have the old design again for now, but that will be fixed when those changes come to the stable branch eventually.

Also reset the versioning to 0.6.0 as the builds we've been testing (0.6.2-0.6.8) were not actually released. If there are no problems, will release tomorrow and hopefully close a bunch of issues.

S7venLights commented 2 years ago

Will you release even though background updates worked on 0.5 but haven't once worked for me on 0.6 versions?

ImranR98 commented 2 years ago

Huh. I thought they worked for you aside from the occasional hostname error. They seem to work for me but definitely can't release if you're not able to update at all. Could you try this new one and let me know.

S7venLights commented 2 years ago

I can only update when opening the app all background notifications on these alpha versions have been errors. It may have found the updates for most aops but only ever reported errors.

I will test this new version though and its up to you if you release, the app still sees and does the updates when I open it, so it still does it's job

ImranR98 commented 2 years ago

Hmm, definitely can't release if there's come bug that breaks background checking completely. Maybe it's a specific app you have added because things are fine for me. Anyways try this one and see.

ImranR98 commented 2 years ago

app-release-0.6.0-43.zip Background internet connectivity issues should no longer give errors. Instead it waits 15 minutes then retries.

@S7venLights if you use GrapheneOS, you should be able to use the native files app to simulate a new update rather than waiting days or weeks for someone to come out with an actual App update.

For example, the latest version of Aegis is v2.0.3 but if you modify /Android/data/dev.imranr.obtainium/files/app_data/com.beemdevelopment.aegis.json and change both installedVersion and latestVersion to v2.0.2, the next background update check should notify you that there is a new version (v2.0.3) available - as long as you don't do a manual update check yourself of course.

Please test things out using this method with the latest APK whenever you have time and let me know how it goes. Hopefully things are working, I reeeally hope this is releasable 🫠 .

S7venLights commented 2 years ago

Great, I'll try that out, maybe I can open JSON files with this: https://github.com/laiiihz/alga/

Was thinking, you probably should add basic logs sometime as you mentioned before and an easy way to submit them. Maybe an email address in the app or link to Github. Cos there are bound to be difficulties getting some apps to update when you're pulling from so many sources. The email could autoreply with FAQs and ask people to let you know if they solved the issue.

ImranR98 commented 2 years ago

Sorry, uploaded the wrong version, so marked the comment as outdated. Will upload in 5 mins.

ImranR98 commented 2 years ago

Great, I'll try that out, maybe I can open JSON files with this: https://github.com/laiiihz/alga/

I use Markor but whatever works,

ImranR98 commented 2 years ago

app-release0.6.0-44.zip

Also yes, will work on logs.