Skip to content

Commit

Permalink
Merge pull request BandarHL#257 from haxibami/feature/add-hide-premiu…
Browse files Browse the repository at this point in the history
…m-offer
  • Loading branch information
BandarHL authored Sep 19, 2024
2 parents a894bf5 + e2f097f commit 1b91395
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions BHTManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
+ (BOOL)hideWhoToFollow;
+ (BOOL)hideTopicsToFollow;
+ (BOOL)hideViewCount;
+ (BOOL)hidePremiumOffer;
+ (BOOL)forceTweetFullFrame;
+ (BOOL)stripTrackingParams;
+ (BOOL)alwaysFollowingPage;
Expand Down
3 changes: 3 additions & 0 deletions BHTManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ + (BOOL)hideTopicsToFollow {
+ (BOOL)hideViewCount {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hide_view_count"];
}
+ (BOOL)hidePremiumOffer {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hide_premium_offer"];
}
+ (BOOL)forceTweetFullFrame {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"force_tweet_full_frame"];
}
Expand Down
3 changes: 3 additions & 0 deletions SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ - (NSArray *)specifiers {
PSSpecifier *hideWhoToFollow = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"HIDE_WHO_FOLLOW_OPTION"] detailTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"HIDE_WHO_FOLLOW_OPTION_DETAIL_TITLE"] key:@"hide_who_to_follow" defaultValue:false changeAction:nil];

PSSpecifier *hideTopicsToFollow = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"HIDE_TOPICS_TO_FOLLOW_OPTION"] detailTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"HIDE_TOPICS_TO_FOLLOW_OPTION_DETAIL_TITLE"] key:@"hide_topics_to_follow" defaultValue:false changeAction:nil];

PSSpecifier *hidePremiumOffer = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"HIDE_PREMIUM_OFFER_OPTION"] detailTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE"] key:@"hide_premium_offer" defaultValue:false changeAction:nil];

PSSpecifier *videoLayerCaption = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE"] detailTitle:nil key:@"dis_VODCaptions" defaultValue:false changeAction:nil];

Expand Down Expand Up @@ -236,6 +238,7 @@ - (NSArray *)specifiers {
hideTopics,
hideWhoToFollow,
hideTopicsToFollow,
hidePremiumOffer,
videoLayerCaption,
directSave,
noHistory,
Expand Down
14 changes: 14 additions & 0 deletions Tweak.x
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@ static void batchSwizzlingOnClass(Class cls, NSArray<NSString*>*origSelectors, I
}
%end

%hook T1ProfileSummaryView
- (BOOL)shouldShowGetVerifiedButton {
return [BHTManager hidePremiumOffer] ? false : %orig;
}
%end

// MARK: hide ADs
// credit goes to haoict https://github.com/haoict/twitter-no-ads
Expand Down Expand Up @@ -854,6 +859,15 @@ static void batchSwizzlingOnClass(Class cls, NSArray<NSString*>*origSelectors, I
}
%end

%hook THFHomeTimelineContainerViewController
- (void)_t1_showPremiumUpsellIfNeeded {
if ([BHTManager hidePremiumOffer]) {
return;
}
return %orig;
}
%end

%hook TFNTwitterMediaUploadConfiguration
- (_Bool)photoUploadHighQualityImagesSettingIsVisible {
return [BHTManager autoHighestLoad] ? true : %orig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
"HIDE_TOPICS_TO_FOLLOW_OPTION" = "إخفاء مواضيع للمتابعة";
"HIDE_TOPICS_TO_FOLLOW_OPTION_DETAIL_TITLE" = "إخفاء مواضيع للمتابعة في الملفات الشخصية";

"HIDE_PREMIUM_OFFER_OPTION" = "إخفاء عرض التسجيل المميز";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "إخفاء زر وثِّق حسابك وترقية في الملف الشخصي وشريط التنقل";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "تعطيل وصف الفيديو";

"VOICE_OPTION_TITLE" = "الملاحظة الصوتية";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
"HIDE_TOPICS_TO_FOLLOW_OPTION" = "Hide Topics to follow section";
"HIDE_TOPICS_TO_FOLLOW_OPTION_DETAIL_TITLE" = "Hide Topics to follow section in Profiles";

"HIDE_PREMIUM_OFFER_OPTION" = "Hide Premium registration offer";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "Hide Get verified and Upgrade button in the profile and navigation bar";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "Disable video layer captions";

"VOICE_OPTION_TITLE" = "Voice feature";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
"HIDE_TOPICS_TO_FOLLOW_OPTION" = "Ocultar Temas a seguir";
"HIDE_TOPICS_TO_FOLLOW_OPTION_DETAIL_TITLE" = "Ocultar la sección Temas a seguir en Perfiles";

"HIDE_PREMIUM_OFFER_OPTION" = "Ocultar la oferta de registro Premium";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "Ocultar los botones Obtener verificación y Actualizar a nivel superior en el perfil y en la barra de navegación";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "Desactivar subtítulos";

"VOICE_OPTION_TITLE" = "Función de voz";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
"HIDE_TOPICS_TO_FOLLOW_OPTION" = "Masquer la section Sujets à suivre";
"HIDE_TOPICS_TO_FOLLOW_OPTION_DETAIL_TITLE" = "Masquer la section Sujets à suivre dans les profils";

"HIDE_PREMIUM_OFFER_OPTION" = "Masquer l'offre d'enregistrement Premium";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "Masquer les boutons Obtenir la certification et Mettre à niveau dans le profil et la barre de navigation";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "Désactiver les sous-titres du calque vidéo";

"VOICE_OPTION_TITLE" = "Fonction vocale";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
"HIDE_TOPICS_OPTION_TITLE" = "Sembunyikan topik";
"HIDE_TOPICS_OPTION_DETAIL_TITLE" = "Hilangkan semua topik dari tweet di timeline";

"HIDE_PREMIUM_OFFER_OPTION" = "Sembunyikan penawaran pendaftaran Premium";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "Sembunyikan tombol Dapatkan verifikasi dan Tingkatkan di profil dan bilah navigasi";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "nonaktifkan text video";

"VOICE_OPTION_TITLE" = "Fitur Suara";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
"HIDE_TOPICS_TO_FOLLOW_OPTION" = "トピックをフォローするを消す";
"HIDE_TOPICS_TO_FOLLOW_OPTION_DETAIL_TITLE" = "プロフィールの「トピックをフォローする」を削除します。";

"HIDE_PREMIUM_OFFER_OPTION" = "プレミアムの登録オファーを消す";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "プロフィールとナビゲーションバーの「認証される」「アップグレード」ボタンを削除します。";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "動画の字幕を無効にする";

"VOICE_OPTION_TITLE" = "音声機能の有効化";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
"HIDE_TOPICS_TO_FOLLOW_OPTION" = "Скрыть секцию «Темы для чтения»";
"HIDE_TOPICS_TO_FOLLOW_OPTION_DETAIL_TITLE" = "Скрывает секцию «Темы для чтения» в профилях пользователей";

"HIDE_PREMIUM_OFFER_OPTION" = "Скрыть предложение премиум-регистрации";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "Скрыть кнопку «Подтвердить подлинность» и «Улучшить подписку» в профиле и на панели навигации";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "Отключить описания видео";

"VOICE_OPTION_TITLE" = "Голосовые";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
"HIDE_TOPICS_TO_FOLLOW_OPTION" = "Takip edilesi konular bölümü gizle";
"HIDE_TOPICS_TO_FOLLOW_OPTION_DETAIL_TITLE" = "Profillerdeki Takip edilesi konular bölümü gizler";

"HIDE_PREMIUM_OFFER_OPTION" = "Premium kayıt teklifini gizle";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "Profil ve gezinti çubuğundaki Onaylanmış hesap sahibi ol ve Yükselt düğmelerini gizleyin";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "Video katmanı altyazılarını devre dışı bırak";

"VOICE_OPTION_TITLE" = "Ses özelliği";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
"HIDE_TOPICS_TO_FOLLOW_OPTION" = "隱藏關注話題";
"HIDE_TOPICS_TO_FOLLOW_OPTION_DETAIL_TITLE" = "在個人檔案中隱藏關注話題";

"HIDE_PREMIUM_OFFER_OPTION" = "隱藏高級註冊優惠";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "在個人檔案和導覽列中隱藏獲得認證和升級按鈕";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "關閉影片字幕";

"VOICE_OPTION_TITLE" = "語音訊息";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
"HIDE_TOPICS_TO_FOLLOW_OPTION" = "隐藏关注话题";
"HIDE_TOPICS_TO_FOLLOW_OPTION_DETAIL_TITLE" = "在个人资料中隐藏关乎话题";

"HIDE_PREMIUM_OFFER_OPTION" = "隐藏高级注册优惠";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "在个人资料和导航栏中隐藏通过验证和升级按钮";

"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "开启视频字幕";

"VOICE_OPTION_TITLE" = "语音功能";
Expand Down

0 comments on commit 1b91395

Please sign in to comment.