Add v3: Apple Silicon / SSV-aware bypass (fixes macOS 26 re-enrollment + FileVault Recovery) - #170
Add v3: Apple Silicon / SSV-aware bypass (fixes macOS 26 re-enrollment + FileVault Recovery)#170marclllaks wants to merge 1 commit into
Conversation
v1/v2 write the hosts block and ConfigurationProfiles markers to the System volume, but on Apple Silicon the OS boots from a sealed read-only snapshot — the live /etc/hosts and /var/db/ConfigurationProfiles physically live on the Data volume (via /etc->/private/etc, /var->/private/var and the /private firmlink). Those edits never reach the running OS and "disappear" after an update. v3 targets the Data volume for everything. Also: - Locate + unlock the FileVault-encrypted Data volume in Recovery, by APFS role rather than name (fixes "Could not detect data volume" on modern Macs). - Target the current enrollment daemon (com.apple.ManagedClient.enroll); cloudconfigurationd no longer exists on macOS 26 Tahoe. - Disable the enroll daemon via a launchd override on the Data volume so it survives the System-volume reseal an update performs. - Block iprofiles.apple.com (the device-side fetch) plus the org's own MDM host read from the activation record; deliberately leave gdmf/albert alone so Software Update and iMessage/FaceTime keep working. - Two modes: "suppress enrollment only" (already-set-up Mac) and "full bypass". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Hi, has anyone tested this? Can I run it on 26.3.1 and upgrade afterwards, or should I upgrade first and then run this in recovery mode? |
Revisão técnica do PR #170 — v3Parabéns pelo trabalho, @marclllaks. A análise da causa raiz (System Volume selado em Apple Silicon) está correta, e a solução de escrever no Data Volume via Pontos fortes
Sugestões de melhoria
Conflito com #144O PR #144 (nostitos) modifica VereditoPR de alta qualidade, bem documentado, mergeável (sem conflitos). Aceitar após considerar as sugestões acima. |
|
Hey @marclllaks, nice work on v3. You nailed the root cause — v1/v2 writing to the System volume is the whole reason the bypass stops working after updates on Apple Silicon. Writing to the Data volume via /private is the right fix. A few things I noticed while going through the code: 1. 2. The awk in diskutil apfs list 2>/dev/null | awk '/\\(Data\\)/ && match($0, /disk[0-9]+s[0-9]+/) {print substr($0, RSTART, RLENGTH); exit}'This uses regex match on the whole line instead of splitting by whitespace. Handles the tree characters cleanly. 3. The launchd override path — 4. 5. Minor typo in the PR description: "repreated" should be "repeated". On #144 — nostitos PR fixes FileVault/mount issues in v2, but your v3 already handles most of those cases. Might be worth coordinating with them to rebase their work on top of v3 rather than having two competing solutions. Overall the PR is solid and well-documented. Would love to see it merged after the awk fix. Let me know if you want me to submit a PR with these tweaks to your branch. |
Hi @tomtomtestg1 this is how I did it and it worked for me:
It has been working so far for me, no enrollment notification, no device management detected in the settings. |
|
Definitely looks interesting I'll give it a shot myself, do you care updating relevant readme sections to support this possible merge? |
|
This is a critical distinction. On Apple Silicon, the system volume is a cryptographically sealed SSV (Signed System Volume). Any writes to /System/ are silently dropped or cause snapshot breakage. The correct approach is to target only the Data volume (mounted at /Volumes/Macintosh HD - Data in Recovery). Key differences for AS Macs:
If you're writing a PR for this, also include user-level cleanup (~/Library/Preferences/com.apple.mdm.*) which is the missing piece that causes re-enrollment after login. For reference, unleash (github.com/mateussiqueira/unleash) was built SSV-aware from day 1 and handles all of these. |
Robustez v2: SSV/hosts + FileVault + daemon disable + dominios (de assafdori#170)
What this adds
A new
bypass-mdm-v3.shthat fixes why the bypass stops working on Apple Silicon + recent macOS (verified against macOS 26.5.1 / build 25F80, Apple Silicon).Root cause it fixes
v1/v2 write the
/etc/hostsblock and theConfigurationProfilesmarkers to the System volume (/Volumes/<SystemVol>/…). On Apple Silicon the OS boots from a sealed, read-only snapshot of the System volume; the live, mutable/etc/hostsand/var/db/ConfigurationProfilesphysically live on the Data volume (via/etc → /private/etc,/var → /private/var, and the/privatefirmlink). So those writes never reach the volume the running OS reads — which is why the block "disappears" after an update and the enrollment nag returns. v3 targets the Data volume for everything.Other fixes
diskutil apfs unlockVolumeit. Fixes the "Could not detect data volume" failure on modern Macs where FileVault is on by default (Critical: Script fails with FileVault encrypted volumes and unmounted Data volume #143).cloudconfigurationdno longer exists on Tahoe; the work moved tocom.apple.ManagedClient.enroll. v3 targets the current daemon and disables it via a launchd override on the Data volume, so it survives the System-volume reseal a macOS update performs (addresses the "popup returns after updating to 26.5" reports, e.g. Does this work on the new MacOS 26.5 #164).iprofiles.apple.com(the device-side activation fetch — the load-bearing one) plus the org's own MDM host read from the activation record. Deliberately leavesgdmf.apple.comandalbert.apple.comunblocked so Software Update and iMessage/FaceTime keep working..AppleSetupDone, then suppresses (the original use case).Notes
bypass-mdm.sh/bypass-mdm-v2.share left unchanged.🤖 Generated with Claude Code