@@ -31,11 +31,10 @@ void preferencesthings(){ //pref (looks THICC)
31
31
}
32
32
33
33
// checking for eneko
34
- NSString *Eneko = @" /usr/lib/Tweakinject/Eneko.dylib" ;
34
+ // NSString *Eneko = @"/usr/lib/Tweakinject/Eneko.dylib";
35
35
36
36
static void hapticpasscode () { // clacking button
37
-
38
- if (Clackingbuttons){
37
+ if (Clackingbuttons){
39
38
if (ClackingHardness == 0 ){
40
39
hardness = UIImpactFeedbackStyleLight;
41
40
}
@@ -51,24 +50,23 @@ static void hapticpasscode() { //clacking button
51
50
}
52
51
}
53
52
54
- %hook SBUIPasscodeLockViewBase // remove default keypad sound
53
+ %hook SBUIPasscodeLockViewBase
55
54
56
- -(void )setPlaysKeypadSounds:(BOOL )arg1{
57
- if ([[NSFileManager defaultManager ]fileExistsAtPath:Eneko]){
58
- %orig ;
59
- }else {
60
- if (isPCEnable){
61
-
62
- }else {
63
- %orig ;
64
- }
65
- }
66
- }
55
+ // -(void)setPlaysKeypadSounds:(BOOL)arg1{ //remove default keypad sound
56
+ // if ([[NSFileManager defaultManager]fileExistsAtPath:Eneko]){
57
+ // %orig;
58
+ // }else{
59
+ // if (isPCEnable){
60
+ //
61
+ // }else{
62
+ // %orig;
63
+ // }
64
+ // }
65
+ // }
67
66
68
67
-(void )_sendDelegateKeypadKeyDown { // BOOP
69
-
68
+ %orig ;
70
69
hapticpasscode ();
71
-
72
70
if (isPCEnable){
73
71
PCSoundURL = [NSURL fileURLWithPath: [NSString stringWithFormat: @" /Library/PreferenceBundles/BoopBoopBoopPrefs.bundle/ASolsounds/boop%d .mp3" , arc4random_uniform (3 )]];
74
72
if (isSinglePCSoundOn){
@@ -81,15 +79,15 @@ static void hapticpasscode() { //clacking button
81
79
SystemSoundID sound = 0 ;
82
80
AudioServicesCreateSystemSoundID ((CFURLRef) CFBridgingRetain (PCSoundURL), &sound);
83
81
AudioServicesPlaySystemSound ((SystemSoundID)sound);
82
+ PCSoundURL = nil ;
84
83
}else {
85
- %orig ;
84
+
86
85
}
87
86
}
88
87
89
88
%end
90
89
91
90
%hook SBUIController // charge sound plug in and pull out
92
-
93
91
-(void )ACPowerChanged{
94
92
%orig ;
95
93
if ([self isOnAC ]){
@@ -105,6 +103,7 @@ static void hapticpasscode() { //clacking button
105
103
SystemSoundID sound = 0 ;
106
104
AudioServicesCreateSystemSoundID ((CFURLRef) CFBridgingRetain (PISoundURL), &sound);
107
105
AudioServicesPlaySystemSound ((SystemSoundID)sound);
106
+ PISoundURL = nil ;
108
107
}else {
109
108
110
109
}
@@ -121,6 +120,7 @@ static void hapticpasscode() { //clacking button
121
120
SystemSoundID sound = 0 ;
122
121
AudioServicesCreateSystemSoundID ((CFURLRef) CFBridgingRetain (POSoundURL), &sound);
123
122
AudioServicesPlaySystemSound ((SystemSoundID)sound);
123
+ POSoundURL = nil ;
124
124
}else {
125
125
126
126
}
@@ -130,7 +130,6 @@ static void hapticpasscode() { //clacking button
130
130
%end
131
131
132
132
%hook SBLockScreenManager // wrong passcode sound
133
-
134
133
-(void )attemptUnlockWithPasscode:(id )arg1 finishUIUnlock:(BOOL )arg2 completion:(id )arg3{
135
134
%orig ;
136
135
if ([self isUILocked ]){
@@ -146,66 +145,67 @@ static void hapticpasscode() { //clacking button
146
145
SystemSoundID sound = 0 ;
147
146
AudioServicesCreateSystemSoundID ((CFURLRef) CFBridgingRetain (WPCSoundURL), &sound);
148
147
AudioServicesPlaySystemSound ((SystemSoundID)sound);
148
+ WPCSoundURL = nil ;
149
149
}else {
150
-
150
+
151
151
}
152
152
}else {
153
-
153
+
154
154
}
155
155
}
156
156
157
157
%end
158
158
159
159
%hook SBCoverSheetPrimarySlidingViewController
160
-
161
160
-(void )viewWillDisappear:(BOOL )arg1{ // unlock sound
162
-
161
+ %orig ;
163
162
Clack = nil ;
164
-
165
163
if (isUnLSEnable){
166
- UnLSoundURL = [NSURL fileURLWithPath: [NSString stringWithFormat: @" /Library/PreferenceBundles/BoopBoopBoopPrefs.bundle/LockAndUnlockSounds/unlock.mp3" ]];
167
- if (isSingleUnLSoundOn){
168
- UnLSoundURL = [NSURL fileURLWithPath: [NSString stringWithFormat: @" /Library/PreferenceBundles/BoopBoopBoopPrefs.bundle/LockAndUnlockSounds/unlock.mp3" ]];
169
- }if (isCustomUnLSoundOn){
170
- UnLSoundURL = [NSURL fileURLWithPath: [NSString stringWithFormat: @" /var/mobile/Documents/CustomSounds/UnlockSounds/unlock%d .mp3" , arc4random_uniform (NofUnLSounds)]];
171
- }if (isSingleUnLSoundOn && isCustomUnLSoundOn){
172
- UnLSoundURL = [NSURL fileURLWithPath: [NSString stringWithFormat: @" /var/mobile/Documents/CustomSounds/UnlockSounds/unlock%d .mp3" , soundnumber[NofUnLSounds]]];
173
- }
174
- if ([[%c (SBCoverSheetPresentationManager)sharedInstance] hasBeenDismissedSinceKeybagLock ]){
175
- %orig ;
176
- }else {
177
- SystemSoundID sound = 0 ;
164
+ if (![[%c (SBCoverSheetPresentationManager)sharedInstance] hasBeenDismissedSinceKeybagLock ]){
165
+ UnLSoundURL = [NSURL fileURLWithPath: [NSString stringWithFormat: @" /Library/PreferenceBundles/BoopBoopBoopPrefs.bundle/LockAndUnlockSounds/unlock.mp3" ]];
166
+ if (isSingleUnLSoundOn){
167
+ UnLSoundURL = [NSURL fileURLWithPath: [NSString stringWithFormat: @" /Library/PreferenceBundles/BoopBoopBoopPrefs.bundle/LockAndUnlockSounds/unlock.mp3" ]];
168
+ }if (isCustomUnLSoundOn){
169
+ UnLSoundURL = [NSURL fileURLWithPath: [NSString stringWithFormat: @" /var/mobile/Documents/CustomSounds/UnlockSounds/unlock%d .mp3" , arc4random_uniform (NofUnLSounds)]];
170
+ }if (isSingleUnLSoundOn && isCustomUnLSoundOn){
171
+ UnLSoundURL = [NSURL fileURLWithPath: [NSString stringWithFormat: @" /var/mobile/Documents/CustomSounds/UnlockSounds/unlock%d .mp3" , soundnumber[NofUnLSounds]]];
172
+ }
173
+ SystemSoundID sound = 0 ;
178
174
AudioServicesCreateSystemSoundID ((CFURLRef) CFBridgingRetain (UnLSoundURL), &sound);
179
175
AudioServicesPlaySystemSound ((SystemSoundID)sound);
176
+ UnLSoundURL = nil ;
177
+ }else {
178
+
180
179
}
181
180
}else {
182
- %orig ;
181
+
183
182
}
184
183
}
185
184
186
185
%end
187
186
188
187
%hook SBSleepWakeHardwareButtonInteraction // lock sound
189
-
190
- -( void )_playLockSound{
188
+ -( void )_playLockSound{
189
+ %orig ;
191
190
if (isLSEnable){
192
- LockSoundURL = [NSURL fileURLWithPath: [NSString stringWithFormat: @" /Library/PreferenceBundles/BoopBoopBoopPrefs.bundle/ASolsounds/lock.mp3" ]];
193
- if (isSingleLSoundOn){
194
- LockSoundURL = [NSURL fileURLWithPath: [NSString stringWithFormat: @" /Library/PreferenceBundles/BoopBoopBoopPrefs.bundle/ASolsounds/lock.mp3" ]];
195
- }if (isCustomLSoundOn){
196
- LockSoundURL = [NSURL fileURLWithPath: [NSString stringWithFormat: @" /var/mobile/Documents/CustomSounds/LockSounds/lock%d .mp3" , arc4random_uniform (NofLSounds)]];
197
- }if (isSingleLSoundOn && isCustomLSoundOn){
198
- LockSoundURL = [NSURL fileURLWithPath: [NSString stringWithFormat: @" /var/mobile/Documents/CustomSounds/LockSounds/lock%d .mp3" , soundnumber[NofLSounds]]];
199
- }
200
- if ([[%c (SBLockScreenManager)sharedInstance] isUILocked ]){
201
- %orig ;
202
- }else {
203
- SystemSoundID sound = 0 ;
191
+ if (![[%c (SBLockScreenManager)sharedInstance] isUILocked ]){
192
+ LockSoundURL = [NSURL fileURLWithPath: [NSString stringWithFormat: @" /Library/PreferenceBundles/BoopBoopBoopPrefs.bundle/ASolsounds/lock.mp3" ]];
193
+ if (isSingleLSoundOn){
194
+ LockSoundURL = [NSURL fileURLWithPath: [NSString stringWithFormat: @" /Library/PreferenceBundles/BoopBoopBoopPrefs.bundle/ASolsounds/lock.mp3" ]];
195
+ }if (isCustomLSoundOn){
196
+ LockSoundURL = [NSURL fileURLWithPath: [NSString stringWithFormat: @" /var/mobile/Documents/CustomSounds/LockSounds/lock%d .mp3" , arc4random_uniform (NofLSounds)]];
197
+ }if (isSingleLSoundOn && isCustomLSoundOn){
198
+ LockSoundURL = [NSURL fileURLWithPath: [NSString stringWithFormat: @" /var/mobile/Documents/CustomSounds/LockSounds/lock%d .mp3" , soundnumber[NofLSounds]]];
199
+ }
200
+ SystemSoundID sound = 0 ;
204
201
AudioServicesCreateSystemSoundID ((CFURLRef) CFBridgingRetain (LockSoundURL), &sound);
205
202
AudioServicesPlaySystemSound ((SystemSoundID)sound);
203
+ LockSoundURL = nil ;
204
+ }else {
205
+
206
206
}
207
207
}else {
208
- %orig ;
208
+
209
209
}
210
210
}
211
211
@@ -215,4 +215,4 @@ static void hapticpasscode() { //clacking button
215
215
// more pref
216
216
preferencesthings ();
217
217
CFNotificationCenterAddObserver (CFNotificationCenterGetDarwinNotifyCenter (), NULL , (CFNotificationCallback)preferencesthings, CFSTR (" com.hoangdus.boopboopboopprefs-updated" ), NULL , CFNotificationSuspensionBehaviorDeliverImmediately);
218
- }
218
+ }
0 commit comments