forked from Mojave/Tick11
Initial Release 1.0
This commit is contained in:
BIN
Tweak/.DS_Store
vendored
Normal file
BIN
Tweak/.DS_Store
vendored
Normal file
Binary file not shown.
15
Tweak/Makefile
Normal file
15
Tweak/Makefile
Normal file
@ -0,0 +1,15 @@
|
||||
ARCHS = arm64 arm64e
|
||||
TARGET = iphone:clang:11.2:11.2
|
||||
|
||||
INSTALL_TARGET_PROCESSES = SpringBoard
|
||||
|
||||
include $(THEOS)/makefiles/common.mk
|
||||
|
||||
TWEAK_NAME = Tick
|
||||
|
||||
Tick_FILES = Tweak.x
|
||||
Tick_CFLAGS = -fobjc-arc
|
||||
$(TWEAK_NAME)_FRAMEWORKS += UIKit AudioToolbox
|
||||
$(TWEAK_NAME)_EXTRA_FRAMEWORKS += Cephei
|
||||
|
||||
include $(THEOS_MAKE_PATH)/tweak.mk
|
11
Tweak/Tick.h
Normal file
11
Tweak/Tick.h
Normal file
@ -0,0 +1,11 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <AudioToolbox/AudioServices.h>
|
||||
#import <Cephei/HBPreferences.h>
|
||||
|
||||
// Utils
|
||||
HBPreferences *pfs;
|
||||
|
||||
// Preferences
|
||||
BOOL enabled = YES;
|
||||
|
||||
NSString *loudnessLevel = @"0";
|
1
Tweak/Tick.plist
Normal file
1
Tweak/Tick.plist
Normal file
@ -0,0 +1 @@
|
||||
{ Filter = { Bundles = ( "com.apple.springboard" ); }; }
|
52
Tweak/Tweak.x
Normal file
52
Tweak/Tweak.x
Normal file
@ -0,0 +1,52 @@
|
||||
#import "Tick.h"
|
||||
|
||||
void playSound() {
|
||||
|
||||
int loudness = [loudnessLevel intValue];
|
||||
|
||||
SystemSoundID sound = 0;
|
||||
AudioServicesDisposeSystemSoundID(sound);
|
||||
|
||||
if (loudness == 0) {
|
||||
AudioServicesCreateSystemSoundID((CFURLRef) CFBridgingRetain([NSURL fileURLWithPath:@"/Library/Application Support/Tick/tick.caf"]), &sound);
|
||||
|
||||
} else if (loudness == 1) {
|
||||
AudioServicesCreateSystemSoundID((CFURLRef) CFBridgingRetain([NSURL fileURLWithPath:@"/Library/Application Support/Tick/tick2.caf"]), &sound);
|
||||
|
||||
} else if (loudness == 2) {
|
||||
AudioServicesCreateSystemSoundID((CFURLRef) CFBridgingRetain([NSURL fileURLWithPath:@"/Library/Application Support/Tick/tick3.caf"]), &sound);
|
||||
|
||||
}
|
||||
|
||||
AudioServicesPlaySystemSound((SystemSoundID)sound);
|
||||
|
||||
}
|
||||
|
||||
%group Tick
|
||||
|
||||
%hook SBUIIconForceTouchViewController
|
||||
|
||||
-(BOOL)presentAnimated:(BOOL)arg1 withCompletionHandler:(/*^block*/id)arg2 {
|
||||
|
||||
if (enabled) {
|
||||
playSound();
|
||||
|
||||
}
|
||||
|
||||
return %orig;
|
||||
|
||||
}
|
||||
|
||||
%end
|
||||
|
||||
%end
|
||||
|
||||
%ctor {
|
||||
pfs = [[HBPreferences alloc] initWithIdentifier:@"me.shymemoriees.tickpreferences"];
|
||||
|
||||
[pfs registerBool:&enabled default:YES forKey:@"Enabled"];
|
||||
[pfs registerObject:&loudnessLevel default:@"0" forKey:@"Loudness"];
|
||||
|
||||
if(enabled)
|
||||
%init(Tick);
|
||||
}
|
Reference in New Issue
Block a user