mirror of
https://github.com/SoPat712/YTLitePlus.git
synced 2025-08-21 18:48:45 -04:00
Copy from uYouEnhanced
This commit is contained in:
19
.github/workflows/buildapp.yml
vendored
19
.github/workflows/buildapp.yml
vendored
@@ -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 '<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
|
||||
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 - <<EOF
|
||||
import plistlib
|
||||
@@ -144,7 +143,7 @@ jobs:
|
||||
with open(filepath, 'wb') as f:
|
||||
plistlib.dump(plist, f)
|
||||
|
||||
filepath = 'main/tmp/Payload/YouTube.app/Info.plist'
|
||||
filepath = 'Payload/YouTube.app/Info.plist'
|
||||
remove_uisupporteddevices(filepath)
|
||||
EOF
|
||||
env:
|
||||
@@ -161,7 +160,7 @@ jobs:
|
||||
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
|
||||
# Build the package
|
||||
make package
|
||||
make package THEOS_PACKAGE_SCHEME=rootless IPA=Payload/YouTube.app FINALPACKAGE=1
|
||||
# Rename the package based on the version
|
||||
(mv "packages/$(ls -t packages | head -n1)" "packages/YTLitePlus_${{ env.YT_VERSION }}_${{ env.YTLITE_VERSION }}.ipa")
|
||||
# Pass package name to the upload step
|
||||
|
58
Makefile
58
Makefile
@@ -1,11 +1,24 @@
|
||||
TARGET = iphone:clang:16.5:15.0
|
||||
YTLitePlus_USE_FISHHOOK = 0
|
||||
ARCHS = arm64
|
||||
export TARGET = iphone:clang:16.5:14.0
|
||||
export 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
|
||||
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
|
Reference in New Issue
Block a user