Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Side by Side Diff: chrome/common/extensions/docs/templates/articles/crx.html

Issue 11035015: Merge 159156 - Extensions Docs Server: Fix headings with no IDs (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1229/src/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <h1>CRX Package Format</h1> 1 <h1>CRX Package Format</h1>
2 2
3 3
4 <p> 4 <p>
5 CRX files are ZIP files with a special header and the <code>.crx</code> file 5 CRX files are ZIP files with a special header and the <code>.crx</code> file
6 extension. 6 extension.
7 </p> 7 </p>
8 8
9 <h2>Package header</h2> 9 <h2 id="package_header">Package header</h2>
10 10
11 <p> 11 <p>
12 The header contains the author's public key and the extension's signature. 12 The header contains the author's public key and the extension's signature.
13 The signature is generated from the ZIP file using SHA-1 with the 13 The signature is generated from the ZIP file using SHA-1 with the
14 author's private key. The header requires a little-endian byte ordering with 14 author's private key. The header requires a little-endian byte ordering with
15 4-byte alignment. The following table describes the fields of 15 4-byte alignment. The following table describes the fields of
16 the <code>.crx</code> header in order: 16 the <code>.crx</code> header in order:
17 </p> 17 </p>
18 18
19 <table> 19 <table>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 <tr> 56 <tr>
57 <td><em>signature</em></td><td>byte[]</td><td><i>sig.length</i></td> 57 <td><em>signature</em></td><td>byte[]</td><td><i>sig.length</i></td>
58 <td><i>sig.contents</i></td> 58 <td><i>sig.contents</i></td>
59 <td> 59 <td>
60 The signature of the ZIP content using the author's private key. The 60 The signature of the ZIP content using the author's private key. The
61 signature is created using the RSA algorithm with the SHA-1 hash function. 61 signature is created using the RSA algorithm with the SHA-1 hash function.
62 </td> 62 </td>
63 </tr> 63 </tr>
64 </table> 64 </table>
65 65
66 <h2>Extension contents</h2> 66 <h2 id="extensions_contents">Extension contents</h2>
67 67
68 <p> 68 <p>
69 The extension's ZIP file is appended to the <code>*.crx</code> package after the 69 The extension's ZIP file is appended to the <code>*.crx</code> package after the
70 header. This should be the same ZIP file that the signature in the header 70 header. This should be the same ZIP file that the signature in the header
71 was generated from. 71 was generated from.
72 </p> 72 </p>
73 73
74 <h2>Example</h2> 74 <h2 id="example">Example</h2>
75 75
76 <p> 76 <p>
77 The following is an example hex dump from the beginning of a <code>.crx</code> 77 The following is an example hex dump from the beginning of a <code>.crx</code>
78 file. 78 file.
79 </p> 79 </p>
80 80
81 <pre> 81 <pre>
82 43 72 32 34 # "Cr24" -- the magic number 82 43 72 32 34 # "Cr24" -- the magic number
83 02 00 00 00 # 2 -- the crx format version number 83 02 00 00 00 # 2 -- the crx format version number
84 A2 00 00 00 # 162 -- length of public key in bytes 84 A2 00 00 00 # 162 -- length of public key in bytes
85 80 00 00 00 # 128 -- length of signature in bytes 85 80 00 00 00 # 128 -- length of signature in bytes
86 ........... # the contents of the public key 86 ........... # the contents of the public key
87 ........... # the contents of the signature 87 ........... # the contents of the signature
88 ........... # the contents of the zip file 88 ........... # the contents of the zip file
89 89
90 </pre> 90 </pre>
91 91
92 <h2 id="scripts">Packaging scripts</h2> 92 <h2 id="scripts">Packaging scripts</h2>
93 <p> 93 <p>
94 Members of the community have written the following scripts to package 94 Members of the community have written the following scripts to package
95 <code>.crx</code> files. 95 <code>.crx</code> files.
96 </p> 96 </p>
97 97
98 <h3 id="ruby">Ruby</h3> 98 <h3 id="ruby">Ruby</h3>
99 <blockquote> 99 <blockquote>
100 <a href="http://github.com/Constellation/crxmake">github: crxmake</a> 100 <a href="http://github.com/Constellation/crxmake">github: crxmake</a>
101 </blockquote> 101 </blockquote>
102 102
103 <h3>Bash</h3> 103 <h3 id="bash">Bash</h3>
104 <pre> 104 <pre>
105 #!/bin/bash -e 105 #!/bin/bash -e
106 # 106 #
107 # Purpose: Pack a Chromium extension directory into crx format 107 # Purpose: Pack a Chromium extension directory into crx format
108 108
109 if test $# -ne 2; then 109 if test $# -ne 2; then
110 echo "Usage: crxmake.sh &lt;extension dir&gt; &lt;pem path&gt;" 110 echo "Usage: crxmake.sh &lt;extension dir&gt; &lt;pem path&gt;"
111 exit 1 111 exit 1
112 fi 112 fi
113 113
(...skipping 23 matching lines...) Expand all
137 137
138 crmagic_hex="4372 3234" # Cr24 138 crmagic_hex="4372 3234" # Cr24
139 version_hex="0200 0000" # 2 139 version_hex="0200 0000" # 2
140 pub_len_hex=$(byte_swap $(printf '%08x\n' $(ls -l "$pub" | awk '{print $5}'))) 140 pub_len_hex=$(byte_swap $(printf '%08x\n' $(ls -l "$pub" | awk '{print $5}')))
141 sig_len_hex=$(byte_swap $(printf '%08x\n' $(ls -l "$sig" | awk '{print $5}'))) 141 sig_len_hex=$(byte_swap $(printf '%08x\n' $(ls -l "$sig" | awk '{print $5}')))
142 ( 142 (
143 echo "$crmagic_hex $version_hex $pub_len_hex $sig_len_hex" | xxd -r -p 143 echo "$crmagic_hex $version_hex $pub_len_hex $sig_len_hex" | xxd -r -p
144 cat "$pub" "$sig" "$zip" 144 cat "$pub" "$sig" "$zip"
145 ) > "$crx" 145 ) > "$crx"
146 echo "Wrote $crx" 146 echo "Wrote $crx"
147 </pre> 147 </pre>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698