Skip to content

Commit e632b98

Browse files
committed
Update to 0.0.3
1 parent 6a201b6 commit e632b98

File tree

6 files changed

+74
-58
lines changed

6 files changed

+74
-58
lines changed

BoopBoopBoop/BoopBoopBoop.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ static BOOL isCustomPOSoundOn;
5353
static BOOL isSinglePOSoundOn;
5454
static int NofPOsounds;
5555
static BOOL Clackingbuttons;
56-
static int ClackingHardness;
56+
static int ClackingHardness;

BoopBoopBoop/BoopBoopBoop.x

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -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

3636
static 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+
}

BoopBoopBoop/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
ARCHS = arm64 arm64e
22
export DEBUG = 0
33
export FINALPACKAGE = 1
4+
export THEOS_DEVICE_IP = localhost
5+
export THEOS_DEVICE_PORT=2222
46

5-
include /var/theos/makefiles/common.mk
7+
8+
include $(THEOS)/makefiles/common.mk
69

710
TWEAK_NAME = BoopBoopBoop
811

BoopBoopBoop/boopboopboopprefs/BOPRootListController.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ - (void)github{ //handle "github" button
2323
- (void)twitter{ //handle "twitter" button
2424
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"https://twitter.com/Hoangdev23"]options:@{} completionHandler:nil];
2525
}
26+
27+
- (void)paypal{ //handle "paypal" button
28+
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"https://www.paypal.com/paypalme/HoangDus"]options:@{} completionHandler:nil];
29+
}
30+
2631
@end
2732

2833
@implementation BOPHeaderCell
@@ -31,15 +36,15 @@ - (id)initWithSpecifier:(PSSpecifier *)specifier { // title
3136
self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
3237

3338
if (self) {
34-
UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(30, 30, self.frame.size.width, 60)];
39+
UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(0, 30, self.frame.size.width, 60)];
3540
title.numberOfLines = 1;
3641
title.font = [UIFont systemFontOfSize:35];
3742
title.text = @"Boop Boop Boop";
3843
title.textColor = [UIColor colorWithRed:0.24 green:0.38 blue:0.8 alpha:1.0];
3944
title.textAlignment = NSTextAlignmentCenter;
4045
[self addSubview:title];
4146

42-
UILabel *subtitle = [[UILabel alloc] initWithFrame:CGRectMake(30, 75, self.frame.size.width, 60)];
47+
UILabel *subtitle = [[UILabel alloc] initWithFrame:CGRectMake(0, 75, self.frame.size.width, 60)];
4348
subtitle.numberOfLines = 2;
4449
subtitle.font = [UIFont systemFontOfSize:20];
4550
subtitle.text = @"-Aurelion Sol \n By Hoangdus";

BoopBoopBoop/boopboopboopprefs/Resources/Root.plist

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,14 @@
560560
<key>label</key>
561561
<string>Source code and how to add custom sound</string>
562562
</dict>
563+
<dict>
564+
<key>action</key>
565+
<string>paypal</string>
566+
<key>cell</key>
567+
<string>PSButtonCell</string>
568+
<key>label</key>
569+
<string>Buy me a Fanta</string>
570+
</dict>
563571
</array>
564572
<key>title</key>
565573
<string></string>
Binary file not shown.

0 commit comments

Comments
 (0)