Skip to content

Instantly share code, notes, and snippets.

@Mabdelwanis
Forked from Danesz/Tweak.x
Created November 30, 2023 22:07
Show Gist options
  • Save Mabdelwanis/c80f46098d1ff3bf63a32dcbbf2e3008 to your computer and use it in GitHub Desktop.
Save Mabdelwanis/c80f46098d1ff3bf63a32dcbbf2e3008 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