I have written a script to run as post install in order to enable flash in safari after installing adobe flash player 24. The script is using plistbuddy to edit the com.apple.safari.plist file in order to set the below values which are responsible to enable flash.(Tested manually and it works)
/usr/libexec/plistbuddy -c "add ManagedPlugInPolicies:com.macromedia.Flash\ Player.plugin:PlugInFirstVisitPolicy string PlugInPolicyAllowWithSecurityRestrictions" /Users/abc/Library/Preferences/com.apple.Safari.plist
/usr/libexec/plistbuddy -c "add PlugInInfo:com.macromedia.Flash\ Player.plugin:plugInCurrentState bool true" /Users/abc/Library/Preferences/com.apple.Safari.plist
After installing flash (the post install script is run). I verified opening terminal and using defaults read com.apple.Safari.plist. The values are indeed added. But when I launch safari, I see that it shows flash is disabled and need to enable it by changing in preferences. I checked again using defaults read and indeed the values are reverted back to other. The values are not what I have set. Have anyone able to successfully enable flash in safari? Kindly provide your suggestions.