summaryrefslogtreecommitdiff
path: root/docker/selenium/crxmake.sh
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2016-11-13 02:12:18 +0100
committerMarcello Stanisci <marcello.stanisci@inria.fr>2016-11-13 02:12:18 +0100
commita224d53923e76e17e10ab31309d11632ebe8b5ba (patch)
tree2f8a024550e0a4b3ddd7b20bc9d7c6d62d4d9460 /docker/selenium/crxmake.sh
parent9196188cb98a64bde615a2f2099e1ac8fa40e384 (diff)
downloaddeployment-a224d53923e76e17e10ab31309d11632ebe8b5ba.tar.gz
deployment-a224d53923e76e17e10ab31309d11632ebe8b5ba.tar.bz2
deployment-a224d53923e76e17e10ab31309d11632ebe8b5ba.zip
pack extension via xvfb'd chromium before running selenium test
Diffstat (limited to 'docker/selenium/crxmake.sh')
-rwxr-xr-xdocker/selenium/crxmake.sh43
1 files changed, 0 insertions, 43 deletions
diff --git a/docker/selenium/crxmake.sh b/docker/selenium/crxmake.sh
deleted file mode 100755
index 539dbfc..0000000
--- a/docker/selenium/crxmake.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash -e
-#
-# Purpose: Pack a Chromium extension directory into crx format
-# Downloaded from https://developer.chrome.com/extensions/crx
-
-if test $# -ne 2; then
- echo "Usage: crxmake.sh <extension dir> <pem path>"
- exit 1
-fi
-
-dir=$1
-key=$2
-name=$(basename "$dir")
-crx="$name.crx"
-pub="$name.pub"
-sig="$name.sig"
-zip="$name.zip"
-trap 'rm -f "$pub" "$sig" "$zip"' EXIT
-
-# zip up the crx dir
-cwd=$(pwd -P)
-(cd "$dir" && zip -qr -9 -X "$cwd/$zip" .)
-
-# signature
-openssl sha1 -sha1 -binary -sign "$key" < "$zip" > "$sig"
-
-# public key
-openssl rsa -pubout -outform DER < "$key" > "$pub" 2>/dev/null
-
-byte_swap () {
- # Take "abcdefgh" and return it as "ghefcdab"
- echo "${1:6:2}${1:4:2}${1:2:2}${1:0:2}"
-}
-
-crmagic_hex="4372 3234" # Cr24
-version_hex="0200 0000" # 2
-pub_len_hex=$(byte_swap $(printf '%08x\n' $(ls -l "$pub" | awk '{print $5}')))
-sig_len_hex=$(byte_swap $(printf '%08x\n' $(ls -l "$sig" | awk '{print $5}')))
-(
- echo "$crmagic_hex $version_hex $pub_len_hex $sig_len_hex" | xxd -r -p
- cat "$pub" "$sig" "$zip"
-) > "$crx"
-echo "Wrote $crx"