Explorar el Código

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 hace 11 años
padre
commit
f620c55507
Se han modificado 2 ficheros con 11 adiciones y 2 borrados
  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];