Permalink
Browse files

[General] Adding .crx packaging files

Signed-off-by: Shane Bryan <shane.bryan@linux.intel.com>
  • Loading branch information...
1 parent 2a3ed50 commit aee43a83c6dc9ed3e7b995d744c163d6e49aabac Shane Bryan committed Apr 17, 2012
Showing with 70 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +2 −0 FILES
  3. +2 −0 README
  4. +46 −0 build/crxmake.sh
  5. +19 −0 manifest.json
  6. BIN src/assets/rib-128.png
  7. BIN src/assets/rib-16.png
  8. BIN src/assets/rib-48.png
View
@@ -1,3 +1,4 @@
*.swp
jslint-report.html
patches/
+*.crx
View
2 FILES
@@ -88,6 +88,7 @@ Intel build/report.css APLv2 N/A
Intel build/builder-jslint.js APLv2 N/A
Douglas build/jslint.js BSD-like [11,12]
Crockford (w/ conditions)
+Google build/crxmake.sh BSD [20]
Notes:
[1] http://code.jquery.com/jquery-1.6.4.js
@@ -110,3 +111,4 @@ Notes:
[17] https://github.com/arenevier/zipfile/blob/master/zipfile.js
[18] http://www.bramstein.com/projects/jlayout/
[19] http://www.bramstein.com/projects/jsizes/
+[20] http://code.google.com/chrome/extensions/crx.html
View
2 README
@@ -78,10 +78,12 @@ File: License: Copyright Holder:
----- -------- -----------------
build/jslint.js BSD-like Douglas Crockford[2,3]
(w/ conditions)
+build/crxmake.sh BSD Google[7]
Notes:
[2] douglas@crockford.com
[3] Portions of the file (jslint.js) are copyright Intel Corporation, 2011-2012
[4] einar@jsbeautifier.org
[5] stuart@stuartk.co.uk
[6] arno@renevier.net
+[7] Copyright 2011 Google (http://code.google.com/chrome/extensions/crx.html)
View
@@ -0,0 +1,46 @@
+#!/bin/bash -e
+#
+# Purpose: Pack a Chromium extension directory into crx format
+#
+# Copyright 2011 Google
+# Licensed under the BSD License http://code.google.com/google_bsd_license.html
+# Original copied from http://code.google.com/chrome/extensions/crx.html#H3-5
+
+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"
View
@@ -0,0 +1,19 @@
+{
+ "name": "Rapid Interface Builder",
+ "version": "0.0.1",
+ "description": "Rapid Interface Builder (RIB) is a browser-based design tool for quickly prototyping and creating the user interface for web applications. Layout your UI by dropping widgets onto a canvas. Run the UI in an interactive 'Preview mode'. Export the generated HTML and Javascript. It's that simple!",
+ "icons": {
+ "16": "src/assets/rib-16.png",
+ "48": "src/assets/rib-48.png",
+ "128": "src/assets/rib-128.png" },
+ "offline_enabled": true,
+ "homepage_url": "https://01.org/rib",
+ "app": {
+ "launch": {
+ "local_path": "index.html",
+ "container": "panel",
+ "height": 1024,
+ "width": 1280
+ }
+ }
+}
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit aee43a8

Please sign in to comment.