Skip to content

Commit

Permalink
revert confirmed working
Browse files Browse the repository at this point in the history
  • Loading branch information
velzie committed Mar 3, 2023
1 parent 4b940d9 commit e62619b
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 21 deletions.
2 changes: 1 addition & 1 deletion chromeos_startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [ ! -f /sshd_staged ]; then
ssh-keygen -f /ssh/root/key -N '' -t rsa >/dev/null
cp /ssh/root/key /rootkey
chmod 600 /ssh/root
chmod 644 /ssh/rootkey
chmod 644 /rootkey

cat >/ssh/config <<-EOF
AuthorizedKeysFile /ssh/%u/key.pub
Expand Down
26 changes: 13 additions & 13 deletions fakemurk.sh.pre
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ EOF
touch "$ROOT/sbin/dumpkeys"
}

devbuild_fakemurk() {
devbuild_patchroot() {
if [ "$INSTALL_LOGKEYS" == "1" ]; then
echo "installing logkeys"
drop_logkeys
Expand Down Expand Up @@ -124,13 +124,10 @@ raw_crossystem_sh() {
EOF
}

drop_pollen() {
mkdir -p "$ROOT/etc/opt/chrome/policies/managed"

base64 -d <<-EOF | bunzip2 -dc >"$ROOT/etc/opt/chrome/policies/managed/policy.json"
raw_pollen() {
base64 -d <<-EOF | bunzip2 -dc
#include "pollen.json.b64"
EOF
chmod 777 "$ROOT/etc/opt/chrome/policies/managed/policy.json"
}
drop_daemon() {
base64 -d <<-EOF | bunzip2 -dc >"$ROOT/etc/init/pre-startup.conf"
Expand Down Expand Up @@ -161,6 +158,15 @@ drop_crossystem_sh() {
raw_crossystem_sh | sed -e "s/#__SED_REPLACEME_CROSSYSTEM_VALUES#/$(sed_escape "$vals")/g" | sed -e "s/THIS_IS_A_SPACE_DUMBASS/ /g" >"$ROOT/usr/bin/crossystem"
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"

}

escape() {
case $1 in
Expand Down Expand Up @@ -375,7 +381,7 @@ patch_root() {
drop_daemon

if [ "$DEVBUILD" == "1" ]; then
devbuild_fakemurk
devbuild_patchroot
fi
}
main() {
Expand Down Expand Up @@ -403,11 +409,6 @@ main() {
sleep 2

echo "----- stage 3: cleaning up -----"

if [ "$COMPAT" == "1" ]; then
echo "pressure washing..."
yes | mkfs.ext4 "${DST}p1" >/dev/null 2>&1 || : # hope you didn't have anything valuable on there
fi
cleanup
sleep 1
echo "setting kernel priority"
Expand All @@ -417,7 +418,6 @@ main() {
echo "done! press enter to reboot, and your chromebook should enroll into management when rebooted, but stay hidden in devmode"
swallow_stdin
read -r
sync
reboot
leave

Expand Down
39 changes: 32 additions & 7 deletions mush.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ main() {
(5) Soft Disable Extensions
(6) Hard Disable Extensions
(7) Hard Enable Extensions
(8) Emergency Revert
(8) Emergency Revert & Re-Enroll
(9) Edit Pollen
EOF
swallow_stdin
Expand All @@ -75,22 +75,47 @@ EOF
}

powerwash() {
swallow_stdin
echo "ARE YOU SURE YOU WANT TO POWERWASH??? THIS WILL REMOVE ALL USER ACCOUNTS"
sleep 2
echo "(press enter to continue, ctrl-c to cancel)"
swallow_stdin
read -r
doas echo "fast safe" >/mnt/stateful_partition/factory_install_reset
doas reboot
exit
}

revert() {
:
}
editpollen() {
:
}
echo "This option will re-enroll your chromebook restore to before fakemurk was run. This is useful if you need to quickly go back to normal"
echo "THIS IS A PERMANENT CHANGE!! YOU WILL NOT BE ABLE TO GO BACK UNLESS YOU UNENROLL AGAIN AND RUN THE SCRIPT, AND IF YOU UPDATE TO THE VERSION SH1MMER IS PATCHED, YOU MAY BE STUCK ENROLLED"
echo "ARE YOU SURE YOU WANT TO CONTINUE? (press enter to continue, ctrl-c to cancel)"
swallow_stdin
read -r
sleep 4
echo "setting kernel priority"

DST=/dev/$(get_largest_nvme_namespace)

if (($(cgpt show -n "$DST" -i 2 -P) > $(cgpt show -n "$DST" -i 4 -P))); then
cgpt add "$DST" -i 2 -P 0
cgpt add "$DST" -i 4 -P 1
else
cgpt add "$DST" -i 4 -P 0
cgpt add "$DST" -i 2 -P 1
fi
echo "setting vpd"
vpd.old -i RW_VPD -s check_enrollment=1
vpd.old -i RW_VPD -s block_devmode=1
crossystem.old block_devmode=1

echo "Done. Press enter to reboot"
swallow_stdin
read -r
echo "bye!"
sleep 2
reboot
sleep 1000
}
harddisableext() { # calling it "hard disable" because it only reenables when you press
if [ ! -d "/home/chronos/.extstore" ]; then
mkdir /home/chronos/.extstore
Expand Down

0 comments on commit e62619b

Please sign in to comment.