Commit 63e4267a authored by David's avatar David
Browse files

passcode: Only convert passcode from old setting to keychain once

Previously, the old passcode was read and set even in case the
user disabled passcode (with the new version of the app).

close #15870
parent 4445132e
......@@ -79,11 +79,16 @@ NSString *const VLCPasscode = @"org.videolan.vlc-ios.passcode";
NSString *passcode = [SSKeychain passwordForService:VLCPasscode account:VLCPasscode];
if (!passcode) {
/* legacy passcode retrieval */
/* legacy passcode conversion to keychain - only do that once */
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
passcode = [defaults objectForKey:kVLCSettingPasscodeKey];
if (passcode)
if (passcode && passcode.length > 0) {
APLog(@"Move passcode from setting to keychain");
[self setPasscode:passcode];
// delete passcode from old setting
[defaults setObject:nil forKey:kVLCSettingPasscodeKey];
[defaults synchronize];
return passcode;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment