From 9f0b7304b4dd42bbe31504261098fb336fd9a017 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 5 Jul 2018 13:28:53 -0400 Subject: [PATCH 1/4] Clear iOS Keychain data on first run (#1889) --- ios/Mattermost.xcodeproj/project.pbxproj | 1 - ios/Mattermost/AppDelegate.m | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ios/Mattermost.xcodeproj/project.pbxproj b/ios/Mattermost.xcodeproj/project.pbxproj index 53bd33aaa..ea6f08a1d 100644 --- a/ios/Mattermost.xcodeproj/project.pbxproj +++ b/ios/Mattermost.xcodeproj/project.pbxproj @@ -85,7 +85,6 @@ 7FF7BE6E1FDEE5E8005E55FE /* MattermostBucket.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FF7BE6C1FDEE5E8005E55FE /* MattermostBucket.m */; }; 7FF7BE6F1FDF3CE4005E55FE /* libRNVectorIcons.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FDF290C1E1F4B4E00DBBE56 /* libRNVectorIcons.a */; }; 7FF7BE701FDF3EE7005E55FE /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 2DCFD31D3F4A4154822AB532 /* Ionicons.ttf */; }; - 7FF7BE711FE004A3005E55FE /* libRNDeviceInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 37DD11281E79EBE1004111BA /* libRNDeviceInfo.a */; }; 7FFDB3191FE3566C009E3BCF /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 005346E5C0E542BFABAE1411 /* FontAwesome.ttf */; }; 7FFE329E1FD9CB650038C7A0 /* ShareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FFE329D1FD9CB650038C7A0 /* ShareViewController.m */; }; 7FFE32A11FD9CB650038C7A0 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7FFE329F1FD9CB650038C7A0 /* MainInterface.storyboard */; }; diff --git a/ios/Mattermost/AppDelegate.m b/ios/Mattermost/AppDelegate.m index 7b179e960..8d929e9e1 100644 --- a/ios/Mattermost/AppDelegate.m +++ b/ios/Mattermost/AppDelegate.m @@ -24,6 +24,23 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Clear keychain on first run in case of reinstallation + if (![[NSUserDefaults standardUserDefaults] objectForKey:@"FirstRun"]) { + + NSString *service = [[NSBundle mainBundle] bundleIdentifier]; + NSDictionary *query = @{ + (__bridge NSString *)kSecClass: (__bridge id)(kSecClassGenericPassword), + (__bridge NSString *)kSecAttrService: service, + (__bridge NSString *)kSecReturnAttributes: (__bridge id)kCFBooleanTrue, + (__bridge NSString *)kSecReturnData: (__bridge id)kCFBooleanFalse + }; + + SecItemDelete((__bridge CFDictionaryRef) query); + + [[NSUserDefaults standardUserDefaults] setValue:@YES forKey:@"FirstRun"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + } + NSURL *jsCodeLocation; jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; From 5bf248d5c44ab5b19d4318e7bae521e7f4b7f59c Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 5 Jul 2018 15:02:34 -0400 Subject: [PATCH 2/4] Fix getting the youtube video id (#1890) * Fix getting the youtube video id regardless where the id is defined in the link * feedback review * Simplify and add unit tests for getYouTubeVideoId --- NOTICE.txt | 34 ---------- .../post_body_additional_content.js | 67 +++++++++---------- app/utils/url.js | 22 ++++++ app/utils/url.test.js | 19 ++++++ package-lock.json | 5 -- package.json | 3 +- 6 files changed, 75 insertions(+), 75 deletions(-) diff --git a/NOTICE.txt b/NOTICE.txt index 3aca8daed..d2f130d1f 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1428,40 +1428,6 @@ SOFTWARE. --- -## youtube-video-id - -This product contains 'youtube-video-id', Extracts the YouTube video ID from a url or string. - -* HOMEPAGE: - * https://github.com/remarkablemark/youtube-video-id - -* LICENSE: - -MIT License - -Copyright (c) 2016 Menglin "Mark" Xu - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ---- - ## react-native-video This product contains 'react-native-video', A