From 17e72a2d3c1ce40805e08eb0561305184200a490 Mon Sep 17 00:00:00 2001 From: BandarHelal <31299470+BandarHL@users.noreply.github.com> Date: Tue, 14 Mar 2023 08:26:27 +0300 Subject: [PATCH] update 3.9.1 --- BHTwitter/BHTManager.h | 1 + BHTwitter/BHTManager.m | 3 +++ BHTwitter/BHTwitter.x | 23 ++++++++++++++++++ BHTwitter/Package/DEBIAN/control | 2 +- .../BHT/BHTwitter.bundle/Info.plist | Bin 534 -> 536 bytes .../ar.lproj/Localizable.strings | 3 +++ .../en.lproj/Localizable.strings | 3 +++ .../es.lproj/Localizable.strings | 2 ++ .../ja.lproj/Localizable.strings | 6 +++-- .../zh-Hant.lproj/Localizable.strings | 2 ++ BHTwitter/SettingsViewController.m | 5 +++- BHTwitter/TWHeaders.h | 4 +++ 12 files changed, 50 insertions(+), 4 deletions(-) diff --git a/BHTwitter/BHTManager.h b/BHTwitter/BHTManager.h index 58c9bc83..302a0ff7 100644 --- a/BHTwitter/BHTManager.h +++ b/BHTwitter/BHTManager.h @@ -53,5 +53,6 @@ + (BOOL)forceTweetFullFrame; + (BOOL)stripTrackingParams; + (BOOL)disableImmersive; ++ (BOOL)alwaysFollowingPage; @end diff --git a/BHTwitter/BHTManager.m b/BHTwitter/BHTManager.m index faf36dff..51f7d10d 100644 --- a/BHTwitter/BHTManager.m +++ b/BHTwitter/BHTManager.m @@ -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]]; diff --git a/BHTwitter/BHTwitter.x b/BHTwitter/BHTwitter.x index cce56603..4372c982 100644 --- a/BHTwitter/BHTwitter.x +++ b/BHTwitter/BHTwitter.x @@ -593,6 +593,29 @@ static void batchSwizzlingOnClass(Class cls, NSArray*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 diff --git a/BHTwitter/Package/DEBIAN/control b/BHTwitter/Package/DEBIAN/control index 392497d2..bc5b266c 100644 --- a/BHTwitter/Package/DEBIAN/control +++ b/BHTwitter/Package/DEBIAN/control @@ -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) diff --git a/BHTwitter/Package/Library/Application Support/BHT/BHTwitter.bundle/Info.plist b/BHTwitter/Package/Library/Application Support/BHT/BHTwitter.bundle/Info.plist index bef07941cf1ca72a8c5bbbac07fe0a88aaf450a0..89ae214409d16e9512946deed07875eb2a94c1c3 100644 GIT binary patch delta 34 qcmbQnGJ|Eq6h^jCV?9ef!^txkLpf(L&SzZ4xSny-