Skip to content

Commit

Permalink
Update to 0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoangdus committed Dec 15, 2022
1 parent 6a201b6 commit e632b98
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 58 deletions.
2 changes: 1 addition & 1 deletion BoopBoopBoop/BoopBoopBoop.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ static BOOL isCustomPOSoundOn;
static BOOL isSinglePOSoundOn;
static int NofPOsounds;
static BOOL Clackingbuttons;
static int ClackingHardness;
static int ClackingHardness;
108 changes: 54 additions & 54 deletions BoopBoopBoop/BoopBoopBoop.x
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ void preferencesthings(){ //pref (looks THICC)
}

//checking for eneko
NSString *Eneko = @"/usr/lib/Tweakinject/Eneko.dylib";
//NSString *Eneko = @"/usr/lib/Tweakinject/Eneko.dylib";

static void hapticpasscode() { //clacking button

if (Clackingbuttons){
if (Clackingbuttons){
if (ClackingHardness == 0){
hardness = UIImpactFeedbackStyleLight;
}
Expand All @@ -51,24 +50,23 @@ static void hapticpasscode() { //clacking button
}
}

%hook SBUIPasscodeLockViewBase //remove default keypad sound
%hook SBUIPasscodeLockViewBase

-(void)setPlaysKeypadSounds:(BOOL)arg1{
if ([[NSFileManager defaultManager]fileExistsAtPath:Eneko]){
%orig;
}else{
if (isPCEnable){

}else{
%orig;
}
}
}
//-(void)setPlaysKeypadSounds:(BOOL)arg1{ //remove default keypad sound
// if ([[NSFileManager defaultManager]fileExistsAtPath:Eneko]){
// %orig;
// }else{
// if (isPCEnable){
//
// }else{
// %orig;
// }
// }
//}

-(void)_sendDelegateKeypadKeyDown { //BOOP

%orig;
hapticpasscode();

if (isPCEnable){
PCSoundURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"/Library/PreferenceBundles/BoopBoopBoopPrefs.bundle/ASolsounds/boop%d.mp3", arc4random_uniform(3)]];
if (isSinglePCSoundOn){
Expand All @@ -81,15 +79,15 @@ static void hapticpasscode() { //clacking button
SystemSoundID sound = 0;
AudioServicesCreateSystemSoundID((CFURLRef) CFBridgingRetain(PCSoundURL), &sound);
AudioServicesPlaySystemSound((SystemSoundID)sound);
PCSoundURL = nil;
}else{
%orig;

}
}

%end

%hook SBUIController //charge sound plug in and pull out

-(void)ACPowerChanged{
%orig;
if ([self isOnAC]){
Expand All @@ -105,6 +103,7 @@ static void hapticpasscode() { //clacking button
SystemSoundID sound = 0;
AudioServicesCreateSystemSoundID((CFURLRef) CFBridgingRetain(PISoundURL), &sound);
AudioServicesPlaySystemSound((SystemSoundID)sound);
PISoundURL = nil;
}else{

}
Expand All @@ -121,6 +120,7 @@ static void hapticpasscode() { //clacking button
SystemSoundID sound = 0;
AudioServicesCreateSystemSoundID((CFURLRef) CFBridgingRetain(POSoundURL), &sound);
AudioServicesPlaySystemSound((SystemSoundID)sound);
POSoundURL = nil;
}else{

}
Expand All @@ -130,7 +130,6 @@ static void hapticpasscode() { //clacking button
%end

%hook SBLockScreenManager //wrong passcode sound

-(void)attemptUnlockWithPasscode:(id)arg1 finishUIUnlock:(BOOL)arg2 completion:(id)arg3{
%orig;
if([self isUILocked]){
Expand All @@ -146,66 +145,67 @@ static void hapticpasscode() { //clacking button
SystemSoundID sound = 0;
AudioServicesCreateSystemSoundID((CFURLRef) CFBridgingRetain(WPCSoundURL), &sound);
AudioServicesPlaySystemSound((SystemSoundID)sound);
WPCSoundURL = nil;
}else{

}
}else{
}
}

%end

%hook SBCoverSheetPrimarySlidingViewController

-(void)viewWillDisappear:(BOOL)arg1{ //unlock sound

%orig;
Clack = nil;

if (isUnLSEnable){
UnLSoundURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"/Library/PreferenceBundles/BoopBoopBoopPrefs.bundle/LockAndUnlockSounds/unlock.mp3"]];
if(isSingleUnLSoundOn){
UnLSoundURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"/Library/PreferenceBundles/BoopBoopBoopPrefs.bundle/LockAndUnlockSounds/unlock.mp3"]];
}if(isCustomUnLSoundOn){
UnLSoundURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"/var/mobile/Documents/CustomSounds/UnlockSounds/unlock%d.mp3", arc4random_uniform(NofUnLSounds)]];
}if(isSingleUnLSoundOn && isCustomUnLSoundOn){
UnLSoundURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"/var/mobile/Documents/CustomSounds/UnlockSounds/unlock%d.mp3", soundnumber[NofUnLSounds]]];
}
if ([[%c(SBCoverSheetPresentationManager)sharedInstance] hasBeenDismissedSinceKeybagLock]){
%orig;
}else{
SystemSoundID sound = 0;
if (![[%c(SBCoverSheetPresentationManager)sharedInstance] hasBeenDismissedSinceKeybagLock]){
UnLSoundURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"/Library/PreferenceBundles/BoopBoopBoopPrefs.bundle/LockAndUnlockSounds/unlock.mp3"]];
if(isSingleUnLSoundOn){
UnLSoundURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"/Library/PreferenceBundles/BoopBoopBoopPrefs.bundle/LockAndUnlockSounds/unlock.mp3"]];
}if(isCustomUnLSoundOn){
UnLSoundURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"/var/mobile/Documents/CustomSounds/UnlockSounds/unlock%d.mp3", arc4random_uniform(NofUnLSounds)]];
}if(isSingleUnLSoundOn && isCustomUnLSoundOn){
UnLSoundURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"/var/mobile/Documents/CustomSounds/UnlockSounds/unlock%d.mp3", soundnumber[NofUnLSounds]]];
}
SystemSoundID sound = 0;
AudioServicesCreateSystemSoundID((CFURLRef) CFBridgingRetain(UnLSoundURL), &sound);
AudioServicesPlaySystemSound((SystemSoundID)sound);
UnLSoundURL = nil;
}else{

}
}else{
%orig;
}
}

%end

%hook SBSleepWakeHardwareButtonInteraction //lock sound

-(void)_playLockSound{
-(void)_playLockSound{
%orig;
if (isLSEnable){
LockSoundURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"/Library/PreferenceBundles/BoopBoopBoopPrefs.bundle/ASolsounds/lock.mp3"]];
if(isSingleLSoundOn){
LockSoundURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"/Library/PreferenceBundles/BoopBoopBoopPrefs.bundle/ASolsounds/lock.mp3"]];
}if(isCustomLSoundOn){
LockSoundURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"/var/mobile/Documents/CustomSounds/LockSounds/lock%d.mp3", arc4random_uniform(NofLSounds)]];
}if(isSingleLSoundOn && isCustomLSoundOn){
LockSoundURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"/var/mobile/Documents/CustomSounds/LockSounds/lock%d.mp3", soundnumber[NofLSounds]]];
}
if ([[%c(SBLockScreenManager)sharedInstance] isUILocked]){
%orig;
}else{
SystemSoundID sound = 0;
if (![[%c(SBLockScreenManager)sharedInstance] isUILocked]){
LockSoundURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"/Library/PreferenceBundles/BoopBoopBoopPrefs.bundle/ASolsounds/lock.mp3"]];
if(isSingleLSoundOn){
LockSoundURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"/Library/PreferenceBundles/BoopBoopBoopPrefs.bundle/ASolsounds/lock.mp3"]];
}if(isCustomLSoundOn){
LockSoundURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"/var/mobile/Documents/CustomSounds/LockSounds/lock%d.mp3", arc4random_uniform(NofLSounds)]];
}if(isSingleLSoundOn && isCustomLSoundOn){
LockSoundURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"/var/mobile/Documents/CustomSounds/LockSounds/lock%d.mp3", soundnumber[NofLSounds]]];
}
SystemSoundID sound = 0;
AudioServicesCreateSystemSoundID((CFURLRef) CFBridgingRetain(LockSoundURL), &sound);
AudioServicesPlaySystemSound((SystemSoundID)sound);
LockSoundURL = nil;
}else{

}
}else{
%orig;

}
}

Expand All @@ -215,4 +215,4 @@ static void hapticpasscode() { //clacking button
//more pref
preferencesthings();
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)preferencesthings, CFSTR("com.hoangdus.boopboopboopprefs-updated"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
}
}
5 changes: 4 additions & 1 deletion BoopBoopBoop/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
ARCHS = arm64 arm64e
export DEBUG = 0
export FINALPACKAGE = 1
export THEOS_DEVICE_IP = localhost
export THEOS_DEVICE_PORT=2222

include /var/theos/makefiles/common.mk

include $(THEOS)/makefiles/common.mk

TWEAK_NAME = BoopBoopBoop

Expand Down
9 changes: 7 additions & 2 deletions BoopBoopBoop/boopboopboopprefs/BOPRootListController.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ - (void)github{ //handle "github" button
- (void)twitter{ //handle "twitter" button
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"https://twitter.com/Hoangdev23"]options:@{} completionHandler:nil];
}

- (void)paypal{ //handle "paypal" button
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"https://www.paypal.com/paypalme/HoangDus"]options:@{} completionHandler:nil];
}

@end

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

if (self) {
UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(30, 30, self.frame.size.width, 60)];
UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(0, 30, self.frame.size.width, 60)];
title.numberOfLines = 1;
title.font = [UIFont systemFontOfSize:35];
title.text = @"Boop Boop Boop";
title.textColor = [UIColor colorWithRed:0.24 green:0.38 blue:0.8 alpha:1.0];
title.textAlignment = NSTextAlignmentCenter;
[self addSubview:title];

UILabel *subtitle = [[UILabel alloc] initWithFrame:CGRectMake(30, 75, self.frame.size.width, 60)];
UILabel *subtitle = [[UILabel alloc] initWithFrame:CGRectMake(0, 75, self.frame.size.width, 60)];
subtitle.numberOfLines = 2;
subtitle.font = [UIFont systemFontOfSize:20];
subtitle.text = @"-Aurelion Sol \n By Hoangdus";
Expand Down
8 changes: 8 additions & 0 deletions BoopBoopBoop/boopboopboopprefs/Resources/Root.plist
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,14 @@
<key>label</key>
<string>Source code and how to add custom sound</string>
</dict>
<dict>
<key>action</key>
<string>paypal</string>
<key>cell</key>
<string>PSButtonCell</string>
<key>label</key>
<string>Buy me a Fanta</string>
</dict>
</array>
<key>title</key>
<string></string>
Expand Down
Binary file not shown.

0 comments on commit e632b98

Please sign in to comment.