From 58f9be779afce213f9aa179bf821ca777e8d8859 Mon Sep 17 00:00:00 2001 From: sspanak Date: Sat, 3 May 2025 13:51:02 +0300 Subject: [PATCH] during build time the dictionary freshness is determined using 'sha256sum' shell command instead of Groovy's digest('SHA-256') to hopefuly prevent build crashing on F-droid --- app/dictionary-tools.gradle | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/dictionary-tools.gradle b/app/dictionary-tools.gradle index 2241bb0b..7ca4d45a 100644 --- a/app/dictionary-tools.gradle +++ b/app/dictionary-tools.gradle @@ -56,10 +56,16 @@ class Wrapper { static def getLanguageHash(File definitionFile, File dictionaryFile) { - def definitionHash = definitionFile != null && definitionFile.exists() ? definitionFile.text.digest("SHA-256") : "" - def dictionaryHash = dictionaryFile != null && dictionaryFile.exists() ? dictionaryFile.text.digest("SHA-256") : "" + def definitionHash = definitionFile != null && definitionFile.exists() ? sha256(definitionFile.path) : "" + def dictionaryHash = dictionaryFile != null && dictionaryFile.exists() ? sha256(dictionaryFile.path) : "" return definitionHash + dictionaryHash } + + + static def sha256(String filePath) { + def parts = "sha256sum $filePath".execute().text.trim().split(" ") + return parts.length > 0 ? parts[0] : "" + } } ext.DictionaryTools = Wrapper