Skip to content

Commit 41021e3

Browse files
committed
fix arc and time wrap issue, version bump to 0.0.2
1 parent 93439e1 commit 41021e3

10 files changed

+32
-20
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ TWEAK_NAME = NotiBlock
55
NotiBlock_FILES = Tweak.xm notiblockpref/NBPNotificationFilter.m notiblockpref/NBPAppInfo.m
66
NotiBlock_LIBRARIES = applist
77
NotiBlock_EXTRA_FRAMEWORKS += Cephei
8+
NotiBlock_CFLAGS = -fobjc-arc
89

910
include $(THEOS_MAKE_PATH)/tweak.mk
1011

Tweak.xm

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
@interface NCNotificationShortLookViewController: NCNotificationViewController
2929
-(id)_initWithNotificationRequest:(id)arg1 revealingAdditionalContentOnPresentation:(BOOL)arg2 ;
30-
-(id)_scrollView;
3130
@end
3231

3332
@interface NCNotificationRequest
@@ -93,13 +92,13 @@ returns whether we are currently inbetween the start time and and time and on a
9392

9493
if ([[newStartTime earlierDate:newEndTime] isEqualToDate:newEndTime]) { //backwards (start time before end time)
9594
HBLogDebug(@"NOTIBLOCK - backwards schedule mode");
96-
return [[newEndTime earlierDate:curTime] isEqualToDate:newEndTime] || [[newStartTime earlierDate:curTime] isEqualToDate:curTime];
95+
return [[newStartTime earlierDate:curTime] isEqualToDate:newStartTime] || [[newEndTime earlierDate:curTime] isEqualToDate:curTime];
9796
} else { //regular, check for in between
9897

9998
HBLogDebug(@"NOTIBLOCK - regular schedule mode");
100-
HBLogDebug(@"NOTIBLOCK - is after start - curTime: %f", [curTime timeIntervalSince1970]);
101-
HBLogDebug(@"NOTIBLOCK - is after start - newStartTime: %f", [newStartTime timeIntervalSince1970]);
102-
HBLogDebug(@"NOTIBLOCK - is after start - newEndTime: %f", [newEndTime timeIntervalSince1970]);
99+
HBLogDebug(@"NOTIBLOCK - curTime: %f", [curTime timeIntervalSince1970]);
100+
HBLogDebug(@"NOTIBLOCK - newStartTime: %f", [newStartTime timeIntervalSince1970]);
101+
HBLogDebug(@"NOTIBLOCK - newEndTime: %f", [newEndTime timeIntervalSince1970]);
103102

104103
HBLogDebug(@"NOTIBLOCK - is after start - %@",([[newStartTime earlierDate:curTime] isEqualToDate:newStartTime] ? @"true" : @"false"));
105104
HBLogDebug(@"NOTIBLOCK - is before end - %@",([[newEndTime earlierDate:curTime] isEqualToDate:curTime] ? @"true" : @"false"));
@@ -119,8 +118,7 @@ returns whether we are currently inbetween the start time and and time and on a
119118
//NSString *bulletinID = bulletin.bulletinID;
120119
NSString *sectionId = bulletin.sectionID;
121120

122-
// HBLogDebug(@"NOTIBLOCK - Entered publish bulletin for %@ with ID: %@ ", sectionId, bulletinID);
123-
121+
// HBLogDebug(@"NOTIBLOCK - Entered publish bulletin for %@ with ID: %@ ", sectionId, bulletinID);
124122
//HBLogDebug(@"NOTIBLOCK - BulletinID:%@ Title: %@ Subtitle: %@ Message: %@", bulletinID, title, subtitle, message );
125123

126124
BOOL filtered = NO;
@@ -281,7 +279,6 @@ Loads filters into memory from disk when springboard is loaded
281279
[appIdfilters addObject:filter];
282280

283281
HBLogDebug(@"NOTIBLOCK - adding filter to dict for appkey: --%@--", dictKey);
284-
285282
}
286283
} else {
287284
HBLogDebug(@"NOTIBLOCK - springboard data load was nil");
@@ -336,7 +333,7 @@ Check for filters and block notifications if needed
336333

337334
bulletin.sound = nil;
338335
bulletin.turnsOnDisplay = NO;
339-
%orig(bulletin, arg2);
336+
%orig(bulletin, arg2);
340337

341338
if (blockType == 2) {
342339
[self _clearBulletinIDs:@[bulletin.bulletinID] forSectionID:bulletin.sectionID shouldSync:YES];

control

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
Package: com.shemeshapps.notiblock
22
Name: NotiBlock
33
Depends: mobilesubstrate, ws.hbang.common, preferenceloader, applist
4-
Version: 0.0.1
4+
Version: 0.0.2
55
Architecture: iphoneos-arm
6-
Description: An awesome MobileSubstrate tweak!
6+
Description: NotiBlock - Block notifications and take control of your digital well-being
7+
Push notifications are a gift and a curse, allowing you to get notified instantly of important information, but also opening a door into letting people and apps interrupt your life without your consent. The tools Apple gives us are not powerful enough to stop the spam of notifications, and required a more advanced tool set.
8+
9+
NotiBlock is an advanced notification blocking and filtering tweak. It lets you block notifications based many fields for simple or advanced configurations. Features include blocking based on:
10+
- Content of the notification
11+
- What app the notification is from
12+
- Whitelist mode to only allow certain notifications through
13+
- Block notifications completely or just mute them
14+
- Schedules, to only block certain times and days of the week.
15+
16+
This app is also open source. View the source code on Github: https://github.com/eclair4151/NotiBlock
17+
18+
If you like this tweak and want to help support my development of free open source tweaks, feel free to donate: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YP44VSWZCTGE4&source=url
19+
20+
Comptible with iOS 11 - 13.5
721
Maintainer: ShemeshApps
822
Author: ShemeshApps
923
Section: Tweaks

notiblockpref/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ NotiBlockPref_FRAMEWORKS = UIKit
88
NotiBlockPref_PRIVATE_FRAMEWORKS = Preferences
99
NotiBlockPref_LIBRARIES = applist
1010
NotiBlockPref_EXTRA_FRAMEWORKS += Cephei CepheiPrefs
11-
11+
NotiBlockPref_CFLAGS = -fobjc-arc
1212
include $(THEOS_MAKE_PATH)/bundle.mk
1313

1414
internal-stage::

notiblockpref/NBPImageTableViewCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
1717
[self setSelectionStyle:UITableViewCellSelectionStyleNone];
1818
self.cellImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
1919

20-
NSBundle *bundle = [[[NSBundle alloc] initWithPath:@"/Library/PreferenceBundles/NotiBlockPref.bundle"] autorelease];
20+
NSBundle *bundle = [[NSBundle alloc] initWithPath:@"/Library/PreferenceBundles/NotiBlockPref.bundle"];
2121
NSString *imagePath = [bundle pathForResource:@"example" ofType:@"png"];
2222
UIImage *myImage = [UIImage imageWithContentsOfFile:imagePath];
2323
self.cellImageView.contentMode = UIViewContentModeScaleAspectFit;

notiblockpref/NBPNotificationFilter.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ - (id)initWithDictionary:(NSDictionary *)dict {
5454

5555

5656
- (NSDictionary *)encodeToDictionary {
57-
NSMutableDictionary *dict = [[NSMutableDictionary dictionaryWithObjectsAndKeys:
57+
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
5858
self.filterName, @"filterName",
5959
self.filterText, @"filterText",
6060
[NSNumber numberWithInt:self.blockType], @"blockType",
@@ -65,7 +65,7 @@ - (NSDictionary *)encodeToDictionary {
6565
self.startTime, @"startTime",
6666
self.endTime, @"endTime",
6767
self.weekDays, @"weekDays",
68-
nil] retain];
68+
nil];
6969

7070
if (self.appToBlock != nil) {
7171
[dict setObject:self.appToBlock.appIdentifier forKey:@"appToBlockIdentifier"];

notiblockpref/NBPRootPreferenceController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ @implementation NBPRootPreferenceController
77

88
- (NSArray *)specifiers {
99
if (!_specifiers) {
10-
_specifiers = [[self loadSpecifiersFromPlistName:@"Root" target:self] retain];
10+
_specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self];
1111
}
1212

1313
return _specifiers;

notiblockpref/NBPRootTableViewController.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ - (void)loadView {
2323
self.filterList = [[NSMutableArray alloc] init];
2424
}
2525
self.title = @"Notification Filters";
26-
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addButtonTapped:)] autorelease];
26+
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addButtonTapped:)];
2727
}
2828

2929
- (void)addButtonTapped:(id)sender {
30-
NBPAddViewController *one = [[[NBPAddViewController alloc]init] autorelease];
30+
NBPAddViewController *one = [[NBPAddViewController alloc]init];
3131
one.delegate = self;
3232
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:one];
3333
if (@available(iOS 13, *)) {
@@ -51,7 +51,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
5151
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
5252

5353
if (!cell) {
54-
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
54+
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
5555
}
5656

5757
cell.textLabel.text = ((NotificationFilter *)self.filterList[indexPath.row]).filterName;
@@ -67,7 +67,7 @@ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEd
6767
#pragma mark - Table View Delegate
6868

6969
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
70-
NBPAddViewController *one = [[[NBPAddViewController alloc]init] autorelease];
70+
NBPAddViewController *one = [[NBPAddViewController alloc]init];
7171
one.delegate = self;
7272
one.currentFilter = [self.filterList objectAtIndex:indexPath.row];
7373

345 KB
Binary file not shown.
353 KB
Binary file not shown.

0 commit comments

Comments
 (0)