Skip to content

Instantly share code, notes, and snippets.

@Danesz
Created May 14, 2020 21:50
Show Gist options
  • Save Danesz/6001a4ba9da6d560facf7520ae458965 to your computer and use it in GitHub Desktop.
Save Danesz/6001a4ba9da6d560facf7520ae458965 to your computer and use it in GitHub Desktop.
AVCaptureSession Jailbreak hook
#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