Created
May 14, 2020 21:50
-
-
Save Danesz/6001a4ba9da6d560facf7520ae458965 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