From d600205c32a85c97573a9621b7af5daef8ba8100 Mon Sep 17 00:00:00 2001 From: qnblackcat Date: Thu, 19 Jan 2023 01:59:28 +0700 Subject: [PATCH] option to show FLEX --- Makefile | 9 +++++---- Settings.xm | 10 ++++++++++ uYouPlus.xm | 12 ++++++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f645e3d..7fefb65 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,4 @@ TARGET = iphone:clang:15.5:14.0 -uYouPlus_USE_FLEX = 0 uYouPlus_USE_FISHHOOK = 0 ARCHS = arm64 MODULES = jailed @@ -10,12 +9,14 @@ PACKAGE_VERSION = 18.01.6-2.3~1 TWEAK_NAME = uYouPlus DISPLAY_NAME = YouTube BUNDLE_ID = com.google.ios.youtube - + +EXTRA_CFLAGS := $(addprefix -I,$(shell find Tweaks/FLEX -name '*.h' -exec dirname {} \;)) + uYouPlus_INJECT_DYLIBS = Tweaks/uYou/Library/MobileSubstrate/DynamicLibraries/uYou.dylib .theos/obj/libcolorpicker.dylib .theos/obj/iSponsorBlock.dylib .theos/obj/YTUHD.dylib .theos/obj/YouPiP.dylib .theos/obj/YouTubeDislikesReturn.dylib .theos/obj/YTABConfig.dylib -uYouPlus_FILES = uYouPlus.xm Settings.xm +uYouPlus_FILES = uYouPlus.xm Settings.xm $(shell find Tweaks/FLEX -type f \( -iname \*.c -o -iname \*.m -o -iname \*.mm \)) uYouPlus_IPA = tmp/Payload/YouTube.app uYouPlus_FRAMEWORKS = UIKit Security -uYouPlus_CFLAGS = -fobjc-arc -DTWEAK_VERSION=$(PACKAGE_VERSION) +uYouPlus_CFLAGS = -fobjc-arc -Wno-deprecated-declarations -Wno-unsupported-availability-guard -DTWEAK_VERSION=$(PACKAGE_VERSION) $(EXTRA_CFLAGS) include $(THEOS)/makefiles/common.mk include $(THEOS_MAKE_PATH)/tweak.mk diff --git a/Settings.xm b/Settings.xm index 1b72e6d..328f281 100644 --- a/Settings.xm +++ b/Settings.xm @@ -369,6 +369,16 @@ extern NSBundle *uYouPlusBundle(); } settingItemId:0], + [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"ENABLE_FLEX") + titleDescription:LOC(@"ENABLE_FLEX_DESC") + accessibilityIdentifier:nil + switchOn:IsEnabled(@"flex_enabled") + switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) { + [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"flex_enabled"]; + return YES; + } + settingItemId:0], + [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"FIX_GOOGLE_SIGNIN") titleDescription:LOC(@"FIX_GOOGLE_SIGNIN_DESC") accessibilityIdentifier:nil diff --git a/uYouPlus.xm b/uYouPlus.xm index 2f4d515..2d153c3 100644 --- a/uYouPlus.xm +++ b/uYouPlus.xm @@ -5,6 +5,7 @@ #import #import #import "Header.h" +#import "Tweaks/FLEX/FLEX.h" #import "Tweaks/YouTubeHeader/YTVideoQualitySwitchOriginalController.h" #import "Tweaks/YouTubeHeader/YTPlayerViewController.h" #import "Tweaks/YouTubeHeader/YTWatchController.h" @@ -193,8 +194,19 @@ static BOOL didFinishLaunching; didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { didFinishLaunching = %orig; self.downloadsVC = [self.downloadsVC init]; + + if (IsEnabled(@"flex_enabled")) { + [[FLEXManager sharedManager] showExplorer]; + } + return didFinishLaunching; } +- (void)appWillResignActive:(id)arg1 { + %orig; + if (IsEnabled(@"flex_enabled")) { + [[FLEXManager sharedManager] showExplorer]; + } +} %end %hook DownloadsPagerVC