I don't have my jailbroken phone with me, so I can't test this, but if you look at the Preferences docs on iphonedevwiki, you'll see that there is a flag that will gray out preference items (enabled
). So, you might use a chunk of code in your preferences plist file like this:
<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<true/>
<key>defaults</key>
<string>com.mycompany.myapp</string>
<key>key</key>
<string>wifi_location</string>
<key>label</key>
<string>WiFi Location</string>
<key>enabled</key>
<false/> <!-- gray out this item -->
</dict>
If you look at the preference loader docs, you see that you also can inject code into Preferences.app, which would probably allow you to set this flag dynamically (probably needed if you're tweaking an app that's not yours).
I'll try to test this later, and hopefully, update this answer.