diff --git a/edge.sh b/edge.sh new file mode 100755 index 000000000000..63b3f16abbec --- /dev/null +++ b/edge.sh @@ -0,0 +1,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" + +#Now remove unneeded pem file +rm public.pem +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 + 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" +rm public.pem \ No newline at end of file diff --git a/install-dev-dependencies.sh b/install-dev-dependencies.sh index db3a50063790..8a9023efb654 100755 --- a/install-dev-dependencies.sh +++ b/install-dev-dependencies.sh @@ -43,6 +43,8 @@ if type apt-get>/dev/null 2>&1; then fi $SUDO_SHIM apt-get install -y libxml2-dev libxml2-utils libxslt1-dev \ python3.6-dev $BROWSERS zip sqlite3 python3-pip libcurl4-openssl-dev xvfb \ + nodejs \ + npm \ libssl-dev git curl $CHROMEDRIVER if ! type geckodriver >/dev/null 2>&1; then curl -LO "https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux$ARCH.tar.gz" @@ -61,6 +63,7 @@ elif type brew >/dev/null 2>&1; then brew list python &>/dev/null || brew install python brew cask install chromedriver brew install libxml2 gnu-sed + brew install node if ! echo $PATH | grep -ql /usr/local/bin ; then echo '/usr/local/bin not found in $PATH, please add it.' fi @@ -86,12 +89,18 @@ elif type dnf >/dev/null 2>&1; then $SUDO_SHIM chown root /usr/bin/geckodriver $SUDO_SHIM chmod 755 /usr/bin/geckodriver fi + # This is needed for Firefox on some systems. See here for more information: # https://github.com/EFForg/https-everywhere/pull/5584#issuecomment-238655443 if [ ! -f /var/lib/dbus/machine-id ]; then $SUDO_SHIM sh -c 'dbus-uuidgen > /var/lib/dbus/machine-id' fi export PYCURL_SSL_LIBRARY=openssl + + #Node + curl -sL https://rpm.nodesource.com/setup_12.x | $SUDO_SHIM bash - + $SUDO_SHIM yum install -y nodejs + $SUDO_SHIM yum install gcc-c++ make else echo \ "Your distro isn't supported by this script yet!"\ @@ -112,5 +121,8 @@ cd test/chromium pip3 install --user -r requirements.txt cd - +# Install Node Package for CRX Verification +$SUDO_SHIM npm -g i crx3-utils + # Install git hook to run tests before pushing. ln -sf ../../test.sh .git/hooks/pre-push diff --git a/make.sh b/make.sh index 26fdc688c9c8..18ee4a20a21e 100755 --- a/make.sh +++ b/make.sh @@ -159,6 +159,7 @@ if [ -n "$BRANCH" ] ; then crx_eff="pkg/https-everywhere-$VERSION-eff.crx" xpi_amo="pkg/https-everywhere-$VERSION-amo.xpi" xpi_eff="pkg/https-everywhere-$VERSION-eff.xpi" + else crx_cws="pkg/https-everywhere-$VERSION~pre-cws.crx" crx_eff="pkg/https-everywhere-$VERSION~pre-eff.crx" @@ -180,10 +181,10 @@ $BROWSER --no-message-box --pack-extension="pkg/crx-cws" --pack-extension-key="$ $BROWSER --no-message-box --pack-extension="pkg/crx-eff" --pack-extension-key="$KEY" 2> /dev/null mv pkg/crx-cws.crx $crx_cws mv pkg/crx-eff.crx $crx_eff + echo >&2 "CWS crx package has sha256sum: `openssl dgst -sha256 -binary "$crx_cws" | xxd -p`" echo >&2 "EFF crx package has sha256sum: `openssl dgst -sha256 -binary "$crx_eff" | xxd -p`" - # now zip up the xpi AMO dir name=pkg/xpi-amo dir=pkg/xpi-amo @@ -195,8 +196,6 @@ echo >&2 "AMO xpi package has sha256sum: `openssl dgst -sha256 -binary "$cwd/$zi cp $zip $xpi_amo - - # now zip up the xpi EFF dir name=pkg/xpi-eff dir=pkg/xpi-eff @@ -208,8 +207,6 @@ echo >&2 "EFF xpi package has sha256sum: `openssl dgst -sha256 -binary "$cwd/$zi cp $zip $xpi_eff - - bash utils/android-push.sh "$xpi_eff" echo >&2 "Total included rules: `find src/chrome/content/rules -name "*.xml" | wc -l`"