From d6ba8d2bfdb539906ee3deccb5cbf026c255017f Mon Sep 17 00:00:00 2001 From: Balackburn Date: Mon, 18 Dec 2023 21:30:36 +0100 Subject: [PATCH] Fixed #48 --- .gitmodules | 3 --- Makefile | 5 ++--- Source/Settings.xm | 10 ++++++++++ Tweaks/YTNoCommunityPosts | 1 - YTLitePlus.xm | 7 +++++++ lang/YTLitePlus.bundle/ar.lproj/Localizable.strings | 3 +++ lang/YTLitePlus.bundle/en.lproj/Localizable.strings | 3 +++ lang/YTLitePlus.bundle/es.lproj/Localizable.strings | 3 +++ lang/YTLitePlus.bundle/fr.lproj/Localizable.strings | 3 +++ lang/YTLitePlus.bundle/ja.lproj/Localizable.strings | 3 +++ lang/YTLitePlus.bundle/pt.lproj/Localizable.strings | 3 +++ lang/YTLitePlus.bundle/ro.lproj/Localizable.strings | 3 +++ lang/YTLitePlus.bundle/ru.lproj/Localizable.strings | 3 +++ .../template.lproj/Localizable.strings | 3 +++ lang/YTLitePlus.bundle/tr.lproj/Localizable.strings | 3 +++ lang/YTLitePlus.bundle/vi.lproj/Localizable.strings | 3 +++ 16 files changed, 52 insertions(+), 7 deletions(-) delete mode 160000 Tweaks/YTNoCommunityPosts diff --git a/.gitmodules b/.gitmodules index 4e37b96..02e0208 100644 --- a/.gitmodules +++ b/.gitmodules @@ -41,9 +41,6 @@ [submodule "Extensions"] path = Extensions url = https://github.com/CokePokes/YoutubeExtensions.git -[submodule "Tweaks/YTNoCommunityPosts"] - path = Tweaks/YTNoCommunityPosts - url = https://github.com/michael-winay/YTNoCommunityPosts.git [submodule "Tweaks/YTVideoOverlay"] path = Tweaks/YTVideoOverlay url = https://github.com/PoomSmart/YTVideoOverlay.git diff --git a/Makefile b/Makefile index 63d15e9..e7da14a 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ BUNDLE_ID = com.google.ios.youtube EXTRA_CFLAGS := $(addprefix -I,$(shell find Tweaks/FLEX -name '*.h' -exec dirname {} \;)) -YTLitePlus_INJECT_DYLIBS = .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/YTLite.dylib .theos/obj/YTNoCommunityPosts.dylib .theos/obj/YTVideoOverlay.dylib .theos/obj/YouQuality.dylib +YTLitePlus_INJECT_DYLIBS = .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/YTLite.dylib .theos/obj/YTVideoOverlay.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) @@ -20,7 +20,7 @@ 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/YTLite Tweaks/YTHoldForSpeed Tweaks/YTNoCommunityPosts Tweaks/YTVideoOverlay Tweaks/YouQuality +SUBPROJECTS += Tweaks/Alderis Tweaks/iSponsorBlock Tweaks/YTUHD Tweaks/YouPiP Tweaks/Return-YouTube-Dislikes Tweaks/YTABConfig Tweaks/YouMute Tweaks/DontEatMyContent Tweaks/YTLite Tweaks/YTHoldForSpeed Tweaks/YTVideoOverlay Tweaks/YouQuality include $(THEOS_MAKE_PATH)/aggregate.mk before-package:: @@ -37,7 +37,6 @@ before-package:: @cp -R Tweaks/iSponsorBlock/layout/Library/Application\ Support/iSponsorBlock.bundle Resources/ @cp -R Tweaks/YTVideoOverlay/layout/Library/Application\ Support/YTVideoOverlay.bundle Resources/ @cp -R Tweaks/YouQuality/layout/Library/Application\ Support/YouQuality.bundle Resources/ - @cp -R Tweaks/YTNoCommunityPosts/layout/Library/Application\ Support/YTNoCommunityPosts.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 diff --git a/Source/Settings.xm b/Source/Settings.xm index aafa4b0..b5e6446 100644 --- a/Source/Settings.xm +++ b/Source/Settings.xm @@ -477,6 +477,16 @@ extern NSBundle *YTLitePlusBundle(); return YES ; } settingItemId:0], + + [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_COMMUNITY_POSTS") + titleDescription:LOC(@"HIDE_COMMUNITY_POSTS_DESC") + accessibilityIdentifier:nil + switchOn:IsEnabled(@"hideCommunityPosts_enabled") + switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) { + [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideCommunityPosts_enabled"]; + return YES; + } + settingItemId:0], [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_CAST_BUTTON") titleDescription:LOC(@"HIDE_CAST_BUTTON_DESC") diff --git a/Tweaks/YTNoCommunityPosts b/Tweaks/YTNoCommunityPosts deleted file mode 160000 index dbb1e82..0000000 --- a/Tweaks/YTNoCommunityPosts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit dbb1e82e32874398315c961fb1ef708cb443fb57 diff --git a/YTLitePlus.xm b/YTLitePlus.xm index 3ca3a30..3258667 100644 --- a/YTLitePlus.xm +++ b/YTLitePlus.xm @@ -330,6 +330,12 @@ static BOOL IsEnabled(NSString *key) { } } } +// Hide Community Posts - @michael-winay & @arichorn + if (IsEnabled(@"hideCommunityPosts_enabled")) { + if ([description containsString:@"post_base_wrapper.eml"]) { + return nil; + } + } return %orig; } %end @@ -592,6 +598,7 @@ static BOOL IsEnabled(NSString *key) { if (IsEnabled(@"disableLiveChatSection_enabled")) { %init(gDisableLiveChatSection); } + // Change the default value of some options NSArray *allKeys = [[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] allKeys]; diff --git a/lang/YTLitePlus.bundle/ar.lproj/Localizable.strings b/lang/YTLitePlus.bundle/ar.lproj/Localizable.strings index e0b4028..b40f4d5 100644 --- a/lang/YTLitePlus.bundle/ar.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/ar.lproj/Localizable.strings @@ -98,6 +98,9 @@ "UN_SHORTS" = "Hide Shorts (YTUnShorts)"; "UN_SHORTS_DESC" = "Remove Shorts from YouTube feed."; +"HIDE_COMMUNITY_POSTS" = "Hide community posts"; +"HIDE_COMMUNITY_POSTS_DESC" = "Hides the Community Posts. App restart is required."; + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "Enable App Version Spoofer (Lite)"; "APP_VERSION_SPOOFER_LITE_DESC" = "Enable this to use the Version Spoofer (Lite) and select your perferred version below. App restart is required."; diff --git a/lang/YTLitePlus.bundle/en.lproj/Localizable.strings b/lang/YTLitePlus.bundle/en.lproj/Localizable.strings index 8ae2880..e986c68 100644 --- a/lang/YTLitePlus.bundle/en.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/en.lproj/Localizable.strings @@ -98,6 +98,9 @@ "UN_SHORTS" = "Hide Shorts (YTUnShorts)"; "UN_SHORTS_DESC" = "Remove Shorts from YouTube feed."; +"HIDE_COMMUNITY_POSTS" = "Hide community posts"; +"HIDE_COMMUNITY_POSTS_DESC" = "Hides the Community Posts. App restart is required."; + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "Enable App Version Spoofer (Lite)"; "APP_VERSION_SPOOFER_LITE_DESC" = "Enable this to use the Version Spoofer (Lite) and select your perferred version below. App restart is required."; diff --git a/lang/YTLitePlus.bundle/es.lproj/Localizable.strings b/lang/YTLitePlus.bundle/es.lproj/Localizable.strings index 36ba9f9..2224e20 100644 --- a/lang/YTLitePlus.bundle/es.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/es.lproj/Localizable.strings @@ -98,6 +98,9 @@ "UN_SHORTS" = "Ocultar Shorts (YTUnShorts)"; "UN_SHORTS_DESC" = "Quitar los Shorts de YouTube"; +"HIDE_COMMUNITY_POSTS" = "Hide community posts"; +"HIDE_COMMUNITY_POSTS_DESC" = "Hides the Community Posts. App restart is required."; + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "Activar App Version Spoofer (Lite)"; "APP_VERSION_SPOOFER_LITE_DESC" = "Active esta opción para utilizar Version Spoofer (Lite) y seleccione su versión preferida a continuación. Es necesario reiniciar la aplicación."; diff --git a/lang/YTLitePlus.bundle/fr.lproj/Localizable.strings b/lang/YTLitePlus.bundle/fr.lproj/Localizable.strings index c009437..aa453fb 100644 --- a/lang/YTLitePlus.bundle/fr.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/fr.lproj/Localizable.strings @@ -101,6 +101,9 @@ "UN_SHORTS" = "Masquer les Shorts (YTUnShorts)" ; "UN_SHORTS_DESC" = "Supprimer les Shorts du feed de YouTube" ; +"HIDE_COMMUNITY_POSTS" = "Masquer les messages de la communauté"; +"HIDE_COMMUNITY_POSTS_DESC" = "Masque les messages de la communauté. Le redémarrage de l'application est nécessaire."; + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "Activer le Spoofer de Version de l'Application (Lite)"; "APP_VERSION_SPOOFER_LITE_DESC" = "Activez cette option pour utiliser le Spoofer de Version de l'Application (Lite) et sélectionnez votre version préférée ci-dessous. Un redémarrage de l'application est requis."; diff --git a/lang/YTLitePlus.bundle/ja.lproj/Localizable.strings b/lang/YTLitePlus.bundle/ja.lproj/Localizable.strings index 1ba3b59..f823cc7 100644 --- a/lang/YTLitePlus.bundle/ja.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/ja.lproj/Localizable.strings @@ -101,6 +101,9 @@ "UN_SHORTS" = "Hide Shorts (YTUnShorts)"; "UN_SHORTS_DESC" = "Remove Shorts from YouTube feed."; +"HIDE_COMMUNITY_POSTS" = "Hide community posts"; +"HIDE_COMMUNITY_POSTS_DESC" = "Hides the Community Posts. App restart is required."; + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "アプリのバージョン偽装(Lite)を有効にする"; "APP_VERSION_SPOOFER_LITE_DESC" = "バージョン偽装(Lite)を使用するにはこれを有効にし、以下からお好みのバージョンを選択してください。アプリの再起動が必要です。"; diff --git a/lang/YTLitePlus.bundle/pt.lproj/Localizable.strings b/lang/YTLitePlus.bundle/pt.lproj/Localizable.strings index 9ce46d8..e599975 100644 --- a/lang/YTLitePlus.bundle/pt.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/pt.lproj/Localizable.strings @@ -98,6 +98,9 @@ "UN_SHORTS" = "Hide Shorts (YTUnShorts)"; "UN_SHORTS_DESC" = "Remove Shorts from YouTube feed."; +"HIDE_COMMUNITY_POSTS" = "Hide community posts"; +"HIDE_COMMUNITY_POSTS_DESC" = "Hides the Community Posts. App restart is required."; + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "Enable App Version Spoofer (Lite)"; "APP_VERSION_SPOOFER_LITE_DESC" = "Enable this to use the Version Spoofer (Lite) and select your perferred version below. App restart is required."; diff --git a/lang/YTLitePlus.bundle/ro.lproj/Localizable.strings b/lang/YTLitePlus.bundle/ro.lproj/Localizable.strings index c8e2e2e..c7bdca2 100644 --- a/lang/YTLitePlus.bundle/ro.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/ro.lproj/Localizable.strings @@ -98,6 +98,9 @@ "UN_SHORTS" = "Hide Shorts (YTUnShorts)"; "UN_SHORTS_DESC" = "Remove Shorts from YouTube feed."; +"HIDE_COMMUNITY_POSTS" = "Hide community posts"; +"HIDE_COMMUNITY_POSTS_DESC" = "Hides the Community Posts. App restart is required."; + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "Activare Spoofer Versiune Aplicație (Lite)"; "APP_VERSION_SPOOFER_LITE_DESC" = "Activați pentru a utiliza Version Spoofer (Lite) și alegeți versiunea preferată. Este necesară repornirea aplicației."; diff --git a/lang/YTLitePlus.bundle/ru.lproj/Localizable.strings b/lang/YTLitePlus.bundle/ru.lproj/Localizable.strings index 5a38bc3..fe67450 100644 --- a/lang/YTLitePlus.bundle/ru.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/ru.lproj/Localizable.strings @@ -98,6 +98,9 @@ "UN_SHORTS" = "Hide Shorts (YTUnShorts)"; "UN_SHORTS_DESC" = "Remove Shorts from YouTube feed."; +"HIDE_COMMUNITY_POSTS" = "Hide community posts"; +"HIDE_COMMUNITY_POSTS_DESC" = "Hides the Community Posts. App restart is required."; + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "Enable App Version Spoofer (Lite)"; "APP_VERSION_SPOOFER_LITE_DESC" = "Enable this to use the Version Spoofer (Lite) and select your perferred version below. App restart is required."; diff --git a/lang/YTLitePlus.bundle/template.lproj/Localizable.strings b/lang/YTLitePlus.bundle/template.lproj/Localizable.strings index 0e26db3..a8fb118 100644 --- a/lang/YTLitePlus.bundle/template.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/template.lproj/Localizable.strings @@ -113,6 +113,9 @@ https://github.com/PoomSmart/Return-YouTube-Dislikes/tree/main/layout/Library/Ap "UN_SHORTS" = "Hide Shorts (YTUnShorts)"; "UN_SHORTS_DESC" = "Remove Shorts from YouTube feed."; +"HIDE_COMMUNITY_POSTS" = "Hide community posts"; +"HIDE_COMMUNITY_POSTS_DESC" = "Hides the Community Posts. App restart is required."; + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "Enable App Version Spoofer (Lite)"; "APP_VERSION_SPOOFER_LITE_DESC" = "Enable this to use the Version Spoofer (Lite) and select your perferred version below. App restart is required."; diff --git a/lang/YTLitePlus.bundle/tr.lproj/Localizable.strings b/lang/YTLitePlus.bundle/tr.lproj/Localizable.strings index 40d99c3..3e6ce9c 100644 --- a/lang/YTLitePlus.bundle/tr.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/tr.lproj/Localizable.strings @@ -98,6 +98,9 @@ "UN_SHORTS" = "Hide Shorts (YTUnShorts)"; "UN_SHORTS_DESC" = "Remove Shorts from YouTube feed."; +"HIDE_COMMUNITY_POSTS" = "Hide community posts"; +"HIDE_COMMUNITY_POSTS_DESC" = "Hides the Community Posts. App restart is required."; + // Version Spoofer "APP_VERSION_SPOOFER_LITE" = "Enable App Version Spoofer (Lite)"; "APP_VERSION_SPOOFER_LITE_DESC" = "Enable this to use the Version Spoofer (Lite) and select your perferred version below. App restart is required."; diff --git a/lang/YTLitePlus.bundle/vi.lproj/Localizable.strings b/lang/YTLitePlus.bundle/vi.lproj/Localizable.strings index 6054809..4aafa0e 100644 --- a/lang/YTLitePlus.bundle/vi.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/vi.lproj/Localizable.strings @@ -133,6 +133,9 @@ "UN_SHORTS" = "Hide Shorts (YTUnShorts)"; "UN_SHORTS_DESC" = "Remove Shorts from YouTube feed."; +"HIDE_COMMUNITY_POSTS" = "Hide community posts"; +"HIDE_COMMUNITY_POSTS_DESC" = "Hides the Community Posts. App restart is required."; + "FIX_GOOGLE_SIGNIN" = "Sửa lỗi Đăng nhập bằng Google (chỉ dành cho người dùng TrollStore)"; "FIX_GOOGLE_SIGNIN_DESC" = "Chỉ bật tùy chọn này khi bạn không thể đăng nhập bằng tài khoản Google của mình và ứng dụng đã được cài đặt qua TrollStore. Nếu bạn có thể đăng nhập bình thường, hãy tắt nó đi. Khởi động lại ứng dụng là bắt buộc.";