Skip to content

Commit

Permalink
refactor: moved hashes to be close to version number
Browse files Browse the repository at this point in the history
This will make more easy when we need to update the version of
dependencies.

Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos authored and backportbot-libresign[bot] committed Jan 31, 2025
1 parent b46c52f commit 3fa611f
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions lib/Service/Install/InstallService.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
class InstallService {
public const JAVA_VERSION = 'openjdk version "21.0.6" 2025-01-21 LTS';
private const JAVA_URL_PATH_NAME = '21.0.6+7';
public const PDFTK_VERSION = '3.3.3';
public const JSIGNPDF_VERSION = '2.3.0';
/**
* When update, verify the hash of all architectures
*/
public const PDFTK_VERSION = '3.3.3'; /** @todo When update, verify the hash **/
private const PDFTK_HASH = '59a28bed53b428595d165d52988bf4cf';
public const JSIGNPDF_VERSION = '2.3.0'; /** @todo When update, verify the hash **/
private const JSIGNPDF_HASH = 'd239658ea50a39eb35169d8392feaffb';
public const CFSSL_VERSION = '1.6.5';

private ICache $cache;
private ?OutputInterface $output = null;
private string $resource = '';
Expand Down Expand Up @@ -484,10 +484,8 @@ public function installJSignPdf(?bool $async = false): void {
}
$comporessedInternalFileName = $this->getInternalPathOfFile($compressedFile);
$url = 'https://github.com/intoolswetrust/jsignpdf/releases/download/JSignPdf_' . str_replace('.', '_', InstallService::JSIGNPDF_VERSION) . '/jsignpdf-' . InstallService::JSIGNPDF_VERSION . '.zip';
/** WHEN UPDATE version: generate this hash handmade and update here */
$hash = 'd239658ea50a39eb35169d8392feaffb';

$this->download($url, 'JSignPdf', $comporessedInternalFileName, $hash);
$this->download($url, 'JSignPdf', $comporessedInternalFileName, self::JSIGNPDF_HASH);

$extractDir = $this->getInternalPathOfFolder($folder);
$zip = new ZIP($extractDir . '/' . $compressedFileName);
Expand Down Expand Up @@ -539,10 +537,8 @@ public function installPdftk(?bool $async = false): void {
}
$fullPath = $this->getInternalPathOfFile($file);
$url = 'https://gitlab.com/api/v4/projects/5024297/packages/generic/pdftk-java/v' . self::PDFTK_VERSION . '/pdftk-all.jar';
/** @todo WHEN UPDATE version: generate this hash handmade and update here */
$hash = '59a28bed53b428595d165d52988bf4cf';

$this->download($url, 'pdftk', $fullPath, $hash);
$this->download($url, 'pdftk', $fullPath, self::PDFTK_HASH);
$this->appConfig->setValueString(Application::APP_ID, 'pdftk_path', $fullPath);
$this->writeAppSignature();
}
Expand Down

0 comments on commit 3fa611f

Please sign in to comment.