Sfoglia il codice sorgente

Update Tweak.xm

pull/1/head
gilshahar7 7 anni fa
parent
commit
323b21dea4
1 ha cambiato i file con 0 aggiunte e 12 eliminazioni
  1. +0
    -12
      Tweak.xm

+ 0
- 12
Tweak.xm Vedi File

@@ -11,7 +11,6 @@
@property (nonatomic,readonly) MPUNowPlayingMetadata * currentNowPlayingMetadata;
@end


@interface JBBulletinManager : NSObject
+(id)sharedInstance;
-(id)showBulletinWithTitle:(NSString *)title message:(NSString *)message bundleID:(NSString *)bundleID;
@@ -23,28 +22,17 @@
-(id)showBulletinWithTitle:(NSString *)title message:(NSString *)message bundleID:(NSString *)bundleID hasSound:(BOOL)hasSound soundID:(int)soundID vibrateMode:(int)vibrate soundPath:(NSString *)soundPath attachmentImage:(UIImage *)attachmentImage overrideBundleImage:(UIImage *)overrideBundleImage;
@end



%hook MPUNowPlayingController
static NSString *cachedTitle;
-(void)_updateCurrentNowPlaying{
%orig;


double delayInSeconds = 0.5;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){

if(self.isPlaying && ([self.nowPlayingAppDisplayID isEqualToString:@"com.apple.Music"] || [self.nowPlayingAppDisplayID isEqualToString:@"com.spotify.client"]) && ![cachedTitle isEqualToString:self.currentNowPlayingMetadata.title]){

cachedTitle = [self.currentNowPlayingMetadata.title copy];


[[objc_getClass("JBBulletinManager") sharedInstance] showBulletinWithTitle:self.currentNowPlayingMetadata.title message:self.currentNowPlayingMetadata.artist bundleID:self.nowPlayingAppDisplayID];


}

});
}
%end

Loading…
Annulla
Salva