-
-
Save Mabdelwanis/c80f46098d1ff3bf63a32dcbbf2e3008 to your computer and use it in GitHub Desktop.
AVCaptureSession Jailbreak hook
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 <UIKit/UIKit.h> | |
%hook SpringBoard | |
-(void) applicationDidFinishLaunching:(id)arg { | |
%orig(arg); | |
UIAlertView *lookWhatWorks = [[UIAlertView alloc] initWithTitle:@"PrivacyGuard Tweak" | |
message:@"Your privacy guard is running 😎" | |
delegate:self | |
cancelButtonTitle:@"OK" | |
otherButtonTitles:nil]; | |
[lookWhatWorks show]; | |
} | |
%end | |
%hook AVCaptureSession | |
// Hooking an instance method with no arguments. | |
-(void) startRunning { | |
NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"]; | |
NSLog(@"PrivacyGuard startRunning: %@", appName); | |
UIView *statusBar = [[UIApplication sharedApplication] valueForKey:@"statusBar"]; | |
statusBar.backgroundColor = [UIColor greenColor]; | |
%orig; | |
} | |
-(void) stopRunning { | |
NSLog(@"PrivacyGuard stopRunning"); | |
UIView *statusBar = [[UIApplication sharedApplication] valueForKey:@"statusBar"]; | |
statusBar.backgroundColor = [UIColor clearColor]; // or we could save and restore the original one | |
%orig; | |
} | |
// Always make sure you clean up after yourself; Not doing so could have grave consequences! | |
%end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment