From 1a8363c56632e4d0c1071ca53af37729c2204c6e Mon Sep 17 00:00:00 2001 From: level3tjg Date: Thu, 9 Mar 2023 11:06:36 -0500 Subject: [PATCH] Rewrite Makefile --- .github/workflows/buildapp.yml | 11 +--- .gitmodules | 17 ++++--- Bundles/RYD.bundle | 1 + Bundles/YTABC.bundle | 1 + Bundles/YTUHD.bundle | 1 + Bundles/YouPiP.bundle | 1 + Bundles/iSponsorBlock.bundle | 1 + Bundles/uYouBundle.bundle | 1 + Bundles/uYouPlus.bundle | 1 + Makefile | 92 ++++++++++++++++++++++++---------- Tweaks/Alderis | 2 +- Tweaks/FLEX | 1 - Tweaks/FLEXing | 1 + Tweaks/RemoteLog | 1 + buildapp.sh | 61 +++------------------- control | 8 +++ uYouPlus.plist | 1 + uYouPlus.xm | 7 ++- 18 files changed, 105 insertions(+), 104 deletions(-) create mode 120000 Bundles/RYD.bundle create mode 120000 Bundles/YTABC.bundle create mode 120000 Bundles/YTUHD.bundle create mode 120000 Bundles/YouPiP.bundle create mode 120000 Bundles/iSponsorBlock.bundle create mode 120000 Bundles/uYouBundle.bundle create mode 120000 Bundles/uYouPlus.bundle delete mode 160000 Tweaks/FLEX create mode 160000 Tweaks/FLEXing create mode 160000 Tweaks/RemoteLog create mode 100644 control create mode 100644 uYouPlus.plist diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index a0227a314d..28982e70fe 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -100,19 +100,12 @@ jobs: env: THEOS: ${{ github.workspace }}/theos - - name: Download uYou & Prepare YouTube iPA + - name: Download YouTube iPA run: | - curl "https://raw.githubusercontent.com/Muirey03/RemoteLog/master/RemoteLog.h" --output "$THEOS/include/RemoteLog.h" - curl "https://miro92.com/repo/debs/com.miro.uyou_${{ env.UYOU_VERSION }}_iphoneos-arm.deb" --output "main/Tweaks/uYou/com.miro.uyou_${{ env.UYOU_VERSION }}_iphoneos-arm.deb" && echo -e "==> \033[1muYou v${{ inputs.uyou_version }} downloaded! \033[0m" wget "$YOUTUBE_URL" --no-verbose -O main/YouTube.ipa && echo -e "==> \033[1mYouTube v${{ inputs.youtube_version }} downloaded! \033[0m" - dpkg-deb -x "main/Tweaks/uYou/com.miro.uyou_${{ env.UYOU_VERSION }}_iphoneos-arm.deb" main/Tweaks/uYou/ - unzip -q main/YouTube.ipa -d main/tmp - rm -rf main/tmp/Payload/YouTube.app/PlugIns/* - cp -R main/Extensions/*.appex main/tmp/Payload/YouTube.app/PlugIns env: THEOS: ${{ github.workspace }}/theos - UYOU_VERSION: ${{ inputs.uyou_version }} YOUTUBE_VERSION: ${{ inputs.youtube_version }} YOUTUBE_URL: ${{ inputs.decrypted_youtube_url }} @@ -122,7 +115,7 @@ jobs: cd ${{ github.workspace }}/main sed -i '' "12s#.*#BUNDLE_ID = ${{ env.BUNDLE_ID }}#g" Makefile sed -i '' "11s#.*#DISPLAY_NAME = ${{ env.APP_NAME }}#g" Makefile - make package FINALPACKAGE=1 + make package IPA=YouTube.ipa FINALPACKAGE=1 (mv "packages/$(ls -t packages | head -n1)" "packages/uYouPlus_${{ env.YOUTUBE_VERSION }}_${{ env.UYOU_VERSION }}.ipa") echo "package=$(ls -t packages | head -n1)" >>$GITHUB_OUTPUT echo -e "==> \033[1mSHASUM256: $(shasum -a 256 packages/*.ipa | cut -f1 -d' ')\033[0m" diff --git a/.gitmodules b/.gitmodules index b3a1c253bf..1488c18ae3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -18,10 +18,6 @@ path = Tweaks/YouTubeHeader url = https://github.com/PoomSmart/YouTubeHeader.git branch = main -[submodule "Tweaks/Alderis"] - path = Tweaks/Alderis - url = https://github.com/qnblackcat/Alderis.git - branch = master [submodule "Tweaks/PSHeader"] path = Tweaks/PSHeader url = https://github.com/PoomSmart/PSHeader.git @@ -34,7 +30,12 @@ path = Tweaks/YTABConfig url = https://github.com/PoomSmart/YTABConfig.git branch = main -[submodule "Tweaks/FLEX"] - path = Tweaks/FLEX - url = https://github.com/qnblackcat/FLEX-Classes.git - branch = main +[submodule "Tweaks/FLEXing"] + path = Tweaks/FLEXing + url = https://github.com/NSExceptional/FLEXing +[submodule "Tweaks/Alderis"] + path = Tweaks/Alderis + url = https://github.com/hbang/Alderis.git +[submodule "Tweaks/RemoteLog"] + path = Tweaks/RemoteLog + url = https://github.com/Muirey03/RemoteLog diff --git a/Bundles/RYD.bundle b/Bundles/RYD.bundle new file mode 120000 index 0000000000..6a689a68d0 --- /dev/null +++ b/Bundles/RYD.bundle @@ -0,0 +1 @@ +../Tweaks/Return-YouTube-Dislikes/layout/Library/Application Support/RYD.bundle \ No newline at end of file diff --git a/Bundles/YTABC.bundle b/Bundles/YTABC.bundle new file mode 120000 index 0000000000..8739918101 --- /dev/null +++ b/Bundles/YTABC.bundle @@ -0,0 +1 @@ +../Tweaks/YTABConfig/layout/Library/Application Support/YTABC.bundle \ No newline at end of file diff --git a/Bundles/YTUHD.bundle b/Bundles/YTUHD.bundle new file mode 120000 index 0000000000..310f16067f --- /dev/null +++ b/Bundles/YTUHD.bundle @@ -0,0 +1 @@ +../Tweaks/YTUHD/layout/Library/Application Support/YTUHD.bundle \ No newline at end of file diff --git a/Bundles/YouPiP.bundle b/Bundles/YouPiP.bundle new file mode 120000 index 0000000000..c6bc8ab569 --- /dev/null +++ b/Bundles/YouPiP.bundle @@ -0,0 +1 @@ +../Tweaks/YouPiP/layout/Library/Application Support/YouPiP.bundle \ No newline at end of file diff --git a/Bundles/iSponsorBlock.bundle b/Bundles/iSponsorBlock.bundle new file mode 120000 index 0000000000..6629038368 --- /dev/null +++ b/Bundles/iSponsorBlock.bundle @@ -0,0 +1 @@ +../Tweaks/iSponsorBlock/layout/Library/Application Support/iSponsorBlock.bundle \ No newline at end of file diff --git a/Bundles/uYouBundle.bundle b/Bundles/uYouBundle.bundle new file mode 120000 index 0000000000..e782a143f5 --- /dev/null +++ b/Bundles/uYouBundle.bundle @@ -0,0 +1 @@ +../Tweaks/uYou/Library/Application Support/uYouBundle.bundle \ No newline at end of file diff --git a/Bundles/uYouPlus.bundle b/Bundles/uYouPlus.bundle new file mode 120000 index 0000000000..be7b05d7fe --- /dev/null +++ b/Bundles/uYouPlus.bundle @@ -0,0 +1 @@ +../lang/uYouPlus.bundle \ No newline at end of file diff --git a/Makefile b/Makefile index 2cad8666bc..18264f9416 100644 --- a/Makefile +++ b/Makefile @@ -1,38 +1,76 @@ -TARGET = iphone:clang:15.5:14.0 -uYouPlus_USE_FISHHOOK = 0 -ARCHS = arm64 -MODULES = jailed -FINALPACKAGE = 1 -CODESIGN_IPA = 0 -PACKAGE_VERSION = 18.08.1-2.3~1 +export TARGET = iphone:clang:15.5:14.0 +export ARCHS = arm64 + +export libcolorpicker_ARCHS = arm64 +export libFLEX_ARCHS = arm64 +export Alderis_XCODEOPTS = LD_DYLIB_INSTALL_NAME=@rpath/Alderis.framework/Alderis +export libcolorpicker_LDFLAGS = -F$(TARGET_PRIVATE_FRAMEWORK_PATH) -install_name @rpath/libcolorpicker.dylib +export ADDITIONAL_CFLAGS = -I$(THEOS_PROJECT_DIR)/Tweaks/RemoteLog +ifndef YOUTUBE_VERSION +YOUTUBE_VERSION = 18.08.1 +endif +ifndef UYOU_VERSION +UYOU_VERSION = 2.3~1 +endif +PACKAGE_VERSION = $(YOUTUBE_VERSION)_$(UYOU_VERSION) + +INSTALL_TARGET_PROCESSES = YouTube TWEAK_NAME = uYouPlus DISPLAY_NAME = YouTube BUNDLE_ID = com.google.ios.youtube -EXTRA_CFLAGS := $(addprefix -I,$(shell find Tweaks/FLEX -name '*.h' -exec dirname {} \;)) +$(TWEAK_NAME)_FILES = uYouPlus.xm Settings.xm +$(TWEAK_NAME)_FRAMEWORKS = UIKit Security +$(TWEAK_NAME)_CFLAGS = -fobjc-arc -DTWEAK_VERSION=\"$(PACKAGE_VERSION)\" +$(TWEAK_NAME)_INJECT_DYLIBS = Tweaks/uYou/Library/MobileSubstrate/DynamicLibraries/uYou.dylib $(THEOS_OBJ_DIR)/libFLEX.dylib $(THEOS_OBJ_DIR)/iSponsorBlock.dylib $(THEOS_OBJ_DIR)/YouPiP.dylib $(THEOS_OBJ_DIR)/YouTubeDislikesReturn.dylib $(THEOS_OBJ_DIR)/YTABConfig.dylib $(THEOS_OBJ_DIR)/YTUHD.dylib +$(TWEAK_NAME)_EMBED_LIBRARIES = $(THEOS_OBJ_DIR)/libcolorpicker.dylib +$(TWEAK_NAME)_EMBED_FRAMEWORKS = $(_THEOS_LOCAL_DATA_DIR)/$(THEOS_OBJ_DIR_NAME)/install/Library/Frameworks/Alderis.framework +$(TWEAK_NAME)_EMBED_BUNDLES = $(wildcard Bundles/*.bundle) +$(TWEAK_NAME)_EMBED_EXTENSIONS = $(wildcard Extensions/*.appex) -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 $(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 -Wno-deprecated-declarations -Wno-unsupported-availability-guard -Wno-unused-but-set-variable -DTWEAK_VERSION=$(PACKAGE_VERSION) $(EXTRA_CFLAGS) +ifneq ($(JAILBROKEN),1) +arm64_LDFLAGS = -F$(_THEOS_LOCAL_DATA_DIR)/$(THEOS_OBJ_DIR_NAME)/install/Library/Frameworks +MODULES = jailed +endif include $(THEOS)/makefiles/common.mk -include $(THEOS_MAKE_PATH)/tweak.mk -SUBPROJECTS += Tweaks/Alderis Tweaks/iSponsorBlock Tweaks/YTUHD Tweaks/YouPiP Tweaks/Return-YouTube-Dislikes Tweaks/YTABConfig +ifneq ($(JAILBROKEN),1) +SUBPROJECTS += Tweaks/Alderis Tweaks/FLEXing/libflex Tweaks/iSponsorBlock Tweaks/Return-YouTube-Dislikes Tweaks/YouPiP Tweaks/YTABConfig Tweaks/YTUHD include $(THEOS_MAKE_PATH)/aggregate.mk +endif +include $(THEOS_MAKE_PATH)/tweak.mk + +REMOVE_EXTENSIONS = 1 +CODESIGN_IPA = 0 + +UYOU_PATH = Tweaks/uYou +UYOU_DEB = $(UYOU_PATH)/com.miro.uyou_$(UYOU_VERSION)_iphoneos-arm.deb +UYOU_DYLIB = $(UYOU_PATH)/Library/MobileSubstrate/DynamicLibraries/uYou.dylib +UYOU_BUNDLE = $(UYOU_PATH)/Library/Application\ Support/uYouBundle.bundle + +internal-clean:: + @rm -rf $(UYOU_PATH)/* +ifneq ($(JAILBROKEN),1) +before-all:: + @if [[ ! -f $(UYOU_DEB) ]]; then \ + rm -rf $(UYOU_PATH)/*; \ + $(PRINT_FORMAT_BLUE) "Downloading uYou"; \ + fi +before-all:: + @if [[ ! -f $(UYOU_DEB) ]]; then \ + if [[ $$(("$$(curl https://miro92.com/repo/debs/com.miro.uyou_$(UYOU_VERSION)_iphoneos-arm.deb -sw "%{http_code}" -o $(UYOU_DEB))")) -ne 200 ]]; then \ + $(PRINT_FORMAT_ERROR) "Failed to download uYou"; exit 1; \ + fi; \ + fi; \ + if [[ ! -f $(UYOU_DYLIB) || ! -d $(UYOU_BUNDLE) ]]; then \ + tar -xf Tweaks/uYou/com.miro.uyou_$(UYOU_VERSION)_iphoneos-arm.deb -C Tweaks/uYou; tar -xf Tweaks/uYou/data.tar* -C Tweaks/uYou; \ + if [[ ! -f $(UYOU_DYLIB) || ! -d $(UYOU_BUNDLE) ]]; then \ + $(PRINT_FORMAT_ERROR) "Failed to extract uYou"; exit 1; \ + fi; \ + fi; +else before-package:: - @echo -e "==> \033[1mMoving tweak's bundle to Resources/...\033[0m" - @mkdir -p Resources/Frameworks/Alderis.framework && find .theos/obj/install/Library/Frameworks/Alderis.framework -maxdepth 1 -type f -exec cp {} Resources/Frameworks/Alderis.framework/ \; - @cp -R Tweaks/YouPiP/layout/Library/Application\ Support/YouPiP.bundle Resources/ - @cp -R Tweaks/YTUHD/layout/Library/Application\ Support/YTUHD.bundle Resources/ - @cp -R Tweaks/Return-YouTube-Dislikes/layout/Library/Application\ Support/RYD.bundle Resources/ - @cp -R Tweaks/YTABConfig/layout/Library/Application\ Support/YTABC.bundle Resources/ - @cp -R Tweaks/iSponsorBlock/layout/Library/Application\ Support/iSponsorBlock.bundle Resources/ - @cp -R Tweaks/uYou/Library/Application\ Support/uYouBundle.bundle Resources/ - @cp -R lang/uYouPlus.bundle Resources/ - @echo -e "==> \033[1mChanging the installation path of dylibs...\033[0m" - @ldid -r .theos/obj/iSponsorBlock.dylib && install_name_tool -change /usr/lib/libcolorpicker.dylib @rpath/libcolorpicker.dylib .theos/obj/iSponsorBlock.dylib - @codesign --remove-signature .theos/obj/libcolorpicker.dylib && install_name_tool -change /Library/Frameworks/Alderis.framework/Alderis @rpath/Alderis.framework/Alderis .theos/obj/libcolorpicker.dylib + @mkdir -p $(THEOS_STAGING_DIR)/Library/Application\ Support; cp -r lang/uYouPlus.bundle $(THEOS_STAGING_DIR)/Library/Application\ Support/ +endif diff --git a/Tweaks/Alderis b/Tweaks/Alderis index 7992b3b57e..a8764bd86b 160000 --- a/Tweaks/Alderis +++ b/Tweaks/Alderis @@ -1 +1 @@ -Subproject commit 7992b3b57e86beca069905df121dc57542ae5b6f +Subproject commit a8764bd86b357caa918165e4d9d03a2776e2195f diff --git a/Tweaks/FLEX b/Tweaks/FLEX deleted file mode 160000 index 20830170bf..0000000000 --- a/Tweaks/FLEX +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 20830170bfe50659de36eace461fd95ebdb16cba diff --git a/Tweaks/FLEXing b/Tweaks/FLEXing new file mode 160000 index 0000000000..f42fdd049a --- /dev/null +++ b/Tweaks/FLEXing @@ -0,0 +1 @@ +Subproject commit f42fdd049a2c4cf3be990c771a5824211a10c5bc diff --git a/Tweaks/RemoteLog b/Tweaks/RemoteLog new file mode 160000 index 0000000000..beee6c7312 --- /dev/null +++ b/Tweaks/RemoteLog @@ -0,0 +1 @@ +Subproject commit beee6c731223abdd9b9d7a69d5df79e5b51b6a53 diff --git a/buildapp.sh b/buildapp.sh index a97e7ffc95..2067e16bb2 100755 --- a/buildapp.sh +++ b/buildapp.sh @@ -1,55 +1,8 @@ -#!/bin/bash -# Thanks Al4ise for his support - -cd "$(dirname "$0")" - -# Check uYou -if [ ! -f Tweaks/uYou/com.miro.uyou_2.3~1_iphoneos-arm.deb ] -then - echo -e "==> \033[1muYou v2.3~1 is not found. Downloading uYou (v2.3~1)...\033[0m" - (set -x ; curl https://miro92.com/repo/debs/com.miro.uyou_2.3~1_iphoneos-arm.deb --output Tweaks/uYou/com.miro.uyou_2.3~1_iphoneos-arm.deb) +read -p $'\e[34m==> \e[1;39mPath to the decrypted YouTube.ipa or YouTube.app: ' PATHTOYT +make package IPA=$PATHTOYT FINALPACKAGE=1 +if [[ $? -eq 0 ]]; then + open packages + echo "\033[0;32m==> \033[1;39mSHASUM256: $(shasum -a 256 packages/*.ipa)" else - echo -e "==> \033[1mFounded uYou (v2.3~1)!\033[0m" -fi - -# Extract uYou - echo -e "==> \033[1mExtracting uYou...\033[0m" -if (cd Tweaks/uYou && tar -xf com.miro.uyou_2.3~1_iphoneos-arm.deb && tar -xf data.tar.*) -then - echo -e "\033[1m> Extracted uYou!\033[0m" -else - echo "> \033[1mCouldn't extract uYou\033[0m" -fi - -# Makefile -if [ -d tmp ] -then - rm -rf tmp -fi - read -e -p "==> Path to the decrypted YouTube.ipa or YouTube.app: " PATHTOYT -if [[ $PATHTOYT == *.ipa ]] -then - unzip -q "$PATHTOYT" -d tmp - rm -rf tmp/Payload/YouTube.app/_CodeSignature/CodeResources - rm -rf tmp/Payload/YouTube.app/PlugIns/*.appex - cp -R Extensions/*.appex tmp/Payload/YouTube.app/PlugIns - make package FINALPACKAGE=1 - open packages - -elif [[ $PATHTOYT == *.app ]] -then - mkdir -p tmp/Payload/ - cp -R "$PATHTOYT" tmp/Payload 2>/dev/null - rm -rf tmp/Payload/YouTube.app/_CodeSignature/CodeResources - rm -rf tmp/Payload/YouTube.app/PlugIns/*.appex - cp -R Extensions/*.appex tmp/Payload/YouTube.app/PlugIns - make package FINALPACKAGE=1 - open packages -else - echo "This is not an ipa/app!" -fi -# Clean up - tput setaf 1 && echo -e "==> \033[1mCleaning up...\033[0m" - find Tweaks/uYou -mindepth 1 ! -name "com.miro.uyou_2.3~1_iphoneos-arm.deb" ! -name ".gitkeep" -exec rm -rf {} \; 2>/dev/null - rm -rf tmp/ Resources .theos/_/Payload - echo -e "==> \033[1mSHASUM256: $(shasum -a 256 packages/*.ipa)\033[0m" \ No newline at end of file + echo "\033[0;31m==> \033[1;39mFailed building uYouPlus" +fi \ No newline at end of file diff --git a/control b/control new file mode 100644 index 0000000000..9ec3c8a55c --- /dev/null +++ b/control @@ -0,0 +1,8 @@ +Package: com.qnblackcat.uyouplus +Name: uYouPlus +Architecture: iphoneos-arm +Description: Modified version of uYou +Maintainer: qnblackcat +Author: qnblackcat +Section: Tweaks +Depends: mobilesubstrate (>= 0.9.5000), com.galacticdev.isponsorblock, com.miro.uyou, com.ps.youpip, com.ps.ytabconfig, com.ps.ytuhd, libflex, weeb.lillie.youtubedislikesreturn diff --git a/uYouPlus.plist b/uYouPlus.plist new file mode 100644 index 0000000000..fb2904eced --- /dev/null +++ b/uYouPlus.plist @@ -0,0 +1 @@ +{ Filter = { Bundles = ( "com.google.ios.youtube" ); }; } diff --git a/uYouPlus.xm b/uYouPlus.xm index d12135c15e..c3b76cb386 100644 --- a/uYouPlus.xm +++ b/uYouPlus.xm @@ -5,7 +5,6 @@ #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" @@ -199,15 +198,15 @@ static BOOL didFinishLaunching; self.downloadsVC = [self.downloadsVC init]; if (IsEnabled(@"flex_enabled")) { - [[FLEXManager sharedManager] showExplorer]; + [[%c(FLEXManager) performSelector:@selector(sharedManager)] performSelector:@selector(showExplorer)]; } return didFinishLaunching; } - (void)appWillResignActive:(id)arg1 { %orig; - if (IsEnabled(@"flex_enabled")) { - [[FLEXManager sharedManager] showExplorer]; + if (IsEnabled(@"flex_enabled")) { + [[%c(FLEXManager) performSelector:@selector(sharedManager)] performSelector:@selector(showExplorer)]; } } %end