Skip to content

Commit

Permalink
Merge branch 'BandarHL:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
JackPlaysGames0510 authored Oct 25, 2024
2 parents 8f993de + 980a37b commit 9112393
Show file tree
Hide file tree
Showing 17 changed files with 64 additions and 33 deletions.
13 changes: 2 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,9 @@ jobs:
path: theos
submodules: recursive

- name: Download Azule
- name: Install cyan
if: inputs.deploy_format == 'sideloaded' || inputs.deploy_format == 'trollstore'
uses: actions/checkout@v4
with:
repository: Al4ise/Azule
ref: main
path: azule

- name: Add Azule to PATH
if: inputs.deploy_format == 'sideloaded' || inputs.deploy_format == 'trollstore'
run: |
echo "${{ github.workspace }}/azule" >> "$GITHUB_PATH"
run: pip install https://github.com/asdfzxcvbn/pyzule-rw/archive/main.zip

- name: iOS SDK Caching
id: SDK
Expand Down
1 change: 1 addition & 0 deletions BHTManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
+ (BOOL)hideTopicsToFollow;
+ (BOOL)hideViewCount;
+ (BOOL)hidePremiumOffer;
+ (BOOL)hideTrendVideos;
+ (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 @@ -229,6 +229,9 @@ + (BOOL)hideViewCount {
+ (BOOL)hidePremiumOffer {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hide_premium_offer"];
}
+ (BOOL)hideTrendVideos {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hide_trend_videos"];
}
+ (BOOL)forceTweetFullFrame {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"force_tweet_full_frame"];
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
## Local

- install [Theos](https://github.com/theos/theos)
- install [Azule](https://github.com/Al4ise/Azule) if you want to build for sideload or TrollStore
- install [cyan](https://github.com/asdfzxcvbn/pyzule-rw) if you want to build for sideload or TrollStore

- Clone the BHTwitter project repository:
```bash
Expand Down
3 changes: 3 additions & 0 deletions SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ - (NSArray *)specifiers {
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 *hideTrendVideos = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"HIDE_TREND_VIDEOS_OPTION_TITLE"] detailTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"HIDE_TREND_VIDEOS_OPTION_DETAIL_TITLE"] key:@"hide_trend_videos" 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 @@ -239,6 +241,7 @@ - (NSArray *)specifiers {
hideWhoToFollow,
hideTopicsToFollow,
hidePremiumOffer,
hideTrendVideos,
videoLayerCaption,
directSave,
noHistory,
Expand Down
19 changes: 19 additions & 0 deletions Tweak.x
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ static void batchSwizzlingOnClass(Class cls, NSArray<NSString*>*origSelectors, I
[_orig setHidden:true];
}
}
if ([BHTManager hideTrendVideos] && ([class_name isEqualToString:@"TwitterURT.URTModuleHeaderViewModel"] || [class_name isEqualToString:@"TwitterURT.URTModuleFooterViewModel"] || [class_name isEqualToString:@"T1TwitterSwift.URTTimelineCarouselViewModel"])) {
[_orig setHidden:true];
}
}

if ([self.adDisplayLocation isEqualToString:@"TIMELINE_HOME"]) {
Expand All @@ -324,6 +327,12 @@ static void batchSwizzlingOnClass(Class cls, NSArray<NSString*>*origSelectors, I
[_orig setHidden:true];
}
}

if ([BHTManager hidePremiumOffer]) {
if ([class_name isEqualToString:@"T1URTTimelineMessageItemViewModel"]) {
[_orig setHidden:true];
}
}
}

return _orig;
Expand Down Expand Up @@ -366,6 +375,10 @@ static void batchSwizzlingOnClass(Class cls, NSArray<NSString*>*origSelectors, I
return 0;
}
}

if ([BHTManager hideTrendVideos] && ([class_name isEqualToString:@"TwitterURT.URTModuleHeaderViewModel"] || [class_name isEqualToString:@"TwitterURT.URTModuleFooterViewModel"] || [class_name isEqualToString:@"T1TwitterSwift.URTTimelineCarouselViewModel"])) {
return 0;
}
}

if ([self.adDisplayLocation isEqualToString:@"TIMELINE_HOME"]) {
Expand All @@ -384,6 +397,12 @@ static void batchSwizzlingOnClass(Class cls, NSArray<NSString*>*origSelectors, I
return 0;
}
}

if ([BHTManager hidePremiumOffer]) {
if ([class_name isEqualToString:@"T1URTTimelineMessageItemViewModel"]) {
return 0;
}
}
}

return %orig;
Expand Down
26 changes: 5 additions & 21 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

LONG=sideloaded:,rootless:,trollstore
OPTS=$(getopt -a weather --longoptions "$LONG" -- "$@")
libcephei_URL="https://web.archive.org/web/20240222081324/https://cdn.discordapp.com/attachments/755439561454256132/1184388888475738243/libcephei.zip"
PROJECT_PATH=$PWD

while :; do
case "$1" in
Expand All @@ -22,16 +20,10 @@ while :; do
fi

if [ -e ./packages/com.atebits.Tweetie2.ipa ]; then

echo -e '\033[1m\033[32mDownloading libcephei SDK.\033[0m'
temp_dir=$(mktemp -d)
curl -L -o "$temp_dir/libcephei.zip" "$libcephei_URL"
unzip -o "$temp_dir/libcephei.zip" -d ./packages
rm -rf "$temp_dir"
rm -rf ./packages/__MACOSX

echo -e '\033[1m\033[32mBuilding the IPA.\033[0m'
azule -i "$PROJECT_PATH/packages/com.atebits.Tweetie2.ipa" -o "$PROJECT_PATH/packages" -n BHTwitter-sideloaded -r -f "$PROJECT_PATH/.theos/obj/debug/keychainfix.dylib" "$PROJECT_PATH/.theos/obj/debug/libbhFLEX.dylib" "$PROJECT_PATH/.theos/obj/debug/BHTwitter.dylib" "$PROJECT_PATH/packages/Cephei.framework" "$PROJECT_PATH/packages/CepheiUI.framework" "$PROJECT_PATH/packages/CepheiPrefs.framework" "$PROJECT_PATH/layout/Library/Application Support/BHT/BHTwitter.bundle"
cyan -i packages/com.atebits.Tweetie2.ipa -o packages/BHTwitter-sideloaded --ignore-encrypted \
-uwf .theos/obj/debug/keychainfix.dylib .theos/obj/debug/libbhFLEX.dylib \
.theos/obj/debug/BHTwitter.dylib layout/Library/Application\ Support/BHT/BHTwitter.bundle

echo -e '\033[1m\033[32mDone, thanks for using BHTwitter.\033[0m'
else
Expand Down Expand Up @@ -65,18 +57,10 @@ while :; do
fi

if [ -e ./packages/com.atebits.Tweetie2.ipa ]; then

echo -e '\033[1m\033[32mDownloading libcephei SDK.\033[0m'
temp_dir=$(mktemp -d)
curl -L -o "$temp_dir/libcephei.zip" "$libcephei_URL"
unzip -o "$temp_dir/libcephei.zip" -d ./packages
rm -rf "$temp_dir"
rm -rf ./packages/__MACOSX

echo -e '\033[1m\033[32mBuilding the IPA.\033[0m'

azule -i "$PROJECT_PATH/packages/com.atebits.Tweetie2.ipa" -o "$PROJECT_PATH/packages" -n BHTwitter-trollstore -r -f "$PROJECT_PATH/.theos/obj/debug/BHTwitter.dylib" "$PROJECT_PATH/.theos/obj/debug/libbhFLEX.dylib" "$PROJECT_PATH/packages/Cephei.framework" "$PROJECT_PATH/packages/CepheiUI.framework" "$PROJECT_PATH/packages/CepheiPrefs.framework" "$PROJECT_PATH/layout/Library/Application Support/BHT/BHTwitter.bundle"
mv "$PROJECT_PATH/packages/BHTwitter-trollstore.ipa" "$PROJECT_PATH/packages/BHTwitter-trollstore.tipa"
cyan -i packages/com.atebits.Tweetie2.ipa -o packages/BHTwitter-trollstore.tipa --ignore-encrypted \
-uwf .theos/obj/debug/BHTwitter.dylib .theos/obj/debug/libbhFLEX.dylib layout/Library/Application\ Support/BHT/BHTwitter.bundle

echo -e '\033[1m\033[32mDone, thanks for using BHTwitter.\033[0m'
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
"HIDE_PREMIUM_OFFER_OPTION" = "إخفاء عرض التسجيل المميز";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "إخفاء زر وثِّق حسابك وترقية في الملف الشخصي وشريط التنقل";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "إخفاء الفيديوهات الرائجة";
"HIDE_TREND_VIDEOS_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 @@ -53,6 +53,9 @@
"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";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "Hide trending videos";
"HIDE_TREND_VIDEOS_OPTION_DETAIL_TITLE" = "Hide trending videos in the Search tab";

"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 @@ -53,6 +53,9 @@
"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";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "Ocultar los vídeos que son tendencia";
"HIDE_TREND_VIDEOS_OPTION_DETAIL_TITLE" = "Ocultar los vídeos que son tendencia en la pestaña de búsqueda";

"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 @@ -53,6 +53,9 @@
"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";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "Masquer les vidéos tendance";
"HIDE_TREND_VIDEOS_OPTION_DETAIL_TITLE" = "Masquer les vidéos tendance dans l'onglet de recherche";

"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 @@ -46,6 +46,9 @@
"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";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "Sembunyikan video yang sedang tren";
"HIDE_TREND_VIDEOS_OPTION_DETAIL_TITLE" = "Sembunyikan video yang sedang tren di tab pencarian";

"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 @@ -53,6 +53,9 @@
"HIDE_PREMIUM_OFFER_OPTION" = "プレミアムの登録オファーを消す";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "プロフィールとナビゲーションバーの「認証される」「アップグレード」ボタンを削除します。";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "トレンドの動画を消す";
"HIDE_TREND_VIDEOS_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 @@ -52,6 +52,9 @@
"HIDE_PREMIUM_OFFER_OPTION" = "Скрыть предложение премиум-регистрации";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "Скрыть кнопку «Подтвердить подлинность» и «Улучшить подписку» в профиле и на панели навигации";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "Скрыть популярные видео";
"HIDE_TREND_VIDEOS_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 @@ -52,6 +52,9 @@
"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";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "Trend olan videoları gizle";
"HIDE_TREND_VIDEOS_OPTION_DETAIL_TITLE" = "Arama sekmesinde trend olan videoları gizle";

"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 @@ -53,6 +53,9 @@
"HIDE_PREMIUM_OFFER_OPTION" = "隱藏高級註冊優惠";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "在個人檔案和導覽列中隱藏獲得認證和升級按鈕";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "隱藏熱門影片";
"HIDE_TREND_VIDEOS_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 @@ -52,6 +52,9 @@
"HIDE_PREMIUM_OFFER_OPTION" = "隐藏高级注册优惠";
"HIDE_PREMIUM_OFFER_OPTION_DETAIL_TITLE" = "在个人资料和导航栏中隐藏通过验证和升级按钮";

"HIDE_TREND_VIDEOS_OPTION_TITLE" = "隐藏热门视频";
"HIDE_TREND_VIDEOS_OPTION_DETAIL_TITLE" = "隐藏搜索标签中的热门视频";

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

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

0 comments on commit 9112393

Please sign in to comment.