From f81a0aee11bdaa84ad2ff282076e21b93357ee80 Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Thu, 22 Oct 2020 22:07:20 +0800 Subject: [PATCH] v2ray: verify binary (#1526) --- bucket/v2ray.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bucket/v2ray.json b/bucket/v2ray.json index 9dd3db6812..8872e8402b 100644 --- a/bucket/v2ray.json +++ b/bucket/v2ray.json @@ -13,6 +13,17 @@ "hash": "sha512:21ac50ca702a7161d366638aa2395c4988e1e5cae0ca436c8be81e9d97552efb5183f2cebc40788f7243b0814f36de4d24b89cde57fd158485dfd6e3517878b9" } }, + "installer": { + "script": [ + "Write-Host 'Verifying V2Ray binary...' -f Yellow", + "$sig = \"$dir\\Release\"", + "Invoke-WebRequest \"https://github.com/v2fly/v2ray-core/releases/download/v$version/Release\" -OutFile $sig", + "if (!(Invoke-Expression \"$dir\\v2ctl.exe verify --sig=$sig $dir\\v2ray.exe\" | Select-String 'OK')) {", + " Write-Host 'V2Ray binary is corrupted!' -f Red", + " exit 1", + "}" + ] + }, "bin": [ "v2ctl.exe", "v2ray.exe",