Commit ac0c989b authored by Tails developers's avatar Tails developers

Refactor code checking if windows camouflage is enabled.

parent 6c06f760
......@@ -20,6 +20,10 @@ mac_spoof_is_enabled() {
[ "$(_get_tg_setting "${PHYSICAL_SECURITY_SETTINGS}" TAILS_MACSPOOF_ENABLED)" != false ]
}
windows_camouflage_is_enabled() {
[ -e /var/lib/gdm3/tails.camouflage ]
}
tails_netconf() {
_get_tg_setting "${PHYSICAL_SECURITY_SETTINGS}" TAILS_NETCONF
}
......@@ -26,16 +26,15 @@ START_PAGE="http://127.0.0.1:7657"
# guess_best_tor_browser_locale()
. /usr/local/lib/tails-shell-library/tor-browser.sh
# Import windows_camouflage_is_enabled()
. /usr/local/lib/tails-shell-library/tor-browser.sh
. /usr/local/lib/tails-shell-library/chroot-browser.sh
NOSCRIPT_EXT_XPI="${TBB_EXT}/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi"
TORBUTTON_EXT_DIR="${TBB_EXT}/torbutton@torproject.org"
NAME="`gettext \"I2P Browser\"`"
if [ -e /var/lib/gdm3/tails.camouflage ]; then
CAMOUFLAGE=yes
fi
cleanup () {
try_cleanup_browser_chroot ${CHROOT} ${COW} ${BROWSER_USER}
}
......@@ -125,7 +124,7 @@ configure_chroot () {
chown -R ${BROWSER_USER}:${BROWSER_USER} "${BROWSER_CONF}"
# Change the theme when not using Windows camouflage
if [ -z "${CAMOUFLAGE}" ]; then
if ! windows_camouflage_is_enabled; then
cat /usr/share/tails/i2p-browser/i2p-browser-theme.js >> "${BROWSER_PREFS}"
else
# The camouflage activation script requires a dbus server for
......
......@@ -22,6 +22,9 @@ BROWSER_USER=clearnet
# guess_best_tor_browser_locale()
. /usr/local/lib/tails-shell-library/tor-browser.sh
# Import windows_camouflage_is_enabled()
. /usr/local/lib/tails-shell-library/tor-browser.sh
. /usr/local/lib/tails-shell-library/chroot-browser.sh
WARNING_PAGE='/usr/share/doc/tails/website/misc/unsafe_browser_warning'
......@@ -32,10 +35,6 @@ else
START_PAGE="${WARNING_PAGE}.en.html"
fi
if [ -e /var/lib/gdm3/tails.camouflage ]; then
CAMOUFLAGE=yes
fi
cleanup () {
try_cleanup_browser_chroot ${CHROOT} ${COW} ${BROWSER_USER}
}
......@@ -118,7 +117,7 @@ configure_chroot () {
# camouflage). Note that the tails-activate-win8-theme script that
# we may run below requires that the browser profile is writable
# by the user running the script (i.e. clearnet).
if [ -z "${CAMOUFLAGE}" ]; then
if ! windows_camouflage_is_enabled; then
cat /usr/share/tails/unsafe-browser/unsafe-browser-theme.js >> "${BROWSER_PREFS}"
else
# The camouflage activation script requires a dbus server for
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment