Created
June 11, 2015 23:06
-
-
Save leibovic/4f30e00461304886d41b to your computer and use it in GitHub Desktop.
Replaces the signed ABP extension file in the profile directory with a slightly modified version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let fileName = "{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.xpi"; | |
// Copy new add-on file from sdcard to profile extensions directory | |
let newFile = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsILocalFile); | |
newFile.initWithPath("/sdcard/" + fileName); | |
let extDir = FileUtils.getFile("ProfD", ["extensions"]); | |
newFile.copyTo(extDir, fileName); | |
console.log("moved file from sdcard to extensions directory"); | |
let observer = (subject, topic, data) => { | |
Services.obs.removeObserver(observer, "xpi-signature-changed"); | |
console.log("signatures changed"); | |
} | |
Services.obs.addObserver(observer, "xpi-signature-changed", false); | |
console.log("verifying signatures"); | |
let XPIscope = Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm"); | |
XPIscope.XPIProvider.verifySignatures(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment