Describe the bug
Update from 5.1.0 to 5.2.0 fails in the install phase
To Reproduce
Additionally, this can be replicated when downloading the APK attached to the v5.2.0 release on GitHub and installing that.
Expected behavior
Adaway v5.2.0 to install
Screenshots


Device
Additional context
_N/a_
Hi @TheLonelyGhost
Happy new year 馃帀
Thanks for the report. The app should not see the update if it was installed from F-Droid.
I will investigate if the error comes from the app or the backend.
Regards
The backend seems fine. So it looks like it comes from the app.
I have some trouble to spy request using mitm to check what request is done to the backend and I did not set log in this part of the app. I will try to setup frida on an emulator and some scripts to dump okhttp requests...
I keep spending hours on this issue and I can't spy what happens in the F-Droid build...
I successfully setup a frida environment but I failed to trace the part I need. It seems it happens before the script being injected.
I guess I will need 5 to 10h more on the subject that I won't have anytime soon. In the meantime, bug reports and XDA posts about the issue keeps coming 馃槶
I finally found the issue... I am mad at me to have to use so much complicated tools to find a so silly error...
The application reads its apk signature, compute the sha256 sum and match it to its record to check if it is me who built the app, f-droid or an unknown builder (which happens to anyone who fork the app or use a builtin version in some ROM).
But when I compute the sha256 sum, I convert the hash byte array to a string representation:
https://github.com/AdAway/AdAway/blob/9bdff23f320f1930e635262391e63b668ce5c88b/app/src/main/java/org/adaway/model/update/UpdateStore.java#L97-L108
You might have guess the issue here. The string representation uses uppercase A-F letters where the sign hash declare in the code uses lower case letters a-f... And the string comparison does not ignore the case so the application does not detect the F-Droid store and tries to server a GitHub release to all users.
https://github.com/AdAway/AdAway/blob/9bdff23f320f1930e635262391e63b668ce5c88b/app/src/main/java/org/adaway/model/update/UpdateStore.java#L86
I will release a 5.2.1 version soon鈩笍 to fix this issue.
So I see that 5.2.1 has a GitHub tag / release, and that shows up in the app, but the installation of this version still fails from the F-Droid version (5.1.0). So I guess you still need to release 5.2.1 on F-Droid to fix this?
I just uninstalled from F-Droid and reinstalled based on the package uploaded to the GitHub release, given there's a built-in update checker and installer. It's not the same third-party verification of source code == application, but it gets updates a bit faster and I trust the maintainer enough to go with their release channel.
Looking forward to the F-Droid release though. 馃槃
Thanks so much @PerfectSlayer !
@Mathnerd314 Yes. Sadly the 5.1will stay bogus. You will need to install 5.2.1 from F-Droid (or let the F-Droid store update it for you) to stop getting this error.
The F-Droid build configuration was fixed today. So I hope it should not be long before the 5.2.1 version appears on F-Droid store. (the 5.2.0 version will never be on the F-Droid store though... I don't know why they remove it from the build list)
@PerfectSlayer I don't know if you noticed (or get notifications) but it seems that 5.2.1 failed to build on fdroid https://f-droid.org/wiki/page/org.adaway/lastbuild_50201
That also seems to be the reason why 5.2.0 is not on fdroid https://f-droid.org/wiki/page/org.adaway/lastbuild_50200
Thanks @derN3rd !
No, I don't get any notification from F-Droid... So thanks for the heads up!
But I am really tired of the build failure on the store. The F-Droid configuration is right: https://gitlab.com/fdroid/fdroiddata/-/blob/7d1544223edbea82fc7617f1320754e307763d68/metadata/org.adaway.yml#L559 and matches the tcpdump requirements: https://github.com/AdAway/AdAway/blob/v5.2.1/tcpdump/build.gradle#L12
So there is nothing I can do to fix it.
About the 5.2.0 version, it is not the main reason: it was removed by a maintainer: https://gitlab.com/fdroid/fdroiddata/-/commit/8668461c70470e2816154deb89cf3207eb05c7a7 Can't tell why 馃し
EDIT: I just realize the failed build log is anterior to the fix. So the F-Droid server should start another build with the ndk fix in order to finally build the release. And I don't know if and when it will happen.
it looks like there is a build running: https://monitor.f-droid.org/builds/running. But I don't see Adaway there yet. (it's building mozilla fennec which takes a few hours)
failed again, "CRITICAL: Android NDK version 'r22' could not be found!". https://monitor.f-droid.org/builds/log/org.adaway/50201
I guess they have to update the build farm images to include r22... :tired_face:
Thanks for keeping track of this!
The r22 of NDK is mark as stable so it should be available soon on their build server.
But yeah... it sucks to wait for the f-droid release when the GitHub ones is already available 馃槄
failed again, "CRITICAL: Android NDK version 'r22' could not be found!". https://monitor.f-droid.org/builds/log/org.adaway/50201
I guess they have to update the build farm images to include r22... 馃槴
The link now shows a successful build, but it's still not available on fdroid...
Copying a comment from https://gitlab.com/fdroid/fdroiddata/-/issues/2268:
As your link shows, it was build, but not yet published. Wait a bit more ;)
I love release engineering...
Finally! 馃帀
Please keep in mind you will need to install it manually as my broken 5.1.0 will keep downloading the GH release. (it was fixed in 5.2.1).
Just got the update notification from fdroid. Seems like it's all fixed now 馃憣馃徏
Most helpful comment
Thanks for keeping track of this!
The r22 of NDK is mark as stable so it should be available soon on their build server.
But yeah... it sucks to wait for the f-droid release when the GitHub ones is already available 馃槄