Skip to content

Instantly share code, notes, and snippets.

@matasarei
Last active August 30, 2018 14:58
Show Gist options
  • Select an option

  • Save matasarei/778887a6e3d300eb52726e2fd83ffad4 to your computer and use it in GitHub Desktop.

Select an option

Save matasarei/778887a6e3d300eb52726e2fd83ffad4 to your computer and use it in GitHub Desktop.
HOWTO: Replace protected codesign file [MACOS]

HOWTO: replace protected codesign file (or any other system file)

  1. Reboot in recovery mode (poweroff, hold Command + R and powerup)

  2. Open terminal

  3. Mount disk in write mode

mount -uw /
  1. Change current directory to your system root
cd /Volumes/<Your System HD Name>/
  1. Copy original file
cp ./usr/bin/codesign .
  1. Replace file with empty one:
echo "" > ./usr/bin/codesign
  1. Place new content using vim:
vim ./usr/bin/codesign

content:

#!/bin/sh
echo "$@" >> /tmp/codesign.log
exit 0;
  1. Reboot and do what you need to do ;)

How to roll back??

Repeat steps 1-4.

  1. mv ./codesign ./usr/bin/codesign

  2. Reboot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment