瀏覽代碼

Remove legacy passcode conversation code and add missing return

(cherry picked from commit 7fcba87bd6d161ceed6b8540d82aed4ee9fb492a)
Felix Paul Kühne 9 年之前
父節點
當前提交
dd9197b83c
共有 4 個文件被更改,包括 3 次插入17 次删除
  1. 1 0
      NEWS
  2. 1 2
      Sources/VLCAppDelegate.m
  3. 0 1
      Sources/VLCConstants.h
  4. 1 14
      Sources/VLCKeychainCoordinator.m

+ 1 - 0
NEWS

@@ -3,6 +3,7 @@
 * Stability improvements
 * Improved HTTP connectivity
 * Improved UPnP reliability, notably with Twonky
+* Fixed issues unlocking the app when a passcode was never set
 
 2.7.1:
 ------

+ 1 - 2
Sources/VLCAppDelegate.m

@@ -61,8 +61,7 @@ NSString *const VLCDropboxSessionWasAuthorized = @"VLCDropboxSessionWasAuthorize
     else
         skipLoopFilterDefaultValue = kVLCSettingSkipLoopFilterNonRef;
 
-    NSDictionary *appDefaults = @{kVLCSettingPasscodeKey : @"",
-                                  kVLCSettingPasscodeAllowTouchID : @(1),
+    NSDictionary *appDefaults = @{kVLCSettingPasscodeAllowTouchID : @(1),
                                   kVLCSettingContinueAudioInBackgroundKey : @(YES),
                                   kVLCSettingStretchAudio : @(NO),
                                   kVLCSettingTextEncoding : kVLCSettingTextEncodingDefaultValue,

+ 0 - 1
Sources/VLCConstants.h

@@ -13,7 +13,6 @@
 
 #define kVLCVersionCodename @"All Along the Watchtower"
 
-#define kVLCSettingPasscodeKey @"Passcode"
 #define kVLCSettingPasscodeOnKey @"PasscodeProtection"
 #define kVLCSettingPasscodeAllowTouchID @"AllowTouchID"
 #define kVLCSettingContinueAudioInBackgroundKey @"BackgroundAudioPlayback"

+ 1 - 14
Sources/VLCKeychainCoordinator.m

@@ -77,20 +77,6 @@ NSString *const VLCPasscode = @"org.videolan.vlc-ios.passcode";
 - (NSString *)_obtainPasscode
 {
     NSString *passcode = [SSKeychain passwordForService:VLCPasscode account:VLCPasscode];
-
-    if (!passcode) {
-        /* legacy passcode conversion to keychain - only do that once */
-        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
-        passcode = [defaults objectForKey:kVLCSettingPasscodeKey];
-        if (passcode && passcode.length > 0) {
-            APLog(@"Move passcode from setting to keychain");
-            [self setPasscode:passcode];
-            // delete passcode from old setting
-            [defaults removeObjectForKey:kVLCSettingPasscodeKey];
-            [defaults synchronize];
-        }
-    }
-
     return passcode;
 }
 
@@ -117,6 +103,7 @@ NSString *const VLCPasscode = @"org.videolan.vlc-ios.passcode";
     NSString *passcode = [self _obtainPasscode];
     if (passcode == nil || [passcode isEqualToString:@""]) {
         [[NSNotificationCenter defaultCenter] postNotificationName:VLCPasscodeValidated object:self];
+        return;
     }
 
     _passcodeLockController = [[PAPasscodeViewController alloc] initForAction:PasscodeActionEnter];