Skip to content

Commit

Permalink
update mush
Browse files Browse the repository at this point in the history
  • Loading branch information
velzie committed Mar 3, 2023
1 parent e62619b commit 9ce530e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 18 deletions.
24 changes: 21 additions & 3 deletions fakemurk.sh.pre
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ leave() {
}
config() {
swallow_stdin

echo "please enter the your managed email's domain. example: if your email is \"randomstudent@skid.edu\" then you will enter skid.edu"
echo "if you don't enter it correctly you won't be able to login, double check this"
read -r -p "> " EMAIL
echo

swallow_stdin
echo
read -r -p "Would you like to enable rootfs restore? It will add an option to quickly revert all changes and re-enroll. (Y/n)" choice
case "$choice" in
N | n | no | No | NO) ROOTFS_BACKUP=0 ;;
Expand Down Expand Up @@ -159,9 +167,6 @@ drop_crossystem_sh() {
chmod 777 "$ROOT/usr/bin/crossystem"
}
drop_pollen() {
echo "please enter the your managed email's domain. example: if your email is \"randomstudent@skid.edu\" then you will enter skid.edu"
echo "if you don't enter it correctly you won't be able to login, double check this"
read -r -p "> " EMAIL
mkdir -p "$ROOT/etc/opt/chrome/policies/managed"
raw_pollen | sed -e "s/__SED_REPLACEME_SCHOOL_EMAIL__/${EMAIL}/g" >$ROOT/etc/opt/chrome/policies/managed/policy.json
chmod 777 "$ROOT/etc/opt/chrome/policies/managed/policy.json"
Expand Down Expand Up @@ -285,7 +290,20 @@ EOF
ROOT=
fi
}
get_largest_nvme_namespace() {
local largest size tmp_size dev
size=0
dev=$(basename "$1")

for nvme in /sys/block/"${dev%n*}"*; do
tmp_size=$(cat "${nvme}"/size)
if [ "${tmp_size}" -gt "${size}" ]; then
largest="${nvme##*/}"
size="${tmp_size}"
fi
done
echo "${largest}"
}
verity_enabled_for_n() {
grep -q "root=/dev/dm" <"${DST}p${1}"
}
Expand Down
2 changes: 1 addition & 1 deletion header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ascii_info() {
THIS IS FREE SOFTWARE! if you paid for this, you have been scammed and should demand your money back
fakemurk - a tool made by coolelectronics and r58playz to spoof verified boot while enrolled
fakemurk - a tool made by Mercury Workshop to spoof verified boot while enrolled
you can find this script, its explanation, and documentation here: https://github.com/MercuryWorkshop/fakemurk
EOF

Expand Down
30 changes: 16 additions & 14 deletions mush.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ main() {
(8) Emergency Revert & Re-Enroll
(9) Edit Pollen
EOF
if ! test -f /mnt/stateful_partition/crouton; then
echo "(10) Install Crouton"
fi
swallow_stdin
read -p "> (1-9): " choice
read -r -p "> (1-11): " choice
case "$choice" in
1) runjob doas bash ;;
2) runjob bash ;;
Expand All @@ -69,6 +72,8 @@ EOF
7) runjob hardenableext "*" ;;
8) runjob revert ;;
9) runjob edit /etc/opt/chrome/policies/managed/policy.json ;;
10) runjob install_crouton ;;
11) runjob prepare_crostini ;;
*) echo "invalid option" ;;
esac
done
Expand Down Expand Up @@ -117,29 +122,26 @@ revert() {
sleep 1000
}
harddisableext() { # calling it "hard disable" because it only reenables when you press
if [ ! -d "/home/chronos/.extstore" ]; then
mkdir /home/chronos/.extstore
fi
mv /home/chronos/user/Extensions/$1 /home/chronos/.extstore/
chmod 000 /home/chronos/user/Extensions/$1

doas restart ui
read -r -p "enter extension id>" extid
chmod 000 "/home/chronos/user/Extensions/$extid"
kill -9 $(pgrep -f "\-\-extension\-process")
}

hardenableext() {
chmod 777 /home/chronos/user/Extensions/$1
mv /home/chronos/.extstore/$1 /home/chronos/user/Extensions/$1

doas restart ui
read -r -p "enter extension id>" extid
chmod 777 "/home/chronos/user/Extensions/$extid"
kill -9 $(pgrep -f "\-\-extension\-process")
}

softdisableext() {
echo "Extensions will stay disabled until you press Ctrl+c or close this tab"
while true; do
kill -9 $(pgrep -f "\-\-extension\-process")
kill -9 $(pgrep -f "\-\-extension\-process") 2>/dev/null
done
}

install_crouton() {
curl -SLk https://goo.gl/fd3zc | doas bash -t xfce && touch /mnt/stateful_partition/crouton
}
if [ "$0" = "$BASH_SOURCE" ]; then
stty sane
main
Expand Down

0 comments on commit 9ce530e

Please sign in to comment.