Created
March 22, 2018 11:55
-
-
Save Juszczak/1e456581a1dca952a3b8aad91872c575 to your computer and use it in GitHub Desktop.
MacOS LockScreen Util
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clang -framework Foundation lock.m -o lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <objc/runtime.h> | |
#import <Foundation/Foundation.h> | |
int main () { | |
NSBundle *bundle = [NSBundle bundleWithPath:@"/Applications/Utilities/Keychain Access.app/Contents/Resources/Keychain.menu"]; | |
Class principalClass = [bundle principalClass]; | |
id instance = [[principalClass alloc] init]; | |
[instance performSelector:@selector(_lockScreenMenuHit:) withObject:nil]; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment