phstudio2 / FreeTV

Free TV app
https://phstudio2.github.io/FreeTV/
GNU General Public License v3.0
76 stars 3 forks source link

Reproducible Builds #8

Closed IzzySoft closed 3 months ago

IzzySoft commented 3 months ago

I've checked your app if its build is reproducible (see: Reproducible bulds, special client support and more in our repo), but while I was able to successfully generate the APK using ./gradlew assembleRelease, the differences to the one provided at your latest release were huge. Was that APK really built from the commit the tag points to? If so, did I miss some build options? And if not, which commit was it?

Here's the top of the APK diff:

-------------------------------
--- /dev/fd/63  2024-07-20 12:30:05.008400621 +0200
+++ /dev/fd/62  2024-07-20 12:30:05.008400621 +0200
@@ -123,17 +123,17 @@
   res/-O.xml
   32-bit CRC value (hex):                         2a38b126
   res/-Y.xml
-  32-bit CRC value (hex):                         6437f9f9
+  32-bit CRC value (hex):                         79855789
   res/-c.xml
-  32-bit CRC value (hex):                         74382989
+  32-bit CRC value (hex):                         49d3b633
   res/-e.xml
-  32-bit CRC value (hex):                         0db85acd
+  32-bit CRC value (hex):                         00ea4626
   res/-h.png
   32-bit CRC value (hex):                         9b9d21a4
   res/-o.xml
-  32-bit CRC value (hex):                         218343ea
+  32-bit CRC value (hex):                         4d4091b8
   res/-u.xml
-  32-bit CRC value (hex):                         f7d609ab
+  32-bit CRC value (hex):                         63514a57
   res/06.png
   32-bit CRC value (hex):                         13296992
   res/09.9.png
@@ -145,7 +145,7 @@
   res/0L.xml
   32-bit CRC value (hex):                         1df0a98c
   res/0N.xml
-  32-bit CRC value (hex):                         a1c288e9
+  32-bit CRC value (hex):                         4cf9291e
   res/0b.png
   32-bit CRC value (hex):                         e0bc8169
   res/0b.xml
@@ -153,13 +153,13 @@
   res/0l.xml
   32-bit CRC value (hex):                         0f982bf2
   res/0q.xml
-  32-bit CRC value (hex):                         bd40c9f2
+  32-bit CRC value (hex):                         53695698
   res/0v.png
   32-bit CRC value (hex):                         9c7bef51
   res/0w.xml
   32-bit CRC value (hex):                         bc5329cc
   res/0w1.xml
-  32-bit CRC value (hex):                         912ea92f
+  32-bit CRC value (hex):                         e230f36a
...

Goes on for much longer. And it seems only XML of resources are affected. Maybe you have an idea why?

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!

obfusk commented 3 months ago

Looks like AXML line number differences. I still don't know what causes this but AFAIK upgrading Android Gradle Plugin (from the currently used 7.2.2, which is from 2022) should fix it.

```diff $ diff2f 'repro-apk binres dump res/*.xml --apk' bc261760c3c37a7ceba8ff327e153f0e65b2048e51aba7d85cc8766b5d3e6e0b-com.phstudio.freetv-1.4-upstream.apk 8d9e6ddf66a2a829ce98198d6c4f0566ff56ebaf558d7e0ec6a12482ea4508e1-com.phstudio.freetv-1.4-unsigned.apk [...] @@ -4,13 +4,13 @@ XML RESOURCE MAP [#resources=6] XML NS START [lineno=0, prefix='android', uri='http://schemas.android.com/apk/res/android'] XML NS START [lineno=0, prefix='aapt', uri='http://schemas.android.com/aapt'] - XML ELEM START [lineno=31, name='objectAnimator', #attributes=6] + XML ELEM START [lineno=25, name='objectAnimator', #attributes=6] ATTR: http://schemas.android.com/apk/res/android:interpolator=@0x010c0006 ATTR: http://schemas.android.com/apk/res/android:duration=@0x7f090040 ATTR: http://schemas.android.com/apk/res/android:valueFrom=@0x7f0f00ef ATTR: http://schemas.android.com/apk/res/android:valueTo=@0x7f0f00f0 ATTR: http://schemas.android.com/apk/res/android:valueType=2 ATTR: http://schemas.android.com/apk/res/android:propertyName='pathData' - XML ELEM END [lineno=31, name='objectAnimator'] + XML ELEM END [lineno=25, name='objectAnimator'] XML NS END [lineno=0, prefix='aapt', uri='http://schemas.android.com/aapt'] XML NS END [lineno=0, prefix='android', uri='http://schemas.android.com/apk/res/android'] [...] ```
pa238 commented 3 months ago

@IzzySoft The latest version used the newer Android Gradle Plugin with version 8.5.1. Try compiling it with the new version and hopefully everything will be fine.

IzzySoft commented 3 months ago

:partying_face: RB now indeed, thanks! So the green shield should show up here with the next sync around 6 pm UTC, when the update has been pulled to the repo as well.

Thanks a lot, and congrats! And here's your welcome toot :smiley: