Revert Revert Revert Makefile

This commit is contained in:
Bryce Hackel
2024-07-27 17:32:05 -07:00
parent a70a4c5e0b
commit 7a2f0b013d
2 changed files with 53 additions and 54 deletions

View File

@@ -47,6 +47,10 @@ on:
required: false required: false
type: boolean type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
name: Build YTLitePlus name: Build YTLitePlus
@@ -120,16 +124,17 @@ jobs:
run: | run: |
# Download and unzip iPA # Download and unzip iPA
wget "$YOUTUBE_URL" --no-verbose -O main/YouTube.ipa wget "$YOUTUBE_URL" --no-verbose -O main/YouTube.ipa
cd ${{ github.workspace }}/main unzip -q main/YouTube.ipa -d main/tmp
mv YouTube.ipa YouTube.zip
unzip -q YouTube.zip
# Get the version number of the YouTube app and store it # Get the version number of the YouTube app and store it
echo "YT_VERSION=$(defaults read "$(pwd)/Payload/YouTube.app/Info" CFBundleVersion)" >> $GITHUB_ENV echo "YT_VERSION=$(grep -A 1 '<key>CFBundleVersion</key>' main/tmp/Payload/YouTube.app/Info.plist | grep '<string>' | awk -F'[><]' '{print $3}')" >> $GITHUB_ENV
# Get the version number of the latest release of YTLite # Get the version number of the latest release
wget -qO- https://github.com/dayanch96/YTLite/releases/latest > release_page.html wget -qO- https://github.com/dayanch96/YTLite/releases/latest > main/tmp/release_page.html
YTLITE_VERSION=$(grep -o -E '/tag/v[^"]+' release_page.html | head -n 1 | sed 's/\/tag\/v//') YTLITE_VERSION=$(grep -o -E '/tag/v[^"]+' main/tmp/release_page.html | head -n 1 | sed 's/\/tag\/v//')
echo "YTLITE_VERSION=${YTLITE_VERSION}" >> $GITHUB_ENV echo "YTLITE_VERSION=${YTLITE_VERSION}" >> $GITHUB_ENV
echo $YTLITE_VERSION 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) # Modify Info.plist to remove UISupportedDevices (Python script)
python - <<EOF python - <<EOF
import plistlib import plistlib
@@ -143,7 +148,7 @@ jobs:
with open(filepath, 'wb') as f: with open(filepath, 'wb') as f:
plistlib.dump(plist, f) plistlib.dump(plist, f)
filepath = 'Payload/YouTube.app/Info.plist' filepath = 'main/tmp/Payload/YouTube.app/Info.plist'
remove_uisupporteddevices(filepath) remove_uisupporteddevices(filepath)
EOF EOF
env: env:
@@ -160,7 +165,7 @@ jobs:
sed -i '' "s/^PACKAGE_VERSION.*$/PACKAGE_VERSION = ${{ env.YT_VERSION }}-${{ env.YTLITE_VERSION }}/" Makefile sed -i '' "s/^PACKAGE_VERSION.*$/PACKAGE_VERSION = ${{ env.YT_VERSION }}-${{ env.YTLITE_VERSION }}/" Makefile
sed -i '' "s/^export TARGET.*$/export TARGET = iphone:clang:${{ inputs.sdk_version }}:14.0/" Makefile sed -i '' "s/^export TARGET.*$/export TARGET = iphone:clang:${{ inputs.sdk_version }}:14.0/" Makefile
# Build the package # Build the package
make package THEOS_PACKAGE_SCHEME=rootless IPA=Payload/YouTube.app FINALPACKAGE=1 make package
# Rename the package based on the version # Rename the package based on the version
(mv "packages/$(ls -t packages | head -n1)" "packages/YTLitePlus_${{ env.YT_VERSION }}_${{ env.YTLITE_VERSION }}.ipa") (mv "packages/$(ls -t packages | head -n1)" "packages/YTLitePlus_${{ env.YT_VERSION }}_${{ env.YTLITE_VERSION }}.ipa")
# Pass package name to the upload step # Pass package name to the upload step

View File

@@ -1,63 +1,58 @@
export TARGET = iphone:clang:16.5:14.0 TARGET = iphone:clang:16.5:15.0
export ARCHS = arm64 YTLitePlus_USE_FISHHOOK = 0
ARCHS = arm64
# Setup libcolorpicker and Alderis to install correctly
export libcolorpicker_ARCHS = arm64
export libFLEX_ARCHS = arm64
export Alderis_XCODEOPTS = LD_DYLIB_INSTALL_NAME=@rpath/Alderis.framework/Alderis
export Alderis_XCODEFLAGS = DYLIB_INSTALL_NAME_BASE=/Library/Frameworks BUILD_LIBRARY_FOR_DISTRIBUTION=YES ARCHS="$(ARCHS)"
export libcolorpicker_LDFLAGS = -F$(TARGET_PRIVATE_FRAMEWORK_PATH) -install_name @rpath/libcolorpicker.dylib
# Add RemoteLog, and allow YouTubeHeader to be accessible using #include <...>
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 MODULES = jailed
endif FINALPACKAGE = 1
CODESIGN_IPA = 0
PACKAGE_VERSION = X.X.X-X.X PACKAGE_VERSION = X.X.X-X.X
INSTALL_TARGET_PROCESSES = YouTube
TWEAK_NAME = YTLitePlus TWEAK_NAME = YTLitePlus
DISPLAY_NAME = YouTube DISPLAY_NAME = YouTube
BUNDLE_ID = com.google.ios.youtube BUNDLE_ID = com.google.ios.youtube
# Setup variables for YTLite download and install 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
YTLitePlus_INJECT_DYLIBS = Tweaks/YTLite/var/jb/Library/MobileSubstrate/DynamicLibraries/YTLite.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 .theos/obj/YouMute.dylib .theos/obj/DontEatMyContent.dylib .theos/obj/YTHoldForSpeed.dylib .theos/obj/YTVideoOverlay.dylib .theos/obj/YouGroupSettings.dylib .theos/obj/YouQuality.dylib
YTLitePlus_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 \))
YTLitePlus_IPA = ./tmp/Payload/YouTube.app
YTLitePlus_CFLAGS = -fobjc-arc -Wno-deprecated-declarations -Wno-unsupported-availability-guard -Wno-unused-but-set-variable -DTWEAK_VERSION=$(PACKAGE_VERSION) $(EXTRA_CFLAGS)
YTLitePlus_FRAMEWORKS = UIKit Security
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 Tweaks/YouMute Tweaks/DontEatMyContent Tweaks/YTHoldForSpeed Tweaks/YTVideoOverlay Tweaks/YouQuality Tweaks/YouGroupSettings
include $(THEOS_MAKE_PATH)/aggregate.mk
YTLITE_PATH = Tweaks/YTLite YTLITE_PATH = Tweaks/YTLite
# Grab the YTLite version from the releases page on GitHub
YTLITE_VERSION := $(shell wget -qO- "https://github.com/dayanch96/YTLite/releases/latest" | grep -o -E '/tag/v[^"]+' | head -n 1 | sed 's/\/tag\/v//') YTLITE_VERSION := $(shell wget -qO- "https://github.com/dayanch96/YTLite/releases/latest" | grep -o -E '/tag/v[^"]+' | head -n 1 | sed 's/\/tag\/v//')
YTLITE_DEB = $(YTLITE_PATH)/com.dvntm.ytlite_$(YTLITE_VERSION)_iphoneos-arm64.deb YTLITE_DEB = $(YTLITE_PATH)/com.dvntm.ytlite_$(YTLITE_VERSION)_iphoneos-arm64.deb
YTLITE_DYLIB = $(YTLITE_PATH)/var/jb/Library/MobileSubstrate/DynamicLibraries/YTLite.dylib YTLITE_DYLIB = $(YTLITE_PATH)/var/jb/Library/MobileSubstrate/DynamicLibraries/YTLite.dylib
YTLITE_BUNDLE = $(YTLITE_PATH)/var/jb/Library/Application\ Support/YTLite.bundle YTLITE_BUNDLE = $(YTLITE_PATH)/var/jb/Library/Application\ Support/YTLite.bundle
before-package::
# Todo figure out the purpose of this @echo -e "==> \033[1mMoving tweak's bundle to Resources/...\033[0m"
EXTRA_CFLAGS := $(addprefix -I,$(shell find Tweaks/FLEX -name '*.h' -exec dirname {} \;)) -I$(THEOS_PROJECT_DIR)/Tweaks @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/YTLite/var/jb/Library/Application\ Support/YTLite.bundle Resources/
$(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 \)) @cp -R Tweaks/YTUHD/layout/Library/Application\ Support/YTUHD.bundle Resources/
$(TWEAK_NAME)_FRAMEWORKS = UIKit Foundation AVFoundation AVKit Photos Accelerate CoreMotion GameController VideoToolbox Security @cp -R Tweaks/YouPiP/layout/Library/Application\ Support/YouPiP.bundle Resources/
$(TWEAK_NAME)_LIBRARIES = bz2 c++ iconv z @cp -R Tweaks/Return-YouTube-Dislikes/layout/Library/Application\ Support/RYD.bundle Resources/
$(TWEAK_NAME)_CFLAGS = -fobjc-arc -Wno-deprecated-declarations -Wno-unsupported-availability-guard -Wno-unused-but-set-variable -DTWEAK_VERSION=$(PACKAGE_VERSION) $(EXTRA_CFLAGS) @cp -R Tweaks/YTABConfig/layout/Library/Application\ Support/YTABC.bundle Resources/
$(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 @cp -R Tweaks/YouMute/layout/Library/Application\ Support/YouMute.bundle Resources/
$(TWEAK_NAME)_EMBED_LIBRARIES = $(THEOS_OBJ_DIR)/libcolorpicker.dylib @cp -R Tweaks/DontEatMyContent/layout/Library/Application\ Support/DontEatMyContent.bundle Resources/
$(TWEAK_NAME)_EMBED_FRAMEWORKS = $(_THEOS_LOCAL_DATA_DIR)/$(THEOS_OBJ_DIR_NAME)/install_Alderis.xcarchive/Products/var/jb/Library/Frameworks/Alderis.framework @cp -R Tweaks/YTHoldForSpeed/layout/Library/Application\ Support/YTHoldForSpeed.bundle Resources/
$(TWEAK_NAME)_EMBED_BUNDLES = $(wildcard Bundles/*.bundle) @cp -R Tweaks/iSponsorBlock/layout/Library/Application\ Support/iSponsorBlock.bundle Resources/
$(TWEAK_NAME)_EMBED_EXTENSIONS = $(wildcard Extensions/*.appex) @cp -R Tweaks/YTVideoOverlay/layout/Library/Application\ Support/YTVideoOverlay.bundle Resources/
@cp -R Tweaks/YouQuality/layout/Library/Application\ Support/YouQuality.bundle Resources/
include $(THEOS)/makefiles/common.mk @cp -R lang/YTLitePlus.bundle Resources/
ifneq ($(JAILBROKEN),1) @echo -e "==> \033[1mChanging the installation path of dylibs...\033[0m"
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 @ldid -r .theos/obj/iSponsorBlock.dylib && install_name_tool -change /usr/lib/libcolorpicker.dylib @rpath/libcolorpicker.dylib .theos/obj/iSponsorBlock.dylib
include $(THEOS_MAKE_PATH)/aggregate.mk @codesign --remove-signature .theos/obj/libcolorpicker.dylib && install_name_tool -change /Library/Frameworks/Alderis.framework/Alderis @rpath/Alderis.framework/Alderis .theos/obj/libcolorpicker.dylib
endif
include $(THEOS_MAKE_PATH)/tweak.mk
REMOVE_EXTENSIONS = 1
CODESIGN_IPA = 0
internal-clean:: internal-clean::
@rm -rf $(YTLITE_PATH)/* @rm -rf $(YTLITE_PATH)/*
ifneq ($(JAILBROKEN),1)
before-all:: before-all::
@if [[ ! -f $(YTLITE_DEB) ]]; then \ @if [[ ! -f $(YTLITE_DEB) ]]; then \
rm -rf $(YTLITE_PATH)/*; \ rm -rf $(YTLITE_PATH)/*; \
@@ -69,4 +64,3 @@ before-all::
$(PRINT_FORMAT_ERROR) "Failed to extract YTLite"; exit 1; \ $(PRINT_FORMAT_ERROR) "Failed to extract YTLite"; exit 1; \
fi; \ fi; \
fi fi
endif