From af8edbe98238d87ea2eb75dfe5f97bd85dba2245 Mon Sep 17 00:00:00 2001 From: Balackburn <93828569+Balackburn@users.noreply.github.com> Date: Mon, 3 Jul 2023 23:00:42 +0200 Subject: [PATCH] new buildapp.sh & 18.23.3 to 18.25.1 text in settings --- .github/workflows/buildapp.yml | 2 +- Makefile | 2 +- Source/Settings.xm | 2 +- Source/Themes.xm | 12 ++-- buildapp.sh | 124 +++++++++++++++++++++------------ 5 files changed, 90 insertions(+), 52 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index 57574ea..99aee95 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -18,7 +18,7 @@ on: type: string ytliteplus_version: description: "The version of YTLitePlus" - default: "2.0" + default: "2.1" required: true type: string bundle_id: diff --git a/Makefile b/Makefile index 6166cc1..17fa250 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ ARCHS = arm64 MODULES = jailed FINALPACKAGE = 1 CODESIGN_IPA = 0 -PACKAGE_VERSION = 18.23.3-2.0 +PACKAGE_VERSION = 18.25.1-2.1 TWEAK_NAME = YTLitePlus DISPLAY_NAME = YouTube diff --git a/Source/Settings.xm b/Source/Settings.xm index 49bab5f..08863e1 100644 --- a/Source/Settings.xm +++ b/Source/Settings.xm @@ -57,7 +57,7 @@ extern NSBundle *YTLitePlusBundle(); accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) { - return [%c(YTUIUtils) openURL:[NSURL URLWithString:@"https://github.com/Balackburn/YTLitePlusExtra/releases/latest"]]; + return [%c(YTUIUtils) openURL:[NSURL URLWithString:@"https://github.com/Balackburn/YTLitePlus/releases/latest"]]; }]; [sectionItems addObject:main]; diff --git a/Source/Themes.xm b/Source/Themes.xm index aab0624..7015050 100644 --- a/Source/Themes.xm +++ b/Source/Themes.xm @@ -122,20 +122,20 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha: %end %hook YTAppView -- (void)setBackgroundColor:(UIColor *)color { - %orig([UIColor blackColor]); +- (UIColor *)backgroundColor:(NSInteger)pageStyle { + return pageStyle == 1 ? [UIColor blackColor] : %orig; } %end %hook YTPivotBarView -- (void)setBackgroundColor:(UIColor *)color { - %orig([UIColor blackColor]); +- (UIColor *)backgroundColor:(NSInteger)pageStyle { + return pageStyle == 1 ? [UIColor blackColor] : %orig; } %end %hook YTAsyncCollectionView -- (void)setBackgroundColor:(UIColor *)color { - %orig([UIColor blackColor]); +- (UIColor *)backgroundColor:(NSInteger)pageStyle { + return pageStyle == 1 ? [UIColor blackColor] : %orig; } %end diff --git a/buildapp.sh b/buildapp.sh index e9e9f78..00209ac 100755 --- a/buildapp.sh +++ b/buildapp.sh @@ -1,55 +1,93 @@ #!/bin/bash -cd "$(dirname "$0")" +cleanup() { + echo "==> Cleaning up..." + rm -f YouTube.ipa + rm -rf tmp + rm -f packages/ipa/YTLitePlus_$youtube_version.ipa +} -# Check Cercube -if [ ! -f Tweaks/Cercube/me.alfhaily.cercube_5.3.11_iphoneos-arm.deb ] -then - echo -e "==> \033[1mCercube v5.3.13 is not found. Downloading Cercube (v5.3.11)...\033[0m" - curl https://dl.dropboxusercontent.com/s/b01erqbp3ajc5e2/me.alfhaily.cercube_5.3.11_iphoneos-arm.deb --output Tweaks/Cercube/me.alfhaily.cercube_5.3.11_iphoneos-arm.deb +revert_makefile_changes() { + echo "==> Reverting Makefile changes..." + if [ "$app_name" != "YouTube" ]; then + sed -i '' "11s#.*#DISPLAY_NAME = YouTube#g" Makefile + fi +} + +trap cleanup EXIT + +# Set your inputs here +decrypted_youtube_url="https://cdn-141.anonfiles.com/J4GdS7zez9/59a30fb9-1688414260/com.google.ios.youtube-18.25.1-Decrypted.ipa" +youtube_version="18.25.1" +ytliteplus_version="2.1" +bundle_id="com.google.ios.youtube" +app_name="YouTube" + +if [ -z "$decrypted_youtube_url" ]; then + echo "Please enter a decrypted YouTube URL" + exit 1 +fi + +if [ -z "$youtube_version" ]; then + echo "Please enter the YouTube version" + exit 1 +fi + +# Install Dependencies +brew install ldid dpkg make + +# Setup Theos +if [ ! -d "theos" ]; then + git clone --recursive https://github.com/theos/theos.git else - echo -e "==> \033[1mFounded Cercube (v5.3.13)\033[0m" + echo "==> Theos already cached" fi -# Extract Cercube - echo -e "==> \033[1mExtracting Cercube...\033[0m" -if (cd Tweaks/Cercube && tar -xf me.alfhaily.cercube_5.3.11_iphoneos-arm.deb && tar -xf data.tar.*) -then - echo -e "\033[1m> Extracted Cercube!\033[0m" +# Download iOS 15.5 SDK +if [ ! -d "theos/sdks/iPhoneOS15.5.sdk" ]; then + if command -v svn > /dev/null; then + svn checkout -q https://github.com/chrisharper22/sdks/trunk/iPhoneOS15.5.sdk + mv iPhoneOS15.5.sdk theos/sdks/ + else + echo "==> svn command not found, please install svn" + exit 1 + fi else - echo "> \033[1mCouldn't extract Cercube\033[0m" + echo "==> iPhoneOS15.5.sdk already cached" 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 +# Setup Theos Jailed +if [ ! -d "theos-jailed" ]; then + git clone --recursive https://github.com/qnblackcat/theos-jailed.git else - echo "This is not an ipa/app!" + echo "==> theos-jailed already cached" fi -# Clean up - tput setaf 1 && echo -e "==> \033[1mCleaning up...\033[0m" - find Tweaks/Cercube -mindepth 1 ! -name "me.alfhaily.cercube_5.3.11_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 | cut -f1 -d' ')\033[0m" +# Install Theos Jailed +./theos-jailed/install + +# Prepare YouTube iPA +wget "$decrypted_youtube_url" --no-verbose -O YouTube.ipa +echo "==> YouTube v$youtube_version downloaded!" +unzip -q YouTube.ipa -d tmp +rm -rf tmp/Payload/YouTube.app/_CodeSignature/CodeResources +rm -rf tmp/Payload/YouTube.app/PlugIns/* +cp -R Extensions/*.appex tmp/Payload/YouTube.app/PlugIns +echo "==> YouTube v$youtube_version unpacked!" + +# Fix Compiling & Build Package +echo "PATH=\"$(brew --prefix make)/libexec/gnubin:\$PATH\"" >> ~/.zprofile +sed -i '' "12s#.*#BUNDLE_ID = $bundle_id#g" Makefile +if [ "$app_name" != "YouTube" ]; then + sed -i '' "11s#.*#DISPLAY_NAME = $app_name#g" Makefile +fi +make package FINALPACKAGE=1 +mkdir -p packages/ipa +mv "packages/$(ls -t packages | head -n1)" "packages/ipa/YTLitePlus_$youtube_version.ipa" +echo "==> SHASUM256: $(shasum -a 256 packages/ipa/*.ipa | cut -f1 -d' ')" +echo "==> Bundle ID: $bundle_id" + +revert_makefile_changes + +# Disable the cleanup function when the script exits successfully +trap - EXIT \ No newline at end of file