Rewrite Makefile

This commit is contained in:
level3tjg 2023-03-09 11:06:36 -05:00
parent 593f653975
commit 1a8363c566
18 changed files with 105 additions and 104 deletions

View file

@ -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"

17
.gitmodules vendored
View file

@ -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

1
Bundles/RYD.bundle Symbolic link
View file

@ -0,0 +1 @@
../Tweaks/Return-YouTube-Dislikes/layout/Library/Application Support/RYD.bundle

1
Bundles/YTABC.bundle Symbolic link
View file

@ -0,0 +1 @@
../Tweaks/YTABConfig/layout/Library/Application Support/YTABC.bundle

1
Bundles/YTUHD.bundle Symbolic link
View file

@ -0,0 +1 @@
../Tweaks/YTUHD/layout/Library/Application Support/YTUHD.bundle

1
Bundles/YouPiP.bundle Symbolic link
View file

@ -0,0 +1 @@
../Tweaks/YouPiP/layout/Library/Application Support/YouPiP.bundle

View file

@ -0,0 +1 @@
../Tweaks/iSponsorBlock/layout/Library/Application Support/iSponsorBlock.bundle

1
Bundles/uYouBundle.bundle Symbolic link
View file

@ -0,0 +1 @@
../Tweaks/uYou/Library/Application Support/uYouBundle.bundle

1
Bundles/uYouPlus.bundle Symbolic link
View file

@ -0,0 +1 @@
../lang/uYouPlus.bundle

View file

@ -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

@ -1 +1 @@
Subproject commit 7992b3b57e86beca069905df121dc57542ae5b6f
Subproject commit a8764bd86b357caa918165e4d9d03a2776e2195f

@ -1 +0,0 @@
Subproject commit 20830170bfe50659de36eace461fd95ebdb16cba

1
Tweaks/FLEXing Submodule

@ -0,0 +1 @@
Subproject commit f42fdd049a2c4cf3be990c771a5824211a10c5bc

1
Tweaks/RemoteLog Submodule

@ -0,0 +1 @@
Subproject commit beee6c731223abdd9b9d7a69d5df79e5b51b6a53

View file

@ -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"
echo "\033[0;31m==> \033[1;39mFailed building uYouPlus"
fi

8
control Normal file
View file

@ -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

1
uYouPlus.plist Normal file
View file

@ -0,0 +1 @@
{ Filter = { Bundles = ( "com.google.ios.youtube" ); }; }

View file

@ -5,7 +5,6 @@
#import <sys/utsname.h>
#import <substrate.h>
#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