Initial commit

This commit is contained in:
Jamie Berghmans
2019-12-29 00:15:35 +01:00
commit 05926540d2
5 changed files with 63 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.DS_Store
.theos
packages

13
Makefile Normal file
View 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
View 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
View File

@ -0,0 +1 @@
{ Filter = { Bundles = ( "com.google.ios.youtube" ); }; }

9
control Normal file
View File

@ -0,0 +1,9 @@
Package: com.devvix.ytcastconfirm
Name: YTCastConfirm
Depends: mobilesubstrate
Version: 1.0.0
Architecture: iphoneos-arm
Description: An awesome MobileSubstrate tweak!
Maintainer: Devvix
Author: Devvix
Section: Tweaks