Created
March 11, 2015 18:47
-
-
Save eviljeff/e97a1f2eb29d3f6a198a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/sh | |
# | |
# This Source Code Form is subject to the terms of the Mozilla Public | |
# License, v. 2.0. If a copy of the MPL was not distributed with this | |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
# | |
# This program modifies the prefs.js file on the given device so that | |
# trusted marketplaces for installing signed privileged apps can be | |
# added/removed *FOR TESTING PURPOSES ONLY*. | |
set -e | |
servers="https://marketplace-dev.allizom.org,https://marketplace.allizom.org,https://marketplace.firefox.com" | |
echo "Connecting to device..." | |
profile=`adb shell ls data/b2g/mozilla | tr -d '\\r' | grep "\.default$"` | |
echo "Pulling old prefs.js file" | |
adb pull data/b2g/mozilla/$profile/prefs.js prefs-old.js | |
echo "Pull Done. Patching file with updated signed_apps_installable_from" | |
# remove old pref value | |
grep -v "dom\.mozApps\.signed_apps_installable_from" prefs-old.js > prefs.js | |
# add new pref value | |
echo "user_pref(\"dom.mozApps.signed_apps_installable_from\",\"$servers\");" >> prefs.js | |
adb shell stop b2g | |
echo "Pushing fixed prefs.js file back to device" | |
adb push prefs.js data/b2g/mozilla/$profile/prefs.js | |
echo "Done! Rebooting..." | |
adb shell start b2g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment