@@ -31,11 +31,10 @@ void preferencesthings(){ //pref (looks THICC)
3131}
3232
3333// checking for eneko
34- NSString *Eneko = @" /usr/lib/Tweakinject/Eneko.dylib" ;
34+ // NSString *Eneko = @"/usr/lib/Tweakinject/Eneko.dylib";
3535
3636static void hapticpasscode () { // clacking button
37-
38- if (Clackingbuttons){
37+ if (Clackingbuttons){
3938 if (ClackingHardness == 0 ){
4039 hardness = UIImpactFeedbackStyleLight;
4140 }
@@ -51,24 +50,23 @@ static void hapticpasscode() { //clacking button
5150 }
5251}
5352
54- %hook SBUIPasscodeLockViewBase // remove default keypad sound
53+ %hook SBUIPasscodeLockViewBase
5554
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+ // }
6766
6867-(void )_sendDelegateKeypadKeyDown { // BOOP
69-
68+ %orig ;
7069 hapticpasscode ();
71-
7270 if (isPCEnable){
7371 PCSoundURL = [NSURL fileURLWithPath: [NSString stringWithFormat: @" /Library/PreferenceBundles/BoopBoopBoopPrefs.bundle/ASolsounds/boop%d .mp3" , arc4random_uniform (3 )]];
7472 if (isSinglePCSoundOn){
@@ -81,15 +79,15 @@ static void hapticpasscode() { //clacking button
8179 SystemSoundID sound = 0 ;
8280 AudioServicesCreateSystemSoundID ((CFURLRef) CFBridgingRetain (PCSoundURL), &sound);
8381 AudioServicesPlaySystemSound ((SystemSoundID)sound);
82+ PCSoundURL = nil ;
8483 }else {
85- %orig ;
84+
8685 }
8786}
8887
8988%end
9089
9190%hook SBUIController // charge sound plug in and pull out
92-
9391-(void )ACPowerChanged{
9492 %orig ;
9593 if ([self isOnAC ]){
@@ -105,6 +103,7 @@ static void hapticpasscode() { //clacking button
105103 SystemSoundID sound = 0 ;
106104 AudioServicesCreateSystemSoundID ((CFURLRef) CFBridgingRetain (PISoundURL), &sound);
107105 AudioServicesPlaySystemSound ((SystemSoundID)sound);
106+ PISoundURL = nil ;
108107 }else {
109108
110109 }
@@ -121,6 +120,7 @@ static void hapticpasscode() { //clacking button
121120 SystemSoundID sound = 0 ;
122121 AudioServicesCreateSystemSoundID ((CFURLRef) CFBridgingRetain (POSoundURL), &sound);
123122 AudioServicesPlaySystemSound ((SystemSoundID)sound);
123+ POSoundURL = nil ;
124124 }else {
125125
126126 }
@@ -130,7 +130,6 @@ static void hapticpasscode() { //clacking button
130130%end
131131
132132%hook SBLockScreenManager // wrong passcode sound
133-
134133-(void )attemptUnlockWithPasscode:(id )arg1 finishUIUnlock:(BOOL )arg2 completion:(id )arg3{
135134 %orig ;
136135 if ([self isUILocked ]){
@@ -146,66 +145,67 @@ static void hapticpasscode() { //clacking button
146145 SystemSoundID sound = 0 ;
147146 AudioServicesCreateSystemSoundID ((CFURLRef) CFBridgingRetain (WPCSoundURL), &sound);
148147 AudioServicesPlaySystemSound ((SystemSoundID)sound);
148+ WPCSoundURL = nil ;
149149 }else {
150-
150+
151151 }
152152 }else {
153-
153+
154154 }
155155}
156156
157157%end
158158
159159%hook SBCoverSheetPrimarySlidingViewController
160-
161160-(void )viewWillDisappear:(BOOL )arg1{ // unlock sound
162-
161+ %orig ;
163162 Clack = nil ;
164-
165163 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 ;
178174 AudioServicesCreateSystemSoundID ((CFURLRef) CFBridgingRetain (UnLSoundURL), &sound);
179175 AudioServicesPlaySystemSound ((SystemSoundID)sound);
176+ UnLSoundURL = nil ;
177+ }else {
178+
180179 }
181180 }else {
182- %orig ;
181+
183182 }
184183}
185184
186185%end
187186
188187%hook SBSleepWakeHardwareButtonInteraction // lock sound
189-
190- -( void )_playLockSound{
188+ -( void )_playLockSound{
189+ %orig ;
191190 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 ;
204201 AudioServicesCreateSystemSoundID ((CFURLRef) CFBridgingRetain (LockSoundURL), &sound);
205202 AudioServicesPlaySystemSound ((SystemSoundID)sound);
203+ LockSoundURL = nil ;
204+ }else {
205+
206206 }
207207 }else {
208- %orig ;
208+
209209 }
210210}
211211
@@ -215,4 +215,4 @@ static void hapticpasscode() { //clacking button
215215 // more pref
216216 preferencesthings ();
217217 CFNotificationCenterAddObserver (CFNotificationCenterGetDarwinNotifyCenter (), NULL , (CFNotificationCallback)preferencesthings, CFSTR (" com.hoangdus.boopboopboopprefs-updated" ), NULL , CFNotificationSuspensionBehaviorDeliverImmediately);
218- }
218+ }
0 commit comments