From a70a4c5e0b31ab88fa375a8dd549adf083bc1214 Mon Sep 17 00:00:00 2001 From: Bryce Hackel <34104885+bhackel@users.noreply.github.com> Date: Sat, 27 Jul 2024 16:11:46 -0700 Subject: [PATCH] Copy from uYouEnhanced --- .github/workflows/buildapp.yml | 19 ++++++----- Makefile | 58 +++++++++++++++++++--------------- 2 files changed, 42 insertions(+), 35 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index 2c9c164..8ba8d41 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -120,17 +120,16 @@ jobs: run: | # Download and unzip iPA wget "$YOUTUBE_URL" --no-verbose -O main/YouTube.ipa - unzip -q main/YouTube.ipa -d main/tmp + cd ${{ github.workspace }}/main + mv YouTube.ipa YouTube.zip + unzip -q YouTube.zip # Get the version number of the YouTube app and store it - echo "YT_VERSION=$(grep -A 1 'CFBundleVersion' main/tmp/Payload/YouTube.app/Info.plist | grep '' | awk -F'[><]' '{print $3}')" >> $GITHUB_ENV - # Get the version number of the latest release - wget -qO- https://github.com/dayanch96/YTLite/releases/latest > main/tmp/release_page.html - YTLITE_VERSION=$(grep -o -E '/tag/v[^"]+' main/tmp/release_page.html | head -n 1 | sed 's/\/tag\/v//') + echo "YT_VERSION=$(defaults read "$(pwd)/Payload/YouTube.app/Info" CFBundleVersion)" >> $GITHUB_ENV + # Get the version number of the latest release of YTLite + wget -qO- https://github.com/dayanch96/YTLite/releases/latest > release_page.html + YTLITE_VERSION=$(grep -o -E '/tag/v[^"]+' release_page.html | head -n 1 | sed 's/\/tag\/v//') echo "YTLITE_VERSION=${YTLITE_VERSION}" >> $GITHUB_ENV echo $YTLITE_VERSION - # Remove contents in the iPA that interfere with sideloading - rm -rf main/tmp/Payload/YouTube.app/_CodeSignature/CodeResources - rm -rf main/tmp/Payload/YouTube.app/PlugIns/* # Modify Info.plist to remove UISupportedDevices (Python script) python - < +export ADDITIONAL_CFLAGS = -I$(THEOS_PROJECT_DIR)/Tweaks/RemoteLog -I$(THEOS_PROJECT_DIR)/Tweaks + +# Todo figure out what this does +ifneq ($(JAILBROKEN),1) +export DEBUGFLAG = -ggdb -Wno-unused-command-line-argument -L$(THEOS_OBJ_DIR) -F$(_THEOS_LOCAL_DATA_DIR)/$(THEOS_OBJ_DIR_NAME)/install/Library/Frameworks MODULES = jailed -FINALPACKAGE = 1 -CODESIGN_IPA = 0 +endif + PACKAGE_VERSION = X.X.X-X.X +INSTALL_TARGET_PROCESSES = YouTube TWEAK_NAME = YTLitePlus DISPLAY_NAME = YouTube BUNDLE_ID = com.google.ios.youtube @@ -21,36 +34,30 @@ YTLITE_BUNDLE = $(YTLITE_PATH)/var/jb/Library/Application\ Support/YTLite.bundle # Todo figure out the purpose of this EXTRA_CFLAGS := $(addprefix -I,$(shell find Tweaks/FLEX -name '*.h' -exec dirname {} \;)) -I$(THEOS_PROJECT_DIR)/Tweaks -# Allow YouTubeHeader to be accessible using #include <...> -export ADDITIONAL_CFLAGS = -I$(THEOS_PROJECT_DIR)/Tweaks - -$(TWEAK_NAME)_INJECT_DYLIBS = $(YTLITE_DYLIB) $(THEOS_OBJ_DIR)/libcolorpicker.dylib $(THEOS_OBJ_DIR)/iSponsorBlock.dylib $(THEOS_OBJ_DIR)/YTUHD.dylib $(THEOS_OBJ_DIR)/YouPiP.dylib $(THEOS_OBJ_DIR)/YouTubeDislikesReturn.dylib $(THEOS_OBJ_DIR)/YTABConfig.dylib $(THEOS_OBJ_DIR)/YouMute.dylib $(THEOS_OBJ_DIR)/DontEatMyContent.dylib $(THEOS_OBJ_DIR)/YTHoldForSpeed.dylib $(THEOS_OBJ_DIR)/YTVideoOverlay.dylib $(THEOS_OBJ_DIR)/YouGroupSettings.dylib $(THEOS_OBJ_DIR)/YouQuality.dylib -$(TWEAK_NAME)_FILES = YTLitePlus.xm $(shell find Source -name '*.xm' -o -name '*.x' -o -name '*.m') $(shell find Tweaks/FLEX -type f \( -iname \*.c -o -iname \*.m -o -iname \*.mm \)) -$(TWEAK_NAME)_IPA = ./tmp/Payload/YouTube.app +$(TWEAK_NAME)_FILES = YTLitePlus.xm $(wildcard Sources/*.xm) $(wildcard Sources/*.x) $(wildcard Sources/*.m) $(shell find Tweaks/FLEX -type f \( -iname \*.c -o -iname \*.m -o -iname \*.mm \)) +$(TWEAK_NAME)_FRAMEWORKS = UIKit Foundation AVFoundation AVKit Photos Accelerate CoreMotion GameController VideoToolbox Security +$(TWEAK_NAME)_LIBRARIES = bz2 c++ iconv z $(TWEAK_NAME)_CFLAGS = -fobjc-arc -Wno-deprecated-declarations -Wno-unsupported-availability-guard -Wno-unused-but-set-variable -DTWEAK_VERSION=$(PACKAGE_VERSION) $(EXTRA_CFLAGS) -$(TWEAK_NAME)_FRAMEWORKS = UIKit Security +$(TWEAK_NAME)_INJECT_DYLIBS = $(YTLITE_DYLIB) $(THEOS_OBJ_DIR)/libcolorpicker.dylib $(THEOS_OBJ_DIR)/iSponsorBlock.dylib $(THEOS_OBJ_DIR)/YTUHD.dylib $(THEOS_OBJ_DIR)/YouPiP.dylib $(THEOS_OBJ_DIR)/YouTubeDislikesReturn.dylib $(THEOS_OBJ_DIR)/YTABConfig.dylib $(THEOS_OBJ_DIR)/YouMute.dylib $(THEOS_OBJ_DIR)/DontEatMyContent.dylib $(THEOS_OBJ_DIR)/YTHoldForSpeed.dylib $(THEOS_OBJ_DIR)/YTVideoOverlay.dylib $(THEOS_OBJ_DIR)/YouGroupSettings.dylib $(THEOS_OBJ_DIR)/YouQuality.dylib +$(TWEAK_NAME)_EMBED_LIBRARIES = $(THEOS_OBJ_DIR)/libcolorpicker.dylib +$(TWEAK_NAME)_EMBED_FRAMEWORKS = $(_THEOS_LOCAL_DATA_DIR)/$(THEOS_OBJ_DIR_NAME)/install_Alderis.xcarchive/Products/var/jb/Library/Frameworks/Alderis.framework +$(TWEAK_NAME)_EMBED_BUNDLES = $(wildcard Bundles/*.bundle) +$(TWEAK_NAME)_EMBED_EXTENSIONS = $(wildcard Extensions/*.appex) include $(THEOS)/makefiles/common.mk -include $(THEOS_MAKE_PATH)/tweak.mk +ifneq ($(JAILBROKEN),1) SUBPROJECTS += Tweaks/Alderis Tweaks/iSponsorBlock Tweaks/YTUHD Tweaks/YouPiP Tweaks/Return-YouTube-Dislikes Tweaks/YTABConfig Tweaks/YouMute Tweaks/DontEatMyContent Tweaks/YTHoldForSpeed Tweaks/YTVideoOverlay Tweaks/YouQuality Tweaks/YouGroupSettings include $(THEOS_MAKE_PATH)/aggregate.mk +endif +include $(THEOS_MAKE_PATH)/tweak.mk -# Embed bundles and extensions -$(TWEAK_NAME)_BUNDLE_RESOURCE_DIRS = $(wildcard Tweaks/*/var/jb/Library/Application\ Support/*.bundle) $(wildcard Tweaks/*/layout/Library/Application\ Support/*.bundle) - - -before-package:: - @echo -e "==> \033[1mMoving tweak's bundle to Resources/...\033[0m" - @mkdir -p Resources/Frameworks/Alderis.framework && find $(THEOS_OBJ_DIR)/install/Library/Frameworks/Alderis.framework -maxdepth 1 -type f -exec cp {} Resources/Frameworks/Alderis.framework/ \; - @cp -R Tweaks/YTLite/var/jb/Library/Application\ Support/YTLite.bundle Resources/ - @cp -R lang/YTLitePlus.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_DIR)/libcolorpicker.dylib && install_name_tool -change /Library/Frameworks/Alderis.framework/Alderis @rpath/Alderis.framework/Alderis $(THEOS_OBJ_DIR)/libcolorpicker.dylib +REMOVE_EXTENSIONS = 1 +CODESIGN_IPA = 0 internal-clean:: @rm -rf $(YTLITE_PATH)/* +ifneq ($(JAILBROKEN),1) before-all:: @if [[ ! -f $(YTLITE_DEB) ]]; then \ rm -rf $(YTLITE_PATH)/*; \ @@ -62,3 +69,4 @@ before-all:: $(PRINT_FORMAT_ERROR) "Failed to extract YTLite"; exit 1; \ fi; \ fi +endif \ No newline at end of file