Browse Source

Initial commit

master
Jamie Berghmans 4 years ago
commit
05926540d2
5 changed files with 63 additions and 0 deletions
  1. +3
    -0
      .gitignore
  2. +13
    -0
      Makefile
  3. +37
    -0
      Tweak.xm
  4. +1
    -0
      YTCastConfirm.plist
  5. +9
    -0
      control

+ 3
- 0
.gitignore View File

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

+ 13
- 0
Makefile 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
- 0
Tweak.xm 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
- 0
YTCastConfirm.plist View File

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

+ 9
- 0
control 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

Loading…
Cancel
Save