苹果笔记本Macbook Ventura/Sonoma跳过监管锁的方法

第一步:重装系统

长按电源键关机,再长按开机(command+R)进入恢复模式,抹掉硬盘,重启后安装系统。

第二步:执行代码

系统安装完重启只后,到连WiFi时长按电源键关机。再长按command+R进入恢复模式,打开Safari,输入本篇文章的地址,复制以下代码:

#!/bin/bash

RED='\033[1;31m'

GRN='\033[1;32m'

BLU='\033[1;34m'

YEL='\033[1;33m'

PUR='\033[1;35m'

CYAN='\033[1;36m'

NC='\033[0m'

 

echo -e "${CYAN}*-------------------*---------------------*${NC}"

echo -e "${YEL}* Check MDM - Skip MDM Auto for MacOS by *${NC}"

echo -e "${RED}*             SKIPMDM.COM                *${NC}"

echo -e "${RED}*            Phoenix Team                *${NC}"

echo -e "${CYAN}*-------------------*---------------------*${NC}"

echo ""

PS3='Please enter your choice: '

options=("Autoypass on Recovery" "Reboot")

select opt in "${options[@]}"; do

       case $opt in

       "Autoypass on Recovery")

              echo -e "${GRN}Bypass on Recovery"

              if [ -d "/Volumes/Macintosh HD - Data" ]; then

                   diskutil rename "Macintosh HD - Data" "Data"

              fi

              echo -e "${GRN}Create a new user / To User mi"

        echo -e "${BLU}Press Enter to continue, Note: Leaving it blank will default to the automatic user / Nhn Enter để tiếp tc, Lưu ý: có th không đin s t động nhn User mc định"

             echo -e "Enter the username (Default: Apple) / Nhp tên User (Mc định: Apple)"

              read realName

             realName="${realName:= Apple}"

    echo -e "${BLUE}Nhn username ${RED}WRITE WITHOUT SPACES / VIT LIN KHÔNG DU ${GRN} (Mc định: Apple)"

          read username

              username="${username:=Apple}"

             echo -e "${BLUE}Enter the password (default: 1234) / Nhp mt khu (mc định: 1234)"

    read passw

          passw="${passw:=1234}"

              dscl_path='/Volumes/Data/private/var/db/dslocal/nodes/Default'

        echo -e "${GREEN}Creating User / Đang to User"

             # Create user

    dscl -f "$dscl_path" localhost -create "/Local/Default/Users/$username"

          dscl -f "$dscl_path" localhost -create "/Local/Default/Users/$username" UserShell "/bin/zsh"

           dscl -f "$dscl_path" localhost -create "/Local/Default/Users/$username" RealName "$realName"

             dscl -f "$dscl_path" localhost -create "/Local/Default/Users/$username" RealName "$realName"

           dscl -f "$dscl_path" localhost -create "/Local/Default/Users/$username" UniqueID "501"

           dscl -f "$dscl_path" localhost -create "/Local/Default/Users/$username" PrimaryGroupID "20"

              mkdir "/Volumes/Data/Users/$username"

           dscl -f "$dscl_path" localhost -create "/Local/Default/Users/$username" NFSHomeDirectory "/Users/$username"

           dscl -f "$dscl_path" localhost -passwd "/Local/Default/Users/$username" "$passw"

           dscl -f "$dscl_path" localhost -append "/Local/Default/Groups/admin" GroupMembership $username

              echo "0.0.0.0 deviceenrollment.apple.com" >>/Volumes/Macintosh\ HD/etc/hosts

              echo "0.0.0.0 mdmenrollment.apple.com" >>/Volumes/Macintosh\ HD/etc/hosts

              echo "0.0.0.0 iprofiles.apple.com" >>/Volumes/Macintosh\ HD/etc/hosts

        echo -e "${GREEN}Successfully blocked host / Thành công chn host${NC}"

              # echo "Remove config profile"

      touch /Volumes/Data/private/var/db/.AppleSetupDone

        rm -rf /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigHasActivationRecord

       rm -rf /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound

       touch /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigProfileInstalled

       touch /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound

       echo -e "${CYAN}------ Autobypass SUCCESSFULLY / Autobypass HOÀN TT ------${NC}"

       echo -e "${CYAN}------ Exit Terminal , Reset Macbook and ENJOY ! ------${NC}"

              break

              ;;

    "Disable Notification (SIP)")

    echo -e "${RED}Please Insert Your Password To Proceed${NC}"

        sudo rm /var/db/ConfigurationProfiles/Settings/.cloudConfigHasActivationRecord

        sudo rm /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound

        sudo touch /var/db/ConfigurationProfiles/Settings/.cloudConfigProfileInstalled

        sudo touch /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound

        break

        ;;

    "Disable Notification (Recovery)")

        rm -rf /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigHasActivationRecord

       rm -rf /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound

       touch /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigProfileInstalled

       touch /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound

 

        break

        ;;

       "Check MDM Enrollment")

              echo ""

              echo -e "${GRN}Check MDM Enrollment. Error is success${NC}"

              echo ""

              echo -e "${RED}Please Insert Your Password To Proceed${NC}"

              echo ""

              sudo profiles show -type enrollment

              break

              ;;

       "Exit")

             echo "Rebooting..."

              reboot

              break

              ;;

       *) echo "Invalid option $REPLY" ;;

       esac

done

 

然后退出Safari,打开终端,粘贴之前复制的代码回车,然后选择1,一路回车,重启进入系统。

第三步:创建账户

上面这段代码会创建一个名为apple,密码为1234的账户,但是这个账户不能进行后续操作,所以需要创建一个新账户,新账户必须是管理员,然后登录新账户,删除老账户。

第四步:关闭SIP(系统完整性保护)

重启后,长按开机进入恢复模式(或command+R),打开终端,输入

csrutil disable

然后重启

第五步:执行命令

依次执行下面5条命令

sudo rm /var/db/ConfigurationProfiles/Settings/.cloudConfigHasActivationRecord

sudo rm /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound

sudo touch /var/db/ConfigurationProfiles/Settings/.cloudConfigProfileInstalled

sudo touch /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound

sudo launchctl disable system/com.apple.ManagedClient.enroll

 

执行命令检查是否成功:

 

sudo profiles show -type enrollment

 

如果出现类似错误就说明大功告成了:Error fetching Device Enrollment configuration: We can't determine if this machine is DEP enabled. Try again later.

 

步:打开SIP(系统完整性保护)

重启后,长按开机进入恢复模式(或command+R),打开终端,输入

csrutil enable

然后重启