Skip to content

Commit

Permalink
Merge pull request #723 from meganz/release/v3.1.7
Browse files Browse the repository at this point in the history
Release/v3.1.7
  • Loading branch information
sergiohs84 authored Jul 6, 2017
2 parents 64f93b1 + 168f65a commit 42043bd
Show file tree
Hide file tree
Showing 8 changed files with 162 additions and 92 deletions.
28 changes: 0 additions & 28 deletions bindings/ios/MEGASDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
414820921C523AA600552E76 /* libuv.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 414820911C523AA600552E76 /* libuv.a */; };
4148209A1C561CB500552E76 /* mega_http_parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 414820991C561CB500552E76 /* mega_http_parser.cpp */; };
418412731BA1A06600D94E72 /* MEGAInputStream.mm in Sources */ = {isa = PBXBuildFile; fileRef = 418412721BA1A06600D94E72 /* MEGAInputStream.mm */; };
41A990731A5D305700B2094A /* mega_utf8proc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41A990721A5D305700B2094A /* mega_utf8proc.cpp */; };
Expand All @@ -21,12 +20,6 @@
41D143DA1B5FC053000CA86F /* pendingcontactrequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41D143D91B5FC053000CA86F /* pendingcontactrequest.cpp */; };
41D98D011BD54B5200764370 /* MEGAContactRequest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 41D98D001BD54B5200764370 /* MEGAContactRequest.mm */; };
41D98D071BD562AD00764370 /* MEGAContactRequestList.mm in Sources */ = {isa = PBXBuildFile; fileRef = 41D98D061BD562AD00764370 /* MEGAContactRequestList.mm */; };
41E3FE961D6B10F2005ABE2B /* libsodium.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 41E3FE951D6B10F2005ABE2B /* libsodium.a */; };
940BEF9219ED9245007E7FA2 /* libcares.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 940BEF8D19ED9245007E7FA2 /* libcares.a */; };
940BEF9319ED9245007E7FA2 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 940BEF8E19ED9245007E7FA2 /* libcrypto.a */; };
940BEF9419ED9245007E7FA2 /* libcryptopp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 940BEF8F19ED9245007E7FA2 /* libcryptopp.a */; };
940BEF9519ED9245007E7FA2 /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 940BEF9019ED9245007E7FA2 /* libcurl.a */; };
940BEF9619ED9245007E7FA2 /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 940BEF9119ED9245007E7FA2 /* libssl.a */; };
940BEFB719ED92C2007E7FA2 /* attrmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 940BEF9819ED92C2007E7FA2 /* attrmap.cpp */; };
940BEFB819ED92C2007E7FA2 /* backofftimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 940BEF9919ED92C2007E7FA2 /* backofftimer.cpp */; };
940BEFB919ED92C2007E7FA2 /* base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 940BEF9A19ED92C2007E7FA2 /* base64.cpp */; };
Expand Down Expand Up @@ -98,7 +91,6 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
414820911C523AA600552E76 /* libuv.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libuv.a; path = 3rdparty/lib/libuv.a; sourceTree = "<group>"; };
414820951C523B2D00552E76 /* mega_http_parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mega_http_parser.h; sourceTree = "<group>"; };
414820961C523B2D00552E76 /* pendingcontactrequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pendingcontactrequest.h; sourceTree = "<group>"; };
414820991C561CB500552E76 /* mega_http_parser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mega_http_parser.cpp; path = ../../src/mega_http_parser.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -129,13 +121,7 @@
41D98D051BD562AD00764370 /* MEGAContactRequestList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MEGAContactRequestList.h; sourceTree = "<group>"; };
41D98D061BD562AD00764370 /* MEGAContactRequestList.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MEGAContactRequestList.mm; sourceTree = "<group>"; };
41D98D081BD5679C00764370 /* MEGAContactRequestList+init.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MEGAContactRequestList+init.h"; sourceTree = "<group>"; };
41E3FE951D6B10F2005ABE2B /* libsodium.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libsodium.a; path = 3rdparty/lib/libsodium.a; sourceTree = "<group>"; };
41F01E301C087D4C001E18E6 /* GfxProcCG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GfxProcCG.h; sourceTree = "<group>"; };
940BEF8D19ED9245007E7FA2 /* libcares.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcares.a; path = 3rdparty/lib/libcares.a; sourceTree = "<group>"; };
940BEF8E19ED9245007E7FA2 /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcrypto.a; path = 3rdparty/lib/libcrypto.a; sourceTree = "<group>"; };
940BEF8F19ED9245007E7FA2 /* libcryptopp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcryptopp.a; path = 3rdparty/lib/libcryptopp.a; sourceTree = "<group>"; };
940BEF9019ED9245007E7FA2 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = 3rdparty/lib/libcurl.a; sourceTree = "<group>"; };
940BEF9119ED9245007E7FA2 /* libssl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libssl.a; path = 3rdparty/lib/libssl.a; sourceTree = "<group>"; };
940BEF9819ED92C2007E7FA2 /* attrmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = attrmap.cpp; path = ../../src/attrmap.cpp; sourceTree = "<group>"; };
940BEF9919ED92C2007E7FA2 /* backofftimer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = backofftimer.cpp; path = ../../src/backofftimer.cpp; sourceTree = "<group>"; };
940BEF9A19ED92C2007E7FA2 /* base64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = base64.cpp; path = ../../src/base64.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -277,13 +263,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
41E3FE961D6B10F2005ABE2B /* libsodium.a in Frameworks */,
414820921C523AA600552E76 /* libuv.a in Frameworks */,
940BEF9219ED9245007E7FA2 /* libcares.a in Frameworks */,
940BEF9319ED9245007E7FA2 /* libcrypto.a in Frameworks */,
940BEF9419ED9245007E7FA2 /* libcryptopp.a in Frameworks */,
940BEF9519ED9245007E7FA2 /* libcurl.a in Frameworks */,
940BEF9619ED9245007E7FA2 /* libssl.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -599,13 +578,6 @@
A82751021E97A929007CD9E2 /* Frameworks */ = {
isa = PBXGroup;
children = (
940BEF8D19ED9245007E7FA2 /* libcares.a */,
940BEF8E19ED9245007E7FA2 /* libcrypto.a */,
940BEF8F19ED9245007E7FA2 /* libcryptopp.a */,
940BEF9019ED9245007E7FA2 /* libcurl.a */,
940BEF9119ED9245007E7FA2 /* libssl.a */,
414820911C523AA600552E76 /* libuv.a */,
41E3FE951D6B10F2005ABE2B /* libsodium.a */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down
91 changes: 45 additions & 46 deletions bindings/megaapi.i
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,26 @@

#ifdef SWIGJAVA
JavaVM *MEGAjvm = NULL;

#ifdef __ANDROID__
jstring strEncodeUTF8;
jclass clsString;
jmethodID ctorString;
int sdkVersion = 100;
#endif
jmethodID getBytes;

JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *jvm, void *reserved)
{
MEGAjvm = jvm;
#ifdef __ANDROID__
JNIEnv* jenv = NULL;
jvm->GetEnv((void**)&jenv, JNI_VERSION_1_4);
jclass buildVersionClass = jenv->FindClass("android/os/Build$VERSION");
jfieldID sdkVersionField = jenv->GetStaticFieldID(buildVersionClass, "SDK_INT", "I");
sdkVersion = jenv->GetStaticIntField(buildVersionClass, sdkVersionField);
if (sdkVersion < 23)
{
jclass clsStringLocal = jenv->FindClass("java/lang/String");
clsString = (jclass)jenv->NewGlobalRef(clsStringLocal);
jenv->DeleteLocalRef(clsStringLocal);
ctorString = jenv->GetMethodID(clsString, "<init>", "([BLjava/lang/String;)V");
jstring strEncodeUTF8Local = jenv->NewStringUTF("UTF-8");
strEncodeUTF8 = (jstring)jenv->NewGlobalRef(strEncodeUTF8Local);
jenv->DeleteLocalRef(strEncodeUTF8Local);
}
#endif

jclass clsStringLocal = jenv->FindClass("java/lang/String");
clsString = (jclass)jenv->NewGlobalRef(clsStringLocal);
jenv->DeleteLocalRef(clsStringLocal);
ctorString = jenv->GetMethodID(clsString, "<init>", "([BLjava/lang/String;)V");
getBytes = jenv->GetMethodID(clsString, "getBytes", "(Ljava/lang/String;)[B");
jstring strEncodeUTF8Local = jenv->NewStringUTF("UTF-8");
strEncodeUTF8 = (jstring)jenv->NewGlobalRef(strEncodeUTF8Local);
jenv->DeleteLocalRef(strEncodeUTF8Local);

return JNI_VERSION_1_4;
}
#endif
Expand Down Expand Up @@ -92,25 +84,41 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *jvm, void *reserved)
%typemap(javaclassmodifiers) mega::ShareList "class";
%typemap(javaclassmodifiers) mega::UserList "class";


%typemap(out) char*
%{
if ($1)
{
#ifdef __ANDROID__
if (sdkVersion < 23)
{
int len = strlen($1);
jbyteArray $1_array = jenv->NewByteArray(len);
jenv->SetByteArrayRegion($1_array, 0, len, (const jbyte*)$1);
$result = (jstring) jenv->NewObject(clsString, ctorString, $1_array, strEncodeUTF8);
jenv->DeleteLocalRef($1_array);
}
else
#endif
int len = strlen($1);
jbyteArray $1_array = jenv->NewByteArray(len);
jenv->SetByteArrayRegion($1_array, 0, len, (const jbyte*)$1);
$result = (jstring) jenv->NewObject(clsString, ctorString, $1_array, strEncodeUTF8);
jenv->DeleteLocalRef($1_array);
}
%}

%typemap(in) char*
%{
jbyteArray $1_array;
$1 = 0;
if ($input)
{
$1_array = (jbyteArray) jenv->CallObjectMethod($input, getBytes, strEncodeUTF8);
jsize $1_size = jenv->GetArrayLength($1_array);
$1 = new char[$1_size + 1];
if ($1_size)
{
$result = jenv->NewStringUTF($1);
jenv->GetByteArrayRegion($1_array, 0, $1_size, (jbyte*)$1);
}
$1[$1_size] = '\0';
}
%}

%typemap(freearg) char*
%{
if ($1)
{
delete [] $1;
jenv->DeleteLocalRef($1_array);
}
%}

Expand All @@ -119,20 +127,11 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *jvm, void *reserved)
$input = 0;
if ($1)
{
#ifdef __ANDROID__
if (sdkVersion < 23)
{
int len = strlen($1);
jbyteArray $1_array = jenv->NewByteArray(len);
jenv->SetByteArrayRegion($1_array, 0, len, (const jbyte*)$1);
$input = (jstring) jenv->NewObject(clsString, ctorString, $1_array, strEncodeUTF8);
jenv->DeleteLocalRef($1_array);
}
else
#endif
{
$input = jenv->NewStringUTF($1);
}
int len = strlen($1);
jbyteArray $1_array = jenv->NewByteArray(len);
jenv->SetByteArrayRegion($1_array, 0, len, (const jbyte*)$1);
$input = (jstring) jenv->NewObject(clsString, ctorString, $1_array, strEncodeUTF8);
jenv->DeleteLocalRef($1_array);
}
Swig::LocalRefGuard $1_refguard(jenv, $input);
%}
Expand Down
5 changes: 5 additions & 0 deletions contrib/QtCreator/MEGAcmd/MEGAcmdClient/MEGAcmdClient.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ SOURCES += ../../../../examples/megacmd/client/megacmdclient.cpp
win32 {
LIBS += -lshlwapi -lws2_32
RC_FILE = icon.rc
QMAKE_LFLAGS += /LARGEADDRESSAWARE
QMAKE_LFLAGS_WINDOWS += /SUBSYSTEM:WINDOWS,5.01
QMAKE_LFLAGS_CONSOLE += /SUBSYSTEM:CONSOLE,5.01
DEFINES += PSAPI_VERSION=1
DEFINES += UNICODE _UNICODE NTDDI_VERSION=0x05010000 _WIN32_WINNT=0x0501
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO
}
Expand Down
5 changes: 5 additions & 0 deletions contrib/QtCreator/MEGAcmd/MEGAcmdServer/MEGAcmdServer.pro
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ HEADERS += ../../../../examples/megacmd/megacmd.h \
win32 {
LIBS += -lshell32
RC_FILE = icon.rc
QMAKE_LFLAGS += /LARGEADDRESSAWARE
QMAKE_LFLAGS_WINDOWS += /SUBSYSTEM:WINDOWS,5.01
QMAKE_LFLAGS_CONSOLE += /SUBSYSTEM:CONSOLE,5.01
DEFINES += PSAPI_VERSION=1
DEFINES += UNICODE _UNICODE NTDDI_VERSION=0x05010000 _WIN32_WINNT=0x0501
}
else {
SOURCES +=../../../../examples/megacmd/comunicationsmanagerfilesockets.cpp
Expand Down
Loading

0 comments on commit 42043bd

Please sign in to comment.