View uninstalld.md

A study of the 'com.apple.uninstalld.uninstall' right

From /System/Library/Security/authorization.plist:

<key>com.apple.uninstalld.uninstall</key>
<dict>
    <key>class</key>
    <string>rule</string>
View app_map.c
/* re-implementation of the behaviour that the /usr/bin/defaults application
* uses to read sandboxed preference data */
#include <CoreFoundation/CoreFoundation.h>
#define EX_BUNDLE_ID "com.apple.mail"
#define EX_KEY "JunkMailBehavior"
// undocumented, internal CFPreferences API call
extern CFDictionaryRef _CFPreferencesCopyApplicationMap(CFStringRef userName, CFStringRef hostName);
View VisualFormat.swift
operator prefix |- {}
@prefix func |- (view: NSView) -> NSView {
view.superview.addConstraint(NSLayoutConstraint(item: view, attribute: NSLayoutAttribute.Leading, relatedBy: NSLayoutRelation.Equal, toItem: view.superview, attribute: NSLayoutAttribute.Leading, multiplier: 1, constant: 20))
return view
}
operator postfix -| {}
@postfix func -| (view: NSView) -> NSView {
view.superview.addConstraint(NSLayoutConstraint(item: view.superview, attribute: NSLayoutAttribute.Trailing, relatedBy: NSLayoutRelation.Equal, toItem: view, attribute: NSLayoutAttribute.Trailing, multiplier: 1, constant: 20))
return view
View authsvc_remade.py
from ctypes import CDLL, Structure, POINTER, c_char_p, c_size_t, c_void_p, c_uint32, pointer, byref
Security = CDLL('/System/Library/Frameworks/Security.framework/Versions/Current/Security')
class OpaqueType(Structure):
pass
OpaqueTypeRef = POINTER(OpaqueType)
AuthorizationRef = OpaqueTypeRef
View hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
View hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
View getimg.py
#!/usr/bin/env python
"""
getimg.py
Gets the current image of the day from NASA and sets it as the
background. The summary / description text is written
to the image.
Requires:
PIL (apt-get install python-imaging or pip install PIL)