Skip to content

Commit

Permalink
Merge pull request #1163 from meganz/release/v3.4.1
Browse files Browse the repository at this point in the history
Release v3.4.1
  • Loading branch information
sergiohs84 authored Oct 2, 2018
2 parents f1f8297 + 205be4b commit f6d80c9
Show file tree
Hide file tree
Showing 79 changed files with 5,628 additions and 1,246 deletions.
5 changes: 2 additions & 3 deletions Makefile.win32
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
# In order to build megacli application, additional libraries are required:
# \FreeImage compiled FreeImage library, http://freeimage.sourceforge.net/
# \readline compiled The GNU Readline Library, http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html
# \termcap compiled The Termcap Library, http://ftp.gnu.org/gnu/termcap/
#
# To compile Mega DLL and all applications:
# make -f Makefile.win32 all
Expand All @@ -56,7 +55,7 @@ MEGACLI_CXXFLAGS=-isystem ../FreeImage/Dist
# common linked libraries for all apps
LIB=-lwinhttp -lws2_32 -lcrypt32 -lole32 -lwinmm -lshlwapi -L../zlib -lz -L../cryptopp -lcryptopp -L../sodium/src/libsodium/.libs -lsodium -L../db/build_windows -L../ -L../FreeImage/Dist -lfreeimage
# megacli specific linked libraries
MEGACLI_LIB=-L../FreeImage/Dist -lfreeimage -L../readline -lreadline -L../termcap -ltermcap
MEGACLI_LIB=-L../FreeImage/Dist -lfreeimage -L../readline -lreadline

LDFLAGS=

Expand Down Expand Up @@ -98,7 +97,7 @@ COMMON_SRC=\
src/win32/fs.cpp src/win32/console.cpp src/win32/net.cpp src/win32/waiter.cpp src/win32/consolewaiter.cpp \
src/db/sqlite.cpp \
src/mega_utf8proc.cpp \
src/mega_ccronexpr.cpp
src/mega_ccronexpr.cpp \
src/mega_evt_tls.cpp

MEGACLI_SRC=examples/megacli.cpp
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ Debian and RedHat derivatives, respectively):
* pthread

Optional dependency:
* Libraw (`libraw-dev`, `libraw-devel`)
* Sodium (`libsodium-dev`, `libsodium-devel`), configure `--with-sodium`
* MediaInfoLib (optional, see third_party/README_MediaInfo.txt)

Expand Down
4 changes: 2 additions & 2 deletions bindings/ios/3rdparty/build-libuv.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

UV_VERSION="1.19.2"
UV_VERSION="1.23.0"
SDKVERSION=`xcrun -sdk iphoneos --show-sdk-version`

##############################################
Expand Down Expand Up @@ -86,7 +86,7 @@ mkdir lib || true
lipo -create ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}-i386.sdk/libuv.a ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}-x86_64.sdk/libuv.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7.sdk/libuv.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7s.sdk/libuv.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-arm64.sdk/libuv.a -output ${CURRENTPATH}/lib/libuv.a

mkdir -p include || true
cp -f libuv-v${UV_VERSION}/include/*.h include/
cp -f -R libuv-v${UV_VERSION}/include/ include/

rm -rf bin
rm -rf libuv-v${UV_VERSION}
Expand Down
20 changes: 20 additions & 0 deletions bindings/ios/MEGANode.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,26 @@ typedef NS_ENUM(NSUInteger, MEGANodeChangeType) {
*/
@property (readonly, nonatomic) NSInteger duration;

/**
* @brief Width of the node for video files, in pixels. -1 if not set.
*/
@property (readonly, nonatomic) NSInteger width;

/**
* @brief Height of the node for video files, in pixels. -1 if not set.
*/
@property (readonly, nonatomic) NSInteger height;

/**
* @brief ShortCode of the node for video files. -1 if not set.
*/
@property (readonly, nonatomic) NSInteger shortFormat;

/**
* @brief VideoCodecId of the node for video files. -1 if not set.
*/
@property (readonly, nonatomic) NSInteger videoCodecId;

/**
* @brief Attribute of the node representing the latitude coordinate in its decimal
* degree notation, or nil if this attribute is not set.
Expand Down
16 changes: 16 additions & 0 deletions bindings/ios/MEGANode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,22 @@ - (NSInteger)duration {
return self.megaNode ? self.megaNode->getDuration() : -1;
}

- (NSInteger)width {
return self.megaNode ? self.megaNode->getWidth() : -1;
}

- (NSInteger)height {
return self.megaNode ? self.megaNode->getHeight(): -1;
}

- (NSInteger)shortFormat {
return self.megaNode ? self.megaNode->getShortformat() : -1;
}

- (NSInteger)videoCodecId {
return self.megaNode ? self.megaNode->getVideocodecid(): -1;
}

- (NSNumber *)latitude {
if (!self.megaNode) return nil;
double latitude = self.megaNode->getLatitude();
Expand Down
3 changes: 0 additions & 3 deletions bindings/ios/MEGARequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ typedef NS_ENUM (NSInteger, MEGANodeAccessLevel) {
*
* This value is valid for these requests:
* - [MEGASdk createAccountWithEmail:password:name:] - Returns the name of the user
* - [MEGASdk fastCreateAccountWithEmail:password:name:] - Returns the name of the user
* - [MEGASdk createFolderWithName:parent:] - Returns the name of the new folder
* - [MEGASdk renameNode:newName:] - Returns the new name for the node
*
Expand All @@ -263,7 +262,6 @@ typedef NS_ENUM (NSInteger, MEGANodeAccessLevel) {
* - [MEGASdk fastLoginWithEmail:password:] - Returns the email of the account
* - [MEGASdk loginToFolderLink:] - Returns the string "FOLDER"
* - [MEGASdk createAccountWithEmail:password:name:] - Returns the name of the user
* - [MEGASdk fastCreateAccountWithEmail:password:name] - Returns the name of the user
* - [MEGASdk shareNode:withUser:level:] - Returns the handle of the folder to share
* - [MEGASdk getAvatarUser:destinationFilePath:] - Returns the email of the user to get the avatar
* - [MEGASdk removeContactWithEmail:] - Returns the email of the contact
Expand Down Expand Up @@ -305,7 +303,6 @@ typedef NS_ENUM (NSInteger, MEGANodeAccessLevel) {
*
* This value is valid for these requests:
* - [MEGASdk fastLoginWithEmail:password:] - Returns the base64pwKey parameter
* - [MEGASdk fastCreateAccountWithEmail:password:name] - Returns the base64pwKey parameter
* - [MEGASdk fastConfirmAccountWithLink:base64pwkey:] - Returns the base64pwKey parameter
*
*/
Expand Down
4 changes: 2 additions & 2 deletions bindings/ios/MEGASDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"3rdparty/include/**",
3rdparty/include,
../../third_party/utf8proc,
3rdparty/webrtc/third_party/boringssl/src/include,
);
Expand All @@ -930,7 +930,7 @@
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"3rdparty/include/**",
3rdparty/include,
../../third_party/utf8proc,
3rdparty/webrtc/third_party/boringssl/src/include,
);
Expand Down
128 changes: 70 additions & 58 deletions bindings/ios/MEGASdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -448,19 +448,6 @@ typedef NS_ENUM(NSInteger, KeepMeAlive) {

#pragma mark - Utils

/**
* @brief Generates a private key based on the access password.
*
* This is a time consuming operation (specially for low-end mobile devices). Since the resulting key is
* required to log in, this function allows to do this step in a separate function. You should run this function
* in a background thread, to prevent UI hangs. The resulting key can be used in
* [MEGASdk fastLoginWithEmail:stringHash:base64pwKey:].
*
* @param password Access password.
* @return Base64-encoded private key
*/
- (NSString *)base64pwkeyForPassword:(NSString *)password;

/**
* @brief Generates a hash based in the provided private key and email.
*
Expand All @@ -469,11 +456,13 @@ typedef NS_ENUM(NSInteger, KeepMeAlive) {
* in a background thread, to prevent UI hangs. The resulting key can be used in
* [MEGASdk fastLoginWithEmail:stringHash:base64pwKey:].
*
* @param base64pwkey Private key returned by [MEGASdk base64PwKeybase64pwkeyForPassword:]
* @param base64pwkey Private key returned by [MEGARequest privateKey] in the onRequestFinish callback of createAccount
* @param email Email to create the hash
* @return Base64-encoded hash
* @deprecated This function is only useful for old accounts. Once enabled the new registration logic,
* this function will return an empty string for new accounts and will be removed few time after.
*/
- (NSString *)hashForBase64pwkey:(NSString *)base64pwkey email:(NSString *)email;
- (NSString *)hashForBase64pwkey:(NSString *)base64pwkey email:(NSString *)email __attribute__((deprecated("This function will return an empty string for new accounts and will be removed few time after")));

/**
* @brief Converts a Base64-encoded node handle to a MegaHandle.
Expand Down Expand Up @@ -535,6 +524,16 @@ typedef NS_ENUM(NSInteger, KeepMeAlive) {

#pragma mark - Login Requests

/**
* @brief Check if multi-factor authentication can be enabled for the current account.
*
* It's needed to be logged into an account and with the nodes loaded (login + fetchNodes) before
* using this function. Otherwise it will always return false.
*
* @return YES if multi-factor authentication can be enabled for the current account, otherwise false.
*/
- (BOOL)multiFactorAuthAvailable;

/**
* @brief Check if multi-factor authentication is enabled for an account
*
Expand Down Expand Up @@ -1155,45 +1154,6 @@ typedef NS_ENUM(NSInteger, KeepMeAlive) {
*/
- (void)resumeCreateAccountWithSessionId:(NSString *)sessionId;

/**
* @brief Initialize the creation of a new MEGA account with precomputed keys
*
* The associated request type with this request is MEGARequestTypeCreateAccount.
* Valid data in the MEGARequest object received on callbacks:
* - [MEGARequest email] - Returns the email for the account
* - [MEGARequest privateKey] - Returns the private key calculated with [MEGASdk base64pwkeyForPassword:]
* - [MEGARequest name] - Returns the name of the user
*
* If this request succeed, a confirmation email will be sent to the users.
* If an account with the same email already exists, you will get the error code
* MEGAErrorTypeApiEExist in onRequestFinish
*
* @param email Email for the account.
* @param base64pwkey Private key calculated with [MEGASdk base64pwkeyForPassword:].
* @param name Name of the user.
* @param delegate Delegate to track this request.
*/
- (void)fastCreateAccountWithEmail:(NSString *)email base64pwkey:(NSString *)base64pwkey name:(NSString *)name delegate:(id<MEGARequestDelegate>)delegate;

/**
* @brief Initialize the creation of a new MEGA account with precomputed keys.
*
* The associated request type with this request is MEGARequestTypeCreateAccount.
* Valid data in the MEGARequest object received on callbacks:
* - [MEGARequest email] - Returns the email for the account
* - [MEGARequest privateKey] - Returns the private key calculated with [MEGASdk base64pwkeyForPassword:]
* - [MEGARequest name] - Returns the name of the user
*
* If this request succeed, a confirmation email will be sent to the users.
* If an account with the same email already exists, you will get the error code
* MEGAErrorTypeApiEExist in onRequestFinish.
*
* @param email Email for the account.
* @param base64pwkey Private key calculated with [MEGASdk base64pwkeyForPassword:].
* @param name Name of the user.
*/
- (void)fastCreateAccountWithEmail:(NSString *)email base64pwkey:(NSString *)base64pwkey name:(NSString *)name;

/**
* @brief Sends the confirmation email for a new account
*
Expand Down Expand Up @@ -1227,7 +1187,7 @@ typedef NS_ENUM(NSInteger, KeepMeAlive) {
*
* @param email Email for the account
* @param name Firstname of the user
* @param base64pwkey Private key calculated with [MEGASdk base64pwkeyForPassword:]
* @param base64pwkeyPrivate key returned by [MEGARequest privateKey] in the onRequestFinish callback of createAccount
* @param delegate MEGARequestDelegate to track this request
*/
- (void)fastSendSignupLinkWithEmail:(NSString *)email base64pwkey:(NSString *)base64pwkey name:(NSString *)name delegate:(id<MEGARequestDelegate>)delegate;
Expand All @@ -1240,7 +1200,7 @@ typedef NS_ENUM(NSInteger, KeepMeAlive) {
*
* @param email Email for the account
* @param name Firstname of the user
* @param base64pwkey Private key calculated with [MEGASdk base64pwkeyForPassword:]
* @param base64pwkeyPrivate key returned by [MEGARequest privateKey] in the onRequestFinish callback of createAccount
*/
- (void)fastSendSignupLinkWithEmail:(NSString *)email base64pwkey:(NSString *)base64pwkey name:(NSString *)name;

Expand Down Expand Up @@ -1330,8 +1290,10 @@ typedef NS_ENUM(NSInteger, KeepMeAlive) {
* @param link Confirmation link.
* @param base64pwkey Private key precomputed with [MEGASdk base64pwkeyForPassword:].
* @param delegate Delegate to track this request.
* @deprecated This function only works using the old registration method and will be removed soon.
* Please use [MEGASdk confirmAccountWithLink:password:delegate] instead.
*/
- (void)fastConfirmAccountWithLink:(NSString *)link base64pwkey:(NSString *)base64pwkey delegate:(id<MEGARequestDelegate>)delegate;
- (void)fastConfirmAccountWithLink:(NSString *)link base64pwkey:(NSString *)base64pwkey delegate:(id<MEGARequestDelegate>)delegate __attribute__((deprecated("This function only works using the old registration method and will be removed soon.")));

/**
* @brief Confirm a MEGA account using a confirmation link and a precomputed key.
Expand All @@ -1348,8 +1310,10 @@ typedef NS_ENUM(NSInteger, KeepMeAlive) {
*
* @param link Confirmation link.
* @param base64pwkey Private key precomputed with [MEGASdk base64pwkeyForPassword:].
* @deprecated This function only works using the old registration method and will be removed soon.
* Please use [MEGASdk confirmAccountWithLink:password] instead.
*/
- (void)fastConfirmAccountWithLink:(NSString *)link base64pwkey:(NSString *)base64pwkey;
- (void)fastConfirmAccountWithLink:(NSString *)link base64pwkey:(NSString *)base64pwkey __attribute__((deprecated("This function only works using the old registration method and will be removed soon.")));

/**
* @brief Initialize the reset of the existing password, with and without the Master Key.
Expand Down Expand Up @@ -1531,6 +1495,8 @@ typedef NS_ENUM(NSInteger, KeepMeAlive) {
/**
* @brief Effectively parks the user's account without creating a new fresh account.
*
* If no user is logged in, you will get the error code MEGAErrorTypeApiEAccess in onRequestFinish.
*
* The contents of the account will then be purged after 60 days. Once the account is
* parked, the user needs to contact MEGA support to restore the account.
*
Expand All @@ -1552,6 +1518,8 @@ typedef NS_ENUM(NSInteger, KeepMeAlive) {
/**
* @brief Effectively parks the user's account without creating a new fresh account.
*
* If no user is logged in, you will get the error code MEGAErrorTypeApiEAccess in onRequestFinish.
*
* The contents of the account will then be purged after 60 days. Once the account is
* parked, the user needs to contact MEGA support to restore the account.
*
Expand Down Expand Up @@ -1636,6 +1604,8 @@ typedef NS_ENUM(NSInteger, KeepMeAlive) {
/**
* @brief Effectively changes the email address associated to the account.
*
* If no user is logged in, you will get the error code MEGAErrorTypeApiEAccess in onRequestFinish.
*
* The associated request type with this request is MEGARequestTypeConfirmChangeEmailLink.
* Valid data in the MEGARequest object received on all callbacks:
* - [MEGARequest link] - Returns the recovery link
Expand All @@ -1654,6 +1624,8 @@ typedef NS_ENUM(NSInteger, KeepMeAlive) {
/**
* @brief Effectively changes the email address associated to the account.
*
* If no user is logged in, you will get the error code MEGAErrorTypeApiEAccess in onRequestFinish.
*
* The associated request type with this request is MEGARequestTypeConfirmChangeEmailLink.
* Valid data in the MEGARequest object received on all callbacks:
* - [MEGARequest link] - Returns the recovery link
Expand Down Expand Up @@ -3363,6 +3335,41 @@ typedef NS_ENUM(NSInteger, KeepMeAlive) {
*/
- (void)shouldShowPasswordReminderDialogAtLogout:(BOOL)atLogout;

/**
* @brief Check if the master key has been exported
*
* The associated request type with this request is MEGARequestTypeGetAttrUser
* Valid data in the MEGARequest object received on callbacks:
* - [MEGARequest paramType] - Returns the attribute type MEGAUserAttributePwdReminder
*
* Valid data in the MEGARequest object received in onRequestFinish when the error code
* is MEGAErrorTypeApiOk:
* - [MEGARequest access] - Returns true if the master key has been exported
*
* If the corresponding user attribute is not set yet, the request will fail with the
* error code MEGAErrorTypeApiENoent.
*
* @param delegate MEGARequestDelegate to track this request
*/
- (void)isMasterKeyExportedWithDelegate:(id<MEGARequestDelegate>)delegate;

/**
* @brief Check if the master key has been exported
*
* The associated request type with this request is MEGARequestTypeGetAttrUser
* Valid data in the MEGARequest object received on callbacks:
* - [MEGARequest paramType] - Returns the attribute type MEGAUserAttributePwdReminder
*
* Valid data in the MEGARequest object received in onRequestFinish when the error code
* is MEGAErrorTypeApiOk:
* - [MEGARequest access] - Returns true if the master key has been exported
*
* If the corresponding user attribute is not set yet, the request will fail with the
* error code MEGAErrorTypeApiENoent.
*
*/
- (void)isMasterKeyExported;

/**
* @brief Enable or disable the generation of rich previews
*
Expand Down Expand Up @@ -4808,6 +4815,9 @@ typedef NS_ENUM(NSInteger, KeepMeAlive) {
*/
- (NSString *)fingerprintForFilePath:(NSString *)filePath;

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

/**
* @brief Get a Base64-encoded fingerprint from an ALAssetRepresentation and a modification time
*
Expand All @@ -4819,6 +4829,8 @@ typedef NS_ENUM(NSInteger, KeepMeAlive) {
*/
- (NSString *)fingerprintForAssetRepresentation:(ALAssetRepresentation *)assetRepresentation modificationTime:(NSDate *)modificationTime;

#pragma clang diagnostic pop

/**
* @brief Get a Base64-encoded fingerprint from a NSData and a modification time
*
Expand Down
Loading

0 comments on commit f6d80c9

Please sign in to comment.