diff --git a/1.png b/1.png index 7c1a4da6..7238e7a1 100644 Binary files a/1.png and b/1.png differ diff --git a/2.png b/2.png index 11771d90..f010b1ac 100644 Binary files a/2.png and b/2.png differ diff --git a/3.png b/3.png index 22e47224..901d6dc8 100644 Binary files a/3.png and b/3.png differ diff --git a/4.png b/4.png index 3f5d72dd..d96d4462 100644 Binary files a/4.png and b/4.png differ diff --git a/BHTwitter.xcodeproj/project.pbxproj b/BHTwitter.xcodeproj/project.pbxproj index 67245947..91a292db 100644 --- a/BHTwitter.xcodeproj/project.pbxproj +++ b/BHTwitter.xcodeproj/project.pbxproj @@ -61,8 +61,6 @@ 5020AA7924E759960080F292 /* SafariServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5020AA7824E759960080F292 /* SafariServices.framework */; }; 5020AA7B24E7599B0080F292 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5020AA7A24E7599B0080F292 /* Security.framework */; }; 5020AA7D24E759A20080F292 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5020AA7C24E759A20080F292 /* QuartzCore.framework */; }; - 503D5BE42717B61200A25742 /* HBViewControllerCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 503D5BE22717B61200A25742 /* HBViewControllerCell.h */; }; - 503D5BE52717B61200A25742 /* HBViewControllerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 503D5BE32717B61200A25742 /* HBViewControllerCell.m */; }; 503FA8362753F04B00BBB92A /* FLEX-Runtime.h in Headers */ = {isa = PBXBuildFile; fileRef = 503FA66E2753F04A00BBB92A /* FLEX-Runtime.h */; }; 503FA8372753F04B00BBB92A /* FLEXTableViewSection.h in Headers */ = {isa = PBXBuildFile; fileRef = 503FA6702753F04A00BBB92A /* FLEXTableViewSection.h */; }; 503FA8382753F04B00BBB92A /* FLEXSingleRowSection.m in Sources */ = {isa = PBXBuildFile; fileRef = 503FA6712753F04A00BBB92A /* FLEXSingleRowSection.m */; }; @@ -474,39 +472,21 @@ 503FA9CE2753F04D00BBB92A /* FLEXKeyboardShortcutManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 503FA8332753F04B00BBB92A /* FLEXKeyboardShortcutManager.m */; }; 503FA9CF2753F04D00BBB92A /* FLEXKeyboardHelpViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 503FA8342753F04B00BBB92A /* FLEXKeyboardHelpViewController.m */; }; 503FA9D02753F04D00BBB92A /* FLEXKeyboardShortcutManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 503FA8352753F04B00BBB92A /* FLEXKeyboardShortcutManager.h */; }; - 5052558825206556004D7089 /* ALActionBlockWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 5052557E25206555004D7089 /* ALActionBlockWrapper.m */; }; - 5052558925206556004D7089 /* UIBarButtonItem+ALActionBlocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 5052557F25206555004D7089 /* UIBarButtonItem+ALActionBlocks.m */; }; - 5052558A25206556004D7089 /* ALActionBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 5052558025206555004D7089 /* ALActionBlock.h */; }; - 5052558B25206556004D7089 /* UIControl+ALActionBlocks.h in Headers */ = {isa = PBXBuildFile; fileRef = 5052558125206555004D7089 /* UIControl+ALActionBlocks.h */; }; - 5052558C25206556004D7089 /* UIControl+ALActionBlocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 5052558225206555004D7089 /* UIControl+ALActionBlocks.m */; }; - 5052558D25206556004D7089 /* ALActionBlockWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 5052558325206555004D7089 /* ALActionBlockWrapper.h */; }; - 5052558E25206556004D7089 /* UIGestureRecognizer+ALActionBlocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 5052558425206556004D7089 /* UIGestureRecognizer+ALActionBlocks.m */; }; - 5052558F25206556004D7089 /* UIBarButtonItem+ALActionBlocks.h in Headers */ = {isa = PBXBuildFile; fileRef = 5052558525206556004D7089 /* UIBarButtonItem+ALActionBlocks.h */; }; - 5052559025206556004D7089 /* ALActionBlocks.h in Headers */ = {isa = PBXBuildFile; fileRef = 5052558625206556004D7089 /* ALActionBlocks.h */; }; - 5052559125206556004D7089 /* UIGestureRecognizer+ALActionBlocks.h in Headers */ = {isa = PBXBuildFile; fileRef = 5052558725206556004D7089 /* UIGestureRecognizer+ALActionBlocks.h */; }; + 504C1C5B288F32050056F5EC /* Preferences.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 504C1C5A288F32050056F5EC /* Preferences.framework */; }; 505C0EBC2801ECAB0028D1C9 /* BHDownloadInlineButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 505C0EBB2801ECAB0028D1C9 /* BHDownloadInlineButton.h */; }; 505C0EBE2801ED020028D1C9 /* BHDownloadInlineButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 505C0EBD2801ED020028D1C9 /* BHDownloadInlineButton.m */; }; 5061F3C02806133400F3D5D3 /* CustomTabBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5061F3BF2806133400F3D5D3 /* CustomTabBarViewController.swift */; }; 50C15C9D271401CB00E8B5E8 /* BHTwitter+NSURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 50C15C9C271401CB00E8B5E8 /* BHTwitter+NSURL.h */; }; - 50C15CB927178C0D00E8B5E8 /* HBCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 50C15CA927178C0D00E8B5E8 /* HBCell.m */; }; - 50C15CBA27178C0D00E8B5E8 /* HBSection.h in Headers */ = {isa = PBXBuildFile; fileRef = 50C15CAA27178C0D00E8B5E8 /* HBSection.h */; }; - 50C15CBD27178C0D00E8B5E8 /* HBTwitterCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 50C15CAD27178C0D00E8B5E8 /* HBTwitterCell.m */; }; - 50C15CBE27178C0D00E8B5E8 /* HBPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 50C15CAE27178C0D00E8B5E8 /* HBPreferences.h */; }; - 50C15CBF27178C0D00E8B5E8 /* HBSwitchCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 50C15CAF27178C0D00E8B5E8 /* HBSwitchCell.m */; }; - 50C15CC027178C0D00E8B5E8 /* HBGithubCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 50C15CB027178C0D00E8B5E8 /* HBGithubCell.m */; }; - 50C15CC127178C0D00E8B5E8 /* HBSection.m in Sources */ = {isa = PBXBuildFile; fileRef = 50C15CB127178C0D00E8B5E8 /* HBSection.m */; }; - 50C15CC227178C0D00E8B5E8 /* HBCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 50C15CB227178C0D00E8B5E8 /* HBCell.h */; }; - 50C15CC327178C0D00E8B5E8 /* HBTwitterCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 50C15CB327178C0D00E8B5E8 /* HBTwitterCell.h */; }; - 50C15CC627178C0D00E8B5E8 /* HBSwitchCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 50C15CB627178C0D00E8B5E8 /* HBSwitchCell.h */; }; - 50C15CC727178C0D00E8B5E8 /* HBPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 50C15CB727178C0D00E8B5E8 /* HBPreferences.m */; }; - 50C15CC827178C0D00E8B5E8 /* HBGithubCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 50C15CB827178C0D00E8B5E8 /* HBGithubCell.h */; }; 50D73500252CBFC1007838C7 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 50D734FF252CBFBD007838C7 /* libz.tbd */; }; 50D73502252CBFC6007838C7 /* SceneKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50D73501252CBFC6007838C7 /* SceneKit.framework */; }; 50D73504252CBFD0007838C7 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 50D73503252CBFCB007838C7 /* libsqlite3.tbd */; }; 50E7ABEF24F5A8F700A8619D /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50E7ABEE24F5A8F600A8619D /* WebKit.framework */; }; 50EE4D4B286F7F70007DE117 /* BHColorThemeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50EE4D4A286F7F70007DE117 /* BHColorThemeViewController.swift */; }; - 50FCAB7E27268E1600265B5D /* HBlinkCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 50FCAB7C27268E1600265B5D /* HBlinkCell.h */; }; - 50FCAB7F27268E1600265B5D /* HBlinkCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 50FCAB7D27268E1600265B5D /* HBlinkCell.m */; }; + 50FAE057288545DB00CDCEB2 /* CepheiPrefs.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50FAE054288545DB00CDCEB2 /* CepheiPrefs.framework */; }; + 50FAE059288545DB00CDCEB2 /* Cephei.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50FAE055288545DB00CDCEB2 /* Cephei.framework */; }; + 50FAE05B288545DC00CDCEB2 /* CepheiUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50FAE056288545DB00CDCEB2 /* CepheiUI.framework */; }; + 50FAE060288545F600CDCEB2 /* SettingsViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 50FAE05E288545F600CDCEB2 /* SettingsViewController.h */; }; + 50FAE061288545F600CDCEB2 /* SettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 50FAE05F288545F600CDCEB2 /* SettingsViewController.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -569,8 +549,6 @@ 5020AA7824E759960080F292 /* SafariServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SafariServices.framework; path = System/Library/Frameworks/SafariServices.framework; sourceTree = SDKROOT; }; 5020AA7A24E7599B0080F292 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; 5020AA7C24E759A20080F292 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - 503D5BE22717B61200A25742 /* HBViewControllerCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HBViewControllerCell.h; sourceTree = ""; }; - 503D5BE32717B61200A25742 /* HBViewControllerCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HBViewControllerCell.m; sourceTree = ""; }; 503FA66E2753F04A00BBB92A /* FLEX-Runtime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "FLEX-Runtime.h"; sourceTree = ""; }; 503FA6702753F04A00BBB92A /* FLEXTableViewSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FLEXTableViewSection.h; sourceTree = ""; }; 503FA6712753F04A00BBB92A /* FLEXSingleRowSection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FLEXSingleRowSection.m; sourceTree = ""; }; @@ -988,41 +966,23 @@ 503FA8332753F04B00BBB92A /* FLEXKeyboardShortcutManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FLEXKeyboardShortcutManager.m; sourceTree = ""; }; 503FA8342753F04B00BBB92A /* FLEXKeyboardHelpViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FLEXKeyboardHelpViewController.m; sourceTree = ""; }; 503FA8352753F04B00BBB92A /* FLEXKeyboardShortcutManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FLEXKeyboardShortcutManager.h; sourceTree = ""; }; - 5052557E25206555004D7089 /* ALActionBlockWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ALActionBlockWrapper.m; sourceTree = ""; }; - 5052557F25206555004D7089 /* UIBarButtonItem+ALActionBlocks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIBarButtonItem+ALActionBlocks.m"; sourceTree = ""; }; - 5052558025206555004D7089 /* ALActionBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ALActionBlock.h; sourceTree = ""; }; - 5052558125206555004D7089 /* UIControl+ALActionBlocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIControl+ALActionBlocks.h"; sourceTree = ""; }; - 5052558225206555004D7089 /* UIControl+ALActionBlocks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIControl+ALActionBlocks.m"; sourceTree = ""; }; - 5052558325206555004D7089 /* ALActionBlockWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ALActionBlockWrapper.h; sourceTree = ""; }; - 5052558425206556004D7089 /* UIGestureRecognizer+ALActionBlocks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIGestureRecognizer+ALActionBlocks.m"; sourceTree = ""; }; - 5052558525206556004D7089 /* UIBarButtonItem+ALActionBlocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIBarButtonItem+ALActionBlocks.h"; sourceTree = ""; }; - 5052558625206556004D7089 /* ALActionBlocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ALActionBlocks.h; sourceTree = ""; }; - 5052558725206556004D7089 /* UIGestureRecognizer+ALActionBlocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIGestureRecognizer+ALActionBlocks.h"; sourceTree = ""; }; + 504C1C5A288F32050056F5EC /* Preferences.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Preferences.framework; path = ../../../../../opt/theos/sdks/iPhoneOS15.0.sdk/System/Library/PrivateFrameworks/Preferences.framework; sourceTree = ""; }; 505C0EBB2801ECAB0028D1C9 /* BHDownloadInlineButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BHDownloadInlineButton.h; sourceTree = ""; }; 505C0EBD2801ED020028D1C9 /* BHDownloadInlineButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BHDownloadInlineButton.m; sourceTree = ""; }; 505C0ED028038B810028D1C9 /* BHTwitter-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BHTwitter-Bridging-Header.h"; sourceTree = ""; }; 5061F3BF2806133400F3D5D3 /* CustomTabBarViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomTabBarViewController.swift; sourceTree = ""; }; 50C15C9B271400DA00E8B5E8 /* BHTwitter+UIImage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BHTwitter+UIImage.h"; sourceTree = ""; }; 50C15C9C271401CB00E8B5E8 /* BHTwitter+NSURL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BHTwitter+NSURL.h"; sourceTree = ""; }; - 50C15CA927178C0D00E8B5E8 /* HBCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBCell.m; sourceTree = ""; }; - 50C15CAA27178C0D00E8B5E8 /* HBSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBSection.h; sourceTree = ""; }; - 50C15CAD27178C0D00E8B5E8 /* HBTwitterCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBTwitterCell.m; sourceTree = ""; }; - 50C15CAE27178C0D00E8B5E8 /* HBPreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBPreferences.h; sourceTree = ""; }; - 50C15CAF27178C0D00E8B5E8 /* HBSwitchCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBSwitchCell.m; sourceTree = ""; }; - 50C15CB027178C0D00E8B5E8 /* HBGithubCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBGithubCell.m; sourceTree = ""; }; - 50C15CB127178C0D00E8B5E8 /* HBSection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBSection.m; sourceTree = ""; }; - 50C15CB227178C0D00E8B5E8 /* HBCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBCell.h; sourceTree = ""; }; - 50C15CB327178C0D00E8B5E8 /* HBTwitterCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBTwitterCell.h; sourceTree = ""; }; - 50C15CB627178C0D00E8B5E8 /* HBSwitchCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBSwitchCell.h; sourceTree = ""; }; - 50C15CB727178C0D00E8B5E8 /* HBPreferences.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBPreferences.m; sourceTree = ""; }; - 50C15CB827178C0D00E8B5E8 /* HBGithubCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBGithubCell.h; sourceTree = ""; }; 50D734FF252CBFBD007838C7 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 50D73501252CBFC6007838C7 /* SceneKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SceneKit.framework; path = System/Library/Frameworks/SceneKit.framework; sourceTree = SDKROOT; }; 50D73503252CBFCB007838C7 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; }; 50E7ABEE24F5A8F600A8619D /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; 50EE4D4A286F7F70007DE117 /* BHColorThemeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BHColorThemeViewController.swift; sourceTree = ""; }; - 50FCAB7C27268E1600265B5D /* HBlinkCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HBlinkCell.h; sourceTree = ""; }; - 50FCAB7D27268E1600265B5D /* HBlinkCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HBlinkCell.m; sourceTree = ""; }; + 50FAE054288545DB00CDCEB2 /* CepheiPrefs.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CepheiPrefs.framework; path = ../../../../../opt/theos/vendor/lib/CepheiPrefs.framework; sourceTree = ""; }; + 50FAE055288545DB00CDCEB2 /* Cephei.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cephei.framework; path = ../../../../../opt/theos/vendor/lib/Cephei.framework; sourceTree = ""; }; + 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1034,15 +994,19 @@ 5020AA6F24E759790080F292 /* CoreGraphics.framework in Frameworks */, 5020AA7D24E759A20080F292 /* QuartzCore.framework in Frameworks */, 5020AA7324E759860080F292 /* Photos.framework in Frameworks */, + 504C1C5B288F32050056F5EC /* Preferences.framework in Frameworks */, + 50FAE05B288545DC00CDCEB2 /* CepheiUI.framework in Frameworks */, 50D73502252CBFC6007838C7 /* SceneKit.framework in Frameworks */, 50D73500252CBFC1007838C7 /* libz.tbd in Frameworks */, 5020AA6924E759700080F292 /* Accelerate.framework in Frameworks */, + 50FAE057288545DB00CDCEB2 /* CepheiPrefs.framework in Frameworks */, 5020AA7124E7597F0080F292 /* ImageIO.framework in Frameworks */, 5020AA7524E7598D0080F292 /* CoreServices.framework in Frameworks */, 5020A87824E758E00080F292 /* UIKit.framework in Frameworks */, 5020AA7724E759910080F292 /* SystemConfiguration.framework in Frameworks */, 5020A87A24E758E00080F292 /* Foundation.framework in Frameworks */, 5020AA6D24E759790080F292 /* CoreImage.framework in Frameworks */, + 50FAE059288545DB00CDCEB2 /* Cephei.framework in Frameworks */, 5020AA6E24E759790080F292 /* CoreMedia.framework in Frameworks */, 50D73504252CBFD0007838C7 /* libsqlite3.tbd in Frameworks */, 5020AA7B24E7599B0080F292 /* Security.framework in Frameworks */, @@ -1088,6 +1052,10 @@ 5020A87624E758E00080F292 /* Frameworks */ = { isa = PBXGroup; children = ( + 504C1C5A288F32050056F5EC /* Preferences.framework */, + 50FAE055288545DB00CDCEB2 /* Cephei.framework */, + 50FAE054288545DB00CDCEB2 /* CepheiPrefs.framework */, + 50FAE056288545DB00CDCEB2 /* CepheiUI.framework */, 50D73503252CBFCB007838C7 /* libsqlite3.tbd */, 50D73501252CBFC6007838C7 /* SceneKit.framework */, 50D734FF252CBFBD007838C7 /* libz.tbd */, @@ -1125,13 +1093,13 @@ 505C0EBD2801ED020028D1C9 /* BHDownloadInlineButton.m */, 50C15C9B271400DA00E8B5E8 /* BHTwitter+UIImage.h */, 50C15C9C271401CB00E8B5E8 /* BHTwitter+NSURL.h */, + 50FAE05E288545F600CDCEB2 /* SettingsViewController.h */, + 50FAE05F288545F600CDCEB2 /* SettingsViewController.m */, 50EE4D49286F7F56007DE117 /* ThemeColor */, 5061F3BE2806132400F3D5D3 /* CustomTabBar */, 503FA66D2753F04A00BBB92A /* Classes */, - 50C15CA827178C0D00E8B5E8 /* HBPreferences */, 500DA69526FF92F500C020B2 /* SAMKeychain */, 5020AA2824E759390080F292 /* JGProgressHUD */, - 5052557D25206549004D7089 /* ALActionBlocks */, 5020A87E24E758E00080F292 /* Package */, 5020A88124E758E00080F292 /* Supporting Files */, 505C0ED028038B810028D1C9 /* BHTwitter-Bridging-Header.h */, @@ -1964,23 +1932,6 @@ path = Keyboard; sourceTree = ""; }; - 5052557D25206549004D7089 /* ALActionBlocks */ = { - isa = PBXGroup; - children = ( - 5052558025206555004D7089 /* ALActionBlock.h */, - 5052558625206556004D7089 /* ALActionBlocks.h */, - 5052558325206555004D7089 /* ALActionBlockWrapper.h */, - 5052557E25206555004D7089 /* ALActionBlockWrapper.m */, - 5052558525206556004D7089 /* UIBarButtonItem+ALActionBlocks.h */, - 5052557F25206555004D7089 /* UIBarButtonItem+ALActionBlocks.m */, - 5052558125206555004D7089 /* UIControl+ALActionBlocks.h */, - 5052558225206555004D7089 /* UIControl+ALActionBlocks.m */, - 5052558725206556004D7089 /* UIGestureRecognizer+ALActionBlocks.h */, - 5052558425206556004D7089 /* UIGestureRecognizer+ALActionBlocks.m */, - ); - path = ALActionBlocks; - sourceTree = ""; - }; 5061F3BE2806132400F3D5D3 /* CustomTabBar */ = { isa = PBXGroup; children = ( @@ -1989,29 +1940,6 @@ path = CustomTabBar; sourceTree = ""; }; - 50C15CA827178C0D00E8B5E8 /* HBPreferences */ = { - isa = PBXGroup; - children = ( - 50C15CA927178C0D00E8B5E8 /* HBCell.m */, - 50C15CAA27178C0D00E8B5E8 /* HBSection.h */, - 50C15CAD27178C0D00E8B5E8 /* HBTwitterCell.m */, - 50C15CAE27178C0D00E8B5E8 /* HBPreferences.h */, - 50C15CAF27178C0D00E8B5E8 /* HBSwitchCell.m */, - 50C15CB027178C0D00E8B5E8 /* HBGithubCell.m */, - 50C15CB127178C0D00E8B5E8 /* HBSection.m */, - 50C15CB227178C0D00E8B5E8 /* HBCell.h */, - 50C15CB327178C0D00E8B5E8 /* HBTwitterCell.h */, - 50C15CB627178C0D00E8B5E8 /* HBSwitchCell.h */, - 50C15CB727178C0D00E8B5E8 /* HBPreferences.m */, - 50C15CB827178C0D00E8B5E8 /* HBGithubCell.h */, - 503D5BE22717B61200A25742 /* HBViewControllerCell.h */, - 503D5BE32717B61200A25742 /* HBViewControllerCell.m */, - 50FCAB7C27268E1600265B5D /* HBlinkCell.h */, - 50FCAB7D27268E1600265B5D /* HBlinkCell.m */, - ); - path = HBPreferences; - sourceTree = ""; - }; 50EE4D49286F7F56007DE117 /* ThemeColor */ = { isa = PBXGroup; children = ( @@ -2046,6 +1974,7 @@ 503FA88A2753F04B00BBB92A /* FLEXNetworkSettingsController.h in Headers */, 503FA85E2753F04B00BBB92A /* FLEXNSStringShortcuts.h in Headers */, 503FA83C2753F04B00BBB92A /* FLEXFilteringTableViewController.h in Headers */, + 50FAE060288545F600CDCEB2 /* SettingsViewController.h in Headers */, 503FA94D2753F04D00BBB92A /* FLEXTableListViewController.h in Headers */, 5020AA4D24E759390080F292 /* JGProgressHUDFadeAnimation.h in Headers */, 503FA8EF2753F04C00BBB92A /* FLEXKeyValueTableViewCell.h in Headers */, @@ -2057,8 +1986,6 @@ 503FA85B2753F04B00BBB92A /* FLEXBundleShortcuts.h in Headers */, 503FA9442753F04C00BBB92A /* FLEXTableLeftCell.h in Headers */, 503FA8CC2753F04C00BBB92A /* UIBarButtonItem+FLEX.h in Headers */, - 5052559025206556004D7089 /* ALActionBlocks.h in Headers */, - 50FCAB7E27268E1600265B5D /* HBlinkCell.h in Headers */, 503FA9002753F04C00BBB92A /* FLEXAlert.h in Headers */, 503FA8B02753F04C00BBB92A /* FLEXArgumentInputNumberView.h in Headers */, 503FA8D22753F04C00BBB92A /* FLEXCodeFontCell.h in Headers */, @@ -2067,19 +1994,16 @@ 503FA8622753F04B00BBB92A /* FLEXUIAppShortcuts.h in Headers */, 5020AA5024E759390080F292 /* JGProgressHUDErrorIndicatorView.h in Headers */, 503FA99B2753F04D00BBB92A /* FLEXProperty.h in Headers */, - 5052558A25206556004D7089 /* ALActionBlock.h in Headers */, 503FA8962753F04B00BBB92A /* FLEX-Core.h in Headers */, 5020AA5124E759390080F292 /* JGProgressHUDIndeterminateIndicatorView.h in Headers */, 503FA9842753F04D00BBB92A /* FLEXRuntimeSafety.h in Headers */, 503FA85A2753F04B00BBB92A /* FLEXDefaultsContentSection.h in Headers */, - 5052559125206556004D7089 /* UIGestureRecognizer+ALActionBlocks.h in Headers */, 503FA8542753F04B00BBB92A /* FLEXCollectionContentSection.h in Headers */, 503FA8852753F04B00BBB92A /* FLEXNetworkTransaction.h in Headers */, 503FA8F12753F04C00BBB92A /* NSTimer+FLEX.h in Headers */, 503FA8EB2753F04C00BBB92A /* FLEXPropertyAttributes.h in Headers */, 503FA8E92753F04C00BBB92A /* FLEXRuntime+Compare.h in Headers */, 503FA8F62753F04C00BBB92A /* FLEXMutableListSection.h in Headers */, - 50C15CBE27178C0D00E8B5E8 /* HBPreferences.h in Headers */, 503FA8902753F04B00BBB92A /* OSCache.h in Headers */, 503FA8A12753F04C00BBB92A /* FLEXFieldEditorViewController.h in Headers */, 503FA92C2753F04C00BBB92A /* FLEXFileBrowserController.h in Headers */, @@ -2103,7 +2027,6 @@ 503FA8762753F04B00BBB92A /* FLEXObjectInfoSection.h in Headers */, 503FA86E2753F04B00BBB92A /* FLEXImageShortcuts.h in Headers */, 503FA83D2753F04B00BBB92A /* FLEXNavigationController.h in Headers */, - 5052558D25206556004D7089 /* ALActionBlockWrapper.h in Headers */, 503FA8792753F04B00BBB92A /* FLEXObjectExplorer.h in Headers */, 503FA92B2753F04C00BBB92A /* FLEXFileBrowserSearchOperation.h in Headers */, 503FA8B82753F04C00BBB92A /* FLEXArgumentInputSwitchView.h in Headers */, @@ -2111,7 +2034,6 @@ 503FA9CD2753F04D00BBB92A /* FLEXKeyboardHelpViewController.h in Headers */, 503FA93F2753F04C00BBB92A /* FLEXDBQueryRowCell.h in Headers */, 503FA8E22753F04C00BBB92A /* FLEXMultilineTableViewCell.h in Headers */, - 5052558F25206556004D7089 /* UIBarButtonItem+ALActionBlocks.h in Headers */, 503FA9992753F04D00BBB92A /* FLEXMirror.h in Headers */, 503FA8432753F04B00BBB92A /* FLEXTableViewCell.h in Headers */, 503FA9532753F04D00BBB92A /* FLEXRuntimeClient.h in Headers */, @@ -2160,7 +2082,6 @@ 503FA9A22753F04D00BBB92A /* FLEXHeapEnumerator.h in Headers */, 503FA8372753F04B00BBB92A /* FLEXTableViewSection.h in Headers */, 503FA9C62753F04D00BBB92A /* UIPasteboard+FLEX.h in Headers */, - 5052558B25206556004D7089 /* UIControl+ALActionBlocks.h in Headers */, 503FA98F2753F04D00BBB92A /* FLEXProtocolBuilder.h in Headers */, 503FA8512753F04B00BBB92A /* FLEX.h in Headers */, 503FA96B2753F04D00BBB92A /* FHSSnapshotView.h in Headers */, @@ -2197,7 +2118,6 @@ 5020AA5224E759390080F292 /* JGProgressHUDFadeZoomAnimation.h in Headers */, 503FA89A2753F04B00BBB92A /* FLEXManager+Networking.h in Headers */, 503FA9C32753F04D00BBB92A /* NSTimer+FLEX.h in Headers */, - 50C15CC327178C0D00E8B5E8 /* HBTwitterCell.h in Headers */, 503FA8AC2753F04C00BBB92A /* FLEXArgumentInputTextView.h in Headers */, 5020AA4A24E759390080F292 /* JGProgressHUDShadow.h in Headers */, 503FA84A2753F04B00BBB92A /* FLEXTableView.h in Headers */, @@ -2209,7 +2129,6 @@ 503FA8EA2753F04C00BBB92A /* FLEXShortcutsSection.h in Headers */, 50198012250E053900207745 /* BHDownload.h in Headers */, 500DA6A526FF9CFE00C020B2 /* SAMKeychain.h in Headers */, - 50C15CC227178C0D00E8B5E8 /* HBCell.h in Headers */, 503FA9192753F04C00BBB92A /* FLEXObjectListViewController.h in Headers */, 503FA9572753F04D00BBB92A /* FLEXRuntimeKeyPathTokenizer.h in Headers */, 503FA8A22753F04C00BBB92A /* FLEXFieldEditorView.h in Headers */, @@ -2231,9 +2150,7 @@ 503FA8FD2753F04C00BBB92A /* FLEXIvar.h in Headers */, 503FA8EC2753F04C00BBB92A /* UIGestureRecognizer+Blocks.h in Headers */, 503FA9492753F04D00BBB92A /* FLEXTableContentViewController.h in Headers */, - 50C15CC827178C0D00E8B5E8 /* HBGithubCell.h in Headers */, 503FA9282753F04C00BBB92A /* FLEXObjectRef.h in Headers */, - 503D5BE42717B61200A25742 /* HBViewControllerCell.h in Headers */, 503FA9B02753F04D00BBB92A /* UIFont+FLEX.h in Headers */, 503FA9222753F04C00BBB92A /* FLEXKeychain.h in Headers */, 503FA9682753F04D00BBB92A /* FHSView.h in Headers */, @@ -2256,7 +2173,6 @@ 503FA8912753F04B00BBB92A /* FLEXExplorerToolbarItem.h in Headers */, 503FA9372753F04C00BBB92A /* ActivityStreamAPI.h in Headers */, 503FA9742753F04D00BBB92A /* FHSRangeSlider.h in Headers */, - 50C15CBA27178C0D00E8B5E8 /* HBSection.h in Headers */, 503FA9952753F04D00BBB92A /* FLEXProtocol.h in Headers */, 503FA8DF2753F04C00BBB92A /* FLEXShortcut.h in Headers */, 503FA9CA2753F04D00BBB92A /* NSUserDefaults+FLEX.h in Headers */, @@ -2299,7 +2215,6 @@ 500DA6A026FF95B100C020B2 /* keychain.h in Headers */, 503FA9B62753F04D00BBB92A /* UIGestureRecognizer+Blocks.h in Headers */, 503FA97F2753F04D00BBB92A /* FLEXResources.h in Headers */, - 50C15CC627178C0D00E8B5E8 /* HBSwitchCell.h in Headers */, 503FA8B62753F04C00BBB92A /* FLEXArgumentInputColorView.h in Headers */, 503FA9CC2753F04D00BBB92A /* FLEXAlert.h in Headers */, 503FA86C2753F04B00BBB92A /* FLEXBlockShortcuts.h in Headers */, @@ -2439,7 +2354,6 @@ 503FA8592753F04B00BBB92A /* FLEXColorPreviewSection.m in Sources */, 503FA85C2753F04B00BBB92A /* FLEXShortcutsSection.m in Sources */, 503FA9A72753F04D00BBB92A /* FLEXRuntime+Compare.m in Sources */, - 50C15CC727178C0D00E8B5E8 /* HBPreferences.m in Sources */, 503FA9B72753F04D00BBB92A /* UIView+FLEX_Layout.m in Sources */, 503FA89F2753F04C00BBB92A /* FLEXDefaultEditorViewController.m in Sources */, 503FA9402753F04C00BBB92A /* FLEXTableListViewController.m in Sources */, @@ -2471,7 +2385,6 @@ 503FA9AF2753F04D00BBB92A /* UIPasteboard+FLEX.m in Sources */, 503FA94A2753F04D00BBB92A /* FLEXSQLiteDatabaseManager.m in Sources */, 5020AA5424E759390080F292 /* JGProgressHUDImageIndicatorView.m in Sources */, - 50FCAB7F27268E1600265B5D /* HBlinkCell.m in Sources */, 503FA8802753F04B00BBB92A /* FLEXNetworkRecorder.m in Sources */, 503FA9A42753F04D00BBB92A /* FLEXResources.m in Sources */, 503FA90D2753F04C00BBB92A /* FLEXBookmarksViewController.m in Sources */, @@ -2502,16 +2415,13 @@ 503FA9C22753F04D00BBB92A /* NSDictionary+ObjcRuntime.m in Sources */, 503FA89B2753F04C00BBB92A /* FLEXManager.m in Sources */, 503FA8AA2753F04C00BBB92A /* FLEXArgumentInputView.m in Sources */, - 50C15CC027178C0D00E8B5E8 /* HBGithubCell.m in Sources */, 503FA9872753F04D00BBB92A /* FLEXRuntimeSafety.m in Sources */, 503FA8B92753F04C00BBB92A /* FLEXArgumentInputTextView.m in Sources */, 503FA9272753F04C00BBB92A /* FLEXKeychainQuery.m in Sources */, - 50C15CC127178C0D00E8B5E8 /* HBSection.m in Sources */, 503FA9932753F04D00BBB92A /* FLEXMethod.m in Sources */, 503FA9C12753F04D00BBB92A /* NSString+FLEX.m in Sources */, 503FA9A02753F04D00BBB92A /* FLEXAlert.m in Sources */, 503FA9412753F04C00BBB92A /* FLEXTableColumnHeader.m in Sources */, - 5052558E25206556004D7089 /* UIGestureRecognizer+ALActionBlocks.m in Sources */, 503FA9812753F04D00BBB92A /* FLEXRuntimeUtility.m in Sources */, 503FA90C2753F04C00BBB92A /* FLEXBookmarkManager.m in Sources */, 503FA8522753F04B00BBB92A /* FLEXObjectExplorerFactory.m in Sources */, @@ -2520,8 +2430,6 @@ 503FA8B42753F04C00BBB92A /* FLEXArgumentInputFontView.m in Sources */, 503FA96F2753F04D00BBB92A /* SceneKit+Snapshot.m in Sources */, 5020AA4324E759390080F292 /* JGProgressHUDIndeterminateIndicatorView.m in Sources */, - 50C15CBD27178C0D00E8B5E8 /* HBTwitterCell.m in Sources */, - 50C15CBF27178C0D00E8B5E8 /* HBSwitchCell.m in Sources */, 503FA88B2753F04B00BBB92A /* FLEXMITMDataSource.m in Sources */, 503FA8472753F04B00BBB92A /* FLEXSubtitleTableViewCell.m in Sources */, 503FA9A82753F04D00BBB92A /* NSArray+FLEX.m in Sources */, @@ -2530,11 +2438,11 @@ 503FA9C02753F04D00BBB92A /* Cocoa+FLEXShortcuts.m in Sources */, 503FA8582753F04B00BBB92A /* FLEXCollectionContentSection.m in Sources */, 503FA8842753F04B00BBB92A /* FLEXNetworkTransactionCell.m in Sources */, - 5052558C25206556004D7089 /* UIControl+ALActionBlocks.m in Sources */, 505C0EBE2801ED020028D1C9 /* BHDownloadInlineButton.m in Sources */, 503FA96E2753F04D00BBB92A /* FHSViewController.m in Sources */, 503FA9B22753F04D00BBB92A /* UITextField+Range.m in Sources */, 503FA9AC2753F04D00BBB92A /* NSTimer+FLEX.m in Sources */, + 50FAE061288545F600CDCEB2 /* SettingsViewController.m in Sources */, 503FA99A2753F04D00BBB92A /* FLEXClassBuilder.m in Sources */, 503FA9422753F04C00BBB92A /* FLEXMultiColumnTableView.m in Sources */, 503FA8702753F04B00BBB92A /* FLEXUIAppShortcuts.m in Sources */, @@ -2544,7 +2452,6 @@ 50198013250E053900207745 /* BHDownload.m in Sources */, 500DA6A426FF9CFE00C020B2 /* SAMKeychain.m in Sources */, 5020AA5524E759390080F292 /* JGProgressHUDSuccessIndicatorView.m in Sources */, - 50C15CB927178C0D00E8B5E8 /* HBCell.m in Sources */, 503FA9312753F04C00BBB92A /* FLEXSystemLogViewController.m in Sources */, 503FA9322753F04C00BBB92A /* FLEXSystemLogMessage.m in Sources */, 503FA9542753F04D00BBB92A /* FLEXRuntimeController.m in Sources */, @@ -2557,7 +2464,6 @@ 503FA8942753F04B00BBB92A /* FLEXExplorerToolbar.m in Sources */, 503FA8A32753F04C00BBB92A /* FLEXMethodCallingViewController.m in Sources */, 503FA8602753F04B00BBB92A /* FLEXClassShortcuts.m in Sources */, - 5052558925206556004D7089 /* UIBarButtonItem+ALActionBlocks.m in Sources */, 503FA8462753F04B00BBB92A /* FLEXCodeFontCell.m in Sources */, 503FA9032753F04C00BBB92A /* FLEXTabsViewController.m in Sources */, 503FA9552753F04D00BBB92A /* FLEXRuntimeExporter.m in Sources */, @@ -2599,12 +2505,10 @@ 503FA8AE2753F04C00BBB92A /* FLEXArgumentInputStructView.m in Sources */, 503FA8822753F04B00BBB92A /* FLEXNetworkMITMViewController.m in Sources */, 503FA8862753F04B00BBB92A /* FLEXNetworkCurlLogger.m in Sources */, - 503D5BE52717B61200A25742 /* HBViewControllerCell.m in Sources */, 503FA89D2753F04C00BBB92A /* FLEXManager+Networking.m in Sources */, 503FA9202753F04C00BBB92A /* FLEXObjectListViewController.m in Sources */, 503FA9882753F04D00BBB92A /* FLEXRuntimeConstants.m in Sources */, 503FA95D2753F04D00BBB92A /* FLEXSearchToken.m in Sources */, - 5052558825206556004D7089 /* ALActionBlockWrapper.m in Sources */, 503FA8C02753F04C00BBB92A /* FLEXArgumentInputViewFactory.m in Sources */, 503FA95B2753F04D00BBB92A /* FLEXRuntimeBrowserToolbar.m in Sources */, 503FA9072753F04C00BBB92A /* FLEXWindow.m in Sources */, @@ -2758,6 +2662,8 @@ "$(inherited)", /opt/theos/lib, /opt/theos/vendor/lib, + /opt/theos/sdks/iPhoneOS14.4.sdk/System/Library/PrivateFrameworks, + /opt/theos/sdks/iPhoneOS15.0.sdk/System/Library/PrivateFrameworks, ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "BHTwitter/BHTwitter-Prefix.pch"; @@ -2819,6 +2725,8 @@ "$(inherited)", /opt/theos/lib, /opt/theos/vendor/lib, + /opt/theos/sdks/iPhoneOS14.4.sdk/System/Library/PrivateFrameworks, + /opt/theos/sdks/iPhoneOS15.0.sdk/System/Library/PrivateFrameworks, ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "BHTwitter/BHTwitter-Prefix.pch"; diff --git a/BHTwitter/ALActionBlocks/ALActionBlock.h b/BHTwitter/ALActionBlocks/ALActionBlock.h deleted file mode 100755 index 77c591d7..00000000 --- a/BHTwitter/ALActionBlocks/ALActionBlock.h +++ /dev/null @@ -1,9 +0,0 @@ -// -// ALActionBlock.h -// ALActionBlocks -// -// Created by Andy LaVoy on 5/16/13. -// Copyright (c) 2013 Andy LaVoy. All rights reserved. -// - -typedef void (^ALActionBlock)(id weakSender); diff --git a/BHTwitter/ALActionBlocks/ALActionBlockWrapper.h b/BHTwitter/ALActionBlocks/ALActionBlockWrapper.h deleted file mode 100755 index c0c90f30..00000000 --- a/BHTwitter/ALActionBlocks/ALActionBlockWrapper.h +++ /dev/null @@ -1,22 +0,0 @@ -// -// ALActionBlockWrapper.h -// ALActionBlocks -// -// Created by Andy LaVoy on 5/16/13. -// Copyright (c) 2013 Andy LaVoy. All rights reserved. -// - -#import -#import -#import "ALActionBlock.h" - -static NSString *const ALActionBlocksArray = @"ALActionBlocksArray"; - -@interface ALActionBlockWrapper : NSObject - -@property (nonatomic, copy) ALActionBlock actionBlock; -@property (nonatomic, assign) UIControlEvents controlEvents; - -- (void)invokeBlock:(id)sender; - -@end diff --git a/BHTwitter/ALActionBlocks/ALActionBlockWrapper.m b/BHTwitter/ALActionBlocks/ALActionBlockWrapper.m deleted file mode 100755 index f0ee1101..00000000 --- a/BHTwitter/ALActionBlocks/ALActionBlockWrapper.m +++ /dev/null @@ -1,22 +0,0 @@ -// -// ALActionBlockWrapper.m -// ALActionBlocks -// -// Created by Andy LaVoy on 5/16/13. -// Copyright (c) 2013 Andy LaVoy. All rights reserved. -// - -#import "ALActionBlockWrapper.h" - - -@implementation ALActionBlockWrapper - - -- (void)invokeBlock:(id)sender { - if (self.actionBlock) { - self.actionBlock(sender); - } -} - - -@end diff --git a/BHTwitter/ALActionBlocks/ALActionBlocks.h b/BHTwitter/ALActionBlocks/ALActionBlocks.h deleted file mode 100755 index c092373f..00000000 --- a/BHTwitter/ALActionBlocks/ALActionBlocks.h +++ /dev/null @@ -1,11 +0,0 @@ -// -// ALActionBlocks.h -// ALActionBlocks -// -// Created by Andy LaVoy on 5/16/13. -// Copyright (c) 2013 Andy LaVoy. All rights reserved. -// - -#import "UIControl+ALActionBlocks.h" -#import "UIBarButtonItem+ALActionBlocks.h" -#import "UIGestureRecognizer+ALActionBlocks.h" \ No newline at end of file diff --git a/BHTwitter/ALActionBlocks/UIBarButtonItem+ALActionBlocks.h b/BHTwitter/ALActionBlocks/UIBarButtonItem+ALActionBlocks.h deleted file mode 100755 index d290ac56..00000000 --- a/BHTwitter/ALActionBlocks/UIBarButtonItem+ALActionBlocks.h +++ /dev/null @@ -1,22 +0,0 @@ -// -// UIBarButtonItem+ALActionBlocks.h -// ALActionBlocks -// -// Created by Andy LaVoy on 5/16/13. -// Copyright (c) 2013 Andy LaVoy. All rights reserved. -// - -#import -#import "UIControl+ALActionBlocks.h" - - -@interface UIBarButtonItem (ALActionBlocks) - -- (instancetype)initWithBarButtonSystemItem:(UIBarButtonSystemItem)systemItem block:(ALActionBlock)actionBlock; -- (instancetype)initWithImage:(UIImage *)image landscapeImagePhone:(UIImage *)landscapeImagePhone style:(UIBarButtonItemStyle)style block:(ALActionBlock)actionBlock; -- (instancetype)initWithImage:(UIImage *)image style:(UIBarButtonItemStyle)style block:(ALActionBlock)actionBlock; -- (instancetype)initWithTitle:(NSString *)title style:(UIBarButtonItemStyle)style block:(ALActionBlock)actionBlock; - -- (void)setBlock:(ALActionBlock)actionBlock; - -@end diff --git a/BHTwitter/ALActionBlocks/UIBarButtonItem+ALActionBlocks.m b/BHTwitter/ALActionBlocks/UIBarButtonItem+ALActionBlocks.m deleted file mode 100755 index e105186f..00000000 --- a/BHTwitter/ALActionBlocks/UIBarButtonItem+ALActionBlocks.m +++ /dev/null @@ -1,66 +0,0 @@ -// -// UIBarButtonItem+ALActionBlocks.m -// ALActionBlocks -// -// Created by Andy LaVoy on 5/16/13. -// Copyright (c) 2013 Andy LaVoy. All rights reserved. -// - -#import "UIBarButtonItem+ALActionBlocks.h" -#import "ALActionBlockWrapper.h" -#import - - -@implementation UIBarButtonItem (ALActionBlocks) - - -- (instancetype)initWithBarButtonSystemItem:(UIBarButtonSystemItem)systemItem block:(ALActionBlock)actionBlock { - UIBarButtonItem *barButtonItem = [[[self class] alloc] initWithBarButtonSystemItem:systemItem target:nil action:nil]; - [barButtonItem setBlock:actionBlock]; - return barButtonItem; -} - - -- (instancetype)initWithImage:(UIImage *)image landscapeImagePhone:(UIImage *)landscapeImagePhone style:(UIBarButtonItemStyle)style block:(ALActionBlock)actionBlock { - UIBarButtonItem *barButtonItem = [[[self class] alloc] initWithImage:image landscapeImagePhone:landscapeImagePhone style:style target:nil action:nil]; - [barButtonItem setBlock:actionBlock]; - return barButtonItem; -} - - -- (instancetype)initWithImage:(UIImage *)image style:(UIBarButtonItemStyle)style block:(ALActionBlock)actionBlock { - UIBarButtonItem *barButtonItem = [[[self class] alloc] initWithImage:image style:style target:nil action:nil]; - [barButtonItem setBlock:actionBlock]; - return barButtonItem; -} - - -- (instancetype)initWithTitle:(NSString *)title style:(UIBarButtonItemStyle)style block:(ALActionBlock)actionBlock { - UIBarButtonItem *barButtonItem = [[[self class] alloc] initWithTitle:title style:style target:nil action:nil]; - [barButtonItem setBlock:actionBlock]; - return barButtonItem; -} - - -- (void)setBlock:(ALActionBlock)actionBlock { - NSMutableArray *actionBlocksArray = [self actionBlocksArray]; - - ALActionBlockWrapper *blockActionWrapper = [[ALActionBlockWrapper alloc] init]; - blockActionWrapper.actionBlock = actionBlock; - [actionBlocksArray addObject:blockActionWrapper]; - - [self setTarget:blockActionWrapper]; - [self setAction:@selector(invokeBlock:)]; -} - - -- (NSMutableArray *)actionBlocksArray { - NSMutableArray *actionBlocksArray = objc_getAssociatedObject(self, &ALActionBlocksArray); - if (!actionBlocksArray) { - actionBlocksArray = [NSMutableArray array]; - objc_setAssociatedObject(self, &ALActionBlocksArray, actionBlocksArray, OBJC_ASSOCIATION_RETAIN); - } - return actionBlocksArray; -} - -@end diff --git a/BHTwitter/ALActionBlocks/UIControl+ALActionBlocks.h b/BHTwitter/ALActionBlocks/UIControl+ALActionBlocks.h deleted file mode 100755 index 19809e82..00000000 --- a/BHTwitter/ALActionBlocks/UIControl+ALActionBlocks.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// UIControl+ALActionBlocks.h -// ALActionBlocks -// -// Created by Andy LaVoy on 3/30/13. -// Copyright (c) 2013 Andy LaVoy. All rights reserved. -// - -#import -#import "ALActionBlock.h" - -@interface UIControl (ALActionBlocks) - -- (void)handleControlEvents:(UIControlEvents)controlEvents withBlock:(ALActionBlock)actionBlock; -- (void)removeActionBlocksForControlEvents:(UIControlEvents)controlEvents; - -@end \ No newline at end of file diff --git a/BHTwitter/ALActionBlocks/UIControl+ALActionBlocks.m b/BHTwitter/ALActionBlocks/UIControl+ALActionBlocks.m deleted file mode 100755 index 1b91b5b7..00000000 --- a/BHTwitter/ALActionBlocks/UIControl+ALActionBlocks.m +++ /dev/null @@ -1,55 +0,0 @@ -// -// UIControl+ALActionBlocks.m -// ALActionBlocks -// -// Created by Andy LaVoy on 3/30/13. -// Copyright (c) 2013 Andy LaVoy. All rights reserved. -// - -#import "UIControl+ALActionBlocks.h" -#import "ALActionBlockWrapper.h" -#import - - -@implementation UIControl (ALActionBlocks) - - -- (void)handleControlEvents:(UIControlEvents)controlEvents withBlock:(ALActionBlock)actionBlock { - NSMutableArray *actionBlocksArray = [self actionBlocksArray]; - - ALActionBlockWrapper *blockActionWrapper = [[ALActionBlockWrapper alloc] init]; - blockActionWrapper.actionBlock = actionBlock; - blockActionWrapper.controlEvents = controlEvents; - [actionBlocksArray addObject:blockActionWrapper]; - - [self addTarget:blockActionWrapper action:@selector(invokeBlock:) forControlEvents:controlEvents]; -} - - -- (void)removeActionBlocksForControlEvents:(UIControlEvents)controlEvents { - NSMutableArray *actionBlocksArray = [self actionBlocksArray]; - NSMutableArray *wrappersToRemove = [NSMutableArray arrayWithCapacity:[actionBlocksArray count]]; - - [actionBlocksArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - ALActionBlockWrapper *wrapperTmp = obj; - if (wrapperTmp.controlEvents == controlEvents) { - [wrappersToRemove addObject:wrapperTmp]; - [self removeTarget:wrapperTmp action:@selector(invokeBlock:) forControlEvents:controlEvents]; - } - }]; - - [actionBlocksArray removeObjectsInArray:wrappersToRemove]; -} - - -- (NSMutableArray *)actionBlocksArray { - NSMutableArray *actionBlocksArray = objc_getAssociatedObject(self, &ALActionBlocksArray); - if (!actionBlocksArray) { - actionBlocksArray = [NSMutableArray array]; - objc_setAssociatedObject(self, &ALActionBlocksArray, actionBlocksArray, OBJC_ASSOCIATION_RETAIN); - } - return actionBlocksArray; -} - - -@end \ No newline at end of file diff --git a/BHTwitter/ALActionBlocks/UIGestureRecognizer+ALActionBlocks.h b/BHTwitter/ALActionBlocks/UIGestureRecognizer+ALActionBlocks.h deleted file mode 100755 index 272383d1..00000000 --- a/BHTwitter/ALActionBlocks/UIGestureRecognizer+ALActionBlocks.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// UIGestureRecognizer+ALActionBlocks.h -// ALActionBlocks -// -// Created by Andy LaVoy on 10/17/13. -// Copyright (c) 2013 Andy LaVoy. All rights reserved. -// - -#import -#import "ALActionBlock.h" - -@interface UIGestureRecognizer (ALActionBlocks) - -- (instancetype)initWithBlock:(ALActionBlock)actionBlock; -- (void)setBlock:(ALActionBlock)actionBlock; - -@end diff --git a/BHTwitter/ALActionBlocks/UIGestureRecognizer+ALActionBlocks.m b/BHTwitter/ALActionBlocks/UIGestureRecognizer+ALActionBlocks.m deleted file mode 100755 index 56762d74..00000000 --- a/BHTwitter/ALActionBlocks/UIGestureRecognizer+ALActionBlocks.m +++ /dev/null @@ -1,43 +0,0 @@ -// -// UIGestureRecognizer+ALActionBlocks.m -// ALActionBlocks -// -// Created by Andy LaVoy on 10/17/13. -// Copyright (c) 2013 Andy LaVoy. All rights reserved. -// - -#import "UIGestureRecognizer+ALActionBlocks.h" -#import "ALActionBlockWrapper.h" -#import - -@implementation UIGestureRecognizer (ALActionBlocks) - - -- (instancetype)initWithBlock:(ALActionBlock)actionBlock { - UIGestureRecognizer *gestureRecognizer = [[[self class] alloc] init]; - [gestureRecognizer setBlock:actionBlock]; - return gestureRecognizer; -} - - -- (void)setBlock:(ALActionBlock)actionBlock { - NSMutableArray *actionBlocksArray = [self actionBlocksArray]; - - ALActionBlockWrapper *blockActionWrapper = [[ALActionBlockWrapper alloc] init]; - blockActionWrapper.actionBlock = actionBlock; - [actionBlocksArray addObject:blockActionWrapper]; - - [self addTarget:blockActionWrapper action:@selector(invokeBlock:)]; -} - - -- (NSMutableArray *)actionBlocksArray { - NSMutableArray *actionBlocksArray = objc_getAssociatedObject(self, &ALActionBlocksArray); - if (!actionBlocksArray) { - actionBlocksArray = [NSMutableArray array]; - objc_setAssociatedObject(self, &ALActionBlocksArray, actionBlocksArray, OBJC_ASSOCIATION_RETAIN); - } - return actionBlocksArray; -} - -@end diff --git a/BHTwitter/BHTManager.h b/BHTwitter/BHTManager.h index 8d27fdb5..fc17b50e 100644 --- a/BHTwitter/BHTManager.h +++ b/BHTwitter/BHTManager.h @@ -23,10 +23,8 @@ + (BOOL)DownloadingVideos; + (BOOL)DirectSave; + (BOOL)VoiceFeature; -+ (BOOL)voice_in_replay; + (BOOL)UndoTweet; + (BOOL)ReaderMode; -+ (BOOL)ReplyLater; + (BOOL)VideoZoom; + (BOOL)NoHistory; + (BOOL)BioTranslate; @@ -49,5 +47,6 @@ + (BOOL)tweetToImage; + (BOOL)hideSpacesBar; + (BOOL)disableRTL; ++ (BOOL)alwaysOpenSafari; @end diff --git a/BHTwitter/BHTManager.m b/BHTwitter/BHTManager.m index 2e482a92..2520483d 100644 --- a/BHTwitter/BHTManager.m +++ b/BHTwitter/BHTManager.m @@ -6,8 +6,7 @@ // #import "BHTManager.h" -#import "BHTwitter-Swift.h" -#import "BHTwitter+NSURL.h" +#import "SettingsViewController.h" @implementation BHTManager + (float)TwitterVersion { @@ -118,9 +117,6 @@ + (BOOL)DirectSave { + (BOOL)VoiceFeature { return [[NSUserDefaults standardUserDefaults] boolForKey:@"voice"]; } -+ (BOOL)voice_in_replay { - return [[NSUserDefaults standardUserDefaults] boolForKey:@"voice_in_replay"]; -} + (BOOL)LikeConfirm { return [[NSUserDefaults standardUserDefaults] boolForKey:@"like_con"]; } @@ -145,9 +141,6 @@ + (BOOL)UndoTweet { + (BOOL)ReaderMode { return [[NSUserDefaults standardUserDefaults] boolForKey:@"reader_mode"]; } -+ (BOOL)ReplyLater { - return [[NSUserDefaults standardUserDefaults] boolForKey:@"reply_layer"]; -} + (BOOL)VideoZoom { return [[NSUserDefaults standardUserDefaults] boolForKey:@"video_zoom"]; } @@ -196,317 +189,12 @@ + (BOOL)hideSpacesBar { + (BOOL)disableRTL { return [[NSUserDefaults standardUserDefaults] boolForKey:@"dis_rtl"]; } ++ (BOOL)alwaysOpenSafari { + return [[NSUserDefaults standardUserDefaults] boolForKey:@"openInBrowser"]; +} + (UIViewController *)BHTSettingsWithAccount:(TFNTwitterAccount *)twAccount { - HBPreferences *pref = [[HBPreferences alloc] initTableWithTableStyle:UITableViewStyleInsetGrouped title:@"BHTwitter" SeparatorStyle:UITableViewCellSeparatorStyleSingleLine]; + SettingsViewController *pref = [[SettingsViewController alloc] initWithTwitterAccount:twAccount]; [pref.navigationItem setTitleView:[objc_getClass("TFNTitleView") titleViewWithTitle:@"BHTwitter" subtitle:twAccount.displayUsername]]; - - HBSection *mainSection = [HBSection sectionWithTitle:@"BHTwitter Preferences" footer:nil]; - HBSection *twitterBlueSection = [HBSection sectionWithTitle:@"Twitter blue features" footer:@"You may need to restart Twitter app to apply changes"]; - HBSection *layoutSection = [HBSection sectionWithTitle:@"Layout customization" footer:@"Restart Twitter app to apply changes"]; - HBSection *debug = [HBSection sectionWithTitle:@"Debugging" footer:nil]; - HBSection *legalSection = [HBSection sectionWithTitle:@"Legal notices" footer:nil]; - HBSection *developer = [HBSection sectionWithTitle:@"Developer" footer:@"BHTwitter v2.9.7"]; - - HBSwitchCell *download = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Downloading videos" DetailTitle:@"Downloading videos. By adding button in tweet and inside video tab bar." switchKey:@"dw_v" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"dw_v"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"dw_v"]; - } - }]; - - HBSwitchCell *direct_save = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Direct save" DetailTitle:@"Save video directly after downloading." switchKey:@"direct_save" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"direct_save"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"direct_save"]; - } - }]; - - HBSwitchCell *hide_ads = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Hide ads" DetailTitle:@"Remove all promoted tweet." switchKey:@"hide_promoted" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"hide_promoted"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"hide_promoted"]; - } - }]; - - HBSwitchCell *hide_topics = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Hide topics tweets" DetailTitle:@"Remove all topics tweets from the timeline." switchKey:@"hide_topics" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"hide_topics"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"hide_topics"]; - } - }]; - - HBSwitchCell *disable_VODCaptions = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Disable video layer captions" DetailTitle:nil switchKey:@"dis_VODCaptions" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"dis_VODCaptions"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"dis_VODCaptions"]; - } - }]; - - HBSwitchCell *voice = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Voice feature" DetailTitle:@"Enable voice in tweet and DM." switchKey:@"voice" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"voice"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"voice"]; - } - }]; - - HBSwitchCell *voice_in_replay = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Voice feature in replay" DetailTitle:@"Enable voice in tweet replay." switchKey:@"voice_in_replay" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"voice_in_replay"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"voice_in_replay"]; - } - }]; - - HBSwitchCell *UndoTweet = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Undo tweets feature" DetailTitle:@"Undo tweets after tweeting." switchKey:@"undo_tweet" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"undo_tweet"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"undo_tweet"]; - } - }]; - - HBSwitchCell *ReaderMode = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Reader mode feature" DetailTitle:@"Enable reader mode in threads." switchKey:@"reader_mode" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"reader_mode"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"reader_mode"]; - } - }]; - - HBSwitchCell *ReplyLater = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Reply later feature" DetailTitle:@"Enable you to mark DM conversations as reply later." switchKey:@"reply_layer" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"reply_layer"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"reply_layer"]; - } - }]; - - HBSwitchCell *VideoZoom = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Video zoom feature" DetailTitle:@"You can zoom the video by double clicking in the center of the video." switchKey:@"video_zoom" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"video_zoom"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"video_zoom"]; - } - }]; - - HBSwitchCell *NoHistory = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"No search history" DetailTitle:@"Force Twitter to stop recording search history." switchKey:@"no_his" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"no_his"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"no_his"]; - } - }]; - - HBSwitchCell *BioTranslate = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Translate bio" DetailTitle:@"Show you a button in user bio to translate it." switchKey:@"bio_translate" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"bio_translate"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"bio_translate"]; - } - }]; - - HBSwitchCell *like_confirm = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Like confirm" DetailTitle:@"Show a confirm alert when you press like button." switchKey:@"like_con" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"like_con"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"like_con"]; - } - }]; - - HBSwitchCell *tweet_confirm = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Tweet confirm" DetailTitle:@"Show a confirm alert when you press tweet button." switchKey:@"tweet_con" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"tweet_con"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"tweet_con"]; - } - }]; - - HBSwitchCell *follow_confirm = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"User follow confirm" DetailTitle:@"Show a confirm alert when you press follow button." switchKey:@"follow_con" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"follow_con"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"follow_con"]; - } - }]; - - HBSwitchCell *padlock = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Padlock" DetailTitle:@"Lock Twitter with passcode." switchKey:@"padlock" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[keychain shared] saveDictionary:@{@"isAuthenticated": @YES}]; - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"padlock"]; - } else { - [[keychain shared] saveDictionary:@{@"isAuthenticated": @NO}]; - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"padlock"]; - } - }]; - - HBSwitchCell *DmModularSearch = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Enable DM Modular Search" DetailTitle:@"Enable the new UI of DM search" switchKey:@"DmModularSearch" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"DmModularSearch"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"DmModularSearch"]; - } - }]; - HBSwitchCell *autoHighestLoad = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Auto load photos in highest quality" DetailTitle:@"This option let you upload photos and load it in highest quality possible." switchKey:@"autoHighestLoad" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"autoHighestLoad"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"autoHighestLoad"]; - } - }]; - - HBSwitchCell *disableSensitiveTweetWarnings = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Disable sensitive tweet warning view" DetailTitle:nil switchKey:@"disableSensitiveTweetWarnings" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"disableSensitiveTweetWarnings"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"disableSensitiveTweetWarnings"]; - } - }]; - - HBSwitchCell *oldTweetStyle = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Disable edge to edge tweet style" DetailTitle:@"Force Twitter to use the old tweet style." switchKey:@"old_style" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"old_style"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"old_style"]; - } - }]; - - HBSwitchCell *trustedFriends = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Enable Twitter Circle feature" DetailTitle:nil switchKey:@"TrustedFriends" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"TrustedFriends"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"TrustedFriends"]; - } - }]; - - HBSwitchCell *copyProfileInfo = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Enable Copying profile information feature" DetailTitle:@"Add new button in Twitter profile that let you copy whatever info you want" switchKey:@"CopyProfileInfo" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"CopyProfileInfo"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"CopyProfileInfo"]; - } - }]; - - HBSwitchCell *tweetToImage = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Save tweet as an image" DetailTitle:@"You can export tweets as image, by long pressing on the Tweet Share button" switchKey:@"TweetToImage" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"TweetToImage"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"TweetToImage"]; - } - }]; - - HBSwitchCell *hideSpace = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Hide spaces bar" DetailTitle:nil switchKey:@"hide_spaces" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"hide_spaces"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"hide_spaces"]; - } - }]; - - HBSwitchCell *disableRTL = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Disable RTL" DetailTitle:@"Force Twitter use LTL with RTL language.\nRestart Twitter app to apply changes" switchKey:@"dis_rtl" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"dis_rtl"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"dis_rtl"]; - } - }]; - - HBViewControllerCell *fontsPicker = [[HBViewControllerCell alloc] initCellWithTitle:@"Font" detail:[[NSUserDefaults standardUserDefaults] objectForKey:@"bhtwitter_font_1"] action:^UIViewController *{ - UIFontPickerViewControllerConfiguration *configuration = [[UIFontPickerViewControllerConfiguration alloc] init]; - [configuration setFilteredTraits:UIFontDescriptorClassMask]; - [configuration setIncludeFaces:false]; - UIFontPickerViewController *fontPicker = [[UIFontPickerViewController alloc] initWithConfiguration:configuration]; - [fontPicker setTitle:@"Choose Font"]; - fontPicker.delegate = pref; - return fontPicker; - }]; - HBViewControllerCell *BoldfontsPicker = [[HBViewControllerCell alloc] initCellWithTitle:@"Bold Font" detail:[[NSUserDefaults standardUserDefaults] objectForKey:@"bhtwitter_font_2"] action:^UIViewController *{ - UIFontPickerViewControllerConfiguration *configuration = [[UIFontPickerViewControllerConfiguration alloc] init]; - [configuration setIncludeFaces:true]; - [configuration setFilteredTraits:UIFontDescriptorClassModernSerifs]; - [configuration setFilteredTraits:UIFontDescriptorClassMask]; - UIFontPickerViewController *fontPicker = [[UIFontPickerViewController alloc] initWithConfiguration:configuration]; - [fontPicker setTitle:@"Choose Font"]; - fontPicker.delegate = pref; - return fontPicker; - }]; - - HBViewControllerCell *CustomTabBarVC = [[HBViewControllerCell alloc] initCellWithTitle:@"Custom Tab Bar" detail:nil action:^UIViewController *{ - CustomTabBarViewController *customTabBArVC = [[CustomTabBarViewController alloc] init]; - [customTabBArVC.navigationItem setTitleView:[objc_getClass("TFNTitleView") titleViewWithTitle:@"Custom Tab Bar" subtitle:twAccount.displayUsername]]; - return customTabBArVC; - }]; - - HBViewControllerCell *appTheme = [[HBViewControllerCell alloc] initCellWithTitle:@"Theme" detail:@"Choose a theme color for you Twitter experience that can only be seen by you." action:^UIViewController *{ -// I create my own Color Theme ViewController for two main reasons: -// 1- Twitter use swift to build their view controller, so I can't hook anything on it. -// 2- Twitter knows you do not actually subscribe with Twitter Blue, so it keeps resting the changes and resting 'T1ColorSettingsPrimaryColorOptionKey' key, so I had to create another key to track the original one and keep sure no changes, but it still not enough to keep the new theme after relaunching app, so i had to force the changes again with new lunch. - BHColorThemeViewController *themeVC = [[BHColorThemeViewController alloc] init]; - [themeVC.navigationItem setTitleView:[objc_getClass("TFNTitleView") titleViewWithTitle:@"Theme" subtitle:twAccount.displayUsername]]; - return themeVC; - }]; - - HBSwitchCell *font = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Enable changing font" DetailTitle:@"Option to allow changing Twitter font and show font picker." switchKey:@"en_font" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"en_font"]; - [layoutSection addCells:@[fontsPicker, BoldfontsPicker]]; - [pref.tableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:3 inSection:2], [NSIndexPath indexPathForRow:4 inSection:2]] withRowAnimation:UITableViewRowAnimationAutomatic]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"en_font"]; - [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"bhtwitter_font_1"]; - [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"bhtwitter_font_2"]; - [layoutSection removeCells:@[fontsPicker, BoldfontsPicker]]; - [pref.tableView deleteRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:3 inSection:2], [NSIndexPath indexPathForRow:4 inSection:2]] withRowAnimation:UITableViewRowAnimationAutomatic]; - } - }]; - - HBSwitchCell *dwbLayout = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Download button always on the trailing side" DetailTitle:@"Force the download button to be always in the trailing side." switchKey:@"dwb_layout" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"dwb_layout"]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"dwb_layout"]; - } - }]; - - HBSwitchCell *flex = [[HBSwitchCell alloc] initSwitchCellWithImage:nil Title:@"Enable FLEX" DetailTitle:@"Show FLEX on twitter app." switchKey:@"flex_twitter" withBlock:^(UISwitch *weakSender) { - if (weakSender.isOn) { - [[FLEXManager sharedManager] showExplorer]; - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"flex_twitter"]; - } else { - [[FLEXManager sharedManager] hideExplorer]; - [[NSUserDefaults standardUserDefaults] setBool:false forKey:@"flex_twitter"]; - } - }]; - - HBViewControllerCell *acknowledgements = [[HBViewControllerCell alloc] initCellWithTitle:@"Acknowledgements" detail:nil action:^UIViewController *{ - T1RichTextFormatViewController *acknowledgementsVC = [[objc_getClass("T1RichTextFormatViewController") alloc] initWithRichTextFormatDocumentPath:[NSURL bhtwitter_fileURLWithPath:@"Acknowledgements.rtf"].path]; - [acknowledgementsVC.navigationItem setTitleView:[objc_getClass("TFNTitleView") titleViewWithTitle:@"Acknowledgements" subtitle:twAccount.displayUsername]]; - return acknowledgementsVC; - }]; - - HBTwitterCell *bandarhl = [[HBTwitterCell alloc] initTwitterCellWithTitle:@"BandarHelal" detail:@"@BandarHL" AccountLink:@"https://twitter.com/BandarHL"]; - HBlinkCell *tipJar = [[HBlinkCell alloc] initLinkCellWithTitle:@"Tip Jar" detailTitle:@"Donate" link:@"https://www.paypal.me/BandarHL"]; - HBGithubCell *sourceCode = [[HBGithubCell alloc] initGithubCellWithTitle:@"BHTwitter" detailTitle:@"Code source of BHTwitter" GithubURL:@"https://github.com/BandarHL/BHTwitter/"]; - - - [mainSection addCells:@[download, hide_ads, hide_topics, disable_VODCaptions, direct_save, voice, voice_in_replay, ReplyLater, VideoZoom, NoHistory, BioTranslate, like_confirm, tweet_confirm, follow_confirm, padlock, DmModularSearch, autoHighestLoad, disableSensitiveTweetWarnings, copyProfileInfo, tweetToImage, hideSpace, disableRTL]]; - - [twitterBlueSection addCells:@[UndoTweet, ReaderMode, trustedFriends, appTheme, CustomTabBarVC]]; - [layoutSection addCells:@[oldTweetStyle, dwbLayout, font]]; - if ([BHTManager changeFont]) { - [layoutSection addCells:@[fontsPicker, BoldfontsPicker]]; - } - - [debug addCell:flex]; - [legalSection addCell:acknowledgements]; - [developer addCells:@[bandarhl, sourceCode, tipJar]]; - - [pref addSections:@[mainSection, twitterBlueSection, layoutSection, debug, legalSection, developer]]; return pref; } diff --git a/BHTwitter/BHTwitter.xm b/BHTwitter/BHTwitter.xm index 79e18292..808a4da3 100644 --- a/BHTwitter/BHTwitter.xm +++ b/BHTwitter/BHTwitter.xm @@ -108,6 +108,9 @@ [UIAction actionWithTitle:@"Copy URL in the bio" image:[UIImage systemImageNamed:@"doc.on.clipboard"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) { UIPasteboard.generalPasteboard.string = self.viewModel.url; }], + [UIAction actionWithTitle:@"Copy Location in the bio" image:[UIImage systemImageNamed:@"doc.on.clipboard"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) { + UIPasteboard.generalPasteboard.string = self.viewModel.location; + }], ]]]; } else { [copyButton addTarget:self action:@selector(copyButtonHandler:) forControlEvents:UIControlEventTouchUpInside]; @@ -160,10 +163,14 @@ UIAlertAction *url = [UIAlertAction actionWithTitle:@"Copy URL in the bio" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { UIPasteboard.generalPasteboard.string = self.viewModel.url; }]; + UIAlertAction *location = [UIAlertAction actionWithTitle:@"Copy Location in the bio" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + UIPasteboard.generalPasteboard.string = self.viewModel.location; + }]; [alert addAction:bio]; [alert addAction:username]; [alert addAction:fullusername]; [alert addAction:url]; + [alert addAction:location]; [alert addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]]; [self presentViewController:alert animated:true completion:nil]; } @@ -406,6 +413,29 @@ } %end +// MARK: Always open in Safrai +// Thanks nyuszika7h https://github.com/nyuszika7h/noinappsafari/ +%hook SFSafariViewController +- (void)viewWillAppear:(BOOL)animated { + if (![BHTManager alwaysOpenSafari]) { + return %orig; + } + NSURL *url = [self initialURL]; + + [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil]; + [self dismissViewControllerAnimated:NO completion:nil]; +} +%end + +%hook SFInteractiveDismissController +- (void)animateTransition:(id)transitionContext { + if (![BHTManager alwaysOpenSafari]) { + return %orig; + } + [transitionContext completeTransition:NO]; +} +%end + %hook TFSTwitterEntityURL - (NSString *)url { // https://github.com/haoict/twitter-no-ads/blob/master/Tweak.xm#L195 @@ -462,7 +492,7 @@ } %end -// MARK: Voice, TwitterCircle, SensitiveTweetWarnings, autoHighestLoad, VideoZoom, ReplyLater, VODCaptions, disableSpacesBar feature +// MARK: Voice, TwitterCircle, SensitiveTweetWarnings, autoHighestLoad, VideoZoom, VODCaptions, disableSpacesBar feature %hook TPSTwitterFeatureSwitches // Twitter save all the features and keys in side JSON file in bundle of application fs_embedded_defaults_production.json, and use it in TFNTwitterAccount class but with DM voice maybe developers forget to add boolean variable in the class, so i had to change it from the file. // also, you can find every key for every feature i used in this tweak, i can remove all the codes below and find every key for it but I'm lazy to do that, :) @@ -611,12 +641,6 @@ } return %orig; } -- (_Bool)isReplyLaterEnabled { - if ([BHTManager ReplyLater]) { - return true; - } - return %orig; -} - (_Bool)isDMVoiceRenderingEnabled { if ([BHTManager VoiceFeature]) { return true; @@ -630,14 +654,6 @@ return %orig; } %end -%hook TFNTwitterComposition -- (BOOL)isReply { - if ([BHTManager voice_in_replay]) { - return false; - } - return %orig; -} -%end %hook T1PhotoMediaRailViewController - (void)setVoiceButtonHidden:(BOOL)arg1 { @@ -682,6 +698,14 @@ return %orig; } } + +// CoTweet +- (BOOL)isTweetCollaborationEnabled { + return true; +} +- (BOOL)_t1_canEnableCollaboration { + return true; +} %end // MARK: Follow confirm @@ -746,6 +770,17 @@ %end // MARK: Reader mode +%hook TUCLayoutContext +- (BOOL)isReaderModeEnabled { + return true; +} +%end + +%hook T1ConversationContainerViewController +- (id)initWithAccount:(id)arg1 viewModel:(id)arg2 statusNavigationContext:(id)arg3 scribeContext:(id)arg4 sourceNavigationMetadata:(id)arg5 overrideNavigationMetadata:(id)arg6 shouldIncludeReferrerParams:(_Bool)arg7 ruxContext:(id)arg8 readerModeEnabled:(_Bool)arg9 { + return %orig(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, [BHTManager ReaderMode]); +} +%end %hook T1ReaderModeConfig - (_Bool)isReaderModeEnabled { if ([BHTManager ReaderMode]) { @@ -798,12 +833,21 @@ - (void)viewWillAppear:(BOOL)arg1 { %orig; if ([self.sections count] == 1) { - TFNItemsDataViewControllerBackingStore *DataViewControllerBackingStore = self.backingStore; + TFNItemsDataViewControllerBackingStore *backingStore = self.backingStore; TFNSettingsNavigationItem *bhtwitter = [[%c(TFNSettingsNavigationItem) alloc] initWithTitle:@"Settings" detail:@"BHTwitter preferences" systemIconName:@"gear" controllerFactory:^UIViewController *{ return [BHTManager BHTSettingsWithAccount:self.account]; }]; - [DataViewControllerBackingStore insertSection:0 atIndex:0]; - [DataViewControllerBackingStore insertItem:bhtwitter atIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; + + if ([backingStore respondsToSelector:@selector(insertSection:atIndex:)]) { + [backingStore insertSection:0 atIndex:0]; + } else { + [backingStore _tfn_insertSection:0 atIndex:0]; + } + if ([backingStore respondsToSelector:@selector(insertItem:atIndexPath:)]) { + [backingStore insertItem:bhtwitter atIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; + } else { + [backingStore _tfn_insertItem:bhtwitter atIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; + } } } %end @@ -1240,6 +1284,11 @@ } %end +%hook HBForceCepheiPrefs ++ (BOOL)forceCepheiPrefsWhichIReallyNeedToAccessAndIKnowWhatImDoingISwear { + return YES; +} +%end // Fix login keychain in non-JB (IPA). //%hook TFSKeychain //- (NSString *)providerDefaultAccessGroup { diff --git a/BHTwitter/HBPreferences/HBCell.h b/BHTwitter/HBPreferences/HBCell.h deleted file mode 100755 index 2d56391e..00000000 --- a/BHTwitter/HBPreferences/HBCell.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// HPCell.h -// Cephei - -#import -#import "../BHTwitter+UIImage.h" -#import "HBPreferences.h" -#import "../Classes/GlobalStateExplorers/RuntimeExplore.h" -#import -#import "ALActionBlocks.h" - -typedef void (^HBPValueChanged)(id sender); - -@interface HBCell : UITableViewCell -+ (instancetype)initCell; -- (instancetype)init; -- (void)didSelectFromTable:(HBPreferences *)viewController; -- (UIContextMenuConfiguration *)contextMenuConfigurationForRowAtCell:(HBCell *)cell FromTable:(HBPreferences *)viewController; -@property (nonatomic, copy) HBPValueChanged valueChanged; -@end diff --git a/BHTwitter/HBPreferences/HBCell.m b/BHTwitter/HBPreferences/HBCell.m deleted file mode 100755 index 03c8d2ba..00000000 --- a/BHTwitter/HBPreferences/HBCell.m +++ /dev/null @@ -1,25 +0,0 @@ -// -// HPCell.m -// Cephei - -#import "HBCell.h" - -@implementation HBCell - -+ (instancetype)initCell { - return [[self alloc] init]; -} - -- (instancetype)init { - self = [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:nil]; - return self; -} - -- (void)didSelectFromTable:(HBPreferences *)viewController { - -} - -- (UIContextMenuConfiguration *)contextMenuConfigurationForRowAtCell:(HBCell *)cell FromTable:(HBPreferences *)viewController { - -} -@end diff --git a/BHTwitter/HBPreferences/HBGithubCell.h b/BHTwitter/HBPreferences/HBGithubCell.h deleted file mode 100755 index 8c82ab23..00000000 --- a/BHTwitter/HBPreferences/HBGithubCell.h +++ /dev/null @@ -1,12 +0,0 @@ -// -// HBGithubCell.h -// Cephei - -#import "HBCell.h" - -@interface HBGithubCell : HBCell -- (instancetype)initGithubCellWithTitle:(NSString *)title detailTitle:(NSString *)Dtitle GithubURL:(NSString *)gURL; -@property (nonatomic, strong) UIImageView *GithubImage; -@property (nonatomic, strong) UIImageView *SafariImage; -@property (nonatomic, strong) NSString *GithubURL; -@end diff --git a/BHTwitter/HBPreferences/HBGithubCell.m b/BHTwitter/HBPreferences/HBGithubCell.m deleted file mode 100755 index e6b2fa46..00000000 --- a/BHTwitter/HBPreferences/HBGithubCell.m +++ /dev/null @@ -1,90 +0,0 @@ -// -// HBGithubCell.m -// Cephei - -#import "HBGithubCell.h" - -@implementation HBGithubCell - -- (instancetype)initGithubCellWithTitle:(NSString *)title detailTitle:(NSString *)Dtitle GithubURL:(NSString *)gURL { - HBGithubCell *cell = [self init]; - self.GithubURL = gURL; - - [self setupUI:Dtitle title:title]; - [cell setSeparatorInset:UIEdgeInsetsMake(0, 60, 0, 0)]; - return cell; -} - -- (void)setupUI:(NSString *)Dtitle title:(NSString *)title { - - [self.imageView setImage:[UIImage bhtwitter_imageNamed:@"github"]]; - [self.imageView setClipsToBounds:true]; - [self.imageView.layer setCornerRadius:(29/2)]; - - CGSize size = CGSizeMake(29, 29); - UIGraphicsBeginImageContextWithOptions(size, NO, UIScreen.mainScreen.scale); - [self.image drawInRect:CGRectMake(0, 0, size.width, size.height)]; - UIImage *newThumbnail = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - self.imageView.image = newThumbnail; - - self.SafariImage = UIImageView.new; - [self.SafariImage setImage:[UIImage systemImageNamed:@"safari"]]; - [self.SafariImage setTintColor:[UIColor lightGrayColor]]; - [self.SafariImage setTranslatesAutoresizingMaskIntoConstraints:false]; - [self addSubview:self.SafariImage]; - - [self.SafariImage.centerYAnchor constraintEqualToAnchor:self.centerYAnchor].active = true; - [self.SafariImage.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-20].active = true; - [self.SafariImage.widthAnchor constraintEqualToConstant:16].active = true; - [self.SafariImage.heightAnchor constraintEqualToConstant:16].active = true; - - [self.textLabel setText:title]; - [self.textLabel setTextColor:[UIColor colorWithRed:0.039 green:0.518 blue:1 alpha:1]]; - [self.textLabel setNumberOfLines:0]; - - [self.detailTextLabel setText:Dtitle]; - [self.detailTextLabel setTextColor:[UIColor secondaryLabelColor]]; - [self.detailTextLabel setFont:[UIFont systemFontOfSize:12]]; - [self.detailTextLabel setNumberOfLines:0]; -} - -- (SFSafariViewController *)SafariViewControllerForURL { - SFSafariViewController *SafariVC = [[SFSafariViewController alloc] initWithURL:[NSURL URLWithString:self.GithubURL]]; - return SafariVC; -} - -- (void)didSelectFromTable:(HBPreferences *)viewController { - NSIndexPath *indexPath = [viewController.tableView indexPathForCell:self]; - if (self.GithubURL.length == 0) { - [viewController.tableView deselectRowAtIndexPath:indexPath animated:YES]; - } else { - [viewController presentViewController:[self SafariViewControllerForURL] animated:true completion:nil]; - } -} - -- (UIContextMenuConfiguration *)contextMenuConfigurationForRowAtCell:(HBCell *)cell FromTable:(HBPreferences *)viewController { - SFSafariViewController *SafariVC = [self SafariViewControllerForURL]; - - UIContextMenuConfiguration *configuration = [UIContextMenuConfiguration configurationWithIdentifier:[RuntimeExplore getAddressFromDescription:SafariVC.description] previewProvider:^UIViewController * _Nullable { - return SafariVC; - } actionProvider:^UIMenu * _Nullable(NSArray * _Nonnull suggestedActions) { - - UIAction *open = [UIAction actionWithTitle:@"Open Link" image:[UIImage systemImageNamed:@"safari"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) { - [viewController presentViewController:SafariVC animated:true completion:nil]; - }]; - - UIAction *copy = [UIAction actionWithTitle:@"Copy Link" image:[UIImage systemImageNamed:@"doc.on.doc"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) { - UIPasteboard.generalPasteboard.string = self.GithubURL; - }]; - - UIAction *share = [UIAction actionWithTitle:@"Share..." image:[UIImage systemImageNamed:@"square.and.arrow.up"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) { - UIActivityViewController *ac = [[UIActivityViewController alloc] initWithActivityItems:@[[NSURL URLWithString:self.GithubURL]] applicationActivities:nil]; - [viewController presentViewController:ac animated:true completion:nil]; - }]; - return [UIMenu menuWithTitle:@"" children:@[open, copy, share]]; - }]; - - return configuration; -} -@end diff --git a/BHTwitter/HBPreferences/HBPreferences.h b/BHTwitter/HBPreferences/HBPreferences.h deleted file mode 100755 index d3132671..00000000 --- a/BHTwitter/HBPreferences/HBPreferences.h +++ /dev/null @@ -1,11 +0,0 @@ -// -// HBPreferences.h -// Cephei -#import - -@interface HBPreferences : UITableViewController -@property (nonatomic, strong) NSArray *sections; -+ (instancetype)tableWithSections:(NSArray *)sections title:(NSString *)title TableStyle:(UITableViewStyle)style SeparatorStyle:(UITableViewCellSeparatorStyle)SeparatorStyle; -- (instancetype)initTableWithTableStyle:(UITableViewStyle)style title:(NSString *)title SeparatorStyle:(UITableViewCellSeparatorStyle)SeparatorStyle; -- (void)addSections:(NSArray *)sections; -@end diff --git a/BHTwitter/HBPreferences/HBPreferences.m b/BHTwitter/HBPreferences/HBPreferences.m deleted file mode 100755 index e7e8d99a..00000000 --- a/BHTwitter/HBPreferences/HBPreferences.m +++ /dev/null @@ -1,124 +0,0 @@ -// -// HBPreferences.m -// Cephei - -#import "HBPreferences.h" -#import "HBCell.h" -#import "HBSection.h" -#import "HBTwitterCell.h" -#import "HBGithubCell.h" -#import "HBSwitchCell.h" -#import "HBlinkCell.h" -#import "HBViewControllerCell.h" -#include -#import - -@interface HBPreferences () - -@end - -@implementation HBPreferences -+ (instancetype)tableWithSections:(NSArray *)sections title:(NSString *)title TableStyle:(UITableViewStyle)style SeparatorStyle:(UITableViewCellSeparatorStyle)SeparatorStyle { - HBPreferences *table = [[self alloc] initTableWithSections:sections TableStyle:style SeparatorStyle:SeparatorStyle]; - table.title = title; - return table; -} - -- (instancetype)initTableWithTableStyle:(UITableViewStyle)style title:(NSString *)title SeparatorStyle:(UITableViewCellSeparatorStyle)SeparatorStyle { - if (self = [super initWithStyle:style]) { - [self.tableView setSeparatorStyle:SeparatorStyle]; - self.title = title; - } - return self; -} -- (instancetype)initTableWithSections:(NSArray *)sections TableStyle:(UITableViewStyle)style SeparatorStyle:(UITableViewCellSeparatorStyle)SeparatorStyle { - if (self = [super initWithStyle:style]) { - self.sections = sections; - [self.tableView setSeparatorStyle:SeparatorStyle]; - } - return self; -} -- (void)addSections:(NSArray *)sections { - self.sections = sections; -} -- (HBCell *)cellForIndexPath:(NSIndexPath *)indexPath { - return [self.sections[indexPath.section] cells][indexPath.row]; -} - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return self.sections.count; -} - -- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { - return [self.sections[section] headerTitle]; -} - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)sectionIndex { - HBSection *section = self.sections[sectionIndex]; - - return section.cells.count; -} - -- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - return UITableViewAutomaticDimension; -} -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - HBCell *cell = [self cellForIndexPath:indexPath]; - - return cell; -} - -- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section { - return [self.sections[section] footerTitle]; -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - HBCell *cell = [self cellForIndexPath:indexPath]; - - if ([cell respondsToSelector:@selector(didSelectFromTable:)]) { - [cell didSelectFromTable:self]; - } -} - -- (UIContextMenuConfiguration *)tableView:(UITableView *)tableView contextMenuConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath point:(CGPoint)point { - HBCell *cell = [self cellForIndexPath:indexPath]; - if ([cell isKindOfClass:HBGithubCell.class] || [cell isKindOfClass:HBTwitterCell.class] || [cell isKindOfClass:HBViewControllerCell.class] || [cell isKindOfClass:HBlinkCell.class]) { - return [cell contextMenuConfigurationForRowAtCell:cell FromTable:self]; - } else { - return UIContextMenuConfiguration.new; - } -} - -- (void)tableView:(UITableView *)tableView willPerformPreviewActionForMenuWithConfiguration:(UIContextMenuConfiguration *)configuration animator:(id)animator { - [animator addCompletion:^{ - UIViewController *vcFromIdentifier = [RuntimeExplore tryExploreAddress:configuration.identifier safely:true]; - if (vcFromIdentifier != nil) { - [self presentViewController:vcFromIdentifier animated:true completion:nil]; - } - }]; -} - -- (void)fontPickerViewControllerDidCancel:(UIFontPickerViewController *)viewController { - [viewController dismissViewControllerAnimated:true completion:nil]; -} - -- (void)fontPickerViewControllerDidPickFont:(UIFontPickerViewController *)viewController { - NSString *fontName = viewController.selectedFontDescriptor.fontAttributes[UIFontDescriptorNameAttribute]; - NSString *fontFamily = viewController.selectedFontDescriptor.fontAttributes[UIFontDescriptorFamilyAttribute]; - - if (viewController.configuration.includeFaces) { - [[NSUserDefaults standardUserDefaults] setObject:fontName forKey:@"bhtwitter_font_2"]; - [viewController dismissViewControllerAnimated:true completion:^{ - HBCell *cell = [self.sections[2] cells][4]; - [cell.detailTextLabel setText:fontName]; - }]; - } else { - [[NSUserDefaults standardUserDefaults] setObject:fontFamily forKey:@"bhtwitter_font_1"]; - [viewController dismissViewControllerAnimated:true completion:^{ - HBCell *cell = [self.sections[2] cells][3]; - [cell.detailTextLabel setText:fontFamily]; - }]; - } - [viewController.navigationController popViewControllerAnimated:true]; -} -@end diff --git a/BHTwitter/HBPreferences/HBSection.h b/BHTwitter/HBPreferences/HBSection.h deleted file mode 100755 index 84fbe364..00000000 --- a/BHTwitter/HBPreferences/HBSection.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// HBSection.h -// Cephei - -#import - -@interface HBSection : UITableViewCell -@property (nonatomic, strong) NSString *headerTitle; -@property (nonatomic, strong) NSString *footerTitle; -@property (nonatomic, strong) NSMutableArray *cells; -+ (instancetype)sectionWithTitle:(NSString *)title footer:(NSString *)footer; -- (void)addCell:(UITableViewCell *)cell; -- (void)removeCell:(UITableViewCell *)cell; -- (void)addCells:(NSArray *)cells; -- (void)removeCells:(NSArray *)cells; -@end diff --git a/BHTwitter/HBPreferences/HBSection.m b/BHTwitter/HBPreferences/HBSection.m deleted file mode 100755 index 5dfda707..00000000 --- a/BHTwitter/HBPreferences/HBSection.m +++ /dev/null @@ -1,39 +0,0 @@ -// -// HBSection.m -// Cephei - -#import "HBSection.h" - -@implementation HBSection - -+ (instancetype)sectionWithTitle:(NSString *)title footer:(NSString *)footer { - return [[self alloc] initWithTitle:title footer:footer]; -} - -- (instancetype)initWithTitle:(NSString *)title footer:(NSString *)footer { - if (self = [super init]) { - self.headerTitle = title; - self.footerTitle = footer; - self.cells = [NSMutableArray new]; - } - - return self; -} - -- (void)addCell:(UITableViewCell *)cell { - [self.cells addObject:cell]; -} -- (void)removeCell:(UITableViewCell *)cell { - [self.cells removeObject:cell]; -} -- (void)addCells:(NSArray *)cells { - for (UITableViewCell *cell in cells) { - [self.cells addObject:cell]; - } -} -- (void)removeCells:(NSArray *)cells { - for (UITableViewCell *cell in cells) { - [self.cells removeObject:cell]; - } -} -@end diff --git a/BHTwitter/HBPreferences/HBSwitchCell.h b/BHTwitter/HBPreferences/HBSwitchCell.h deleted file mode 100755 index a2ab1e14..00000000 --- a/BHTwitter/HBPreferences/HBSwitchCell.h +++ /dev/null @@ -1,11 +0,0 @@ -// -// HBSwitchCell.h -// Cephei - -#import "HBCell.h" - - -@interface HBSwitchCell : HBCell -- (instancetype)initSwitchCellWithImage:(UIImage *)image Title:(NSString *)title DetailTitle:(NSString *)Dtitle switchKey:(NSString *)key withBlock:(ALActionBlock)actionBlock; -@property (nonatomic, strong) UISwitch *Switch; -@end diff --git a/BHTwitter/HBPreferences/HBSwitchCell.m b/BHTwitter/HBPreferences/HBSwitchCell.m deleted file mode 100755 index 8ded3c9a..00000000 --- a/BHTwitter/HBPreferences/HBSwitchCell.m +++ /dev/null @@ -1,48 +0,0 @@ -// -// HBSwitchCell.m -// Cephei - -#import "HBSwitchCell.h" - -@implementation HBSwitchCell - -- (instancetype)initSwitchCellWithImage:(UIImage *)img Title:(NSString *)title DetailTitle:(NSString *)Dtitle switchKey:(NSString *)key withBlock:(ALActionBlock)actionBlock { - HBSwitchCell *cell = [self init]; - - [self setupUI:Dtitle actionBlock:actionBlock cell:cell img:img switchMod:key title:title]; - - - return cell; -} - -- (void)setupUI:(NSString *)Dtitle actionBlock:(ALActionBlock)actionBlock cell:(HBSwitchCell *)cell img:(UIImage *)img switchMod:(NSString *)key title:(NSString *)title { - - [self.textLabel setText:title]; - [self.textLabel setTextColor:UIColor.labelColor]; - [self.textLabel setNumberOfLines:0]; - - [self.detailTextLabel setText:Dtitle]; - [self.detailTextLabel setNumberOfLines:0]; - [self.detailTextLabel setTextColor:[UIColor secondaryLabelColor]]; - [self.detailTextLabel setFont:[UIFont systemFontOfSize:12]]; - - self.imageView.image = img; - - self.Switch = UISwitch.new; - if ([[NSUserDefaults standardUserDefaults] boolForKey:key]) { - [self.Switch setOn:true]; - } else { - [self.Switch setOn:false]; - } - [self.Switch handleControlEvents:UIControlEventValueChanged withBlock:actionBlock]; - self.accessoryView = self.Switch; - - [self addSubview:self.Switch]; -} - -- (void)didSelectFromTable:(HBPreferences *)viewController { - NSIndexPath *indexPath = [viewController.tableView indexPathForCell:self]; - [viewController.tableView deselectRowAtIndexPath:indexPath animated:YES]; -} - -@end diff --git a/BHTwitter/HBPreferences/HBTwitterCell.h b/BHTwitter/HBPreferences/HBTwitterCell.h deleted file mode 100755 index ac92fd00..00000000 --- a/BHTwitter/HBPreferences/HBTwitterCell.h +++ /dev/null @@ -1,11 +0,0 @@ -// -// HBTwitterCell.h -// Cephei - -#import "HBCell.h" - -@interface HBTwitterCell : HBCell -- (instancetype)initTwitterCellWithTitle:(NSString *)title detail:(NSString *)detail AccountLink:(NSString *)Aurl; -@property (nonatomic, strong) UIImageView *TwitterImage; -@property (nonatomic, strong) NSString *AccountURL; -@end diff --git a/BHTwitter/HBPreferences/HBTwitterCell.m b/BHTwitter/HBPreferences/HBTwitterCell.m deleted file mode 100755 index b29a4df8..00000000 --- a/BHTwitter/HBPreferences/HBTwitterCell.m +++ /dev/null @@ -1,90 +0,0 @@ -// -// HBTwitterCell.m -// Cephei - -#import "HBTwitterCell.h" - -@implementation HBTwitterCell - -- (instancetype)initTwitterCellWithTitle:(NSString *)title detail:(NSString *)detail AccountLink:(NSString *)Aurl { - HBTwitterCell *cell = [super init]; - self.AccountURL = Aurl; - [self setupUI:Aurl detail:detail title:title]; - return cell; -} - -- (void)setupUI:(NSString *)Aurl detail:(NSString *)detail title:(NSString *)title { - - [self.imageView setImage:[UIImage bhtwitter_imageNamed:@"BandarHL.jpg"]]; - [self.imageView setClipsToBounds:true]; - [self.imageView.layer setCornerRadius:(29/2)]; - - CGSize size = CGSizeMake(29, 29); - UIGraphicsBeginImageContextWithOptions(size, NO, UIScreen.mainScreen.scale); - [self.image drawInRect:CGRectMake(0, 0, size.width, size.height)]; - UIImage *newThumbnail = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - self.imageView.image = newThumbnail; - - self.TwitterImage = UIImageView.new; - [self.TwitterImage setImage:[UIImage bhtwitter_imageNamed:@"twitter"]]; - [self.TwitterImage setTintColor:[UIColor systemGray3Color]]; - [self.TwitterImage setTranslatesAutoresizingMaskIntoConstraints:false]; - [self addSubview:self.TwitterImage]; - - [self.TwitterImage.centerYAnchor constraintEqualToAnchor:self.centerYAnchor].active = true; - [self.TwitterImage.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-20].active = true; - [self.TwitterImage.widthAnchor constraintEqualToConstant:16].active = true; - [self.TwitterImage.heightAnchor constraintEqualToConstant:13].active = true; - - [self.textLabel setText:title]; - [self.textLabel setTextColor:[UIColor colorWithRed:0.039 green:0.518 blue:1 alpha:1]]; - [self.textLabel setNumberOfLines:0]; - - [self.detailTextLabel setText:detail]; - [self.detailTextLabel setTextColor:[UIColor secondaryLabelColor]]; - [self.detailTextLabel setFont:[UIFont systemFontOfSize:12]]; - [self.detailTextLabel setNumberOfLines:0]; - -} - -- (SFSafariViewController *)SafariViewControllerForURL { - SFSafariViewController *SafariVC = [[SFSafariViewController alloc] initWithURL:[NSURL URLWithString:self.AccountURL]]; - return SafariVC; -} - -- (void)didSelectFromTable:(HBPreferences *)viewController { - if (self.AccountURL.length == 0) { - NSIndexPath *indexPath = [viewController.tableView indexPathForCell:self]; - [viewController.tableView deselectRowAtIndexPath:indexPath animated:YES]; - } else { - [viewController presentViewController:[self SafariViewControllerForURL] animated:true completion:nil]; - } - -} - -- (UIContextMenuConfiguration *)contextMenuConfigurationForRowAtCell:(HBCell *)cell FromTable:(HBPreferences *)viewController { - SFSafariViewController *SafariVC = [self SafariViewControllerForURL]; - - UIContextMenuConfiguration *configuration = [UIContextMenuConfiguration configurationWithIdentifier:[RuntimeExplore getAddressFromDescription:SafariVC.description] previewProvider:^UIViewController * _Nullable{ - return SafariVC; - } actionProvider:^UIMenu * _Nullable(NSArray * _Nonnull suggestedActions) { - UIAction *open = [UIAction actionWithTitle:@"Open Link" image:[UIImage systemImageNamed:@"safari"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) { - [viewController presentViewController:SafariVC animated:true completion:nil]; - }]; - - UIAction *copy = [UIAction actionWithTitle:@"Copy Link" image:[UIImage systemImageNamed:@"doc.on.doc"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) { - UIPasteboard.generalPasteboard.string = self.AccountURL; - }]; - - UIAction *share = [UIAction actionWithTitle:@"Share..." image:[UIImage systemImageNamed:@"square.and.arrow.up"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) { - UIActivityViewController *ac = [[UIActivityViewController alloc] initWithActivityItems:@[[NSURL URLWithString:self.AccountURL]] applicationActivities:nil]; - [viewController presentViewController:ac animated:true completion:nil]; - }]; - return [UIMenu menuWithTitle:@"" children:@[open, copy, share]]; - }]; - - return configuration; -} - -@end diff --git a/BHTwitter/HBPreferences/HBViewControllerCell.h b/BHTwitter/HBPreferences/HBViewControllerCell.h deleted file mode 100644 index d77c5c40..00000000 --- a/BHTwitter/HBPreferences/HBViewControllerCell.h +++ /dev/null @@ -1,9 +0,0 @@ -// -// HBViewControllerCell.h -// Cephei - -#import "HBCell.h" - -@interface HBViewControllerCell : HBCell -- (instancetype)initCellWithTitle:(NSString *)title detail:(NSString *)detail action:(UIViewController* (^_Nonnull)(void))action; -@end diff --git a/BHTwitter/HBPreferences/HBViewControllerCell.m b/BHTwitter/HBPreferences/HBViewControllerCell.m deleted file mode 100644 index 5d354afd..00000000 --- a/BHTwitter/HBPreferences/HBViewControllerCell.m +++ /dev/null @@ -1,46 +0,0 @@ -// -// HBViewControllerCell.m -// Cephei - -#import "HBViewControllerCell.h" - -@interface HBViewControllerCell () -@property (nonatomic, strong) UIViewController *destanationVC; -@end - -@implementation HBViewControllerCell -- (instancetype)initCellWithTitle:(NSString *)title detail:(NSString *)detail action:(UIViewController* (^_Nonnull)(void))action { - HBViewControllerCell *cell = [super init]; - cell.destanationVC = action(); - [self setupUI:title detail:detail]; - return cell; -} - -- (void)setupUI:(NSString *)title detail:(NSString *)detail { - [self.textLabel setText:title]; - [self.textLabel setTextColor:[UIColor colorWithRed:0.35 green:0.78 blue:0.98 alpha:1]]; - [self.textLabel setNumberOfLines:0]; - - [self.detailTextLabel setText:detail]; - [self.detailTextLabel setNumberOfLines:0]; - [self.detailTextLabel setTextColor:[UIColor secondaryLabelColor]]; - [self.detailTextLabel setFont:[UIFont systemFontOfSize:12]]; -} - -- (void)didSelectFromTable:(HBPreferences *)viewController { - NSIndexPath *indexPath = [viewController.tableView indexPathForCell:self]; - [viewController.tableView deselectRowAtIndexPath:indexPath animated:YES]; -// [viewController presentViewController:self.destanationVC animated:true completion:nil]; - [viewController.navigationController pushViewController:self.destanationVC animated:true]; -} - -- (UIContextMenuConfiguration *)contextMenuConfigurationForRowAtCell:(HBCell *)cell FromTable:(HBPreferences *)viewController { - UIContextMenuConfiguration *configuration = [UIContextMenuConfiguration configurationWithIdentifier:[RuntimeExplore getAddressFromDescription:self.destanationVC.description] previewProvider:^UIViewController * _Nullable{ - return self.destanationVC; - } actionProvider:^UIMenu * _Nullable(NSArray * _Nonnull suggestedActions) { - return [UIMenu menuWithTitle:@"" children:@[]]; - }]; - - return configuration; -} -@end diff --git a/BHTwitter/HBPreferences/HBlinkCell.h b/BHTwitter/HBPreferences/HBlinkCell.h deleted file mode 100644 index c9722f47..00000000 --- a/BHTwitter/HBPreferences/HBlinkCell.h +++ /dev/null @@ -1,10 +0,0 @@ -// -// HBlinkCell.h -// Cephei - -#import "HBCell.h" -@interface HBlinkCell : HBCell -- (instancetype)initLinkCellWithTitle:(NSString *)title detailTitle:(NSString *)Dtitle link:(NSString *)gURL; -@property (nonatomic, strong) UIImageView *SafariImage; -@property (nonatomic, strong) NSString *url; -@end diff --git a/BHTwitter/HBPreferences/HBlinkCell.m b/BHTwitter/HBPreferences/HBlinkCell.m deleted file mode 100644 index d669a658..00000000 --- a/BHTwitter/HBPreferences/HBlinkCell.m +++ /dev/null @@ -1,75 +0,0 @@ -// -// HBlinkCell.m -// Cephei - -#import "HBlinkCell.h" - -@implementation HBlinkCell -- (instancetype)initLinkCellWithTitle:(NSString *)title detailTitle:(NSString *)Dtitle link:(NSString *)gURL { - HBlinkCell *cell = [self init]; - self.url = gURL; - [self setupUI:Dtitle title:title]; - return cell; -} - -- (void)setupUI:(NSString *)Dtitle title:(NSString *)title { - self.SafariImage = UIImageView.new; - [self.SafariImage setImage:[UIImage systemImageNamed:@"safari"]]; - [self.SafariImage setTintColor:[UIColor lightGrayColor]]; - [self.SafariImage setTranslatesAutoresizingMaskIntoConstraints:false]; - [self addSubview:self.SafariImage]; - - [self.SafariImage.centerYAnchor constraintEqualToAnchor:self.centerYAnchor].active = true; - [self.SafariImage.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-20].active = true; - [self.SafariImage.widthAnchor constraintEqualToConstant:16].active = true; - [self.SafariImage.heightAnchor constraintEqualToConstant:16].active = true; - - [self.textLabel setText:title]; - [self.textLabel setTextColor:[UIColor colorWithRed:0.039 green:0.518 blue:1 alpha:1]]; - [self.textLabel setNumberOfLines:0]; - - [self.detailTextLabel setText:Dtitle]; - [self.detailTextLabel setTextColor:[UIColor secondaryLabelColor]]; - [self.detailTextLabel setFont:[UIFont systemFontOfSize:12]]; - [self.detailTextLabel setNumberOfLines:0]; -} - -- (SFSafariViewController *)SafariViewControllerForURL { - SFSafariViewController *SafariVC = [[SFSafariViewController alloc] initWithURL:[NSURL URLWithString:self.url]]; - return SafariVC; -} - -- (void)didSelectFromTable:(HBPreferences *)viewController { - NSIndexPath *indexPath = [viewController.tableView indexPathForCell:self]; - if (self.url.length == 0) { - [viewController.tableView deselectRowAtIndexPath:indexPath animated:YES]; - } else { - [viewController presentViewController:[self SafariViewControllerForURL] animated:true completion:nil]; - } -} - -- (UIContextMenuConfiguration *)contextMenuConfigurationForRowAtCell:(HBCell *)cell FromTable:(HBPreferences *)viewController { - SFSafariViewController *SafariVC = [self SafariViewControllerForURL]; - - UIContextMenuConfiguration *configuration = [UIContextMenuConfiguration configurationWithIdentifier:[RuntimeExplore getAddressFromDescription:SafariVC.description] previewProvider:^UIViewController * _Nullable { - return SafariVC; - } actionProvider:^UIMenu * _Nullable(NSArray * _Nonnull suggestedActions) { - - UIAction *open = [UIAction actionWithTitle:@"Open Link" image:[UIImage systemImageNamed:@"safari"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) { - [viewController presentViewController:SafariVC animated:true completion:nil]; - }]; - - UIAction *copy = [UIAction actionWithTitle:@"Copy Link" image:[UIImage systemImageNamed:@"doc.on.doc"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) { - UIPasteboard.generalPasteboard.string = self.url; - }]; - - UIAction *share = [UIAction actionWithTitle:@"Share..." image:[UIImage systemImageNamed:@"square.and.arrow.up"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) { - UIActivityViewController *ac = [[UIActivityViewController alloc] initWithActivityItems:@[[NSURL URLWithString:self.url]] applicationActivities:nil]; - [viewController presentViewController:ac animated:true completion:nil]; - }]; - return [UIMenu menuWithTitle:@"" children:@[open, copy, share]]; - }]; - - return configuration; -} -@end diff --git a/BHTwitter/Package/DEBIAN/control b/BHTwitter/Package/DEBIAN/control index 8eb74634..26b27c8d 100644 --- a/BHTwitter/Package/DEBIAN/control +++ b/BHTwitter/Package/DEBIAN/control @@ -1,9 +1,9 @@ Package: com.bandarhl.BHTwitter Name: BHTwitter -Version: 2.9.7 +Version: 2.9.8 Description: Awesome tweak for Twitter Section: Tweaks -Depends: firmware (>= 13.0), mobilesubstrate +Depends: firmware (>= 13.0), mobilesubstrate, ws.hbang.common (>= 1.17) Priority: optional Architecture: iphoneos-arm Author: BandarHelal diff --git a/BHTwitter/Package/Library/Application Support/BHT/Ressources.bundle/BandarHL.jpg b/BHTwitter/Package/Library/Application Support/BHT/Ressources.bundle/BandarHL.jpg deleted file mode 100644 index 8873946c..00000000 Binary files a/BHTwitter/Package/Library/Application Support/BHT/Ressources.bundle/BandarHL.jpg and /dev/null differ diff --git a/BHTwitter/Package/Library/Application Support/BHT/Ressources.bundle/github.png b/BHTwitter/Package/Library/Application Support/BHT/Ressources.bundle/github.png deleted file mode 100644 index 36f48874..00000000 Binary files a/BHTwitter/Package/Library/Application Support/BHT/Ressources.bundle/github.png and /dev/null differ diff --git a/BHTwitter/Package/Library/Application Support/BHT/Ressources.bundle/twitter.png b/BHTwitter/Package/Library/Application Support/BHT/Ressources.bundle/twitter.png deleted file mode 100644 index f708572a..00000000 Binary files a/BHTwitter/Package/Library/Application Support/BHT/Ressources.bundle/twitter.png and /dev/null differ diff --git a/BHTwitter/Package/Library/Application Support/BHT/Ressources.bundle/twitter@2x.png b/BHTwitter/Package/Library/Application Support/BHT/Ressources.bundle/twitter@2x.png deleted file mode 100644 index 2f74d765..00000000 Binary files a/BHTwitter/Package/Library/Application Support/BHT/Ressources.bundle/twitter@2x.png and /dev/null differ diff --git a/BHTwitter/Package/Library/Application Support/BHT/Ressources.bundle/twitter@3x.png b/BHTwitter/Package/Library/Application Support/BHT/Ressources.bundle/twitter@3x.png deleted file mode 100644 index 4738fb58..00000000 Binary files a/BHTwitter/Package/Library/Application Support/BHT/Ressources.bundle/twitter@3x.png and /dev/null differ diff --git a/BHTwitter/SettingsViewController.h b/BHTwitter/SettingsViewController.h new file mode 100755 index 00000000..f282b95b --- /dev/null +++ b/BHTwitter/SettingsViewController.h @@ -0,0 +1,27 @@ +// +// SettingsViewController.h +// FlexCrack +// +// Created by BandarHelal on 25/11/2021. +// + +#import "TWHeaders.h" +#import +#import + +typedef NS_ENUM(NSInteger, DynamicSpecifierOperatorType) { + EqualToOperatorType, + NotEqualToOperatorType, + GreaterThanOperatorType, + LessThanOperatorType, +}; + +@interface SettingsViewController : HBListController +- (instancetype)initWithTwitterAccount:(TFNTwitterAccount *)account; +@end + +@interface BHButtonTableViewCell : HBTintedTableCell +@end + +@interface BHSwitchTableCell : PSSwitchTableCell +@end diff --git a/BHTwitter/SettingsViewController.m b/BHTwitter/SettingsViewController.m new file mode 100755 index 00000000..4adb249a --- /dev/null +++ b/BHTwitter/SettingsViewController.m @@ -0,0 +1,469 @@ +// +// SettingsViewController.m +// BHTwitter +// +// Created by BandarHelal +// + +#import "SettingsViewController.h" +#import "BHTwitter+NSURL.h" +#import "BHTwitter-Swift.h" + +@interface SettingsViewController () +@property (nonatomic, strong) TFNTwitterAccount *twAccount; +@property (nonatomic, assign) BOOL hasDynamicSpecifiers; +@property (nonatomic, retain) NSMutableDictionary *dynamicSpecifiers; +@end + +@implementation SettingsViewController +- (instancetype)init { + self = [super init]; + if (self) { + [self setupAppearance]; + } + return self; +} +- (instancetype)initWithTwitterAccount:(TFNTwitterAccount *)account { + self = [super init]; + if (self) { + self.twAccount = account; + [self setupAppearance]; + } + return self; +} + +- (void)setupAppearance { + NSUInteger colorOption = [[NSUserDefaults standardUserDefaults] integerForKey:@"bh_color_theme_selectedColor"]; + TAEColorSettings *colorSettings = [objc_getClass("TAEColorSettings") sharedSettings]; + UIColor *primaryColor = [[[colorSettings currentColorPalette] colorPalette] primaryColorForOption:colorOption]; + + HBAppearanceSettings *appearanceSettings = [[HBAppearanceSettings alloc] init]; + appearanceSettings.tintColor = primaryColor; + self.hb_appearanceSettings = appearanceSettings; +} +- (UITableViewStyle)tableViewStyle { + return UITableViewStyleInsetGrouped; +} + +- (PSSpecifier *)newSectionWithTitle:(NSString *)header footer:(NSString *)footer { + PSSpecifier *section = [PSSpecifier preferenceSpecifierNamed:header target:self set:nil get:nil detail:nil cell:PSGroupCell edit:nil]; + if (footer != nil) { + [section setProperty:footer forKey:@"footerText"]; + } + return section; +} +- (PSSpecifier *)newSwitchCellWithTitle:(NSString *)titleText detailTitle:(NSString *)detailText key:(NSString *)keyText defaultValue:(BOOL)defValue { + PSSpecifier *switchCell = [PSSpecifier preferenceSpecifierNamed:titleText target:self set:@selector(setPreferenceValue:specifier:) get:@selector(readPreferenceValue:) detail:nil cell:PSSwitchCell edit:nil]; + + [switchCell setProperty:keyText forKey:@"key"]; + [switchCell setProperty:keyText forKey:@"id"]; + [switchCell setProperty:@YES forKey:@"big"]; + [switchCell setProperty:BHSwitchTableCell.class forKey:@"cellClass"]; + [switchCell setProperty:NSBundle.mainBundle.bundleIdentifier forKey:@"defaults"]; + [switchCell setProperty:@(defValue) forKey:@"default"]; + if (detailText != nil ){ + [switchCell setProperty:detailText forKey:@"subtitle"]; + } + return switchCell; +} +- (PSSpecifier *)newButtonCellWithTitle:(NSString *)titleText detailTitle:(NSString *)detailText dynamicRule:(NSString *)rule action:(SEL)action { + PSSpecifier *buttonCell = [PSSpecifier preferenceSpecifierNamed:titleText target:self set:@selector(setPreferenceValue:specifier:) get:@selector(readPreferenceValue:) detail:nil cell:PSButtonCell edit:nil]; + + [buttonCell setButtonAction:action]; + [buttonCell setProperty:@YES forKey:@"big"]; + [buttonCell setProperty:BHButtonTableViewCell.class forKey:@"cellClass"]; + if (detailText != nil ){ + [buttonCell setProperty:detailText forKey:@"subtitle"]; + } + if (rule != nil) { + [buttonCell setProperty:@44 forKey:@"height"]; + [buttonCell setProperty:rule forKey:@"dynamicRule"]; + } + return buttonCell; +} +- (PSSpecifier *)newHBLinkCellWithTitle:(NSString *)titleText detailTitle:(NSString *)detailText url:(NSString *)url { + PSSpecifier *HBLinkCell = [PSSpecifier preferenceSpecifierNamed:titleText target:self set:@selector(setPreferenceValue:specifier:) get:@selector(readPreferenceValue:) detail:nil cell:PSButtonCell edit:nil]; + + [HBLinkCell setButtonAction:@selector(hb_openURL:)]; + [HBLinkCell setProperty:HBLinkTableCell.class forKey:@"cellClass"]; + [HBLinkCell setProperty:url forKey:@"url"]; + if (detailText != nil) { + [HBLinkCell setProperty:detailText forKey:@"subtitle"]; + } + return HBLinkCell; +} +- (PSSpecifier *)newHBTwitterCellWithTitle:(NSString *)titleText twitterUsername:(NSString *)user { + PSSpecifier *TwitterCell = [PSSpecifier preferenceSpecifierNamed:titleText target:self set:@selector(setPreferenceValue:specifier:) get:@selector(readPreferenceValue:) detail:nil cell:1 edit:nil]; + + [TwitterCell setButtonAction:@selector(hb_openURL:)]; + [TwitterCell setProperty:HBTwitterCell.class forKey:@"cellClass"]; + [TwitterCell setProperty:user forKey:@"user"]; + [TwitterCell setProperty:@YES forKey:@"big"]; + [TwitterCell setProperty:@56 forKey:@"height"]; + + return TwitterCell; +} +- (NSArray *)specifiers { + if (!_specifiers) { + + PSSpecifier *mainSection = [self newSectionWithTitle:@"BHTwitter Preferences" footer:nil]; + PSSpecifier *twitterBlueSection = [self newSectionWithTitle:@"Twitter blue features" footer:@"You may need to restart Twitter app to apply changes"]; + PSSpecifier *layoutSection = [self newSectionWithTitle:@"Layout customization" footer:@"Restart Twitter app to apply changes"]; + PSSpecifier *debug = [self newSectionWithTitle:@"Debugging" footer:nil]; + PSSpecifier *legalSection = [self newSectionWithTitle:@"Legal notices" footer:nil]; + PSSpecifier *developer = [self newSectionWithTitle:@"Developer" footer:@"BHTwitter v2.9.8"]; + + PSSpecifier *download = [self newSwitchCellWithTitle:@"Downloading videos" detailTitle:@"Downloading videos. By adding button in tweet and inside video tab bar." key:@"dw_v" defaultValue:true]; + + PSSpecifier *directSave = [self newSwitchCellWithTitle:@"Direct save" detailTitle:@"Save video directly after downloading." key:@"direct_save" defaultValue:false]; + + PSSpecifier *hideAds = [self newSwitchCellWithTitle:@"Hide Ads" detailTitle:@"Remove all Ads in Twitter." key:@"hide_promoted" defaultValue:true]; + + PSSpecifier *hideTopics = [self newSwitchCellWithTitle:@"Hide topics tweets" detailTitle:@"Remove all topics tweets from the timeline." key:@"hide_topics" defaultValue:false]; + + PSSpecifier *videoLayerCaption = [self newSwitchCellWithTitle:@"Disable video layer captions" detailTitle:nil key:@"dis_VODCaptions" defaultValue:false]; + + PSSpecifier *voice = [self newSwitchCellWithTitle:@"Voice feature" detailTitle:@"Enable voice in tweet and DM." key:@"voice" defaultValue:true]; + + PSSpecifier *videoZoom = [self newSwitchCellWithTitle:@"Video zoom feature" detailTitle:@"You can zoom the video by double clicking in the center of the video." key:@"video_zoom" defaultValue:false]; + + PSSpecifier *noHistory = [self newSwitchCellWithTitle:@"No search history" detailTitle:@"Force Twitter to stop recording search history." key:@"no_his" defaultValue:false]; + + PSSpecifier *bioTranslate = [self newSwitchCellWithTitle:@"Translate bio" detailTitle:@"show you a button in user bio to translate it." key:@"bio_translate" defaultValue:false]; + + PSSpecifier *likeConfrim = [self newSwitchCellWithTitle:@"Like confirm" detailTitle:@"Show a confirm alert when you press like button." key:@"like_con" defaultValue:false]; + + PSSpecifier *tweetConfirm = [self newSwitchCellWithTitle:@"Tweet confirm" detailTitle:@"Show a confirm alert when you press tweet button." key:@"tweet_con" defaultValue:false]; + + PSSpecifier *followConfirm = [self newSwitchCellWithTitle:@"User follow confirm" detailTitle:@"Show a confirm alert when you press follow button." key:@"follow_con" defaultValue:false]; + + PSSpecifier *padLock = [self newSwitchCellWithTitle:@"Padlock" detailTitle:@"Lock Twitter with passcode." key:@"padlock" defaultValue:false]; + + PSSpecifier *DmModularSearch = [self newSwitchCellWithTitle:@"Enable DM Modular Search" detailTitle:@"Enable the new UI of DM search." key:@"DmModularSearch" defaultValue:false]; + + PSSpecifier *autoHighestLoad = [self newSwitchCellWithTitle:@"Auto load photos in highest quality" detailTitle:@"This option let you upload photos and load it in highest quality possible." key:@"autoHighestLoad" defaultValue:true]; + + PSSpecifier *disableSensitiveTweetWarnings = [self newSwitchCellWithTitle:@"Disable sensitive tweet warning view" detailTitle:nil key:@"disableSensitiveTweetWarnings" defaultValue:true]; + + PSSpecifier *trustedFriends = [self newSwitchCellWithTitle:@"Enable Twitter Circle feature" detailTitle:nil key:@"TrustedFriends" defaultValue:false]; + + PSSpecifier *copyProfileInfo = [self newSwitchCellWithTitle:@"Enable Copying profile information feature" detailTitle:@"Add new button in Twitter profile that let you copy whatever info you want." key:@"CopyProfileInfo" defaultValue:false]; + + PSSpecifier *tweetToImage = [self newSwitchCellWithTitle:@"Save tweet as an image" detailTitle:@"You can export tweets as image, by long pressing on the Tweet Share button." key:@"TweetToImage" defaultValue:false]; + + PSSpecifier *hideSpace = [self newSwitchCellWithTitle:@"Hide spaces bar" detailTitle:nil key:@"hide_spaces" defaultValue:false]; + + PSSpecifier *disableRTL = [self newSwitchCellWithTitle:@"Disable RTL" detailTitle:@"Force Twitter use LTR with RTL language.\nRestart Twitter app to apply changes." key:@"dis_rtl" defaultValue:false]; + + PSSpecifier *alwaysOpenSafari = [self newSwitchCellWithTitle:@"Always open in Safari" detailTitle:@"Force twitter to open URLs in Safari or your default browser." key:@"openInBrowser" defaultValue:false]; + + // Twitter bule section + PSSpecifier *undoTweet = [self newSwitchCellWithTitle:@"Undo tweets feature" detailTitle:@"Undo tweets after tweeting." key:@"undo_tweet" defaultValue:false]; + + PSSpecifier *readerMode = [self newSwitchCellWithTitle:@"Reader mode feature" detailTitle:@"Enable reader mode in threads." key:@"reader_mode" defaultValue:false]; + + PSSpecifier *appTheme = [self newButtonCellWithTitle:@"Theme" detailTitle:@"Choose a theme color for you Twitter experience that can only be seen by you." dynamicRule:nil action:@selector(showThemeViewController:)]; + + PSSpecifier *customTabBarVC = [self newButtonCellWithTitle:@"Custom Tab Bar" detailTitle:nil dynamicRule:nil action:@selector(showCustomTabBarVC:)]; + + // Layout customization section + PSSpecifier *origTweetStyle = [self newSwitchCellWithTitle:@"Disable edge to edge tweet style" detailTitle:@"Force Twitter to use the original tweet style." key:@"old_style" defaultValue:true]; + + PSSpecifier *font = [self newSwitchCellWithTitle:@"Enable changing font" detailTitle:@"Option to allow changing Twitter font and show font picker." key:@"en_font" defaultValue:false]; + + PSSpecifier *regularFontsPicker = [self newButtonCellWithTitle:@"Font" detailTitle:[[NSUserDefaults standardUserDefaults] objectForKey:@"bhtwitter_font_1"] dynamicRule:@"en_font, ==, 0" action:@selector(showRegularFontPicker:)]; + + PSSpecifier *boldFontsPicker = [self newButtonCellWithTitle:@"Bold Font" detailTitle:[[NSUserDefaults standardUserDefaults] objectForKey:@"bhtwitter_font_2"] dynamicRule:@"en_font, ==, 0" action:@selector(showBoldFontPicker:)]; + + // dubug section + PSSpecifier *flex = [self newSwitchCellWithTitle:@"Enable FLEX" detailTitle:@"Show FLEX on twitter app." key:@"flex_twitter" defaultValue:false]; + + // legal section + PSSpecifier *acknowledgements = [self newButtonCellWithTitle:@"Acknowledgements" detailTitle:nil dynamicRule:nil action:@selector(showAcknowledgements:)]; + + // dvelopers section + PSSpecifier *bandarHL = [self newHBTwitterCellWithTitle:@"BandarHelal" twitterUsername:@"BandarHL"]; + PSSpecifier *tipJar = [self newHBLinkCellWithTitle:@"Tip Jar" detailTitle:@"Donate Via Paypal" url:@"https://www.paypal.me/BandarHL"]; + PSSpecifier *sourceCode = [self newHBLinkCellWithTitle:@"BHTwitter" detailTitle:@"Code source of BHTwitter" url:@"https://github.com/BandarHL/BHTwitter/"]; + + _specifiers = [NSMutableArray arrayWithArray:@[ + + mainSection, // 0 + download, + hideAds, + hideTopics, + videoLayerCaption, + directSave, + voice, + videoZoom, + noHistory, + bioTranslate, + likeConfrim, + tweetConfirm, + followConfirm, + padLock, + DmModularSearch, + autoHighestLoad, + disableSensitiveTweetWarnings, + copyProfileInfo, + tweetToImage, + hideSpace, + disableRTL, + alwaysOpenSafari, + trustedFriends, + + twitterBlueSection, // 1 + undoTweet, + readerMode, + appTheme, + customTabBarVC, + + layoutSection, // 2 + origTweetStyle, + font, + regularFontsPicker, + boldFontsPicker, + + legalSection, // 3 + acknowledgements, + + debug, // 4 + flex, + + developer, // 5 + bandarHL, + tipJar, + sourceCode + ]]; + + [self collectDynamicSpecifiersFromArray:_specifiers]; + } + + return _specifiers; +} +- (void)reloadSpecifiers { + [super reloadSpecifiers]; + + [self collectDynamicSpecifiersFromArray:self.specifiers]; +} +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + if (self.hasDynamicSpecifiers) { + PSSpecifier *dynamicSpecifier = [self specifierAtIndexPath:indexPath]; + BOOL __block shouldHide = false; + + [self.dynamicSpecifiers enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) { + NSMutableArray *specifiers = obj; + if ([specifiers containsObject:dynamicSpecifier]) { + shouldHide = [self shouldHideSpecifier:dynamicSpecifier]; + + UITableViewCell *specifierCell = [dynamicSpecifier propertyForKey:PSTableCellKey]; + specifierCell.clipsToBounds = shouldHide; + } + }]; + if (shouldHide) { + return 0; + } + } + + return UITableViewAutomaticDimension; +} + +- (void)collectDynamicSpecifiersFromArray:(NSArray *)array { + if (!self.dynamicSpecifiers) { + self.dynamicSpecifiers = [NSMutableDictionary new]; + + } else { + [self.dynamicSpecifiers removeAllObjects]; + } + + for (PSSpecifier *specifier in array) { + NSString *dynamicSpecifierRule = [specifier propertyForKey:@"dynamicRule"]; + + if (dynamicSpecifierRule.length > 0) { + NSArray *ruleComponents = [dynamicSpecifierRule componentsSeparatedByString:@", "]; + + if (ruleComponents.count == 3) { + NSString *opposingSpecifierID = [ruleComponents objectAtIndex:0]; + if ([self.dynamicSpecifiers objectForKey:opposingSpecifierID]) { + NSMutableArray *specifiers = [[self.dynamicSpecifiers objectForKey:opposingSpecifierID] mutableCopy]; + [specifiers addObject:specifier]; + + + [self.dynamicSpecifiers removeObjectForKey:opposingSpecifierID]; + [self.dynamicSpecifiers setObject:specifiers forKey:opposingSpecifierID]; + } else { + [self.dynamicSpecifiers setObject:[NSMutableArray arrayWithArray:@[specifier]] forKey:opposingSpecifierID]; + } + + } else { + [NSException raise:NSInternalInconsistencyException format:@"dynamicRule key requires three components (Specifier ID, Comparator, Value To Compare To). You have %ld of 3 (%@) for specifier '%@'.", ruleComponents.count, dynamicSpecifierRule, [specifier propertyForKey:PSTitleKey]]; + } + } + } + + self.hasDynamicSpecifiers = (self.dynamicSpecifiers.count > 0); +} +- (DynamicSpecifierOperatorType)operatorTypeForString:(NSString *)string { + NSDictionary *operatorValues = @{ @"==" : @(EqualToOperatorType), @"!=" : @(NotEqualToOperatorType), @">" : @(GreaterThanOperatorType), @"<" : @(LessThanOperatorType) }; + return [operatorValues[string] intValue]; +} +- (BOOL)shouldHideSpecifier:(PSSpecifier *)specifier { + if (specifier) { + NSString *dynamicSpecifierRule = [specifier propertyForKey:@"dynamicRule"]; + NSArray *ruleComponents = [dynamicSpecifierRule componentsSeparatedByString:@", "]; + + PSSpecifier *opposingSpecifier = [self specifierForID:[ruleComponents objectAtIndex:0]]; + id opposingValue = [self readPreferenceValue:opposingSpecifier]; + id requiredValue = [ruleComponents objectAtIndex:2]; + + if ([opposingValue isKindOfClass:NSNumber.class]) { + DynamicSpecifierOperatorType operatorType = [self operatorTypeForString:[ruleComponents objectAtIndex:1]]; + + switch (operatorType) { + case EqualToOperatorType: + return ([opposingValue intValue] == [requiredValue intValue]); + break; + + case NotEqualToOperatorType: + return ([opposingValue intValue] != [requiredValue intValue]); + break; + + case GreaterThanOperatorType: + return ([opposingValue intValue] > [requiredValue intValue]); + break; + + case LessThanOperatorType: + return ([opposingValue intValue] < [requiredValue intValue]); + break; + } + } + + if ([opposingValue isKindOfClass:NSString.class]) { + return [opposingValue isEqualToString:requiredValue]; + } + + if ([opposingValue isKindOfClass:NSArray.class]) { + return [opposingValue containsObject:requiredValue]; + } + } + + return NO; +} + +- (void)setPreferenceValue:(id)value specifier:(PSSpecifier *)specifier { + NSUserDefaults *Prefs = [NSUserDefaults standardUserDefaults]; + [Prefs setValue:value forKey:[specifier identifier]]; + + if (self.hasDynamicSpecifiers) { + NSString *specifierID = [specifier propertyForKey:PSIDKey]; + PSSpecifier *dynamicSpecifier = [self.dynamicSpecifiers objectForKey:specifierID]; + + if (dynamicSpecifier) { + [self.table beginUpdates]; + [self.table endUpdates]; + } + } +} +- (id)readPreferenceValue:(PSSpecifier *)specifier { + NSUserDefaults *Prefs = [NSUserDefaults standardUserDefaults]; + return [Prefs valueForKey:[specifier identifier]]?:[specifier properties][@"default"]; +} + + +- (void)fontPickerViewControllerDidPickFont:(UIFontPickerViewController *)viewController { + NSString *fontName = viewController.selectedFontDescriptor.fontAttributes[UIFontDescriptorNameAttribute]; + NSString *fontFamily = viewController.selectedFontDescriptor.fontAttributes[UIFontDescriptorFamilyAttribute]; + + if (viewController.configuration.includeFaces) { + PSSpecifier *fontSpecifier = [self specifierForID:@"Bold Font"]; + [[NSUserDefaults standardUserDefaults] setObject:fontName forKey:@"bhtwitter_font_2"]; + [fontSpecifier setProperty:fontName forKey:@"subtitle"]; + } else { + PSSpecifier *fontSpecifier = [self specifierForID:@"Font"]; + [[NSUserDefaults standardUserDefaults] setObject:fontFamily forKey:@"bhtwitter_font_1"]; + [fontSpecifier setProperty:fontName forKey:@"subtitle"]; + } + [self reloadSpecifiers]; + [viewController.navigationController popViewControllerAnimated:true]; +} +- (void)showRegularFontPicker:(PSSpecifier *)specifier { + UIFontPickerViewControllerConfiguration *configuration = [[UIFontPickerViewControllerConfiguration alloc] init]; + [configuration setFilteredTraits:UIFontDescriptorClassMask]; + [configuration setIncludeFaces:false]; + + UIFontPickerViewController *fontPicker = [[UIFontPickerViewController alloc] initWithConfiguration:configuration]; + fontPicker.delegate = self; + + if (self.twAccount != nil) { + [fontPicker.navigationItem setTitleView:[objc_getClass("TFNTitleView") titleViewWithTitle:@"Choose Font" subtitle:self.twAccount.displayUsername]]; + } + [self.navigationController pushViewController:fontPicker animated:true]; +} +- (void)showBoldFontPicker:(PSSpecifier *)specifier { + UIFontPickerViewControllerConfiguration *configuration = [[UIFontPickerViewControllerConfiguration alloc] init]; + [configuration setIncludeFaces:true]; + [configuration setFilteredTraits:UIFontDescriptorClassModernSerifs]; + [configuration setFilteredTraits:UIFontDescriptorClassMask]; + + UIFontPickerViewController *fontPicker = [[UIFontPickerViewController alloc] initWithConfiguration:configuration]; + fontPicker.delegate = self; + + if (self.twAccount != nil) { + [fontPicker.navigationItem setTitleView:[objc_getClass("TFNTitleView") titleViewWithTitle:@"Choose Font" subtitle:self.twAccount.displayUsername]]; + } + [self.navigationController pushViewController:fontPicker animated:true]; +} +- (void)showAcknowledgements:(PSSpecifier *)specifier { + T1RichTextFormatViewController *acknowledgementsVC = [[objc_getClass("T1RichTextFormatViewController") alloc] initWithRichTextFormatDocumentPath:[NSURL bhtwitter_fileURLWithPath:@"Acknowledgements.rtf"].path]; + if (self.twAccount != nil) { + [acknowledgementsVC.navigationItem setTitleView:[objc_getClass("TFNTitleView") titleViewWithTitle:@"Acknowledgements" subtitle:self.twAccount.displayUsername]]; + } + [self.navigationController pushViewController:acknowledgementsVC animated:true]; +} +- (void)showCustomTabBarVC:(PSSpecifier *)specifier { + CustomTabBarViewController *customTabBarVC = [[CustomTabBarViewController alloc] init]; + if (self.twAccount != nil) { + [customTabBarVC.navigationItem setTitleView:[objc_getClass("TFNTitleView") titleViewWithTitle:@"Custom Tab Bar" subtitle:self.twAccount.displayUsername]]; + } + [self.navigationController pushViewController:customTabBarVC animated:true]; +} +- (void)showThemeViewController:(PSSpecifier *)specifier { + // I create my own Color Theme ViewController for two main reasons: + // 1- Twitter use swift to build their view controller, so I can't hook anything on it. + // 2- Twitter knows you do not actually subscribe with Twitter Blue, so it keeps resting the changes and resting 'T1ColorSettingsPrimaryColorOptionKey' key, so I had to create another key to track the original one and keep sure no changes, but it still not enough to keep the new theme after relaunching app, so i had to force the changes again with new lunch. + BHColorThemeViewController *themeVC = [[BHColorThemeViewController alloc] init]; + if (self.twAccount != nil) { + [themeVC.navigationItem setTitleView:[objc_getClass("TFNTitleView") titleViewWithTitle:@"Theme" subtitle:self.twAccount.displayUsername]]; + } + [self.navigationController pushViewController:themeVC animated:true]; +} +@end + +@implementation BHButtonTableViewCell + +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier specifier:(PSSpecifier *)specifier { + self = [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier specifier:specifier]; + if (self) { + NSString *subTitle = [specifier.properties[@"subtitle"] copy]; + BOOL isBig = specifier.properties[@"big"] ? ((NSNumber *)specifier.properties[@"big"]).boolValue : NO; + self.detailTextLabel.text = subTitle; + self.detailTextLabel.numberOfLines = isBig ? 0 : 1; + self.detailTextLabel.textColor = [UIColor secondaryLabelColor]; + } + return self; +} + +@end + +@implementation BHSwitchTableCell +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier specifier:(PSSpecifier *)specifier { + if ((self = [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier specifier:specifier])) { + NSString *subTitle = [specifier.properties[@"subtitle"] copy]; + BOOL isBig = specifier.properties[@"big"] ? ((NSNumber *)specifier.properties[@"big"]).boolValue : NO; + self.detailTextLabel.text = subTitle; + self.detailTextLabel.numberOfLines = isBig ? 0 : 1; + self.detailTextLabel.textColor = [UIColor secondaryLabelColor]; + } + return self; +} +@end diff --git a/BHTwitter/TWHeaders.h b/BHTwitter/TWHeaders.h index 2e0acc58..4b6b9ab3 100644 --- a/BHTwitter/TWHeaders.h +++ b/BHTwitter/TWHeaders.h @@ -9,18 +9,16 @@ #import #import #import +#import #import "./Classes/Utility/FLEXAlert.h" #import "./Classes/FLEX.h" #import "BHDownload.h" #import "JGProgressHUD/include/JGProgressHUD.h" #import "SAMKeychain/keychain.h" -#import "HBPreferences/HBPreferences.h" -#import "HBPreferences/HBSection.h" -#import "HBPreferences/HBTwitterCell.h" -#import "HBPreferences/HBSwitchCell.h" -#import "HBPreferences/HBGithubCell.h" -#import "HBPreferences/HBlinkCell.h" -#import "HBPreferences/HBViewControllerCell.h" +#import +#import +#import +#import @interface T1AppDelegate : UIResponder @property(retain, nonatomic) UIWindow *window; @@ -30,6 +28,10 @@ + (NSWritingDirection)_defaultWritingDirection; @end +@interface SFSafariViewController () +- (NSURL *)initialURL; +@end + @interface TFNTwitterAccount : NSObject @property (nonatomic, strong) NSString *displayFullName; @property (nonatomic, strong) NSString *username; @@ -50,9 +52,11 @@ - (id)itemAtIndexPath:(id)arg1; @end -@interface TFNItemsDataViewControllerBackingStore -- (void)insertSection:(id)arg1 atIndex:(long long)arg2; -- (void)insertItem:(id)arg1 atIndexPath:(id)arg2; +@interface TFNItemsDataViewControllerBackingStore: NSObject +- (void)insertSection:(id)section atIndex:(NSUInteger)index; +- (void)insertItem:(id)item atIndexPath:(NSIndexPath *)indexPath; +- (void)_tfn_insertSection:(id)section atIndex:(NSUInteger)index; +- (void)_tfn_insertItem:(id)item atIndexPath:(NSIndexPath *)indexPath; @end @interface T1TabView : UIView @@ -153,6 +157,7 @@ @end @interface T1ProfileUserViewModel : NSObject +@property(readonly, copy, nonatomic) NSString *location; @property(readonly, copy, nonatomic) NSString *fullName; @property(readonly, copy, nonatomic) NSString *username; @property(readonly, copy, nonatomic) NSString *bio; @@ -316,7 +321,12 @@ + (instancetype)titleViewWithTitle:(NSString *)title subtitle:(NSString *)subTitle; @end +@protocol TAEColorPalette +- (UIColor *)primaryColorForOption:(NSUInteger)colorOption; +@end + @interface TAETwitterColorPaletteSettingInfo : NSObject +@property(readonly, nonatomic) id colorPalette; @property(readonly, nonatomic) _Bool isDark; @end diff --git a/README.md b/README.md index 64f30793..5a64c9ef 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ # Features - Download Videos (even if account private). -- Reply later feature. - Custom Tab Bar - Video zoom feature. - No history feature. @@ -11,10 +10,17 @@ - Disable video layer caption. - Padlock. - Font changer. -- Disable double tap to like. - Enable the new UI of DM search. - Auto load photos in highest quality feature. - Undo tweet feature. +- Theme (like Twitter Bule). +- Twitter Circle feature. +- Copying profile information feature. +- Save tweet as an image. +- Hide spaces bar. +- Disable RTL. +- Always open in Safari. +- Translate bio. - Reader mode feature. - Disable new tweet style (A.K.A edge to edge tweet) - Enable voice tweet and voice message in DM.