Skip to content

Commit

Permalink
update 3.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
BandarHL committed Mar 14, 2023
1 parent 74c7282 commit 17e72a2
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 4 deletions.
1 change: 1 addition & 0 deletions BHTwitter/BHTManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@
+ (BOOL)forceTweetFullFrame;
+ (BOOL)stripTrackingParams;
+ (BOOL)disableImmersive;
+ (BOOL)alwaysFollowingPage;
@end

3 changes: 3 additions & 0 deletions BHTwitter/BHTManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ + (BOOL)stripTrackingParams {
+ (BOOL)disableImmersive {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"disable_immersive_player"];
}
+ (BOOL)alwaysFollowingPage {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"always_following_page"];
}
+ (UIViewController *)BHTSettingsWithAccount:(TFNTwitterAccount *)twAccount {
SettingsViewController *pref = [[SettingsViewController alloc] initWithTwitterAccount:twAccount];
[pref.navigationItem setTitleView:[objc_getClass("TFNTitleView") titleViewWithTitle:@"BHTwitter" subtitle:twAccount.displayUsername]];
Expand Down
23 changes: 23 additions & 0 deletions BHTwitter/BHTwitter.x
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,29 @@ static void batchSwizzlingOnClass(Class cls, NSArray<NSString*>*origSelectors, I
}
%end


// MARK: Always use Following page
%hook TFNScrollingHorizontalLabelView
- (NSUInteger)startingIndex {
if ([BHTManager alwaysFollowingPage]) {
UIViewController *Navigation = self.NearestViewController;
if ([Navigation.childViewControllers[0] isKindOfClass:%c(THFHomeTimelineContainerViewController)] || [Navigation.childViewControllers[0] isKindOfClass:%c(T1HomeTimelineContainerViewController)]) {
[self setValue:[NSNumber numberWithInteger:1] forKey:@"_startingIndex"];
return 1;
}
}
return %orig;
}

%new - (UIViewController *)NearestViewController {
UIResponder *responder = self;
while ([responder isKindOfClass:[UIView class]])
responder = [responder nextResponder];
return (UIViewController *)responder;
}
%end


// MARK: Always open in Safrai
// Thanks nyuszika7h https://github.com/nyuszika7h/noinappsafari/
%hook SFSafariViewController
Expand Down
2 changes: 1 addition & 1 deletion BHTwitter/Package/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: com.bandarhl.BHTwitter
Name: BHTwitter
Version: 3.9
Version: 3.9.1
Description: Awesome tweak for Twitter
Section: Tweaks
Depends: firmware (>= 13.0), mobilesubstrate, ws.hbang.common (>= 1.17)
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@

"SHOW_SCOLL_INDICATOR_OPTION_TITLE" = "إظهار شريط التمرير الجانبي";

"ALWAYS_FOLLOWING_PAGE_OPTION_TITLE" = "فتح التطبيق على صفحة المتابعة";
"ALWAYS_FOLLOWING_PAGE_OPTION_DETAIL_TITLE" = "إجبار تويتر على إستخدام قسم المتابعة في التايم لاين كصفحة رئيسية عند فتح التطبيق.";

"FONT_OPTION_TITLE" = "تفعيل تغيير خط التطبيق";
"FONT_OPTION_DETAIL_TITLE" = "خيار لتفعيل تغيير خط تويتر";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@

"SHOW_SCOLL_INDICATOR_OPTION_TITLE" = "Show Scroll Bar";

"ALWAYS_FOLLOWING_PAGE_OPTION_TITLE" = "Always start on Following page";
"ALWAYS_FOLLOWING_PAGE_OPTION_DETAIL_TITLE" = "Force Twitter to always use Following section of the timeline when the user start the application";

"FONT_OPTION_TITLE" = "Enable changing font";
"FONT_OPTION_DETAIL_TITLE" = "Option to allow changing Twitter font and show font picker.";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@
"DISABLE_IMMERSIVE_PLAYER_TITLE" = "Desactivar reproductor inmersivo";
"DISABLE_IMMERSIVE_PLAYER_DETAIL_TITLE" = "Desactivar el nuevo reproductor de vídeo de Twitter (Reproductor inmersivo)";

"SHOW_SCOLL_INDICATOR_OPTION_TITLE" = "Mostrar barra de desplazamiento";

"FONT_OPTION_TITLE" = "Activar el cambio de fuente";
"FONT_OPTION_DETAIL_TITLE" = "Opción para permitir cambiar la fuente de Twitter y mostrar el selector de fuentes";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@
"FORCE_TWEET_FULL_FRAME_TITLE" = "Twitterで画像を全体表示するように強制する";

"DISABLE_IMMERSIVE_PLAYER_TITLE" = "イマーシブプレーヤーを無効化";
"DISABLE_IMMERSIVE_PLAYER_DETAIL_TITLE" = "Twitterの新しい動画プレーヤーを無効にする (イマーシブプレーヤー)";
"DISABLE_IMMERSIVE_PLAYER_DETAIL_TITLE" = "Twitterの新しい動画プレーヤーを無効にします。 (イマーシブプレーヤー)";

"SHOW_SCOLL_INDICATOR_OPTION_TITLE" = "スクロールバーを表示します。";

"FONT_OPTION_TITLE" = "カスタムフォントの有効化";
"FONT_OPTION_DETAIL_TITLE" = "Twitterのフォントを変更できるようにします。";
Expand All @@ -151,7 +153,7 @@

"DEBUG_SECTION_HEADER_TITLE" = "デバッグ";
"FLEX_OPTION_TITLE" = "FLEXの有効化";
"FLEX_OPTION_DETAIL_TITLE" = "TwitterアプリでFLEXを表示";
"FLEX_OPTION_DETAIL_TITLE" = "TwitterアプリでFLEXを表示します。";

"LEGAL_SECTION_HEADER_TITLE" = "法的通知";
"LEGAL_BUTTON_TITLE" = "謝辞";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@
"DISABLE_IMMERSIVE_PLAYER_TITLE" = "禁用沉浸式播放器";
"DISABLE_IMMERSIVE_PLAYER_DETAIL_TITLE" = "禁用 Twitter 新版影片播放器(沉浸式播放)";

"SHOW_SCOLL_INDICATOR_OPTION_TITLE" = "顯示滾動條";

"FONT_OPTION_TITLE" = "更換字體";
"FONT_OPTION_DETAIL_TITLE" = "啟用此選項,可以更換 Twitter 字體";

Expand Down
5 changes: 4 additions & 1 deletion BHTwitter/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,15 @@ - (NSArray *)specifiers {

PSSpecifier *showScrollIndicator = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"SHOW_SCOLL_INDICATOR_OPTION_TITLE"] detailTitle:nil key:@"showScollIndicator" defaultValue:false changeAction:nil];

PSSpecifier *alwaysFollowingPage = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"ALWAYS_FOLLOWING_PAGE_OPTION_TITLE"] detailTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"ALWAYS_FOLLOWING_PAGE_OPTION_DETAIL_TITLE"] key:@"always_following_page" defaultValue:false changeAction:nil];

PSSpecifier *font = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"FONT_OPTION_TITLE"] detailTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"FONT_OPTION_DETAIL_TITLE"] key:@"en_font" defaultValue:false changeAction:nil];

PSSpecifier *regularFontsPicker = [self newButtonCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"REQULAR_FONTS_PICKER_OPTION_TITLE"] detailTitle:[[NSUserDefaults standardUserDefaults] objectForKey:@"bhtwitter_font_1"] dynamicRule:@"en_font, ==, 0" action:@selector(showRegularFontPicker:)];

PSSpecifier *boldFontsPicker = [self newButtonCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"BOLD_FONTS_PICKER_OPTION_TITLE"] detailTitle:[[NSUserDefaults standardUserDefaults] objectForKey:@"bhtwitter_font_2"] dynamicRule:@"en_font, ==, 0" action:@selector(showBoldFontPicker:)];

// dubug section
// debug section
PSSpecifier *flex = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"FLEX_OPTION_TITLE"] detailTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"FLEX_OPTION_DETAIL_TITLE"] key:@"flex_twitter" defaultValue:false changeAction:@selector(FLEXAction:)];

// legal section
Expand Down Expand Up @@ -265,6 +267,7 @@ - (NSArray *)specifiers {
forceFullFrame,
disableImmersive,
showScrollIndicator,
alwaysFollowingPage,
font,
regularFontsPicker,
boldFontsPicker,
Expand Down
4 changes: 4 additions & 0 deletions BHTwitter/TWHeaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ static NSString *_lastCopiedURL;
@property (nonatomic, strong) TFNTwitterAccount *account;
@end

@interface TFNScrollingHorizontalLabelView : UIView
- (UIViewController *)NearestViewController;
@end

@interface TFNNavigationController : UINavigationController
@end

Expand Down

0 comments on commit 17e72a2

Please sign in to comment.