浏览代码

Initial commit

master
Jamie Berghmans 4 年前
当前提交
05926540d2
共有 5 个文件被更改,包括 63 次插入0 次删除
  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 查看文件

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

+ 13
- 0
Makefile 查看文件

@@ -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 查看文件

@@ -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 查看文件

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

+ 9
- 0
control 查看文件

@@ -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

正在加载...
取消
保存