From d6c54b3d4ee757958f9040a84dfbde0ab25f59bf Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Thu, 5 Jan 2023 21:00:58 +0100 Subject: [PATCH] android: Enable checksum verification for gradle download Follow the F-Droid Bot suggestion in [1] and set the checksum from [2] in gradle-wrapper.properties, so a downloaded gradle distribution will be verified against that, s. doc at [3]. Command used from within the `android/source` directory: ./gradlew wrapper --distribution-type all --gradle-distribution-sha256-sum cd5c2958a107ee7f0722004a12d0f8559b4564c34daad7df06cffd4d12a426d0 Note that this is the checksum for the gradle distribution, not the gradle wrapper (which is mentioned in Change-Id I3f466061aba55c5704fe251eee7e8c73f7d316aa instead.) Also note that Android Studio does not fully support the "distributionSha256Sum" attribute and requires confirming in a message saying so that the checksum is correct before syncing the project, s. [4]. [1] https://gitlab.com/fdroid/fdroiddata/-/merge_requests/12380#note_1229239229 [2] https://downloads.gradle-dn.com/distributions/gradle-7.4-all.zip.sha256 [3] https://docs.gradle.org/current/userguide/gradle_wrapper.html#configuring_checksum_verification [4] https://issuetracker.google.com/issues/129261435#comment11 Change-Id: I39902be79e7dad2ad006262efe3b6c6ab3b5de5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145105 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- android/source/gradle/wrapper/gradle-wrapper.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/android/source/gradle/wrapper/gradle-wrapper.properties b/android/source/gradle/wrapper/gradle-wrapper.properties index b1159fc54f39..dcf5e2cb7b3e 100644 --- a/android/source/gradle/wrapper/gradle-wrapper.properties +++ b/android/source/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionSha256Sum=cd5c2958a107ee7f0722004a12d0f8559b4564c34daad7df06cffd4d12a426d0 distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists