ShiftHackZ / Stable-Diffusion-Android

Stable Diffusion AI client app for Android
https://sdai.moroz.cc
GNU Affero General Public License v3.0
659 stars 63 forks source link

F-Droid reproducible build failed #75

Closed linsui closed 1 year ago

linsui commented 1 year ago

diff.zip

Is there anything changed?

ShiftHackZ commented 1 year ago

Hi, the version 0.4.11 implemented:

Also I updated some docs in readme, but it should not impact the build.

The diff between 2 tags: https://github.com/ShiftHackZ/Stable-Diffusion-Android/compare/0.4.10...0.4.11

linsui commented 1 year ago

The code change looks small. Is the build environment changed?

ShiftHackZ commented 1 year ago

Currently I only use ThinkPad laptop with Ubuntu 23.04 and Android Studio installed as snap-package. I remember there were some minor system/packages updates from Ubuntu team, but not for Android Studio snap. Is it worth trying checkout tag 0.4.11, re-build the apk from scratch and re-upload it to the existing github release? Or could you please advice, are there any other common reasons for problems like this, so I can check ?

linsui commented 1 year ago

The most important part is the jdk version. AS may uses a different jdk. Could you please rebuild it with gradle assemble with openjdk 17? You can upload it here so that I can check if it's reproducible. You can also check that with diffoscope. Our build can be found at https://gitlab.com/linsui/fdroiddata/-/jobs/4769604895/artifacts/file/tmp/com.shifthackz.aisdv1.app.foss_158.apk.

ShiftHackZ commented 1 year ago

I tried JDK installation commands from metadata.yml file, to try make the environment identical.

Here is a command-sequence used to produce the build:

sudo apt-get install -y openjdk-17-jdk-headless
update-alternatives --auto java
cd Develop/Stable-Diffusion-Android
git fetch 
git checkout tags/0.4.11
chmod +x ./gradlew
./gradlew assembleFossRelease

Output for java --version:

shifthackz@shz-thinkpad-ubnt:~$ java --version
openjdk 17.0.7 2023-04-18
OpenJDK Runtime Environment (build 17.0.7+7-Ubuntu-0ubuntu123.04)
OpenJDK 64-Bit Server VM (build 17.0.7+7-Ubuntu-0ubuntu123.04, mixed mode, sharing)

Build logs:

> Task :data:compileReleaseKotlin
w: file:///home/shifthackz/Develop/Stable-Diffusion-Android/data/src/main/java/com/shifthackz/aisdv1/data/gateway/mediastore/MediaStoreGatewayFactory.kt:20:16 'MediaStoreGatewayOldImpl' is deprecated. Deprecated since Android 12, it is here to support old devices.

> Task :app:compileFossReleaseArtProfile
Sorting /home/shifthackz/Develop/Stable-Diffusion-Android/app/build/intermediates/binary_art_profile_metadata/fossRelease/baseline.profm ...

BUILD SUCCESSFUL in 56s
480 actionable tasks: 264 executed, 216 up-to-date

I compressed apk to zip archive, because github does not allow upload apk extension: sdai-foss-release-0.4.11.zip

linsui commented 1 year ago

All files in the apk are identical now but the metadata is different. @obfusk Could you please take a look?

obfusk commented 1 year ago

All files in the apk are identical now but the metadata is different. @obfusk Could you please take a look?

Because one of them is signed (v2 only, so no v1 signature files). It's RB now:

$ apksigcopier compare sdai-foss-release-0.4.11.apk --unsigned com.shifthackz.aisdv1.app.foss_158.apk &&
echo OK
OK
linsui commented 1 year ago

Ah, I make a mistake when I checked it with apksigcopier copy...

linsui commented 1 year ago

Thanks!