From 615e712e14c83de39157bef9e9838d00705c5ea7 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Fri, 1 Dec 2023 18:21:26 +0100 Subject: [PATCH] build: Set olm to 1.3.2 to fix android build --- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- scripts/prepare-web.sh | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index a8ea28a5ca..02e28522da 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -636,10 +636,10 @@ packages: dependency: "direct main" description: name: flutter_olm - sha256: ea8da4b76b5005b1df80ff5afd705ba17a9e2db5ac8848512d3455a88b56fb67 + sha256: "69aaac45d854e74d17d04dac8a0ca3f548266d271a0f0fa7600e006e81432417" url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.3.2" flutter_openssl_crypto: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 928dad66d8..9d065201ea 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -42,7 +42,7 @@ dependencies: sdk: flutter flutter_map: ^4.0.0 flutter_math_fork: ^0.7.2 - flutter_olm: ^1.4.0 + flutter_olm: 1.3.2 # Keep in sync with scripts/prepare-web.sh ! 1.4.0 does currently not build on Android flutter_openssl_crypto: ^0.3.0 flutter_ringtone_player: ^4.0.0+2 flutter_secure_storage: ^9.0.0 diff --git a/scripts/prepare-web.sh b/scripts/prepare-web.sh index 0c4283e69d..70b15a246a 100755 --- a/scripts/prepare-web.sh +++ b/scripts/prepare-web.sh @@ -1,6 +1,10 @@ #!/bin/sh -ve rm -r assets/js/package -cd assets/js/ && curl -L $(curl -s 'https://api.github.com/repos/famedly/olm/releases' | jq -r '.[0] | .assets | .[0] | .browser_download_url') > olm.zip && cd ../../ + +OLM_VERSION=$(cat pubspec.yaml | yq .dependencies.flutter_olm) +DOWNLOAD_PATH="https://github.com/famedly/olm/releases/download/v$OLM_VERSION/olm.zip" + +cd assets/js/ && curl -L $DOWNLOAD_PATH > olm.zip && cd ../../ cd assets/js/ && unzip olm.zip && cd ../../ cd assets/js/ && rm olm.zip && cd ../../ cd assets/js/ && mv javascript package && cd ../../