Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable30] refactor: moved hashes to be close to version number #4575

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading