From 9a02c79e55c8de8fbf4f8ccb59e3d3e16023d35c Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 24 Oct 2014 02:50:10 -0700 Subject: [PATCH] Only remove entry if it was actually there before. --- postrm.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/postrm.mm b/postrm.mm index d3b1332..1e1ea7c 100644 --- a/postrm.mm +++ b/postrm.mm @@ -32,12 +32,13 @@ int main(int argc, const char *argv[]) { NSString *path(@"/System/Library/Lockdown/Services.plist"); NSMutableDictionary *services([NSMutableDictionary dictionaryWithContentsOfFile:path]); - [services removeObjectForKey:@"com.apple.afc2"]; + if (services != nil && [services objectForKey:@"com.apple.afc2"] != nil) { + [services removeObjectForKey:@"com.apple.afc2"]; + [services writeToFile:path atomically:YES]; + } - [services writeToFile:path atomically:YES]; system("/bin/launchctl stop com.apple.mobile.lockdown"); [pool release]; - return 0; } -- 2.47.2