Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Add feature: Remove Fleets
Browse files Browse the repository at this point in the history
  • Loading branch information
haoict committed Dec 31, 2020
1 parent 9c5f504 commit 2ebc532
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 10 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARCHS = arm64 arm64e
TARGET = iphone:clang:12.2:10.0
TARGET = iphone:clang:12.4:10.0
INSTALL_TARGET_PROCESSES = Twitter Preferences

include $(THEOS)/makefiles/common.mk
Expand All @@ -14,3 +14,6 @@ include $(THEOS_MAKE_PATH)/tweak.mk
SUBPROJECTS += pref

include $(THEOS_MAKE_PATH)/aggregate.mk

clean::
rm -rf .theos packages
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Free & Open Source Tweak for Twitter app on iOS!

## Features
- Remove Ads
- Remove Fleets
- Hide News and Trending posts in search tab
- Hide who to follow section
- Can Save Video (long press on video to save)
Expand Down
22 changes: 18 additions & 4 deletions Tweak.xm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Load Preferences
*/
BOOL noads;
BOOL nofleets;
BOOL hideNewsAndTrending;
BOOL hideWhoToFollow;
BOOL canSaveVideo;
Expand All @@ -13,10 +14,11 @@ static void reloadPrefs() {
NSDictionary *settings = [[NSMutableDictionary alloc] initWithContentsOfFile:@PLIST_PATH] ?: [@{} mutableCopy];

noads = [[settings objectForKey:@"noads"] ?: @(YES) boolValue];
hideNewsAndTrending = [[settings objectForKey:@"hideNewsAndTrending"] ?: @(YES) boolValue];
hideWhoToFollow = [[settings objectForKey:@"hideWhoToFollow"] ?: @(YES) boolValue];
canSaveVideo = [[settings objectForKey:@"canSaveVideo"] ?: @(YES) boolValue];
skipAnalyticUrl = [[settings objectForKey:@"skipAnalyticUrl"] ?: @(YES) boolValue];
nofleets = [[settings objectForKey:@"nofleets"] ?: @(NO) boolValue];
hideNewsAndTrending = [[settings objectForKey:@"hideNewsAndTrending"] ?: @(NO) boolValue];
hideWhoToFollow = [[settings objectForKey:@"hideWhoToFollow"] ?: @(NO) boolValue];
canSaveVideo = [[settings objectForKey:@"canSaveVideo"] ?: @(NO) boolValue];
skipAnalyticUrl = [[settings objectForKey:@"skipAnalyticUrl"] ?: @(NO) boolValue];
}

static void showDownloadPopup(id twStatus, UIViewController *viewController, void (^origHandler)(UIAlertAction *)) {
Expand Down Expand Up @@ -191,6 +193,14 @@ static void showDownloadPopup(id twStatus, UIViewController *viewController, voi
%end
%end

%group NoFleet
%hook T1HomeTimelineItemsViewController
- (void)_t1_initializeFleets {
return;
}
%end
%end

%ctor {
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback) reloadPrefs, CFSTR(PREF_CHANGED_NOTIF), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
reloadPrefs();
Expand All @@ -204,4 +214,8 @@ static void showDownloadPopup(id twStatus, UIViewController *viewController, voi
if (skipAnalyticUrl) {
%init(SkipAnalyticUrl);
}

if (nofleets) {
%init(NoFleet);
}
}
3 changes: 2 additions & 1 deletion control
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
Package: com.haoict.twitternoads
Name: Twitter No Ads
Depends: mobilesubstrate, preferenceloader, com.haoict.libhdev (>= 4.5.0), firmware (>= 10)
Version: 1.2.2
Version: 1.3.0
Architecture: iphoneos-arm
Description: Free & Open Source Tweak for Twitter
Free & Open Source Tweak for Twitter
Change log: https://github.com/haoict/twitter-no-ads/releases
.
Features:
- Remove Ads
- Remove Fleets
- Hide News and Trending posts in search tab
- Hide who to follow section
- Can Save Video (long press on video to save)
Expand Down
48 changes: 44 additions & 4 deletions pref/Resources/Root.plist
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,26 @@
<key>cellClass</key>
<string>HPSSwitchCell</string>
<key>default</key>
<true/>
<false/>
<key>defaults</key>
<string>com.haoict.twitternoadspref</string>
<key>key</key>
<string>nofleets</string>
<key>label</key>
<string>NO_FLEETS</string>
<key>subtitle</key>
<string>REMOVE_FLEETS_IN_NEWS_FEED</string>
<key>PostNotification</key>
<string>com.haoict.twitternoadspref/PrefChanged</string>
</dict>

<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>cellClass</key>
<string>HPSSwitchCell</string>
<key>default</key>
<false/>
<key>defaults</key>
<string>com.haoict.twitternoadspref</string>
<key>key</key>
Expand All @@ -64,7 +83,7 @@
<key>cellClass</key>
<string>HPSSwitchCell</string>
<key>default</key>
<true/>
<false/>
<key>defaults</key>
<string>com.haoict.twitternoadspref</string>
<key>key</key>
Expand All @@ -83,7 +102,7 @@
<key>cellClass</key>
<string>HPSSwitchCell</string>
<key>default</key>
<true/>
<false/>
<key>defaults</key>
<string>com.haoict.twitternoadspref</string>
<key>key</key>
Expand All @@ -102,7 +121,7 @@
<key>cellClass</key>
<string>HPSSwitchCell</string>
<key>default</key>
<true/>
<false/>
<key>defaults</key>
<string>com.haoict.twitternoadspref</string>
<key>key</key>
Expand All @@ -115,6 +134,27 @@
<string>com.haoict.twitternoadspref/PrefChanged</string>
</dict>

<!-- OTHERS PREFS -->
<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>label</key>
<string>OTHER_PREFERENCES</string>
</dict>

<dict>
<key>cell</key>
<string>PSLinkCell</string>
<key>cellClass</key>
<string>HPSLinkCell</string>
<key>defaults</key>
<string>com.haoict.twitternoadspref</string>
<key>label</key>
<string>RESET_SETTINGS</string>
<key>action</key>
<string>resetSettings:</string>
</dict>

<!-- Support Me -->
<dict>
<key>cell</key>
Expand Down
2 changes: 2 additions & 0 deletions pref/Resources/base.lproj/Root.strings
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"MAIN_PREFERENCES" = "Main Preferences";
"NO_ADS" = "No Ads";
"REMOVE_ADS_IN_NEWS_FEED" = "Remove Ads in News Feed";
"NO_FLEETS" = "No Fleets";
"REMOVE_FLEETS_IN_NEWS_FEED" = "Remove Fleets in News Feed";
"HIDE_NEWS_AND_TRENDING" = "Remove News And Trending";
"HIDE_NEWS_AND_TRENDING_POST_ON_SEARCH_TAB" = "Remove News And Trending post on Search tab";
"HIDE_WHO_TO_FOLLOW" = "Hide who to follow";
Expand Down
2 changes: 2 additions & 0 deletions pref/Resources/en.lproj/Root.strings
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"MAIN_PREFERENCES" = "Main Preferences";
"NO_ADS" = "No Ads";
"REMOVE_ADS_IN_NEWS_FEED" = "Remove Ads in News Feed";
"NO_FLEETS" = "No Fleets";
"REMOVE_FLEETS_IN_NEWS_FEED" = "Remove Fleets in News Feed";
"HIDE_NEWS_AND_TRENDING" = "Remove News And Trending";
"HIDE_NEWS_AND_TRENDING_POST_ON_SEARCH_TAB" = "Remove News And Trending post on Search tab";
"HIDE_WHO_TO_FOLLOW" = "Hide who to follow";
Expand Down
2 changes: 2 additions & 0 deletions pref/Resources/vi.lproj/Root.strings
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"MAIN_PREFERENCES" = "Tùy chỉnh chính";
"NO_ADS" = "Gỡ quảng cáo";
"REMOVE_ADS_IN_NEWS_FEED" = "Gỡ quảng cáo ở News Feed";
"NO_FLEETS" = "Gỡ Fleets";
"REMOVE_FLEETS_IN_NEWS_FEED" = "Gỡ Fleets ở News Feed";
"HIDE_NEWS_AND_TRENDING" = "Ẩn Tin tức và chủ đề nổi trội";
"HIDE_NEWS_AND_TRENDING_POST_ON_SEARCH_TAB" = "Ẩn Tin tức và chủ đề nổi trội ở tab Tìm kiếm";
"HIDE_WHO_TO_FOLLOW" = "Ẩn gợi ý theo dõi";
Expand Down
Binary file not shown.

0 comments on commit 2ebc532

Please sign in to comment.