AlfaazPlus / QuranApp

An ad-free and privacy-focused app for exploring the Holy Qur’an.
https://quran.alfaazplus.com/
GNU General Public License v3.0
225 stars 26 forks source link

Reproducible Builds #474

Open IzzySoft opened 2 months ago

IzzySoft commented 2 months ago

Steps to reproduce

I've checked your app if its build is reproducible (see: Reproducible Builds, special client support and more in our repo), but while I was able to successfully generate the APK using ./gradlew assembleRelease, the resulting APK was not identical. Here's the head of the diff:

-------------------------------
--- /dev/fd/63  2024-07-12 08:37:36.576467486 +0200
+++ /dev/fd/62  2024-07-12 08:37:36.576467486 +0200
@@ -647,7 +647,7 @@
   res/5c.png
   32-bit CRC value (hex):                         04576501
   res/5g.png
-  32-bit CRC value (hex):                         8a43fb7d
+  32-bit CRC value (hex):                         9b44d110
   res/5h.webp
   32-bit CRC value (hex):                         b14414eb
   res/5k.png
@@ -993,7 +993,7 @@
   res/Ce1.xml
   32-bit CRC value (hex):                         a814eb19
   res/Cf.png
-  32-bit CRC value (hex):                         3fa64b07
+  32-bit CRC value (hex):                         8cc41d38
   res/Cg.xml
   32-bit CRC value (hex):                         34d74fa3
   res/Ck.png
@@ -1629,7 +1629,7 @@
   res/QQ.xml
   32-bit CRC value (hex):                         1aa98b4b
   res/QT.png
-  32-bit CRC value (hex):                         aa846f99
+  32-bit CRC value (hex):                         4d4f962a
...

It seems only PNG files are affected, which raises the question if you have PNGCrunching enabled? That's known to be non-deterministic and would cause such a behavior. A search for "crunch" on this repo however did not turn up anything (but I'm no Android dev; maybe it's on by default unless you disable it).

We'd appreciate if you could help making your build reproducible. We've prepared some hints on reproducible builds for that.

Looking forward to your reply!

Expected behavior

APKs are identical

Actual behavior

APKs are not identical

QuranApp version

2024.04.01.1

Android version

n/a

Other details

No response

Acknowledgements

IzzySoft commented 1 week ago

@faisalcodes not sure if you just missed ths, but as it's almost 2 months I hope you don't mind a ping? Any chance we can get this tackled?

faisalcodes commented 1 week ago

@IzzySoft

Sorry, totally missed it.

It seems PNG optimisation is enabled by default. I'll disable it. Or there are just 2 PNGs in the app, I'll convert to WEBP.

IzzySoft commented 1 week ago

Sorry, totally missed it.

Happens. Sometimes even notifications don't make it to the mail inbox even…

It seems PNG optimisation is enabled by default. I'll disable it.

That should do the trick. I don't know how WEBP would be handled, but that could also be a possibility. If you do that e.g. in a separate branch, commit, and build an APK from that commit: naming the commit hash and attaching the APK here (renamed to *.zip so Github allows you to attach it – you know, MS always tells things by the file extension and not the content), I can run it through the builder here and see if it's RB.