Advertisement
Guest User

Untitled

a guest
Dec 30th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @interface IGStoryMusicTrack : NSObject
  2. @property (nonatomic, readonly) NSURL *audioFileURL;
  3. @property (nonatomic, readonly) NSString *title;
  4. @property (nonatomic, readonly) NSString *artistName;
  5. @end
  6.  
  7. @interface IGStoryMusicTrackClip : NSObject
  8. @property (nonatomic, assign) IGStoryMusicTrack *musicTrack;
  9. @end
  10.  
  11. @interface IGMusicStickerEditViewController : UIViewController
  12. @property (nonatomic, assign) IGStoryMusicTrackClip *musicTrackClip;
  13. @end
  14.  
  15. %hook IGMusicStickerEditViewController
  16. -(void)saveSong{
  17.     NSString *documents = [[[[NSBundle.mainBundle.appStoreReceiptURL stringByReplacingOccurrencesOfString:@"file://" withString:@""] stringByDeletingLastPathComponent] stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"Documents"]
  18.     IGStoryMusicTrack *track = self.musicTrackClip.musicTrack;
  19.     NSURL *fileURL = track.audioFileURL;
  20.     [[NSData dataWithContentsOfURL:fileURL] writeToFile:[NSString stringWithFormat:@"%@/%@ - %@.m4a", documents, track.artistName, track.title] atomically:YES];
  21. }
  22. %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement