Initial commit
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.DS_Store
|
||||||
|
.theos
|
||||||
|
packages
|
13
Makefile
Normal file
13
Makefile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
export ARCHS = armv7 arm64 arm64e
|
||||||
|
|
||||||
|
PACKAGE_VERSION = 1.0.0
|
||||||
|
|
||||||
|
include $(THEOS)/makefiles/common.mk
|
||||||
|
|
||||||
|
TWEAK_NAME = YTCastConfirm
|
||||||
|
YTCastConfirm_FILES = Tweak.xm
|
||||||
|
|
||||||
|
include $(THEOS_MAKE_PATH)/tweak.mk
|
||||||
|
|
||||||
|
after-install::
|
||||||
|
install.exec "killall -9 SpringBoard"
|
37
Tweak.xm
Normal file
37
Tweak.xm
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
%hook MDXPlaybackRouteButtonController
|
||||||
|
|
||||||
|
-(void)didPressButton:(id)arg1 {
|
||||||
|
|
||||||
|
UIAlertController* alertController = [%c(UIAlertController) alertControllerWithTitle:@"Casting"
|
||||||
|
message:@"Are you sure you want to start casting?"
|
||||||
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
|
UIAlertAction* defaultAction = [%c(UIAlertAction) actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
||||||
|
%orig;
|
||||||
|
}];
|
||||||
|
|
||||||
|
UIAlertAction* noButton = [%c(UIAlertAction)
|
||||||
|
actionWithTitle:@"Cancel"
|
||||||
|
style:UIAlertActionStyleDefault
|
||||||
|
handler: ^(UIAlertAction * action) {
|
||||||
|
return;
|
||||||
|
}];
|
||||||
|
|
||||||
|
|
||||||
|
[alertController addAction:defaultAction];
|
||||||
|
[alertController addAction:noButton];
|
||||||
|
|
||||||
|
id rootViewController = [%c(UIApplication) sharedApplication].delegate.window.rootViewController;
|
||||||
|
if([rootViewController isKindOfClass:[%c(UINavigationController) class]]) {
|
||||||
|
rootViewController = ((UINavigationController *)rootViewController).viewControllers.firstObject;
|
||||||
|
}
|
||||||
|
if([rootViewController isKindOfClass:[%c(UITabBarController) class]]) {
|
||||||
|
rootViewController = ((UITabBarController *)rootViewController).selectedViewController;
|
||||||
|
}
|
||||||
|
if ([rootViewController presentedViewController] != nil) {
|
||||||
|
rootViewController = [rootViewController presentedViewController];
|
||||||
|
}
|
||||||
|
[rootViewController presentViewController:alertController animated:YES completion:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
%end
|
1
YTCastConfirm.plist
Normal file
1
YTCastConfirm.plist
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ Filter = { Bundles = ( "com.google.ios.youtube" ); }; }
|
Reference in New Issue
Block a user