Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @interface IGStoryMusicTrack : NSObject
- @property (nonatomic, readonly) NSURL *audioFileURL;
- @property (nonatomic, readonly) NSString *title;
- @property (nonatomic, readonly) NSString *artistName;
- @end
- @interface IGStoryMusicTrackClip : NSObject
- @property (nonatomic, assign) IGStoryMusicTrack *musicTrack;
- @end
- @interface IGMusicStickerEditViewController : UIViewController
- @property (nonatomic, assign) IGStoryMusicTrackClip *musicTrackClip;
- @end
- %hook IGMusicStickerEditViewController
- -(void)saveSong{
- NSString *documents = [[[[NSBundle.mainBundle.appStoreReceiptURL stringByReplacingOccurrencesOfString:@"file://" withString:@""] stringByDeletingLastPathComponent] stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"Documents"]
- IGStoryMusicTrack *track = self.musicTrackClip.musicTrack;
- NSURL *fileURL = track.audioFileURL;
- [[NSData dataWithContentsOfURL:fileURL] writeToFile:[NSString stringWithFormat:@"%@/%@ - %@.m4a", documents, track.artistName, track.title] atomically:YES];
- }
- %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement