فهرست منبع

playback: don't leak meta data to the OS if passcode lock is enabled since this voids the privacy added by the lock

Felix Paul Kühne 11 سال پیش
والد
کامیت
f620c55507
2فایلهای تغییر یافته به همراه11 افزوده شده و 2 حذف شده
  1. 2 0
      NEWS
  2. 9 2
      Sources/VLCMovieViewController.m

+ 2 - 0
NEWS

@@ -19,6 +19,8 @@ Interface:
     more precisely (iPad only)
 * Previously removed episodes and tracks no longer show up in the respective
   group listings (#9705)
+* Improved privacy by requesting the passcode 2 minutes after leaving the app
+  and by obfuscating playback metadata if passcode lock is enabled
 
 Cloud interaction:
 * Added support for downloads from Google Drive (#8690)

+ 9 - 2
Sources/VLCMovieViewController.m

@@ -1149,10 +1149,17 @@
     }
     MLFile * currentFile = _mediaItem;
 
+    /* don't leak sensitive information to the OS, if passcode lock is enabled */
+    BOOL passcodeLockEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:kVLCSettingPasscodeOnKey] boolValue];
+
     /* we omit artwork for now since we had to read it from storage as we can't access
      * the artwork cache at the moment - FIXME? */
-    NSMutableDictionary *currentlyPlayingTrackInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: currentFile.title, MPMediaItemPropertyTitle, @(currentFile.duration.intValue / 1000.), MPMediaItemPropertyPlaybackDuration, @(_mediaPlayer.time.intValue / 1000.), MPNowPlayingInfoPropertyElapsedPlaybackTime, @(_mediaPlayer.rate), MPNowPlayingInfoPropertyPlaybackRate, nil];
-    if ([currentFile isAlbumTrack]) {
+    NSMutableDictionary *currentlyPlayingTrackInfo;
+    if (passcodeLockEnabled)
+        currentlyPlayingTrackInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys:@(currentFile.duration.intValue / 1000.), MPMediaItemPropertyPlaybackDuration, @(_mediaPlayer.time.intValue / 1000.), MPNowPlayingInfoPropertyElapsedPlaybackTime, @(_mediaPlayer.rate), MPNowPlayingInfoPropertyPlaybackRate, nil];
+    else
+        currentlyPlayingTrackInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: currentFile.title, MPMediaItemPropertyTitle, @(currentFile.duration.intValue / 1000.), MPMediaItemPropertyPlaybackDuration, @(_mediaPlayer.time.intValue / 1000.), MPNowPlayingInfoPropertyElapsedPlaybackTime, @(_mediaPlayer.rate), MPNowPlayingInfoPropertyPlaybackRate, nil];
+    if ([currentFile isAlbumTrack] && !passcodeLockEnabled) {
         MLAlbumTrack *track = currentFile.albumTrack;
         if (track.artist.length > 0)
             [currentlyPlayingTrackInfo setObject:track.artist forKey:MPMediaItemPropertyArtist];