Skip to content

Instantly share code, notes, and snippets.

@dchanm
Last active May 4, 2019 22:23
Show Gist options
  • Save dchanm/598d11ae6b97bd0f63189e586e7a66f7 to your computer and use it in GitHub Desktop.
Save dchanm/598d11ae6b97bd0f63189e586e7a66f7 to your computer and use it in GitHub Desktop.
#!/bin/bash
JAR=omni.ja
FILE=modules/AppConstants.jsm
function main() {
cp -n $JAR $JAR.orig
zip -F $JAR --out $JAR.fix
unzip $JAR.fix $FILE
perl -0777 -i.orig -pe 's/(MOZ_REQUIRE_SIGNING:\n.+?\n\s+)true,/\1false,/' $FILE
zip -vu0XD $JAR.fix $FILE
mv $JAR.fix $JAR
}
main
@dchanm
Copy link
Author

dchanm commented May 4, 2019

You can verify that the change was applied by running the following in a privileged console
https://developer.mozilla.org/en-US/docs/Tools/Browser_Console

Cu.import("resource://gre/modules/addons/AddonSettings.jsm")
alert(AddonSettings.REQUIRE_SIGNING)

This returns false after the change instead of the default true on release builds. The constant affects the following code paths
https://dxr.mozilla.org/mozilla-central/search?q=MOZ_REQUIRE_SIGNING+path%3Atoolkit%2F&redirect=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment