forked from EFForg/https-everywhere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
edge.sh
executable file
·32 lines (23 loc) · 1.05 KB
/
edge.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# Written for transparency and reproducibility on Edge upload
# Install Node Package for CRX Verification via NPM
# [sudo] npm -g i crx3-utils
# Verify CRX file
# crx3-info rsa 0 < $crx_cws > public.pem
# crx3-verify rsa 0 public.pem < $crx_cws
# echo "CRX verified"
VERSION=`python3.6 -c "import json ; print(json.loads(open('chromium/manifest.json').read())['version'])"`
crx_cws="pkg/https-everywhere-$VERSION-cws.crx"
crx_eff="pkg/https-everywhere-$VERSION-eff.crx"
crx3-info rsa 0 < $crx_cws > public.pem
crx3-verify rsa 0 public.pem < $crx_cws
echo "CRX verified"
#Build Edge Zip File
echo "Building Edge Zip"
crx3-info < $crx_eff | awk '/^header/ {print $2}' \
| xargs -I% dd if=$crx_eff iflag=skip_bytes skip=% > https-everywhere-$VERSION-edge.zip
echo >&2 "Edge zip package has sha256sum: `openssl dgst -sha256 -binary "https-everywhere-$VERSION-edge.zip" | xxd -p`"
mv https-everywhere-$VERSION-edge.zip pkg/https-everywhere-$VERSION-edge.zip
echo "Created pkg/https-everywhere-$VERSION-edge.zip"
#Now remove unneeded pem file
rm public.pem