-
Notifications
You must be signed in to change notification settings - Fork 4
/
MSettings.xm
658 lines (643 loc) · 19.2 KB
/
MSettings.xm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
#define DPKG_PATH @"/var/lib/dpkg/info/apt.sun.msettings.list"
@interface SBWallpaperEffectView : UIView
@end
#ifndef kCFCoreFoundationVersionNumber_iOS_9_0
#define kCFCoreFoundationVersionNumber_iOS_9_0 1240.10
#endif
static BOOL Enabled = YES;
static BOOL HideTurnPoint = NO;
static BOOL DisableLeftSearch = NO;
static BOOL DisableDownSearch = NO;
static BOOL HideNCLogo = NO;
static BOOL HideNCLine = NO;
static BOOL ForceAppFit = NO;
static BOOL SameStatusBar = NO;
static BOOL ShowsLTE = NO;
static BOOL DisableCCBounce = NO;
static BOOL HideLockScreenGrabber = NO;
static BOOL HideSwitcherBgDarkeningFactor = NO;
static BOOL HideSwitcherCardDarkeningFactor = NO;
static BOOL HideIconName = NO;
static BOOL HideBetaDot = NO;
static BOOL HideFolderName = NO;
static BOOL enableAnimationspeed = NO;
static BOOL HideFolderBg = NO;
static BOOL HideFolderCloseBg = NO;
static BOOL DisableVoiceControl = NO;
static BOOL HideCCDarkBg = NO;
static BOOL HideCCAirDrop = NO;
static BOOL HideCCToggle = NO;
static BOOL HideBrightnessSection = NO;
static BOOL HideMediaControls = NO;
static BOOL HideLaunchSection = NO;
static BOOL CustomUnlockText = NO;
static BOOL HideUnlockSlider = NO;
static BOOL HideLCMusicControl = NO;
static BOOL HideLCCamera = NO;
static BOOL HideNCCalendar = NO;
static BOOL HideLunarDate = NO;
static BOOL HideNCConfigureButton = NO;
static BOOL HideLCClock = NO;
static BOOL CustomOperator = NO;
static BOOL LSSTatusBarTime = NO;
static BOOL HideStatusBarBattery = NO;
static BOOL CustomVolumHUDShowTime = NO;
static BOOL HideUpdatedDot = NO;
static BOOL HideVolumeHUDBg = NO;
static NSString *customOperator;
static NSString *customUnlockText;
static CGFloat Animationspeed = 0.5;
static double VolunmHUDShowTime = 1;
static int DockStyle = 1;
NSFileManager *manager = [NSFileManager defaultManager];
static void initPrefs()
{
NSMutableDictionary *prefs = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/apt.sun.msettings.plist"];
if (prefs) {
Enabled = ([prefs objectForKey:@"Enabled"] ? [[prefs objectForKey:@"Enabled"] boolValue] : Enabled );
HideTurnPoint = ([prefs objectForKey:@"HideTurnPoint"] ? [[prefs objectForKey:@"HideTurnPoint"] boolValue] : HideTurnPoint );
DisableLeftSearch = ([prefs objectForKey:@"DisableLeftSearch"] ? [[prefs objectForKey:@"DisableLeftSearch"] boolValue] : DisableLeftSearch );
DisableDownSearch = ([prefs objectForKey:@"DisableDownSearch"] ? [[prefs objectForKey:@"DisableDownSearch"] boolValue] : DisableDownSearch );
HideNCLogo = ([prefs objectForKey:@"HideNCLogo"] ? [[prefs objectForKey:@"HideNCLogo"] boolValue] : HideNCLogo );
HideNCLine = ([prefs objectForKey:@"HideNCLine"] ? [[prefs objectForKey:@"HideNCLine"] boolValue] : HideNCLine );
ForceAppFit = ([prefs objectForKey:@"ForceAppFit"] ? [[prefs objectForKey:@"ForceAppFit"] boolValue] : ForceAppFit );
SameStatusBar = ([prefs objectForKey:@"SameStatusBar"] ? [[prefs objectForKey:@"SameStatusBar"] boolValue] : SameStatusBar );
ShowsLTE = ([prefs objectForKey:@"ShowsLTE"] ? [[prefs objectForKey:@"ShowsLTE"] boolValue] : ShowsLTE );
DisableCCBounce = ([prefs objectForKey:@"DisableCCBounce"] ? [[prefs objectForKey:@"DisableCCBounce"] boolValue] : DisableCCBounce );
HideLockScreenGrabber = ([prefs objectForKey:@"HideLockScreenGrabber"] ? [[prefs objectForKey:@"HideLockScreenGrabber"] boolValue] : HideLockScreenGrabber );
HideSwitcherBgDarkeningFactor = ([prefs objectForKey:@"HideSwitcherBgDarkeningFactor"] ? [[prefs objectForKey:@"HideSwitcherBgDarkeningFactor"] boolValue] : HideSwitcherBgDarkeningFactor );
HideSwitcherCardDarkeningFactor = ([prefs objectForKey:@"HideSwitcherCardDarkeningFactor"] ? [[prefs objectForKey:@"HideSwitcherCardDarkeningFactor"] boolValue] : HideSwitcherCardDarkeningFactor );
HideIconName = ([prefs objectForKey:@"HideIconName"] ? [[prefs objectForKey:@"HideIconName"] boolValue] : HideIconName );
HideBetaDot = ([prefs objectForKey:@"HideBetaDot"] ? [[prefs objectForKey:@"HideBetaDot"] boolValue] : HideBetaDot );
HideFolderName = ([prefs objectForKey:@"HideFolderName"] ? [[prefs objectForKey:@"HideFolderName"] boolValue] : HideFolderName );
enableAnimationspeed = ([prefs objectForKey:@"enableAnimationspeed"] ? [[prefs objectForKey:@"enableAnimationspeed"] boolValue] : enableAnimationspeed );
Animationspeed = ([prefs objectForKey:@"Animationspeed"] ? [[prefs objectForKey:@"Animationspeed"] floatValue] : Animationspeed );
HideFolderBg = ([prefs objectForKey:@"HideFolderBg"] ? [[prefs objectForKey:@"HideFolderBg"] boolValue] : HideFolderBg );
HideFolderCloseBg = ([prefs objectForKey:@"HideFolderCloseBg"] ? [[prefs objectForKey:@"HideFolderCloseBg"] boolValue] : HideFolderCloseBg );
DisableVoiceControl = ([prefs objectForKey:@"DisableVoiceControl"] ? [[prefs objectForKey:@"DisableVoiceControl"] boolValue] : DisableVoiceControl );
HideCCDarkBg = ([prefs objectForKey:@"HideCCDarkBg"] ? [[prefs objectForKey:@"HideCCDarkBg"] boolValue] : HideCCDarkBg );
HideCCAirDrop = ([prefs objectForKey:@"HideCCAirDrop"] ? [[prefs objectForKey:@"HideCCAirDrop"] boolValue] : HideCCAirDrop );
HideCCToggle = ([prefs objectForKey:@"HideCCToggle"] ? [[prefs objectForKey:@"HideCCToggle"] boolValue] : HideCCToggle );
HideBrightnessSection = ([prefs objectForKey:@"HideBrightnessSection"] ? [[prefs objectForKey:@"HideBrightnessSection"] boolValue] : HideBrightnessSection );
HideMediaControls = ([prefs objectForKey:@"HideMediaControls"] ? [[prefs objectForKey:@"HideMediaControls"] boolValue] : HideMediaControls );
HideLaunchSection = ([prefs objectForKey:@"HideLaunchSection"] ? [[prefs objectForKey:@"HideLaunchSection"] boolValue] : HideLaunchSection );
CustomUnlockText = ([prefs objectForKey:@"CustomUnlockText"] ? [[prefs objectForKey:@"CustomUnlockText"] boolValue] : CustomUnlockText );
HideUnlockSlider = ([prefs objectForKey:@"HideUnlockSlider"] ? [[prefs objectForKey:@"HideUnlockSlider"] boolValue] : HideUnlockSlider );
HideLCMusicControl = ([prefs objectForKey:@"HideLCMusicControl"] ? [[prefs objectForKey:@"HideLCMusicControl"] boolValue] : HideLCMusicControl );
HideLCCamera = ([prefs objectForKey:@"HideLCCamera"] ? [[prefs objectForKey:@"HideLCCamera"] boolValue] : HideCCToggle );
HideNCCalendar = ([prefs objectForKey:@"HideNCCalendar"] ? [[prefs objectForKey:@"HideNCCalendar"] boolValue] : HideNCCalendar );
HideLunarDate = ([prefs objectForKey:@"HideLunarDate"] ? [[prefs objectForKey:@"HideLunarDate"] boolValue] : HideLunarDate );
HideNCConfigureButton = ([prefs objectForKey:@"HideNCConfigureButton"] ? [[prefs objectForKey:@"HideNCConfigureButton"] boolValue] : HideNCConfigureButton );
HideLCClock = ([prefs objectForKey:@"HideLCClock"] ? [[prefs objectForKey:@"HideLCClock"] boolValue] : HideLCClock );
LSSTatusBarTime = ([prefs objectForKey:@"LSSTatusBarTime"] ? [[prefs objectForKey:@"LSSTatusBarTime"] boolValue] : LSSTatusBarTime );
CustomOperator = ([prefs objectForKey:@"CustomOperator"] ? [[prefs objectForKey:@"CustomOperator"] boolValue] : CustomOperator );
HideStatusBarBattery = ([prefs objectForKey:@"HideStatusBarBattery"] ? [[prefs objectForKey:@"HideStatusBarBattery"] boolValue] : HideStatusBarBattery );
customOperator = ([prefs objectForKey:@"customOperator"] ? [prefs objectForKey:@"customOperator"] : customOperator);
customUnlockText = ([prefs objectForKey:@"customUnlockText"] ? [prefs objectForKey:@"customUnlockText"] : customUnlockText);
DockStyle = ([prefs objectForKey:@"DockStyle"] ? [[prefs objectForKey:@"DockStyle"] intValue] : DockStyle );
HideUpdatedDot = ([prefs objectForKey:@"HideUpdatedDot"] ? [[prefs objectForKey:@"HideUpdatedDot"] boolValue] : HideUpdatedDot );
HideVolumeHUDBg = ([prefs objectForKey:@"HideVolumeHUDBg"] ? [[prefs objectForKey:@"HideVolumeHUDBg"] boolValue] : HideVolumeHUDBg );
CustomVolumHUDShowTime = ([prefs objectForKey:@"CustomVolumHUDShowTime"] ? [[prefs objectForKey:@"CustomVolumHUDShowTime"] boolValue] : CustomVolumHUDShowTime );
VolunmHUDShowTime = ([prefs objectForKey:@"VolunmHUDShowTime"] ? [[prefs objectForKey:@"VolunmHUDShowTime"] doubleValue] : VolunmHUDShowTime);
}
[prefs release];
[customOperator retain];
[customUnlockText retain];
}
/* SpringBoard */
//Do a check for DPKG_PATH
%hook SpringBoard
- (void)applicationDidFinishLaunching:(id)arg1 {
%orig;
if (![manager fileExistsAtPath:DPKG_PATH]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"警告"
message:@"感谢您安装 MSettings,这是一款免费又实用的系统深度定制插件,但是您的 MSettings 软件包标识符已被篡改!这意味着您正在使用着盗版插件,为了您的设备与个人隐私的安全,请添加 S™ 中文源(http://apt.Sunbelife.com)来获取官方发行的版本!特别提醒,即使检测系统被破解但仍具有法律效力,从非官方源安装的软件在使用过程中出现了任何问题与作者无关!@0xJacky 保留追究破解者法律责任的权力!"
delegate:nil
cancelButtonTitle:@"好的"
otherButtonTitles:nil];
[alert show];
[alert release];
}
}
%end
//隐藏翻页小白点
%hook SBIconListPageControl
- (id)initWithFrame:(CGRect)arg {
if (HideTurnPoint && Enabled) {
return nil;
}
return %orig;
}
%end
//隐藏Dock背景
%hook SBDockView
- (void)layoutSubviews {
%orig;
SBWallpaperEffectView *dockBackground = MSHookIvar<SBWallpaperEffectView *>(self, "_backgroundView");
UIView * backgroundView = MSHookIvar<UIView *>(self, "_backgroundView");
UIView * highLightView = MSHookIvar<UIView *>(self, "_highlightView");
switch (DockStyle) {
case 1: {
%orig;
}
break;
case 2: {
dockBackground.hidden = YES;
}
break;
case 3: {
highLightView.alpha = 0;
backgroundView.layer.cornerRadius = 20;
backgroundView.layer.masksToBounds = YES;
CGRect frame = backgroundView.frame;
backgroundView.frame = (CGRect){{10, frame.origin.y},{frame.size.width - 20, frame.size.height}};
}
break;
default: {
%orig;
}
break;
}
}
%end
//禁用左侧搜索
%hook SBSpotlightSettings
- (bool)enableSpotlightOnMinusPage {
if (DisableLeftSearch && Enabled) {
return NO;
}
return %orig;
}
%end
//禁用下拉搜索
%hook SBSearchScrollView
- (bool)gestureRecognizerShouldBegin:(id)arg {
if (DisableDownSearch && Enabled) {
return NO;
}
return %orig;
}
%end
//隐藏桌面图标名称
%hook SBIconLabelImageParameters
- (id)text {
if (HideIconName && Enabled) {
return nil;
}
return %orig;
}
%end
//隐藏文件夹名称
%hook SBFolder
- (id)displayName {
if (HideFolderName && Enabled) {
return nil;
}
return %orig;
}
%end
%hook _SBIconWallpaperBackgroundProvider
- (void)_updateBlurForClient:(id)arg {
if (HideFolderCloseBg && Enabled) {
arg = nil;
}
%orig;
}
%end
%hook SBFolderIconImageView
- (void)_updateAccessibilityBackgroundContrast {
if (HideFolderCloseBg && Enabled) {
return;
}
%orig;
}
%end
//强制分辨率
%hook SBApplication
- (BOOL)supportsApplicationType:(int)arg {
if (ForceAppFit && Enabled)
{
return YES;
}
return %orig;
}
//隐藏测试版应用图标前的黄点Part1
- (bool)iconIsBeta:(id)arg {
if (HideBetaDot && Enabled) {
return NO;
}
return %orig;
}
%end
//图标名称圆点
%hook SBIconBetaLabelAccessoryView
//隐藏测试版应用图标前的黄点Part2 && 隐藏应用更新后图标前的蓝点Part1
- (id)init {
if ((HideBetaDot && Enabled) || (HideUpdatedDot && Enabled)) {
return nil;
}
return %orig;
}
%end
//隐藏应用更新后图标前的蓝点Part2
%hook SBIconRecentlyUpdatedLabelAccessoryView
- (id)init {
if (HideUpdatedDot && Enabled) {
return nil;
}
return %orig;
}
%end
//iOS 多任务背景去磨砂
%hook SBAppSwitcherSettings
- (double)deckSwitcherBackgroundDarkeningFactor {
if (HideSwitcherBgDarkeningFactor && Enabled) {
return 0;
}
return %orig;
}
- (double)deckSwitcherBackgroundBlurRadius {
if (HideSwitcherBgDarkeningFactor && Enabled) {
return 0;
}
return %orig;
}
%end
//iOS 多任务去除主屏幕卡片磨砂
%hook SBSwitcherWallpaperPageContentView
- (id)wallpaperEffectView {
if (HideSwitcherCardDarkeningFactor && Enabled) {
return nil;
}
return %orig;
}
%end
//动画持续时间
%group iOS9
%hook SBAnimationFactorySettings
- (BOOL)slowAnimations {
return enableAnimationspeed;
}
- (CGFloat)slowDownFactor {
if (enableAnimationspeed && Enabled) {
return Animationspeed;
} else {
return %orig();
}
}
%end
%end
%group iOS78
%hook SBFAnimationFactorySettings
- (BOOL) slowAnimations {
return enableAnimationspeed;
}
- (CGFloat) slowDownFactor {
if (enableAnimationspeed && Enabled) {
return Animationspeed;
} else {
return %orig();
}
}
%end
%end
//修复闪屏
%hook SBFadeAnimationSettings
- (CGFloat) backlightFadeDuration {
if (enableAnimationspeed && Enabled) {
if (Animationspeed <= 0.30)
{
return 0.1;
}
else if (Animationspeed <= 0.10)
{
return 0.0;
}
else
{
return 0.2;
}
}
else
{
return %orig();
}
}
%end
//隐藏文件夹背景
%hook SBFolderBackgroundView
- (id) initWithFrame:(CGRect)arg1 {
if (HideFolderBg && Enabled) {
return nil;
}
return %orig;
}
%end
//禁用语言控制
%hook SBVoiceControlController
- (BOOL)handleHomeButtonHeld {
if (DisableVoiceControl && Enabled) {
return NO;
}
return %orig;
}
%end
//隐藏音量浮窗背景
%hook SBHUDView
- (void) layoutSubviews {
if (HideVolumeHUDBg && Enabled) {
id backdropView = MSHookIvar<id>(self, "_backdropView");
if ([backdropView respondsToSelector:@selector(subviews)]) {
NSArray *subViews = [backdropView subviews];
for (UIView *subView in subViews) {
if (![subView isMemberOfClass:[%c(_UIBackdropContentView) class]]) {
[subView setHidden:YES];
}
}
}
}
%orig;
}
%end
//音量浮窗显示时间
%hook SBHUDController
- (void)presentHUDView:(id)arg1 autoDismissWithDelay:(double)arg2 {
if (CustomVolumHUDShowTime && Enabled) {
arg2 = VolunmHUDShowTime;
}
%orig(arg1, arg2);
}
%end
/*状态栏*/
//LTE标识
%hook SBTelephonyManager
- (bool)_lteConnectionShows4G {
if (ShowsLTE && Enabled) {
return NO;
}
return %orig;
}
//自定义运营商
- (void)_reallySetOperatorName:(id)arg {
if (Enabled && CustomOperator) {
if (![customOperator isEqualToString:@""]) {
arg = customOperator;
}
}
%orig(arg);
}
%end
//隐藏运营商
%hook SBStatusBarStateAggregator
- (void) _updateServiceItem {
if (Enabled && CustomOperator) {
if ([customOperator isEqualToString:@""]) {
return;
}
}
return %orig;
}
%end
/*锁屏*/
%hook SBSlideUpAppGrabberView
//锁屏 隐藏相机图标
- (void)setBackgroundColor:(id)arg1 {
if (HideLCCamera && Enabled) {
return;
}
%orig;
}
- (BOOL)_shouldUseVibrancy {
if (HideLCCamera && Enabled) {
return NO;
}
return %orig;
}
%end
//锁屏 状态栏大小不变
%hook SBLockScreenViewController
- (int)statusBarStyle {
if (SameStatusBar && Enabled) {
return 0;
}
return %orig;
}
//锁屏显示时间
- (bool)shouldShowLockStatusBarTime {
if (LSSTatusBarTime && Enabled) {
return YES;
}
return %orig;
}
//锁屏 隐藏音乐播放示图
- (void)setMediaControlsHidden:(bool)arg1 forRequester:(id)arg2 withAnimationFactory:(id)arg3 {
if (HideLCMusicControl && Enabled) {
arg1 = 1;
arg3 = nil;
}
%orig;
}
%end
%hook SBLockScreenNowPlayingPluginController
- (id)initWithLockScreenViewController:(id)arg1 mediaController:(id)arg2 {
if (HideLCMusicControl && Enabled) {
arg2 = nil;
}
return %orig;
}
%end
//隐藏锁屏上下横杠
%hook SBLockScreenView
- (void)setBottomGrabberView:(id)arg {
if (HideLockScreenGrabber && Enabled) {
arg = nil;
}
%orig;
}
- (bool)isBottomGrabberHidden {
if (HideLockScreenGrabber && Enabled) {
return NO;
}
return %orig;
}
- (bool)isTopGrabberHidden {
if ((HideLockScreenGrabber && Enabled) || (LSSTatusBarTime && Enabled)) {
return NO;
}
return %orig;
}
- (void)_layoutGrabberView:(id)arg1 atTop:(bool)arg2 {
if ((HideLockScreenGrabber && Enabled) || (LSSTatusBarTime && Enabled)) {
arg2 = 0;
}
%orig;
}
- (void)_addGrabberViews {
if (HideLockScreenGrabber && Enabled) {
return;
}
%orig;
}
- (void)setTopGrabberView:(id)arg {
if (HideLockScreenGrabber && Enabled) {
return;
}
%orig;
}
//锁屏 解锁文字自定义
- (id)_defaultSlideToUnlockText {
if (CustomUnlockText && Enabled) {
if ([customUnlockText isEqualToString:@"echoTime"]) {
NSDate *currentDate = [NSDate date];//获取当前时间,日期
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"M月d日 a h:mm"];
NSString *dateString = [dateFormatter stringFromDate:currentDate];
return dateString;
} else {
return customUnlockText;
}
}
return %orig;
}
%end
//锁屏 隐藏解锁滑块
%hook _UIGlintyStringView
- (id)chevron {
if (HideUnlockSlider && Enabled) {
return nil;
}
return %orig;
}
%end
//锁屏 隐藏时间/充电信息等
%hook SBLockScreenDateViewController
- (void)loadView {
if (HideLCClock && Enabled) {
return;
}
%orig;
}
%end
/*通知中心*/
//隐藏通知中心提供商
%hook SBTodayTableFooterView
- (void)setAttributionViewController:(id)arg {
if (HideNCLogo && Enabled) {
arg = nil;
}
%orig;
}
%end
//隐藏通知中心分割线
%hook SBNotificationSeparatorView
- (id)initWithFrame:(struct CGRect)arg1 mode:(long long)arg2 {
if (HideNCLine && Enabled) {
return nil;
}
return %orig;
}
%end
//通知中心 隐藏日历
%hook SBTodayTableHeaderView
- (id)initWithFrame:(CGRect)arg1 {
if (HideNCCalendar && Enabled) {
return nil;
}
return %orig;
}
//通知中心 隐藏农历
- (bool)showsLunarDate {
if (HideLunarDate && Enabled) {
return NO;
}
return %orig;
}
%end
//通知中心 隐藏编辑按钮
%hook SBNotificationVibrantButton
- (void)_configureButton:(id*)arg1 withSettings:(id)arg2 {
if (HideNCConfigureButton && Enabled) {
return;
}
%orig;
}
- (void)_configureOverlayViewWithSettings:(id)arg {
if (HideNCConfigureButton && Enabled) {
arg = nil;
}
%orig;
}
%end
/*控制中心*/
//禁止控制中心回弹
%hook SBControlCenterSettings
- (bool)useNewBounce {
if (DisableCCBounce && Enabled) {
return NO;
}
return %orig;
}
%end
//控制中心 禁用背景色差
%hook SBCCBrightnessSectionController
- (bool)_shouldDarkenBackground {
if (HideCCDarkBg && Enabled) {
return nil;
}
return %orig;
}
%end
%hook SBControlCenterContentView
//控制中心 隐藏快捷开关
- (id)settingsSection {
if (HideCCToggle && Enabled) {
return nil;
}
return %orig;
}
//控制中心 隐藏亮度滑块
- (void)setBrightnessSection:(id)arg1 {
if (HideBrightnessSection && Enabled) {
return;
}
%orig;
}
//控制中心 隐藏音乐控制
- (void)setMediaControlsSection:(id)arg1 {
if (HideMediaControls && Enabled) {
arg1 = nil;
}
%orig;
}
- (id)mediaControlsSection {
if (HideMediaControls && Enabled) {
return nil;
}
return %orig;
}
//控制中心 隐藏快速启动
- (id)quickLaunchSection {
if (HideLaunchSection && Enabled) {
return nil;
}
return %orig;
}
//控制中心 隐藏AirDrop/AirPlay
- (void)setAirplaySection:(id)arg1 {
if (HideCCAirDrop && Enabled) {
return;
}
%orig;
}
%end
%ctor
{
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)initPrefs, CFSTR("apt.sun.msettings/settingschanged"), NULL, CFNotificationSuspensionBehaviorCoalesce);
initPrefs();
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_9_0) {
%init(iOS9);
} else {
%init(iOS78);
}
%init();
}