Skip to content

Commit 9f73c5c

Browse files
committed
Merge branch 'release/3.6'
2 parents 74101d8 + 9a676c7 commit 9f73c5c

File tree

121 files changed

+4852
-2469
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+4852
-2469
lines changed

MEGA.entitlements

+8
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,13 @@
1818
</array>
1919
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
2020
<string>$(TeamIdentifierPrefix)$(CFBundleIdentifier)</string>
21+
<key>com.apple.security.application-groups</key>
22+
<array>
23+
<string>group.mega.ios</string>
24+
</array>
25+
<key>keychain-access-groups</key>
26+
<array>
27+
<string>$(AppIdentifierPrefix)group.mega.ios</string>
28+
</array>
2129
</dict>
2230
</plist>

MEGA.xcodeproj/project.pbxproj

+699-4
Large diffs are not rendered by default.

iMEGA.xcworkspace/xcshareddata/iMEGA.xcscmblueprint

+30-16
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
"9E1ECC80773D1F4F22D03CB4DEA298B3CB57FAF5" : 9223372036854775807,
1010
"7070BA961BCA286ED2393408B1E3D78393C99B33" : 9223372036854775807,
1111
"08C1DA4DCD3A676FACD29A3E823E30C353DAC834" : 9223372036854775807,
12+
"90530B99EB0008E7A50951FDFBE02169118FA649" : 9223372036854775807,
13+
"B581AC17A2775FC6A45FCBAAF61C20743E649A6A" : 9223372036854775807,
1214
"3E02169055262138F7D692446C25677927AC13EE" : 9223372036854775807,
1315
"C16576B571172538D95183F9515DC5DB064EAF7F" : 9223372036854775807,
1416
"2ACD55DC2C09557CD027EC23DA3FA73537703B13" : 9223372036854775807,
@@ -23,22 +25,24 @@
2325
},
2426
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "90D22726-558B-45A2-90EE-F171BACF478D",
2527
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
26-
"E762C42BC8C71A1AD1A00E2FC726C42A9BF54268" : "ios3\/iMEGA\/Vendor\/CTAssetsPickerController\/",
27-
"9F9B14DA276794D9192F387F0CC62561009373D0" : "ios3\/iMEGA\/Vendor\/MWPhotoBrowser\/",
28-
"9E1ECC80773D1F4F22D03CB4DEA298B3CB57FAF5" : "ios3\/iMEGA\/Vendor\/SVProgressHUD\/",
29-
"7070BA961BCA286ED2393408B1E3D78393C99B33" : "ios3\/iMEGA\/Vendor\/Reachability\/",
30-
"08C1DA4DCD3A676FACD29A3E823E30C353DAC834" : "ios3\/iMEGA\/Vendor\/AMLocalizedString\/",
31-
"3E02169055262138F7D692446C25677927AC13EE" : "ios3\/iMEGA\/Vendor\/LTHPasscodeViewController\/",
32-
"C16576B571172538D95183F9515DC5DB064EAF7F" : "ios3\/iMEGA\/Vendor\/SAMKeychain\/",
33-
"2ACD55DC2C09557CD027EC23DA3FA73537703B13" : "ios3\/iMEGA\/Vendor\/PieChartView\/",
34-
"E6248D77DBBC6B1D6F6059D14C6A0B9ED1677585" : "ios3\/iMEGA\/Vendor\/PureLayout\/",
35-
"BDFA195447E23E7077125556D5DE624222871CE5" : "ios3\/iMEGA\/Vendor\/UIBarButtonItem-Badge\/",
36-
"F8622BA04EBD09F8BA8DC9C0C199149407552BFA" : "ios3\/iMEGA\/Vendor\/DateTools\/",
37-
"00DEE37500E6C7998F4D113C875F3996AE26D5BE" : "ios3\/iMEGA\/Vendor\/SVWebViewController\/",
38-
"DD091C5D03D23C2F1EC054BC9C018DF9A9125FD6" : "ios3\/iMEGA\/Vendor\/DZNEmptyDataSet\/",
39-
"2AADEAED908340583C88E195E0B330D50D5EFB2E" : "ios3\/iMEGA\/Vendor\/SDK\/",
40-
"FFD45562D681BCF3154B3744FD74B029E1BBF63E" : "ios3\/iMEGA\/Vendor\/GKContactImage\/",
41-
"B29DB52C58D4DBF94A2D8B6DF807BA0284E98CA5" : "ios3\/"
28+
"E762C42BC8C71A1AD1A00E2FC726C42A9BF54268" : "iOS_dev\/iMEGA\/Vendor\/CTAssetsPickerController\/",
29+
"9F9B14DA276794D9192F387F0CC62561009373D0" : "iOS_dev\/iMEGA\/Vendor\/MWPhotoBrowser\/",
30+
"9E1ECC80773D1F4F22D03CB4DEA298B3CB57FAF5" : "iOS_dev\/iMEGA\/Vendor\/SVProgressHUD\/",
31+
"7070BA961BCA286ED2393408B1E3D78393C99B33" : "iOS_dev\/iMEGA\/Vendor\/Reachability\/",
32+
"08C1DA4DCD3A676FACD29A3E823E30C353DAC834" : "iOS_dev\/iMEGA\/Vendor\/AMLocalizedString\/",
33+
"90530B99EB0008E7A50951FDFBE02169118FA649" : "iOS_dev\/iMEGA\/Vendor\/JSQMessagesViewController\/",
34+
"B581AC17A2775FC6A45FCBAAF61C20743E649A6A" : "iOS_dev\/iMEGA\/Vendor\/Karere\/",
35+
"3E02169055262138F7D692446C25677927AC13EE" : "iOS_dev\/iMEGA\/Vendor\/LTHPasscodeViewController\/",
36+
"C16576B571172538D95183F9515DC5DB064EAF7F" : "iOS_dev\/iMEGA\/Vendor\/SAMKeychain\/",
37+
"2ACD55DC2C09557CD027EC23DA3FA73537703B13" : "iOS_dev\/iMEGA\/Vendor\/PieChartView\/",
38+
"E6248D77DBBC6B1D6F6059D14C6A0B9ED1677585" : "iOS_dev\/iMEGA\/Vendor\/PureLayout\/",
39+
"BDFA195447E23E7077125556D5DE624222871CE5" : "iOS_dev\/iMEGA\/Vendor\/UIBarButtonItem-Badge\/",
40+
"F8622BA04EBD09F8BA8DC9C0C199149407552BFA" : "iOS_dev\/iMEGA\/Vendor\/DateTools\/",
41+
"00DEE37500E6C7998F4D113C875F3996AE26D5BE" : "iOS_dev\/iMEGA\/Vendor\/SVWebViewController\/",
42+
"DD091C5D03D23C2F1EC054BC9C018DF9A9125FD6" : "iOS_dev\/iMEGA\/Vendor\/DZNEmptyDataSet\/",
43+
"2AADEAED908340583C88E195E0B330D50D5EFB2E" : "iOS_dev\/iMEGA\/Vendor\/SDK\/",
44+
"FFD45562D681BCF3154B3744FD74B029E1BBF63E" : "iOS_dev\/iMEGA\/Vendor\/GKContactImage\/",
45+
"B29DB52C58D4DBF94A2D8B6DF807BA0284E98CA5" : "iOS_dev\/"
4246
},
4347
"DVTSourceControlWorkspaceBlueprintNameKey" : "iMEGA",
4448
"DVTSourceControlWorkspaceBlueprintVersion" : 204,
@@ -74,6 +78,11 @@
7478
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
7579
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "7070BA961BCA286ED2393408B1E3D78393C99B33"
7680
},
81+
{
82+
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/meganz\/JSQMessagesViewController.git",
83+
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
84+
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "90530B99EB0008E7A50951FDFBE02169118FA649"
85+
},
7786
{
7887
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/SVProgressHUD\/SVProgressHUD.git",
7988
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
@@ -89,6 +98,11 @@
8998
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
9099
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "B29DB52C58D4DBF94A2D8B6DF807BA0284E98CA5"
91100
},
101+
{
102+
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/code.developers.mega.co.nz\/messenger\/karere-native.git",
103+
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
104+
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "B581AC17A2775FC6A45FCBAAF61C20743E649A6A"
105+
},
92106
{
93107
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/meganz\/UIBarButtonItem-Badge.git",
94108
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
#import <Foundation/Foundation.h>
3+
4+
@interface MEGABaseRequestDelegate : NSObject <MEGARequestDelegate>
5+
6+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
#import "MEGABaseRequestDelegate.h"
3+
4+
@implementation MEGABaseRequestDelegate
5+
6+
- (void)onRequestStart:(MEGASdk *)api request:(MEGARequest *)request {
7+
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
8+
}
9+
10+
- (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEGAError *)error {
11+
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
12+
}
13+
14+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
#import "MEGABaseRequestDelegate.h"
3+
4+
@interface MEGACreateAccountRequestDelegate : MEGABaseRequestDelegate
5+
6+
- (instancetype)initWithCompletion:(void (^)(MEGAError *error))completion;
7+
8+
@property (nonatomic) BOOL resumeCreateAccount;
9+
10+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
2+
#import "MEGACreateAccountRequestDelegate.h"
3+
#import "MEGALoginRequestDelegate.h"
4+
5+
#import "SAMKeychain.h"
6+
7+
@interface MEGACreateAccountRequestDelegate ()
8+
9+
@property (nonatomic, copy) void (^completion)(MEGAError *error);
10+
11+
@end
12+
13+
@implementation MEGACreateAccountRequestDelegate
14+
15+
- (instancetype)initWithCompletion:(void (^)(MEGAError *error))completion {
16+
self = [super init];
17+
if (self) {
18+
_completion = completion;
19+
}
20+
return self;
21+
}
22+
23+
24+
#pragma mark - MEGARequestDelegate
25+
26+
- (void)onRequestStart:(MEGASdk *)api request:(MEGARequest *)request {
27+
[super onRequestStart:api request:request];
28+
}
29+
30+
- (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEGAError *)error {
31+
[super onRequestFinish:api request:request error:error];
32+
33+
if (error.type) {
34+
NSString *message;
35+
36+
switch (error.type) {
37+
case MEGAErrorTypeApiEExist:
38+
message = AMLocalizedString(@"emailAlreadyRegistered", @"Error text shown when the users tries to create an account with an email already in use");
39+
break;
40+
41+
case MEGAErrorTypeApiEArgs:
42+
message = AMLocalizedString(@"accountAlreadyConfirmed", @"Message shown when the user clicks on a confirm account link that has already been used");
43+
break;
44+
45+
default:
46+
message = [NSString stringWithFormat:@"%@ %@", request.requestString, error.name];;
47+
break;
48+
}
49+
50+
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:AMLocalizedString(@"error", nil) message:message preferredStyle:UIAlertControllerStyleAlert];
51+
[alertController addAction:[UIAlertAction actionWithTitle:AMLocalizedString(@"ok", nil) style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
52+
}]];
53+
54+
[[UIApplication sharedApplication].delegate.window.rootViewController presentViewController:alertController animated:YES completion:nil];
55+
56+
if (self.resumeCreateAccount) {
57+
MEGALoginRequestDelegate *loginRequestDelegate = [[MEGALoginRequestDelegate alloc] init];
58+
loginRequestDelegate.confirmAccountInOtherClient = YES;
59+
NSString *email = [SAMKeychain passwordForService:@"MEGA" account:@"email"];
60+
NSString *base64pwkey = [SAMKeychain passwordForService:@"MEGA" account:@"base64pwkey"];
61+
NSString *stringHash = [api hashForBase64pwkey:base64pwkey email:email];
62+
[api fastLoginWithEmail:email stringHash:stringHash base64pwKey:base64pwkey delegate:loginRequestDelegate];
63+
}
64+
65+
} else {
66+
[SAMKeychain setPassword:request.sessionKey forService:@"MEGA" account:@"sessionId"];
67+
[SAMKeychain setPassword:request.email forService:@"MEGA" account:@"email"];
68+
[SAMKeychain setPassword:request.name forService:@"MEGA" account:@"name"];
69+
NSString *base64pwkey = [api base64pwkeyForPassword:request.password];
70+
[SAMKeychain setPassword:base64pwkey forService:@"MEGA" account:@"base64pwkey"];
71+
}
72+
73+
if (self.completion) {
74+
self.completion(error);
75+
}
76+
}
77+
78+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
#import "MEGABaseRequestDelegate.h"
3+
4+
@interface MEGAInviteContactRequestDelegate : MEGABaseRequestDelegate
5+
6+
- (instancetype)initWithNumberOfRequests:(NSUInteger)numberOfRequests;
7+
8+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
2+
#import "MEGAInviteContactRequestDelegate.h"
3+
4+
#import "SVProgressHUD.h"
5+
6+
@interface MEGAInviteContactRequestDelegate ()
7+
8+
@property (nonatomic) NSUInteger numberOfRequests;
9+
@property (nonatomic) NSUInteger totalRequests;
10+
11+
@end
12+
13+
@implementation MEGAInviteContactRequestDelegate
14+
15+
#pragma mark - Initialization
16+
17+
- (instancetype)initWithNumberOfRequests:(NSUInteger)numberOfRequests {
18+
self = [super init];
19+
if (self) {
20+
_numberOfRequests = numberOfRequests;
21+
_totalRequests = numberOfRequests;
22+
}
23+
24+
return self;
25+
}
26+
27+
#pragma mark - MEGARequestDelegate
28+
29+
- (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEGAError *)error {
30+
[super onRequestFinish:api request:request error:error];
31+
32+
self.numberOfRequests--;
33+
34+
if (error.type) {
35+
[SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
36+
switch (error.type) {
37+
case MEGAErrorTypeApiEArgs:
38+
if ([request.email isEqualToString:api.myEmail]) {
39+
[SVProgressHUD showErrorWithStatus:AMLocalizedString(@"noNeedToAddYourOwnEmailAddress", @"Add contacts and share dialog error message when user try to add your own email address")];
40+
}
41+
break;
42+
43+
case MEGAErrorTypeApiEExist: {
44+
[SVProgressHUD showErrorWithStatus:AMLocalizedString(@"alreadyHaveAContactWithThatEmailAddress", @"Add contacts and share dialog error message when user try to add already existing email address.")];
45+
break;
46+
}
47+
48+
default:
49+
[SVProgressHUD showErrorWithStatus:[NSString stringWithFormat:@"%@ %@", request.requestString, error.name]];
50+
break;
51+
}
52+
53+
return;
54+
}
55+
56+
if (self.numberOfRequests == 0) {
57+
[SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
58+
[SVProgressHUD dismiss];
59+
60+
NSString *alertTitle;
61+
if (self.totalRequests > 1) {
62+
alertTitle = AMLocalizedString(@"theUsersHaveBeenInvited", @"Success message shown when some contacts have been invited");
63+
} else {
64+
alertTitle = AMLocalizedString(@"theUserHasBeenInvited", @"Success message shown when a contact has been invited");
65+
alertTitle = [alertTitle stringByReplacingOccurrencesOfString:@"[X]" withString:request.email];
66+
}
67+
68+
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:alertTitle message:nil preferredStyle:UIAlertControllerStyleAlert];
69+
[alertController addAction:[UIAlertAction actionWithTitle:AMLocalizedString(@"ok", nil) style:UIAlertActionStyleCancel handler:nil]];
70+
[[UIApplication sharedApplication].delegate.window.rootViewController presentViewController:alertController animated:YES completion:nil];
71+
}
72+
}
73+
74+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
#import <Foundation/Foundation.h>
3+
4+
#import "MEGABaseRequestDelegate.h"
5+
6+
@interface MEGALoginRequestDelegate : MEGABaseRequestDelegate
7+
8+
@property (nonatomic) BOOL confirmAccountInOtherClient;
9+
10+
@end

0 commit comments

Comments
 (0)