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

Commit

Permalink
Add feature: Extend Story Video Upload Length
Browse files Browse the repository at this point in the history
  • Loading branch information
haoict committed May 9, 2020
1 parent 94180bd commit 2e87d20
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.theos
packages
packages
HAOUtils*
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# THEOS_DEVICE_IP = 192.168.1.63
# THEOS_DEVICE_IP = 192.168.1.45

ARCHS = arm64 arm64e
TARGET = iphone:clang:12.2:12.0
TARGET = iphone:clang:12.2:10.0

INSTALL_TARGET_PROCESSES = LightSpeedApp Messenger

include $(THEOS)/makefiles/common.mk

TWEAK_NAME = MessengerNoAds
MessengerNoAds_FILES = Tweak.xm $(wildcard settingsview/*.xm settingsview/*.m)
MessengerNoAds_FILES = $(wildcard *.xm *.m settingsview/*.xm settingsview/*.m)
MessengerNoAds_CFLAGS = -fobjc-arc

include $(THEOS_MAKE_PATH)/tweak.mk
Expand Down
15 changes: 15 additions & 0 deletions Tweak.xm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ BOOL hidesearchbar;
BOOL hidestoriesrow;
BOOL hidepeopletab;
BOOL showTheEyeButton;
BOOL extendStoryVideoUploadLength;
NSString *plistPath;
NSMutableDictionary *settings;

Expand All @@ -30,6 +31,7 @@ static void reloadPrefs() {
hidestoriesrow = [[settings objectForKey:@"hidestoriesrow"] ?: @(NO) boolValue];
hidepeopletab = [[settings objectForKey:@"hidepeopletab"] ?: @(NO) boolValue];
showTheEyeButton = [[settings objectForKey:@"showTheEyeButton"] ?: @(YES) boolValue];
extendStoryVideoUploadLength = [[settings objectForKey:@"extendStoryVideoUploadLength"] ?: @(YES) boolValue];
}
static void PreferencesChangedCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) {
reloadPrefs();
Expand Down Expand Up @@ -307,6 +309,18 @@ static void PreferencesChangedCallback(CFNotificationCenterRef center, void *obs
%end
%end

%group ExtendStoryVideoUploadLength
%hook MSGVideoTrimmerPresenter
- (id)presentIfPossibleWithNSURL:(id)arg1 videoMaximumDuration:(double)arg2 completion:(id)arg3 {
double length = arg2;
if (extendStoryVideoUploadLength) {
length = 600.0; // 10 mins
}
return %orig(arg1, length, arg3);
}
%end
%end

/**
* Constructor
*/
Expand All @@ -324,5 +338,6 @@ static void PreferencesChangedCallback(CFNotificationCenterRef center, void *obs
%init(CanSaveFriendsStory);
%init(HideSearchBar);
%init(HidePeopleTab);
%init(ExtendStoryVideoUploadLength);
}

3 changes: 2 additions & 1 deletion control
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: com.haoict.messengernoads
Name: Messenger No Ads
Depends: mobilesubstrate, firmware (>= 10)
Conflicts: com.haoict.messengernoads
Version: 3.3.0
Version: 3.4.0
Architecture: iphoneos-arm
Description: The best tweak for Messenger app.
The best tweak for Messenger app.
Expand All @@ -14,6 +14,7 @@ Description: The best tweak for Messenger app.
- Disable Story Seen Receipt
- Can Save Friend's Story
- Hide Search Bar, Stories row, People tab
- Extend Story Video Upload Length (from default is 20 seconds to 10 minutes)
- Support iOS 10 (not tested) - 11 (tested) - 12 (tested) - 13 (tested)
- Support latest Messenger version (If it doesn't work, you should update the app to latest version >= 258.0)
.
Expand Down
Binary file not shown.
8 changes: 7 additions & 1 deletion settingsview/MNASettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ - (void)initTableData {
hidePeopleTabSwitchCell.defaultValue = @"false";
hidePeopleTabSwitchCell.isRestartRequired = TRUE;

MNACellModel *extendStoryVideoUploadLengthSwitchCell = [[MNACellModel alloc] initWithType:Switch withLabel:[MNAUtil localizedItem:@"EXTEND_STORY_VIDEO_UPLOAD_LENGTH"]];
extendStoryVideoUploadLengthSwitchCell.prefKey = @"extendStoryVideoUploadLength";
extendStoryVideoUploadLengthSwitchCell.defaultValue = @"true";

MNACellModel *otherPreferencesCell = [[MNACellModel alloc] initWithType:StaticText withLabel:@" " withSubtitle:[[MNAUtil localizedItem:@"OTHER_PREFERENCES"] uppercaseString]];
MNACellModel *showTheEyeButtonSwitchCell = [[MNACellModel alloc] initWithType:Switch withLabel:[MNAUtil localizedItem:@"SHOW_THE_EYE_BUTTON"]];
showTheEyeButtonSwitchCell.prefKey = @"showTheEyeButton";
Expand Down Expand Up @@ -182,6 +186,7 @@ - (void)initTableData {
[_tableData addObject:hideSearchBarSwitchCell];
[_tableData addObject:hideStoriesRowSwitchCell];
[_tableData addObject:hidePeopleTabSwitchCell];
[_tableData addObject:extendStoryVideoUploadLengthSwitchCell];

[_tableData addObject:otherPreferencesCell];
[_tableData addObject:showTheEyeButtonSwitchCell];
Expand Down Expand Up @@ -248,7 +253,8 @@ - (void)resetSettings {
[@{} writeToFile:plistPath atomically:YES];
[_tableView reloadData];
notify_post(PREF_CHANGED_NOTIF);
[MNAUtil showAlertMessage:nil title:@"Done" viewController:self];
// [MNAUtil showAlertMessage:nil title:@"Done" viewController:self];
[MNAUtil showRequireRestartAlert:self];
}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
Expand Down
1 change: 1 addition & 0 deletions settingsview/Resources/Localization-contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Here are base strings
"HIDE_SEARCH_BAR" = "Hide Search Bar (iOS 12 only)";
"HIDE_STORIES_ROW" = "Hide Stories Row";
"HIDE_PEOPLE_TAB" = "Hide People Tab";
"EXTEND_STORY_VIDEO_UPLOAD_LENGTH" = "Extend Story Video Upload Length";
"OTHER_PREFERENCES" = "Other Preferences";
"RESET_SETTINGS" = "Reset Settings";
"SUPPORT_ME" = "Support Me";
Expand Down
1 change: 1 addition & 0 deletions settingsview/Resources/ar.lproj/Root.strings
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"HIDE_SEARCH_BAR" = "اخفاء شريط البحث - تعمل فقط مع الاصدار 12";
"HIDE_STORIES_ROW" = "الغاء شريط الحاله";
"HIDE_PEOPLE_TAB" = "اخفاء ايقونه الاشخاص";
"EXTEND_STORY_VIDEO_UPLOAD_LENGTH" = "تمديد طول تحميل الفيديو القصة";
"OTHER_PREFERENCES" = "الاعدادات الاخرى";
"SHOW_THE_EYE_BUTTON" = "إظهار زر العين";
"RESET_SETTINGS" = "اعاده ضبط الاعدادات";
Expand Down
1 change: 1 addition & 0 deletions settingsview/Resources/base.lproj/Root.strings
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"HIDE_SEARCH_BAR" = "Hide Search Bar (iOS 12 only)";
"HIDE_STORIES_ROW" = "Hide Stories Row";
"HIDE_PEOPLE_TAB" = "Hide People Tab";
"EXTEND_STORY_VIDEO_UPLOAD_LENGTH" = "Extend Story Video Upload Length";
"OTHER_PREFERENCES" = "Other Preferences";
"SHOW_THE_EYE_BUTTON" = "Show The Eye Button";
"RESET_SETTINGS" = "Reset Settings";
Expand Down
1 change: 1 addition & 0 deletions settingsview/Resources/en.lproj/Root.strings
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"HIDE_SEARCH_BAR" = "Hide Search Bar (iOS 12 only)";
"HIDE_STORIES_ROW" = "Hide Stories Row";
"HIDE_PEOPLE_TAB" = "Hide People Tab";
"EXTEND_STORY_VIDEO_UPLOAD_LENGTH" = "Extend Story Video Upload Length";
"OTHER_PREFERENCES" = "Other Preferences";
"SHOW_THE_EYE_BUTTON" = "Show The Eye Button";
"RESET_SETTINGS" = "Reset Settings";
Expand Down
1 change: 1 addition & 0 deletions settingsview/Resources/fr.lproj/Root.strings
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"HIDE_SEARCH_BAR" = "Cacher barre de recherche (iOS12)";
"HIDE_STORIES_ROW" = "Cacher la rangée des Stories";
"HIDE_PEOPLE_TAB" = "Cacher l'onglet Personnes";
"EXTEND_STORY_VIDEO_UPLOAD_LENGTH" = "Prolonger la durée de téléchargement de la vidéo de l'histoire";
"OTHER_PREFERENCES" = "Autres réglages";
"SHOW_THE_EYE_BUTTON" = "Afficher le bouton oeil";
"RESET_SETTINGS" = "Réinitialiser les réglages";
Expand Down
1 change: 1 addition & 0 deletions settingsview/Resources/nl.lproj/Root.strings
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"HIDE_SEARCH_BAR" = "Zoekbalk verbergen (alleen iOS 12)";
"HIDE_STORIES_ROW" = "Verhalenrij verbergen";
"HIDE_PEOPLE_TAB" = "Tabblad Personen verbergen";
"EXTEND_STORY_VIDEO_UPLOAD_LENGTH" = "Verleng de lengte van de uploadvideo van het verhaal";
"OTHER_PREFERENCES" = "Andere voorkeuren";
"SHOW_THE_EYE_BUTTON" = "Toon de oogknop";
"RESET_SETTINGS" = "Instellingen resetten";
Expand Down
1 change: 1 addition & 0 deletions settingsview/Resources/vi.lproj/Root.strings
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"HIDE_SEARCH_BAR" = "Ẩn ô tìm kiếm (iOS 12)";
"HIDE_STORIES_ROW" = "Ẩn hàng story";
"HIDE_PEOPLE_TAB" = "Ẩn tab Mọi người";
"EXTEND_STORY_VIDEO_UPLOAD_LENGTH" = "Tăng thời lượng tải lên Story video";
"OTHER_PREFERENCES" = "Tùy chỉnh phụ";
"SHOW_THE_EYE_BUTTON" = "Hiện nút con mắt";
"RESET_SETTINGS" = "Đặt lại tùy chỉnh";
Expand Down

0 comments on commit 2e87d20

Please sign in to comment.