I'm going to change the network's settings by my codes. I've read the sample code of MoreSCF. and I've set my user as root. and the SCPreferencesPathSetValue returns 'true'! But it doesn't modify the data file, for it doesn't modified when I check the value by "System Preferences".
some of my codes:
SCPreferencesRef gPrefsRef = SCPreferencesCreate(NULL,CFSTR("MyApp"),NULL);
SCPreferencesLock(gPrefsRef,true);
// format path; eg. "/sets/<setID>/Network/Service/<serviceID>"
CFMutableDictionary propertyList = SCPreferencesPahtGetValue(gPrefsRef,path);
// change propertyList
SCPreferencesPathSetValue(gPrefsRef,path,propertyList/*modified*/);
SCPreferencesCommitChanges(gPrefsRef);
SCPreferencesApplyChanges(gPrefsRef);
SCPreferencesUnlock(gPrefsRef);
some of my codes:
SCPreferencesRef gPrefsRef = SCPreferencesCreate(NULL,CFSTR("MyApp"),NULL);
SCPreferencesLock(gPrefsRef,true);
// format path; eg. "/sets/<setID>/Network/Service/<serviceID>"
CFMutableDictionary propertyList = SCPreferencesPahtGetValue(gPrefsRef,path);
// change propertyList
SCPreferencesPathSetValue(gPrefsRef,path,propertyList/*modified*/);
SCPreferencesCommitChanges(gPrefsRef);
SCPreferencesApplyChanges(gPrefsRef);
SCPreferencesUnlock(gPrefsRef);