diff --git a/BHTwitter.xcodeproj/project.pbxproj b/BHTwitter.xcodeproj/project.pbxproj index a99db9fd..04c55a4b 100644 --- a/BHTwitter.xcodeproj/project.pbxproj +++ b/BHTwitter.xcodeproj/project.pbxproj @@ -19,7 +19,6 @@ 50198013250E053900207745 /* BHDownload.m in Sources */ = {isa = PBXBuildFile; fileRef = 50198011250E053900207745 /* BHDownload.m */; }; 5020A87824E758E00080F292 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5020A87724E758E00080F292 /* UIKit.framework */; }; 5020A87A24E758E00080F292 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5020A87924E758E00080F292 /* Foundation.framework */; }; - 5020A88524E758E00080F292 /* BHTwitter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5020A88424E758E00080F292 /* BHTwitter.mm */; }; 5020A8D824E759190080F292 /* TWHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 5020A8D524E759190080F292 /* TWHeaders.h */; }; 5020A8D924E759190080F292 /* BHTManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 5020A8D624E759190080F292 /* BHTManager.h */; }; 5020A8DA24E759190080F292 /* BHTManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5020A8D724E759190080F292 /* BHTManager.m */; }; @@ -53,6 +52,7 @@ 50FAE061288545F600CDCEB2 /* SettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 50FAE05F288545F600CDCEB2 /* SettingsViewController.m */; }; 91086148293001530011609E /* FLEX in Frameworks */ = {isa = PBXBuildFile; productRef = 91086147293001530011609E /* FLEX */; }; 9108614B293005750011609E /* JGProgressHUD in Frameworks */ = {isa = PBXBuildFile; productRef = 9108614A293005750011609E /* JGProgressHUD */; }; + 916CFDE12971A4CF00325345 /* BHTwitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 916CFDE02971A4CF00325345 /* BHTwitter.m */; }; 916F1E1B2912F16D00865DD2 /* Preferences.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 916F1E1A2912F16D00865DD2 /* Preferences.framework */; }; /* End PBXBuildFile section */ @@ -72,8 +72,7 @@ 5020A87924E758E00080F292 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 5020A88024E758E00080F292 /* control */ = {isa = PBXFileReference; lastKnownFileType = text; path = control; sourceTree = ""; }; 5020A88224E758E00080F292 /* BHTwitter-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "BHTwitter-Prefix.pch"; path = "../BHTwitter-Prefix.pch"; sourceTree = ""; }; - 5020A88324E758E00080F292 /* BHTwitter.xm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; path = BHTwitter.xm; sourceTree = ""; }; - 5020A88424E758E00080F292 /* BHTwitter.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = BHTwitter.mm; sourceTree = ""; }; + 5020A88324E758E00080F292 /* BHTwitter.x */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; path = BHTwitter.x; sourceTree = ""; }; 5020A88924E758E00080F292 /* BHTwitter.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = BHTwitter.plist; sourceTree = ""; }; 5020A8D524E759190080F292 /* TWHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TWHeaders.h; sourceTree = ""; }; 5020A8D624E759190080F292 /* BHTManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BHTManager.h; sourceTree = ""; }; @@ -108,6 +107,7 @@ 50FAE056288545DB00CDCEB2 /* CepheiUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CepheiUI.framework; path = ../../../../../opt/theos/vendor/lib/CepheiUI.framework; sourceTree = ""; }; 50FAE05E288545F600CDCEB2 /* SettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsViewController.h; sourceTree = ""; }; 50FAE05F288545F600CDCEB2 /* SettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingsViewController.m; sourceTree = ""; }; + 916CFDE02971A4CF00325345 /* BHTwitter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BHTwitter.m; sourceTree = ""; }; 916F1E1A2912F16D00865DD2 /* Preferences.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Preferences.framework; path = ../../../../../opt/theos/sdks/iPhoneOS16.0.sdk/System/Library/PrivateFrameworks/Preferences.framework; sourceTree = ""; }; /* End PBXFileReference section */ @@ -209,8 +209,8 @@ 5020A87D24E758E00080F292 /* BHTwitter */ = { isa = PBXGroup; children = ( - 5020A88324E758E00080F292 /* BHTwitter.xm */, - 5020A88424E758E00080F292 /* BHTwitter.mm */, + 5020A88324E758E00080F292 /* BHTwitter.x */, + 916CFDE02971A4CF00325345 /* BHTwitter.m */, 5020A8D524E759190080F292 /* TWHeaders.h */, 50198010250E053900207745 /* BHDownload.h */, 50198011250E053900207745 /* BHDownload.m */, @@ -431,12 +431,12 @@ 500DA69D26FF930A00C020B2 /* SAMKeychainQuery.m in Sources */, 50198013250E053900207745 /* BHDownload.m in Sources */, 500DA6A426FF9CFE00C020B2 /* SAMKeychain.m in Sources */, - 5020A88524E758E00080F292 /* BHTwitter.mm in Sources */, 500DA6A926FF9D5100C020B2 /* AuthViewController.m in Sources */, 5061F3C02806133400F3D5D3 /* CustomTabBarViewController.swift in Sources */, 50EE4D4B286F7F70007DE117 /* BHColorThemeViewController.swift in Sources */, 50F7929028A0EA22000A2269 /* BHTBundle.m in Sources */, 500DA6A126FF95B100C020B2 /* keychain.m in Sources */, + 916CFDE12971A4CF00325345 /* BHTwitter.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -572,6 +572,7 @@ ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "BHTwitter/BHTwitter-Prefix.pch"; + GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = NO; INFOPLIST_FILE = ""; INSTALL_PATH = /Library/MobileSubstrate/DynamicLibraries; IPHONEOS_DEPLOYMENT_TARGET = 13.0; @@ -609,6 +610,7 @@ "-Wno-undeclared-selector", "-Wno-objc-designated-initializers", "-Wno-nullability-completeness", + "-Wno-error", ); }; name = Release; @@ -634,6 +636,7 @@ ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "BHTwitter/BHTwitter-Prefix.pch"; + GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = NO; INFOPLIST_FILE = ""; INSTALL_PATH = /Library/MobileSubstrate/DynamicLibraries; IPHONEOS_DEPLOYMENT_TARGET = 13.0; @@ -672,6 +675,7 @@ "-Wno-undeclared-selector", "-Wno-objc-designated-initializers", "-Wno-nullability-completeness", + "-Wno-error", ); }; name = Debug; diff --git a/BHTwitter/BHTwitter.mm b/BHTwitter/BHTwitter.m similarity index 100% rename from BHTwitter/BHTwitter.mm rename to BHTwitter/BHTwitter.m diff --git a/BHTwitter/BHTwitter.xm b/BHTwitter/BHTwitter.x similarity index 78% rename from BHTwitter/BHTwitter.xm rename to BHTwitter/BHTwitter.x index cc1c007e..c7768d7b 100644 --- a/BHTwitter/BHTwitter.xm +++ b/BHTwitter/BHTwitter.x @@ -6,6 +6,25 @@ %config(generator=internal) +static UIFont * _Nullable TAEStandardFontGroupReplacement(UIFont *self, SEL _cmd) { + BH_BaseImp orig = originalFontsIMP[NSStringFromSelector(_cmd)].pointerValue; + UIFont *origFont = orig(self, _cmd); + UIFont *newFont = BH_getDefaultFont(origFont); + return newFont != nil ? newFont : origFont; +} +static void batchSwizzlingOnClass(Class cls, NSArray*origSelectors, IMP newIMP){ + for (NSString *sel in origSelectors) { + SEL origSel = NSSelectorFromString(sel); + Method origMethod = class_getInstanceMethod(cls, origSel); + if (origMethod != NULL) { + BH_BaseImp oldImp = (BH_BaseImp)class_replaceMethod(cls, origSel, newIMP, method_getTypeEncoding(origMethod)); + [originalFontsIMP setObject:[NSValue valueWithPointer:oldImp] forKey:sel]; + } else { + NSLog(@"[BHTwitter] Can't find method (%@) in Class (%@)", sel, NSStringFromClass(cls)); + } + } +} + // MARK: Clean cache and Padlock %hook T1AppDelegate - (_Bool)application:(UIApplication *)application didFinishLaunchingWithOptions:(id)arg2 { @@ -96,25 +115,25 @@ [copyButton setMenu:[UIMenu menuWithTitle:@"" children:@[ [UIAction actionWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"COPY_PROFILE_INFO_MENU_OPTION_1"] image:[UIImage systemImageNamed:@"doc.on.clipboard"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) { - if (self.viewModel.bio != nil) - UIPasteboard.generalPasteboard.string = self.viewModel.bio; - }], + if (self.viewModel.bio != nil) + UIPasteboard.generalPasteboard.string = self.viewModel.bio; + }], [UIAction actionWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"COPY_PROFILE_INFO_MENU_OPTION_2"] image:[UIImage systemImageNamed:@"doc.on.clipboard"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) { - if (self.viewModel.username != nil) - UIPasteboard.generalPasteboard.string = self.viewModel.username; - }], + if (self.viewModel.username != nil) + UIPasteboard.generalPasteboard.string = self.viewModel.username; + }], [UIAction actionWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"COPY_PROFILE_INFO_MENU_OPTION_3"] image:[UIImage systemImageNamed:@"doc.on.clipboard"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) { - if (self.viewModel.fullName != nil) - UIPasteboard.generalPasteboard.string = self.viewModel.fullName; - }], + if (self.viewModel.fullName != nil) + UIPasteboard.generalPasteboard.string = self.viewModel.fullName; + }], [UIAction actionWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"COPY_PROFILE_INFO_MENU_OPTION_4"] image:[UIImage systemImageNamed:@"doc.on.clipboard"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) { - if (self.viewModel.url != nil) - UIPasteboard.generalPasteboard.string = self.viewModel.url; - }], + if (self.viewModel.url != nil) + UIPasteboard.generalPasteboard.string = self.viewModel.url; + }], [UIAction actionWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"COPY_PROFILE_INFO_MENU_OPTION_5"] image:[UIImage systemImageNamed:@"doc.on.clipboard"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) { - if (self.viewModel.location != nil) - UIPasteboard.generalPasteboard.string = self.viewModel.location; - }], + if (self.viewModel.location != nil) + UIPasteboard.generalPasteboard.string = self.viewModel.location; + }], ]]]; } else { @@ -563,16 +582,16 @@ if (![BHTManager alwaysOpenSafari]) { return %orig; } - + NSURL *url = [self initialURL]; NSString *urlStr = [url absoluteString]; - + // In-app browser is used for two-factor authentication with security key, // login will not complete successfully if it's redirected to Safari if ([urlStr containsString:@"twitter.com/account/"] || [urlStr containsString:@"twitter.com/i/flow/"]) { return %orig; } - + [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil]; [self dismissViewControllerAnimated:NO completion:nil]; } @@ -942,7 +961,7 @@ %hook TFNActionItem %new + (instancetype)actionItemWithTitle:(NSString *)arg1 systemImageName:(NSString *)arg2 action:(void (^)(void))arg3 { TFNActionItem *_self = [%c(TFNActionItem) actionItemWithTitle:arg1 imageName:nil action:arg3]; - [_self setValue:[UIImage systemImageNamed:arg2] forKey:@"_image"]; + [_self setValue:[UIImage systemImageNamed:arg2] forKey:@"_image"]; return _self; } %end @@ -1073,340 +1092,32 @@ %end %hook TAEStandardFontGroup -- (UIFont *)profilesFollowingCountFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)profilesFollowingFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)userCellFollowsYouFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)dashFollowingCountFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)dashFollowingFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)carouselUsernameFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)carouselDisplayNameFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)profilesFullNameFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)profilesUsernameFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)readerModeSmallFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)readerModeSmallBoldFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(true, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)readerModeMediumFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)readerModeMediumBoldFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(true, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)readerModeLargeFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)readerModeLargeBoldFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(true, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)treeTopicsDescriptionFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)treeTopicsCategoryNameFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)treeTopicsNameFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)treeTopicsCategoryNameLargeFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)topicsPillNameFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)topicsDescriptionFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)topicsNameFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)composerTextEditorFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)statusCellEdgeToEdgeBodyBoldFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(true, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)statusCellEdgeToEdgeBodyFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)statusCellBodyFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)statusCellBodyBoldFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(true, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)cardAttributionFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)cardTitleBoldFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(true, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)cardTitleFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)tweetDetailBoldFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(true, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)tweetDetailFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)directMessageBubbleBodyFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)directMessageComposePersistentBarFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)fixedJumboBoldFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(true, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)fixedXLargeBoldFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(true, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)fixedLargeBoldFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(true, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)fixedNormalBoldFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(true, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)fixedSmallBoldFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(true, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)fixedJumboFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)fixedXLargeFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)fixedLargeFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)fixedNormalFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)fixedSmallFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)jumboBoldFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(true, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)xLargeBoldFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(true, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)largeBoldFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(true, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)normalBoldFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(true, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)smallBoldFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(true, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)xSmallBoldFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(true, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)jumboFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)xLargeFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)largeFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)normalFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)smallFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)xSmallFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)buttonXLargeFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)buttonLargeFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)buttonMediumFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)buttonMedium_CondensedFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)buttonMedium_CondensedLighterFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)buttonSmallFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)buttonSmallLighterFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)buttonSmall_CondensedFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)buttonSmall_CondensedLighterFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)buttonNavigationBarFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; -} -- (UIFont *)buttonHeavyNavigationBarFont { - UIFont *origFont = %orig; - UIFont *newFont = BH_getDefaultFont(false, origFont.pointSize); - return newFont != nil ? newFont : origFont; ++ (TAEStandardFontGroup*)sharedFontGroup { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + NSArray *fontsMethods = @[ + @"profilesFollowingCountFont", @"profilesFollowingFont", @"userCellFollowsYouFont", @"dashFollowingCountFont", + @"dashFollowingFont", @"carouselUsernameFont", @"carouselDisplayNameFont", @"profilesFullNameFont", + @"profilesUsernameFont", @"readerModeSmallFont", @"readerModeSmallBoldFont", @"readerModeMediumFont", + @"readerModeMediumBoldFont", @"readerModeLargeFont", @"readerModeLargeBoldFont", @"treeTopicsDescriptionFont", + @"treeTopicsCategoryNameFont", @"treeTopicsNameFont", @"treeTopicsCategoryNameLargeFont", @"topicsPillNameFont", + @"topicsDescriptionFont", @"topicsNameFont", @"composerTextEditorFont", @"statusCellEdgeToEdgeBodyBoldFont", + @"statusCellEdgeToEdgeBodyFont", @"statusCellBodyFont", @"statusCellBodyBoldFont", @"cardAttributionFont", + @"cardTitleBoldFont", @"cardTitleFont", @"tweetDetailBoldFont", @"tweetDetailFont", + @"directMessageBubbleBodyFont", @"directMessageComposePersistentBarFont", @"fixedJumboBoldFont", @"fixedXLargeBoldFont", + @"fixedLargeBoldFont", @"fixedNormalBoldFont", @"fixedSmallBoldFont", @"fixedJumboFont", + @"fixedXLargeFont", @"fixedLargeFont", @"fixedNormalFont", @"fixedSmallFont", + @"jumboBoldFont", @"xLargeBoldFont", @"largeBoldFont", @"normalBoldFont", + @"smallBoldFont", @"jumboFont", @"xLargeFont", @"largeFont", + @"normalFont", @"smallFont", @"buttonXLargeFont", @"buttonLargeFont", + @"buttonMediumFont", @"buttonMedium_CondensedFont", @"buttonMedium_CondensedLighterFont", @"buttonSmallFont", + @"buttonSmallLighterFont", @"buttonSmall_CondensedFont", @"buttonSmall_CondensedLighterFont", @"buttonNavigationBarFont", + @"buttonHeavyNavigationBarFont" + ]; + originalFontsIMP = [NSMutableDictionary new]; + batchSwizzlingOnClass([self class], fontsMethods, (IMP)TAEStandardFontGroupReplacement); + }); + return %orig; } %end @@ -1436,16 +1147,19 @@ //%end // MARK: Clean tracking from copied links: https://github.com/BandarHL/BHTwitter/issues/75 -static id _PasteboardChangeObserver; -// format = {"host": ["parm1", "parm2"...]} // https://developer.apple.com/documentation/foundation/nsurl/1413640-host -static NSDictionary*> *trackingParams = @{@"twitter.com" : @[@"s", @"t"]}; -static NSString *_lastCopiedURL; - %ctor { NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; NSOperationQueue *mainQueue = [NSOperationQueue mainQueue]; // Someone needs to hold reference the to Notification _PasteboardChangeObserver = [center addObserverForName:UIPasteboardChangedNotification object:nil queue:mainQueue usingBlock:^(NSNotification * _Nonnull note){ + + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + trackingParams = @{ + @"twitter.com" : @[@"s", @"t"] + }; + }); + if ([BHTManager stripTrackingParams]) { if (UIPasteboard.generalPasteboard.hasURLs) { NSURL *pasteboardURL = UIPasteboard.generalPasteboard.URL; diff --git a/BHTwitter/Package/DEBIAN/control b/BHTwitter/Package/DEBIAN/control index 35fcb9bb..0ba928aa 100644 --- a/BHTwitter/Package/DEBIAN/control +++ b/BHTwitter/Package/DEBIAN/control @@ -1,6 +1,6 @@ Package: com.bandarhl.BHTwitter Name: BHTwitter -Version: 3.6 +Version: 3.7 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 e426d0ff..04f1cf73 100644 Binary files a/BHTwitter/Package/Library/Application Support/BHT/BHTwitter.bundle/Info.plist and b/BHTwitter/Package/Library/Application Support/BHT/BHTwitter.bundle/Info.plist differ diff --git a/BHTwitter/Package/Library/Application Support/BHT/BHTwitter.bundle/ar.lproj/Localizable.strings b/BHTwitter/Package/Library/Application Support/BHT/BHTwitter.bundle/ar.lproj/Localizable.strings new file mode 100644 index 00000000..5ce8e12c --- /dev/null +++ b/BHTwitter/Package/Library/Application Support/BHT/BHTwitter.bundle/ar.lproj/Localizable.strings @@ -0,0 +1,159 @@ +/* + ar + BHTwitter +*/ + +"BHTWITTER_SETTINGS_TITLE" = "الإعدادات"; +"BHTWITTER_SETTINGS_DETAIL" = "BHTwitter إعدادات"; + +"DOWNLOAD_MENU_TITLE" = "\nقم باختيار جودة تحميل الفيديو"; +"CUSTOM_FONTS_MENU_TITLE" = "\nقم بإختيار الخط "; +"CUSTOM_FONTS_TUT_ALERT_MESSAGE" = "لم يتم العثور على خط مثبت على الجهاز . \nكيف أقوم بتثبيت الخطوط؟ \nاذهب الى AppStore ثم قم بتثبيت تطبيق iFont ومن ثم قم بالبحث أو استيراد الخطوط التي تريدها وتثبيتها ، بعد ذلك يفترض أن تجد الخط المثبت هنا"; + +"OK_BUTTON_TITLE" = "حسنا"; +"YES_BUTTON_TITLE" = "نعم"; +"NO_BUTTON_TITLE" = "لا"; +"CONFIRM_ALERT_MESSAGE" = "هل أنت متأكد ؟"; +"CANCEL_BUTTON_TITLE" = "إلغاء"; + +"PROGRESS_DOWNLOADING_STATUS_TITLE" = "جاري التنزيل"; + +"CUSTOM_FONTS_NAVIGATION_BUTTON_TITLE" = "خط مخصص"; +"CUSTOM_FONTS_NAVIGATION_TITLE" = "اختر الخط"; +"THEME_SETTINGS_NAVIGATION_TITLE" = "الثيم"; +"CUSTOM_TAB_BAR_SETTINGS_NAVIGATION_TITLE" = "تخصيص الشريط السفلي"; +"ACKNOWLEDGEMENTS_SETTINGS_NAVIGATION_TITLE" = "الحقوق"; + +"COPY_PROFILE_INFO_MENU_OPTION_1" = "نسخ البايو"; +"COPY_PROFILE_INFO_MENU_OPTION_2" = "نسخ اسم المستخدم"; +"COPY_PROFILE_INFO_MENU_OPTION_3" = "نسخ اسم المستخدم كاملا"; +"COPY_PROFILE_INFO_MENU_OPTION_4" = "نسخ رابط البايو"; +"COPY_PROFILE_INFO_MENU_OPTION_5" = "نسخ الموقع الجغرافي"; + +"MAIN_SECTION_HEADER_TITLE" = "BHTwitter إعدادات"; +"DOWNLOAD_VIDEOS_OPTION_TITLE" = "تنزيل الفيديوهات"; +"DOWNLOAD_VIDEOS_OPTION_DETAIL_TITLE" = "تنزيل الفيديوهات بإضافة زر للتغريدة وداخل الفيديو"; + +"DIRECT_SAVE_OPTION_TITLE" = "حفظ مباشر"; +"DIRECT_SAVE_OPTION_DETAIL_TITLE" = "حفظ الفيديو مباشرة بعد التنزيل"; + +"HIDE_ADS_OPTION_TITLE" = "إزالة الإعلانات"; +"HIDE_ADS_OPTION_DETAIL_TITLE" = "إزالة جميع الإعلانات المزعجة في تويتر"; + +"HIDE_TOPICS_OPTION_TITLE" = "إخفاء التغريدات الموضوعية"; +"HIDE_TOPICS_OPTION_DETAIL_TITLE" = "إزالة جميع التغريدات الموضوعية من الخط الزمني "; + +"HIDE_WHO_FOLLOW_OPTION" = "إخفاء اقتراحات المتابعة"; +"HIDE_WHO_FOLLOW_OPTION_DETAIL_TITLE" = "إخفاء اقتراحات المتابعة في الملفات الشخصية"; + +"HIDE_TOPICS_TO_FOLLOW_OPTION" = "إخفاء مواضيع للمتابعة"; +"HIDE_TOPICS_TO_FOLLOW_OPTION_DETAIL_TITLE" = "إخفاء مواضيع للمتابعة في الملفات الشخصية"; + +"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "تعطيل وصف الفيديو"; + +"VOICE_OPTION_TITLE" = "الملاحظة الصوتية"; +"VOICE_OPTION_DETAIL_TITLE" = "تفعيل الملاحظة الصوتية في التغريدة والرسائل الخاصة"; + +"VIDEO_ZOOM_OPTION_TITLE" = "تكبير الفيديو"; +"VIDEO_ZOOM_OPTION_DETAIL_TITLE" = "يمكنك تكبير الفيديو عبر الضغط مرتين في وسط الفيديو ."; + +"NO_HISTORY_OPTION_TITLE" = "عدم حفظ سجل البحث"; +"NO_HISTORY_OPTION_DETAIL_TITLE" = "إجبار التطبيق على التوقف عن حفظ سجل البحث ."; + +"BIO_TRANSALTE_OPTION_TITLE" = "ترجمة البايو"; +"BIO_TRANSALTE_OPTION_DETAIL_TITLE" = "إظهار زر في البايو لترجمته ."; + +"LIKE_CONFIRM_OPTION_TITLE" = "تأكيد الإعجاب"; +"LIKE_CONFIRM_OPTION_DETAIL_TITLE" = "إظهار تنبيه للتأكيد عند الضغط على زر الإعجاب ."; + +"TWEET_CONFIRM_OPTION_TITLE" = "تأكيد التغريد"; +"TWEET_CONFIRM_OPTION_DETAIL_TITLE" = "إظهار تنبيه للتأكيد عند الضغط على زر التغريد ."; + +"FOLLOW_CONFIRM_OPTION_TITLE" = "تأكيد المتابعة"; +"FOLLOW_CONFIRM_OPTION_DETAIL_TITLE" = "إظهار تنبيه للتأكيد عن الضغط على زر المتابعة ."; + +"PADLOCK_OPTION_TITLE" = "قفل التطبيق"; +"PADLOCK_OPTION_DETAIL_TITLE" = "قفل التطبيق بكلمة مرور ."; + +"DN_MODULAR_SEARCH_OPTION_TITLE" = "تفعيل نمط البحث في الرسائل الخاصة"; +"DN_MODULAR_SEARCH_OPTION_DETAIL_TITLE" = "تفعيل النمط الجديد للبحث في الرسائل الخاصة ."; + +"AUTO_HIGHEST_LOAD_OPTION_TITLE" = "تحميل الصور بأعلى جودة تلقائيا"; +"AUTO_HIGHEST_LOAD_OPTION_DETAIL_TITLE" = "هذا الخيار يقوم بتحميل ومعالجة الصورة بأعلى جودة ممكنة ."; + +"DISABLE_SENSITIVE_TWEET_WARNINGS_OPTION_TITLE" = "تعطيل تنبيه المحتوى الحساس"; +"TRUSTED_FRIENSS_OPTION_TITLE" = "تفعيل ميزة Twitter Circle "; + +"COPY_PROFILE_INFO_OPTION_TITLE" = "تفعيل نسخ المعلومات الموجودة في الصفحة الشخصية"; +"COPY_PROFILE_INFO_OPTION_DETAIL_TITLE" = "إضافة زر في الصفحة الشخصية يسمح لك بنسخ ما تريد ."; + +"TWEET_TO_IMAGE_OPTION_TITLE" = "حفظ التغريدة كصورة "; +"TWEET_TO_IMAGE_OPTION_DETAIL_TITLE" = "يمكنك حفظ التغريدة كصورة عبر الضغط المطوّل على زر مشاركة التغريدة ."; + +"HIDE_SPACE_OPTION_TITLE" = "إخفاء المساحات من الشريط العلوي"; + +"DISABLE_RTL_OPTION_TITLE" = "ضبط الاتجاه من اليمين إلى اليسار"; +"DISABLE_RTL_OPTION_DETAIL_TITLE" = "تغيير اتجاه النصوص والقوائم من اليمين إلى اليسار (يجب إغلاق التطبيق)"; + +"ALWAYS_OPEN_SAFARI_OPTION_TITLE" = "فتح الروابط في المتصفح"; +"ALWAYS_OPEN_SAFARI_OPTION_DETAIL_TITLE" = "إجبار التطبيق على فتح الروابط في المتصفح الإفتراضي ."; + +"STRIP_URL_TRACKING_PARAMETERS_TITLE" = "حذف التتبع من الروابط"; +"STRIP_URL_TRACKING_PARAMETERS_DETAIL_TITLE" = "حذف معلومات التتبع من رابط التغريدة عند نسخها "; + +"TWITTER_BLUE_SECTION_HEADER_TITLE" = "Twitter blue مزايا"; +"UNDO_TWEET_OPTION_TITLE" = "التراجع عن التغريد"; +"UNDO_TWEET_OPTION_DETAIL_TITLE" = "التراجع عن التغريد بعد إرسالها ."; + +"READER_MODE_OPTION_TITLE" = "نمط القراءة"; +"READER_MODE_OPTION_DETAIL_TITLE" = "تفعيل نمط القراءة في الثريدات ."; + +"THEME_OPTION_TITLE" = "الثيم"; +"THEME_OPTION_DETAIL_TITLE" = "قم بإختيار لون الثيم الذي تريده ."; +"THEME_OPTION_1" = "أزرق"; +"THEME_OPTION_2" = "أصفر"; +"THEME_OPTION_3" = "أحمر"; +"THEME_OPTION_4" = "أرجواني"; +"THEME_OPTION_5" = "البرتقالي"; +"THEME_OPTION_6" = "أخضر"; + +"CUSTOM_TAB_BAR_OPTION_TITLE" = "تخصيص الشريط السفلي"; +"CUSTOM_TAB_BAR_REST_MESSAGE" = "هل انت متأكد انك تريد أعادة ضبط الاعدادات؟"; +"CUSTOM_TAB_BAR_SECTION_1_TITLE" = "عناصر الشريط السلفي الظاهرة"; +"CUSTOM_TAB_BAR_SECTION_2_TITLE" = "عناصر الشريط السلفي المخفية"; +"CUSTOM_TAB_BAR_OPTION_1" = "الرئيسية"; +"CUSTOM_TAB_BAR_OPTION_2" = "البحث"; +"CUSTOM_TAB_BAR_OPTION_3" = "المساحات"; +"CUSTOM_TAB_BAR_OPTION_4" = "المجتمعات"; +"CUSTOM_TAB_BAR_OPTION_5" = "التنبيهات"; +"CUSTOM_TAB_BAR_OPTION_6" = "الرسائل"; + +"TWITTER_BLUE_SECTION_FOOTER_TITLE" = "قم بإغلاق التطبيق لحفظ التغييرات ."; + +"LAYOUT_CUS_SECTION_HEADER_TITLE" = "تخصيص المظهر"; +"ORIG_TWEET_STYLE_OPTION_TITLE" = "تعطيل النمط الجديد للتغريدة"; +"ORIG_TWEET_STYLE_OPTION_DETAIL_TITLE" = "إجبار التطبيق على استخدام النمط الأساسي"; + +"HIDE_VIEW_COUNT_OPTION_TITLE" = "إخفاء عدد مُشاهدة التغريدة"; +"HIDE_VIEW_COUNT_OPTION_DETAIL_TITLE" = "إزالة عدد المُشاهدات من التغريدة"; + +"SHOW_TWEET_SOURCE_TITLE" = "إظهار مصدر التغريدة "; + +"FORCE_TWEET_FULL_FRAME_TITLE" = "إجبار تويتر على إستخدام الإطار الكامل للصور"; + +"FONT_OPTION_TITLE" = "تفعيل تغيير خط التطبيق"; +"FONT_OPTION_DETAIL_TITLE" = "خيار لتفعيل تغيير خط تويتر"; + +"REQULAR_FONTS_PICKER_OPTION_TITLE" = "الخط"; +"BOLD_FONTS_PICKER_OPTION_TITLE" = "خط غامق"; +"LAYOUT_CUS_SECTION_FOOTER_TITLE" = "قم بإغلاق التطبيق لحفظ التغييرات ."; + +"DEBUG_SECTION_HEADER_TITLE" = "Debugging"; +"FLEX_OPTION_TITLE" = "Enable FLEX"; +"FLEX_OPTION_DETAIL_TITLE" = "Show FLEX on twitter app."; + +"LEGAL_SECTION_HEADER_TITLE" = "إشعارات قانونية"; +"LEGAL_BUTTON_TITLE" = "الحقوق"; + +"DEVELOPER_SECTION_HEADER_TITLE" = "المطور"; + diff --git a/BHTwitter/Package/Library/Application Support/BHT/BHTwitter.bundle/en.lproj/Localizable.strings b/BHTwitter/Package/Library/Application Support/BHT/BHTwitter.bundle/en.lproj/Localizable.strings new file mode 100644 index 00000000..3baa936c --- /dev/null +++ b/BHTwitter/Package/Library/Application Support/BHT/BHTwitter.bundle/en.lproj/Localizable.strings @@ -0,0 +1,158 @@ +/* + en + BHTwitter +*/ + +"BHTWITTER_SETTINGS_TITLE" = "Settings"; +"BHTWITTER_SETTINGS_DETAIL" = "BHTwitter preferences"; + +"DOWNLOAD_MENU_TITLE" = "\nSelect video quality you want to download"; +"CUSTOM_FONTS_MENU_TITLE" = "\nSelect your custom font"; +"CUSTOM_FONTS_TUT_ALERT_MESSAGE" = "Cannot find any custom/installed font on this device. \nHow can I install custom fonts? \nGo to the AppStore and install the iFont application, from iFont you can search or import fonts to install, after that you should find your custom font here."; + +"OK_BUTTON_TITLE" = "OK"; +"YES_BUTTON_TITLE" = "YES"; +"NO_BUTTON_TITLE" = "NO"; +"CONFIRM_ALERT_MESSAGE" = "Are you sure?"; +"CANCEL_BUTTON_TITLE" = "Cancel"; + +"PROGRESS_DOWNLOADING_STATUS_TITLE" = "Downloading"; + +"CUSTOM_FONTS_NAVIGATION_BUTTON_TITLE" = "Custom fonts"; +"CUSTOM_FONTS_NAVIGATION_TITLE" = "Choose Font"; +"THEME_SETTINGS_NAVIGATION_TITLE" = "Theme"; +"CUSTOM_TAB_BAR_SETTINGS_NAVIGATION_TITLE" = "Custom Tab Bar"; +"ACKNOWLEDGEMENTS_SETTINGS_NAVIGATION_TITLE" = "Acknowledgements"; + +"COPY_PROFILE_INFO_MENU_OPTION_1" = "Copy bio"; +"COPY_PROFILE_INFO_MENU_OPTION_2" = "Copy Username"; +"COPY_PROFILE_INFO_MENU_OPTION_3" = "Copy Full Username"; +"COPY_PROFILE_INFO_MENU_OPTION_4" = "Copy URL in the bio"; +"COPY_PROFILE_INFO_MENU_OPTION_5" = "Copy Location in the bio"; + +"MAIN_SECTION_HEADER_TITLE" = "BHTwitter Preferences"; +"DOWNLOAD_VIDEOS_OPTION_TITLE" = "Downloading videos"; +"DOWNLOAD_VIDEOS_OPTION_DETAIL_TITLE" = "Downloading videos. By adding button in tweet and inside video tab bar."; + +"DIRECT_SAVE_OPTION_TITLE" = "Direct save"; +"DIRECT_SAVE_OPTION_DETAIL_TITLE" = "Save video directly after downloading."; + +"HIDE_ADS_OPTION_TITLE" = "Hide Ads"; +"HIDE_ADS_OPTION_DETAIL_TITLE" = "Remove all Ads in Twitter."; + +"HIDE_TOPICS_OPTION_TITLE" = "Hide topics tweets"; +"HIDE_TOPICS_OPTION_DETAIL_TITLE" = "Remove all topics tweets from the timeline."; + +"HIDE_WHO_FOLLOW_OPTION" = "Hide Who to follow section"; +"HIDE_WHO_FOLLOW_OPTION_DETAIL_TITLE" = "Hide Who to follow section in Profiles"; + +"HIDE_TOPICS_TO_FOLLOW_OPTION" = "Hide Topics to follow section"; +"HIDE_TOPICS_TO_FOLLOW_OPTION_DETAIL_TITLE" = "Hide Topics to follow section in Profiles"; + +"DISABLE_VIDEO_LAYER_CAPTIONS_OPTION_TITLE" = "Disable video layer captions"; + +"VOICE_OPTION_TITLE" = "Voice feature"; +"VOICE_OPTION_DETAIL_TITLE" = "Enable voice in tweet and DM."; + +"VIDEO_ZOOM_OPTION_TITLE" = "Video zoom feature"; +"VIDEO_ZOOM_OPTION_DETAIL_TITLE" = "You can zoom the video by double clicking in the center of the video."; + +"NO_HISTORY_OPTION_TITLE" = "No search history"; +"NO_HISTORY_OPTION_DETAIL_TITLE" = "Force Twitter to stop recording search history."; + +"BIO_TRANSALTE_OPTION_TITLE" = "Translate bio"; +"BIO_TRANSALTE_OPTION_DETAIL_TITLE" = "show you a button in user bio to translate it."; + +"LIKE_CONFIRM_OPTION_TITLE" = "Like confirm"; +"LIKE_CONFIRM_OPTION_DETAIL_TITLE" = "Show a confirm alert when you press like button."; + +"TWEET_CONFIRM_OPTION_TITLE" = "Tweet confirm"; +"TWEET_CONFIRM_OPTION_DETAIL_TITLE" = "Show a confirm alert when you press tweet button."; + +"FOLLOW_CONFIRM_OPTION_TITLE" = "User follow confirm"; +"FOLLOW_CONFIRM_OPTION_DETAIL_TITLE" = "Show a confirm alert when you press follow button."; + +"PADLOCK_OPTION_TITLE" = "Padlock"; +"PADLOCK_OPTION_DETAIL_TITLE" = "Lock Twitter with passcode."; + +"DN_MODULAR_SEARCH_OPTION_TITLE" = "Enable DM Modular Search"; +"DN_MODULAR_SEARCH_OPTION_DETAIL_TITLE" = "Enable the new UI of DM search."; + +"AUTO_HIGHEST_LOAD_OPTION_TITLE" = "Auto load photos in highest quality"; +"AUTO_HIGHEST_LOAD_OPTION_DETAIL_TITLE" = "This option let you upload photos and load it in highest quality possible."; + +"DISABLE_SENSITIVE_TWEET_WARNINGS_OPTION_TITLE" = "Disable sensitive tweet warning view"; +"TRUSTED_FRIENSS_OPTION_TITLE" = "Enable Twitter Circle feature"; + +"COPY_PROFILE_INFO_OPTION_TITLE" = "Enable Copying profile information feature"; +"COPY_PROFILE_INFO_OPTION_DETAIL_TITLE" = "Add new button in Twitter profile that let you copy whatever info you want."; + +"TWEET_TO_IMAGE_OPTION_TITLE" = "Save tweet as an image"; +"TWEET_TO_IMAGE_OPTION_DETAIL_TITLE" = "You can export tweets as image, by long pressing on the Tweet Share button."; + +"HIDE_SPACE_OPTION_TITLE" = "Hide spaces bar"; + +"DISABLE_RTL_OPTION_TITLE" = "Disable RTL"; +"DISABLE_RTL_OPTION_DETAIL_TITLE" = "Force Twitter use LTR with RTL language.\nRestart Twitter app to apply changes."; + +"ALWAYS_OPEN_SAFARI_OPTION_TITLE" = "Always open in Safari"; +"ALWAYS_OPEN_SAFARI_OPTION_DETAIL_TITLE" = "Force twitter to open URLs in Safari or your default browser."; + +"STRIP_URL_TRACKING_PARAMETERS_TITLE" = "Remove tracking from URL's"; +"STRIP_URL_TRACKING_PARAMETERS_DETAIL_TITLE" = "Strip tracking parameters from tweet URL's when it's copy"; + +"TWITTER_BLUE_SECTION_HEADER_TITLE" = "Twitter blue features"; +"UNDO_TWEET_OPTION_TITLE" = "Undo tweets feature"; +"UNDO_TWEET_OPTION_DETAIL_TITLE" = "Undo tweets after tweeting."; + +"READER_MODE_OPTION_TITLE" = "Reader mode feature"; +"READER_MODE_OPTION_DETAIL_TITLE" = "Enable reader mode in threads."; + +"THEME_OPTION_TITLE" = "Theme"; +"THEME_OPTION_DETAIL_TITLE" = "Choose a theme color for you Twitter experience that can only be seen by you."; +"THEME_OPTION_1" = "Blue"; +"THEME_OPTION_2" = "Yellow"; +"THEME_OPTION_3" = "Red"; +"THEME_OPTION_4" = "Purple"; +"THEME_OPTION_5" = "Orange"; +"THEME_OPTION_6" = "Green"; + +"CUSTOM_TAB_BAR_OPTION_TITLE" = "Custom Tab Bar"; +"CUSTOM_TAB_BAR_REST_MESSAGE" = "Are sure you want to rest the settings to default?"; +"CUSTOM_TAB_BAR_SECTION_1_TITLE" = "Active tab bar"; +"CUSTOM_TAB_BAR_SECTION_2_TITLE" = "Hidden tab bar"; +"CUSTOM_TAB_BAR_OPTION_1" = "Home"; +"CUSTOM_TAB_BAR_OPTION_2" = "Explore"; +"CUSTOM_TAB_BAR_OPTION_3" = "Spaces"; +"CUSTOM_TAB_BAR_OPTION_4" = "Communities"; +"CUSTOM_TAB_BAR_OPTION_5" = "Notifications"; +"CUSTOM_TAB_BAR_OPTION_6" = "Messages"; + +"TWITTER_BLUE_SECTION_FOOTER_TITLE" = "You may need to restart Twitter app to apply changes."; + +"LAYOUT_CUS_SECTION_HEADER_TITLE" = "Layout customization"; +"ORIG_TWEET_STYLE_OPTION_TITLE" = "Disable edge to edge tweet style"; +"ORIG_TWEET_STYLE_OPTION_DETAIL_TITLE" = "Force Twitter to use the original tweet style."; + +"HIDE_VIEW_COUNT_OPTION_TITLE" = "Hide view count"; +"HIDE_VIEW_COUNT_OPTION_DETAIL_TITLE" = "Remove view count from tweet"; + +"SHOW_TWEET_SOURCE_TITLE" = "Show tweet source"; + +"FORCE_TWEET_FULL_FRAME_TITLE" = "Force Twitter to use full frame for images"; + +"FONT_OPTION_TITLE" = "Enable changing font"; +"FONT_OPTION_DETAIL_TITLE" = "Option to allow changing Twitter font and show font picker."; + +"REQULAR_FONTS_PICKER_OPTION_TITLE" = "Font"; +"BOLD_FONTS_PICKER_OPTION_TITLE" = "Bold Font"; +"LAYOUT_CUS_SECTION_FOOTER_TITLE" = "Restart Twitter app to apply changes."; + +"DEBUG_SECTION_HEADER_TITLE" = "Debugging"; +"FLEX_OPTION_TITLE" = "Enable FLEX"; +"FLEX_OPTION_DETAIL_TITLE" = "Show FLEX on twitter app."; + +"LEGAL_SECTION_HEADER_TITLE" = "Legal notices"; +"LEGAL_BUTTON_TITLE" = "Acknowledgements"; + +"DEVELOPER_SECTION_HEADER_TITLE" = "Developer"; diff --git a/BHTwitter/Package/Library/Application Support/BHT/BHTwitter.bundle/ja.lproj/Localizable.strings b/BHTwitter/Package/Library/Application Support/BHT/BHTwitter.bundle/ja.lproj/Localizable.strings index 70e56b0f..ee96510c 100644 --- a/BHTwitter/Package/Library/Application Support/BHT/BHTwitter.bundle/ja.lproj/Localizable.strings +++ b/BHTwitter/Package/Library/Application Support/BHT/BHTwitter.bundle/ja.lproj/Localizable.strings @@ -134,6 +134,8 @@ "HIDE_VIEW_COUNT_OPTION_TITLE" = "表示回数を隠す"; "HIDE_VIEW_COUNT_OPTION_DETAIL_TITLE" = "ツイートから表示回数を削除します。"; +"SHOW_TWEET_SOURCE_TITLE" = "ツイートソースラベルを表示する"; + "FONT_OPTION_TITLE" = "カスタムフォントの有効化"; "FONT_OPTION_DETAIL_TITLE" = "Twitterのフォントを変更できるようにします。"; diff --git a/BHTwitter/Package/Library/Application Support/BHT/BHTwitter.bundle/zh-Hant.lproj/Localizable.strings b/BHTwitter/Package/Library/Application Support/BHT/BHTwitter.bundle/zh-Hant.lproj/Localizable.strings index b8b4571e..0ff18e12 100644 --- a/BHTwitter/Package/Library/Application Support/BHT/BHTwitter.bundle/zh-Hant.lproj/Localizable.strings +++ b/BHTwitter/Package/Library/Application Support/BHT/BHTwitter.bundle/zh-Hant.lproj/Localizable.strings @@ -134,6 +134,8 @@ "HIDE_VIEW_COUNT_OPTION_TITLE" = "隱藏查看次數"; "HIDE_VIEW_COUNT_OPTION_DETAIL_TITLE" = "在推文中隱藏查看次數"; +"SHOW_TWEET_SOURCE_TITLE" = "顯示推文來源"; + "FONT_OPTION_TITLE" = "更換字體"; "FONT_OPTION_DETAIL_TITLE" = "啟用此選項,可以更換 Twitter 字體"; diff --git a/BHTwitter/SettingsViewController.m b/BHTwitter/SettingsViewController.m index 3d194ecc..393ea563 100755 --- a/BHTwitter/SettingsViewController.m +++ b/BHTwitter/SettingsViewController.m @@ -184,7 +184,7 @@ - (NSArray *)specifiers { PSSpecifier *alwaysOpenSafari = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"ALWAYS_OPEN_SAFARI_OPTION_TITLE"] detailTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"ALWAYS_OPEN_SAFARI_OPTION_DETAIL_TITLE"] key:@"openInBrowser" defaultValue:false changeAction:nil]; - PSSpecifier *stripTrackingParams = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"STRIP_URL_TRACKING_PARAMETERS_TITLE"] detailTitle:nil key:@"strip_tracking_params" defaultValue:false changeAction:nil]; + PSSpecifier *stripTrackingParams = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"STRIP_URL_TRACKING_PARAMETERS_TITLE"] detailTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"STRIP_URL_TRACKING_PARAMETERS_DETAIL_TITLE"] key:@"strip_tracking_params" defaultValue:false changeAction:nil]; // Twitter bule section PSSpecifier *undoTweet = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"UNDO_TWEET_OPTION_TITLE"] detailTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"UNDO_TWEET_OPTION_DETAIL_TITLE"] key:@"undo_tweet" defaultValue:false changeAction:nil]; @@ -202,7 +202,7 @@ - (NSArray *)specifiers { PSSpecifier *tweetSource = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"SHOW_TWEET_SOURCE_TITLE"] detailTitle:nil key:@"show_tweet_source" defaultValue:false changeAction:nil]; - PSSpecifier *forceFullFrame = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"FORCE_TWEET_FULL_FRAME_TITLE"] detailTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"FORCE_TWEET_FULL_FRAME_DETAIL_TITLE"] key:@"force_tweet_full_frame" defaultValue:false changeAction:nil]; + PSSpecifier *forceFullFrame = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"FORCE_TWEET_FULL_FRAME_TITLE"] detailTitle:nil key:@"force_tweet_full_frame" 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]; diff --git a/BHTwitter/TWHeaders.h b/BHTwitter/TWHeaders.h index a01c5d13..9ba2dd47 100644 --- a/BHTwitter/TWHeaders.h +++ b/BHTwitter/TWHeaders.h @@ -19,6 +19,13 @@ #import #import + +typedef UIFont *(*BH_BaseImp)(id,SEL); +static NSMutableDictionary* originalFontsIMP; +static id _PasteboardChangeObserver; +static NSDictionary*> *trackingParams; +static NSString *_lastCopiedURL; + @interface T1AppDelegate : UIResponder @property(retain, nonatomic) UIWindow *window; @end @@ -383,7 +390,6 @@ static UIImage *BH_imageFromView(UIView *view) { TAEColorSettings *colorSettings = [objc_getClass("TAEColorSettings") sharedSettings]; bool opaque = [colorSettings.currentColorPalette isDark] ? true : false; UIGraphicsBeginImageContextWithOptions(view.frame.size, opaque, 0.0); -// [view.layer renderInContext:UIGraphicsGetCurrentContext()]; [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:false]; UIImage *img = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); @@ -391,17 +397,20 @@ static UIImage *BH_imageFromView(UIView *view) { return img; } -static UIFont * _Nullable BH_getDefaultFont(bool isBold, CGFloat pointSize) { +static UIFont * _Nullable BH_getDefaultFont(UIFont *font) { if ([[NSUserDefaults standardUserDefaults] boolForKey:@"en_font"]) { + // https://stackoverflow.com/a/20515367/16619237 + UIFontDescriptorSymbolicTraits fontDescriptorSymbolicTraits = font.fontDescriptor.symbolicTraits; + BOOL isBold = (fontDescriptorSymbolicTraits & UIFontDescriptorTraitBold) != 0; + if ([[NSUserDefaults standardUserDefaults] objectForKey:isBold ? @"bhtwitter_font_2" : @"bhtwitter_font_1"]) { NSString *fontName = [[NSUserDefaults standardUserDefaults] objectForKey:isBold ? @"bhtwitter_font_2" : @"bhtwitter_font_1"]; - return [UIFont fontWithName:fontName size:pointSize]; + return [UIFont fontWithName:fontName size:font.pointSize]; } return nil; } return nil; } - static BOOL isDeviceLanguageRTL() { return [NSParagraphStyle _defaultWritingDirection] == NSWritingDirectionRightToLeft; }