Giter Club home page Giter Club logo

Comments (2)

kasnder avatar kasnder commented on September 27, 2024

I've now figured this out. The configuration is stored in /Library/Preferences/com.apple.networkextension.plist. This file is amended once a new app is installed. For example, the (shortended) entry for the Spotify app is:

<dict>
[...]
	<key>DenyMulticast</key>
	<true/>
	<key>IsIdentifierExternal</key>
	<false/>
	<key>MatchAccountIdentifiers</key>
	<dict>
		<key>CF$UID</key>
		<integer>0</integer>
	</dict>
	<key>MatchDomains</key>
	<dict>
		<key>CF$UID</key>
		<integer>0</integer>
	</dict>
	<key>MulticastPreferenceSet</key>
	<false/>
[...]
</dict>
<string>com.spotify.client</string>

MulticastPreferenceSet indicates whether a permission popup has been shown before. DenyMulticast saves the user's choice in response to that permission popup.

The file is manged by the nehelper daemon. We can thus

  1. unload the daemon with
launchctl unload /System/Library/LaunchDaemons/com.apple.nehelper-embedded.plist
  1. change /Library/Preferences/com.apple.networkextension.plist as we wish
  2. reload the daemon with
launchctl load /System/Library/LaunchDaemons/com.apple.nehelper-embedded.plist

There does, however, seem to exist some kind of signature that's additionally added to the file. I haven't figure out yet, how this works. Yet, I've been able to change the file regardless.

from applesimulatorutils.

kasnder avatar kasnder commented on September 27, 2024

For those who want to quickly change the setting with the command line (like me), this is a set of commands that automates granting the setting (for the app com.spotify.client):

plistutil -i com.apple.networkextension.plist -o com.apple.networkextension.xml -f xml
xmlstarlet ed -r "//string[text() = 'com.spotify.client']/preceding-sibling::*[1]/key[text() = 'MulticastPreferenceSet' or text() = 'DenyMulticast']/following-sibling::*[1]" -v true com.apple.networkextension.xml
plistutil -i com.apple.networkextension.xml -o com.apple.networkextension.plist -f bin

Update: Here's a fully working script to grant this permission (needs jailbroken device).

from applesimulatorutils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.