Skip to content

Instantly share code, notes, and snippets.

Created March 10, 2023 12:11
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Grant the local network permission to an iOS app. More permissions here:
# Todo: This currently fails to update the file signature. It still seems to work but should not be used on a production device.
# Usage:./ [bundleId]
# Example: ./ com.spotify.client
if [ -z "$1" ]; then
echo "Please pass bundleId"
exit -1
# Create backup (-n makes sure to not overwrite existing backup)
ssh -T -p 2222 root@localhost "cp -n /Library/Preferences/ ~/"
# Download binary plist file
scp -P 2222 root@localhost:/Library/Preferences/ ./
# Cleanup if exists
rm ./ || true
rm ./ || true
# Convert binary to XML plist
plistutil -i -o -f xml
# Grant permission
xmlstarlet ed -r "//string[text() = '$1']/preceding-sibling::*[1]/key[text() = 'MulticastPreferenceSet' or text() = 'DenyMulticast']/following-sibling::*[1]" -v true
# Convert plist back to binary
plistutil -i -o -f bin
echo "Created new network configuration at ./"
echo "Now copy this file to your device"
# Stop nehelper service
#ssh -T -p 2222 root@localhost "launchctl unload /System/Library/LaunchDaemons/"
#sleep 1
# Copy over new plist file
#scp -P 2222 ./ /Library/Preferences/
# Restart nehelper service
#ssh -T -p 2222 root@localhost "launchctl load /System/Library/LaunchDaemons/"
# Cleanup
#rm ./ || true
#rm ./ || true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment