Advertisement
christopher_a

oof.x

Sep 20th, 2020 (edited)
682
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "Tweak.h"
  2.  
  3. @implementation PlayOof
  4.  
  5. -(void)playSong {
  6.     //NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"/Library/oof/oof" ofType:@"mp3"];
  7.     NSURL *soundFileURL = [NSURL fileURLWithPath:@"/Library/oof/oof.mp3"];
  8.     AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:soundFileURL error:nil];
  9.     player.numberOfLoops = 5;
  10.     [player play];
  11. }
  12.  
  13. @end
  14.  
  15. %hook SBVolumeControl
  16.  
  17. -(void)increaseVolume {
  18.     %orig;
  19.     PlayOof *Oof = [[PlayOof alloc] init];
  20.     [Oof playSong];
  21.     NSLog(@"Did it work? up");
  22.     // The NSLog output works perfectly when the volume keys are pressed but no sound plays
  23. }
  24.  
  25. -(void)decreaseVolume {
  26.     %orig;
  27.     PlayOof *Oof = [[PlayOof alloc] init];
  28.     [Oof playSong];
  29.     NSLog(@"Did it work? down");
  30. }
  31.  
  32. %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement