elastic-rock / KeepScreenOn

An Android screen timeout quick settings tile
GNU General Public License v3.0
131 stars 4 forks source link

F-Droid reproducible build failed #26

Closed linsui closed 2 weeks ago

linsui commented 5 months ago

https://gitlab.com/fdroid/fdroiddata/-/issues/3267 We don't know how to fix it currently. It seems it's caused by toolchain update and the reproducible-apk-tools doesn't work with that yet. Could you please take a look? Thanks!

elastic-rock commented 5 months ago

Thank you for opening this issue. Unfortunately, my knowledge in this is rather limited so I am affraid I won't be able to help much.

licaon-kter commented 5 months ago

Trying all sorts of commands combos

but...

Where are these files from anyway? What are they?

fixing 'META-INF/services/P1.w'...
fixing 'META-INF/services/Q1.a'...
linsui commented 5 months ago

They are java spi minigied by r8.

linsui commented 5 months ago

I find an ugly fix. https://gitlab.com/fdroid/fdroiddata/-/merge_requests/15103

elastic-rock commented 5 months ago

Thank you very much. Once there is a known cause for the issue, let me know.

elastic-rock commented 5 months ago

One thing I notice is that I get this gradle warning:

SDK processing. This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times.

linsui commented 5 months ago

It turns out that the new AGP causes this problem. https://github.com/obfusk/reproducible-apk-tools/issues/19

licaon-kter commented 3 months ago

please reopen

ref: https://monitor.f-droid.org/builds/log/com.elasticrock.keepscreenon/29#site-footer

diff log: elas29.log

/LE: fyi https://gitlab.com/fdroid/fdroiddata/-/commit/1e20c4b2419d285e7ffc44fa22d0576e8ff92b7c

linsui commented 2 months ago

1.19.0 also failed. com.elasticrock.keepscreenon_v1.19.0.apk.html.zip

Maybe it's caused by cache. Could you please clean the cache and rebuild the apk?

licaon-kter commented 2 months ago

@elastic-rock fun thought, can you build 1.19 with false here https://github.com/elastic-rock/KeepScreenOn/blob/v1.19.0/app/build.gradle.kts#L29 and attach the APK for us to test?

elastic-rock commented 2 months ago

@elastic-rock fun thought, can you build 1.19 with false here https://github.com/elastic-rock/KeepScreenOn/blob/v1.19.0/app/build.gradle.kts#L29 and attach the APK for us to test?

Here it is. Thanks! (note that I also had to set isShrinkResources to false) keepscreenon_v1.19.0_minifyfalse.zip

licaon-kter commented 2 months ago

@elastic-rock indeed, as with other recent apps, minify introduces non-determinism :disappointed:

the attached APK is repro, then again, it's 10 times bigger too

linsui commented 2 months ago

The res/Hz file is not reproducible. I guess it's generated by com.google.android.gms:oss-licenses-plugin.

elastic-rock commented 2 months ago

Do you have any proposals as to what could be done with this whole situation? 🙂

I disabled minify but this was only meant as a temporary solution since an APK size of 10 MB and install size of 131 MB is just not feasible in the long term. Well and now I hindered my hopes for a finaly successful build with the oss-licenses-plugin. 🙃 I suppose I have to figure out a diferent solution for the licenses and regarding minify , are there any fixes coming?

Thanks!

linsui commented 1 month ago

No idea about minify. For oss-licenses-plugin I thought we'd better just replace it with other license libs.

elastic-rock commented 2 weeks ago

I switched the oss-licenses-plugin for com.mikepenz.aboutlibraries. If the issue with minify still persists, let me know and I can try and build the app outside Android Studio using gradle directly.

licaon-kter commented 2 weeks ago

@elastic-rock do add https://github.com/mikepenz/AboutLibraries/issues/784#issuecomment-1205501876 else the files have compile dates in them

elastic-rock commented 2 weeks ago

Done. Thanks! :slightly_smiling_face:

licaon-kter commented 2 weeks ago

Ref: https://gitlab.com/fdroid/fdroiddata/-/jobs/8243447401#L571

hmm looks like you have the DependencyInfoBlock thing :disappointed:

Can you add this fix: https://gitlab.com/fdroid/fdroidserver/-/issues/1056#note_1218193185 ?

android {
    dependenciesInfo {
        // Disables dependency metadata when building APKs.
        includeInApk = false
        // Disables dependency metadata when building Android App Bundles.
        includeInBundle = false
    }
}

we'll need a new version, tag, release

elastic-rock commented 2 weeks ago

Fix added in 1.20.3

licaon-kter commented 2 weeks ago

:tada: /close this

elastic-rock commented 2 weeks ago

Amazing! Thanks for the help, you have my respect! 😃