How do you retrieve the extension ID from the xpi file? (It is needed f.ex. for global extension installation)
In previous versions, you could get it from the install.rdf
, which no longer exists in WebExtensions. http://www.di-mgt.com.au/how-mozilla-signs-addons.html describes that it is contained in the META-INF/mozilla.rsa
file.
In python, there is the pyasn1 library. I could not get it to work on the first attempt:
from pyasn1.codec.der import decoder
f = open('/path/to/addon-dir/META-INF/mozilla.rsa')
decoder.decode(f)
gave
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/pyasn1/codec/ber/decoder.py", line 623, in __call__
raise error.PyAsn1Error('Bad octet stream type')
pyasn1.error.PyAsn1Error: Bad octet stream type
decoder.decode(buf)[0][1][3][0][5][5][0][1].asOctets()
? – Ferminafermion