• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

bindings/H18-Sep-2020-57,30125,691

contrib/H03-May-2022-10,9608,807

doc/H03-May-2022-9,3186,816

examples/H18-Sep-2020-51,95339,080

include/H18-Sep-2020-48,30124,077

m4/H18-Sep-2020-2,1401,895

patches/H18-Sep-2020-3734

src/H18-Sep-2020-120,872101,414

tests/H18-Sep-2020-19,10713,462

third_party/H03-May-2022-265212

.gitignoreH A D18-Sep-20201.4 KiB10495

.travis.ymlH A D18-Sep-2020291 1211

CREDITS.mdH A D18-Sep-20204.8 KiB161100

LICENSEH A D18-Sep-20201.3 KiB2722

Makefile.amH A D03-May-20222.2 KiB10965

Makefile.win32H A D18-Sep-20204.7 KiB14881

README.mdH A D18-Sep-20207.9 KiB183128

autogen.shH A D18-Sep-202037 31

clean.shH A D18-Sep-20201.8 KiB4725

configure.acH A D18-Sep-202061.7 KiB2,1471,876

libmega.pc.inH A D18-Sep-2020322 1513

README.md

1# MEGA SDK - Client Access Engine <a href="https://scan.coverity.com/projects/4315"><img alt="Coverity Scan Build Status" src="https://scan.coverity.com/projects/4315/badge.svg"/></a>
2
3MEGA --- _The Privacy Company_ --- is a Secure Cloud Storage
4provider that protects your data thanks to end-to-end encryption. We call it User Controlled Encryption,
5or UCE, and all our clients automatically manage it.
6
7All files stored on MEGA are encrypted. All data transfers from and to MEGA are encrypted. And while
8most cloud storage providers can and do claim the same, MEGA is different – unlike the industry norm
9where the cloud storage provider holds the decryption key, with MEGA, you control the encryption,
10you hold the keys, and you decide who you grant or deny access to your files.
11
12This SDK brings you all the power of our client applications and let you create
13your own or analyze the security of our products. Are you ready to start? Please continue reading.
14
15SDK Contents
16------------
17
18In this SDK, you can find our low level SDK, that was already released few months after the MEGA launch,
19a new intermediate layer to make it easier to use and to bind with other programming languages, and
20example apps for all our currently supported platforms (Windows, Linux, OSX, Android, iOS and Windows Phone).
21
22In the `examples` folder you can find example apps using:
23
241. The low level SDK:
25  - megacli (a powerful command line tool that allows to use all SDK features)
26  - megasimplesync (a command line tool that allows to use the synchronization engine)
27
282. The intermediate layer:
29  - An example app for Visual Studio in `examples/win32`
30  - An example app for Android (using Java bindings based on SWIG) in `examples/android`
31  - An example app for iOS (using Objective-C bindings) in `examples/iOS`
32  - An example app for Windows Phone (using Windows Phone bindings) in `examples/wp8`
33
34[MEGAcmd](examples/megacmd), a higher level command line application that uses the SDK to provide interactive and scriptable access to MEGA, can be found [here](https://github.com/meganz/megacmd).
35
36Building
37--------
38
39For platforms with Autotools, the generic way to build and install it is:
40
41    sh autogen.sh
42    ./configure
43    make
44    sudo make install
45
46Notice that you would need Autotools installed in your system (in Linux this normally entails having `autoconf` and `libtool` packages installed).
47
48That compilation will include the examples using our low level SDK (`megacli` and `megasimplesync`).
49You also have specific build instructions for OSX (`doc/OSX.txt`) and FreeBSD (`doc/FreeBSD.txt`)
50and a build script to automatically download and build the SDK along with all its dependencies (`contrib/build_sdk.sh`)
51
52For other platforms, or if you want to see how to use the new intermediate layer,
53the easiest way is to get a smooth start is to build one of the examples in subfolders
54of the `examples` folder.
55
56All these folders contains a README.md file with information about how to get the project up and running,
57including the installation of all required dependencies.
58
59Usage
60-----
61
62The low level SDK doesn't have inline documentation yet. If you want to use it,
63please check one of our example apps (`examples/megacli`, `examples/megasimplesync`).
64
65The new intermediate layer has been documented using Doxygen. The only public header that you need
66to include to use is `include/megaapi.h`. You can read the documentation in that header file,
67or download the same documentation in HTML format from this link:
68
69https://mega.nz/#!7glwEQBT!Fy9cwPpCmuaVdEkW19qwBLaiMeyufB1kseqisOAxfi8
70
71Additional info
72---------------
73
74### Platform Dependencies
75
76Dependencies are different for each platform because the SDK uses generic interfaces to get some features and they have different implentations:
77- Network (cURL with OpenSSL/c-ares or WinHTTP)
78- Filesystem access (Posix or Win32)
79- Graphics management (FreeImage, QT or iOS frameworks)
80- Database (SQLite or Berkeley DB)
81- Threads/mutexes (Win32, pthread, QT threads, or C++11)
82
83#### POSIX (Linux/Darwin/BSD/OSX ...)
84
85Install the following development packages, if available, or download
86and compile their respective sources (package names are for
87Debian and RedHat derivatives, respectively):
88
89* cURL (`libcurl4-openssl-dev`, `libcurl-devel`), compiled with `--enable-ssl`
90* c-ares (`libc-ares-dev`, `libcares-devel`, `c-ares-devel`)
91* OpenSSL (`libssl-dev`, `openssl-devel`)
92* Crypto++ (`libcrypto++-dev`, `libcryptopp-devel`)
93* zlib (`zlib1g-dev`, `zlib-devel`)
94* SQLite (`libsqlite3-dev`, `sqlite-devel`) or configure `--without-sqlite`
95* FreeImage (`libfreeimage-dev`, `freeimage-devel`) or configure `--without-freeimage`
96* pthread
97
98Optional dependency:
99* Libraw (`libraw-dev`, `libraw-devel`)
100* Sodium (`libsodium-dev`, `libsodium-devel`), configure `--with-sodium`
101* MediaInfoLib (optional, see third_party/README_MediaInfo.txt)
102
103Filesystem event monitoring: The provided filesystem layer implements
104the Linux `inotify` and the MacOS `fsevents` interfaces.
105
106To build the reference `megacli` example, you may also need to install:
107
108* GNU Readline (`libreadline-dev`, `readline-devel`)
109
110For Android, we provide an additional implementation of the graphics subsystem using Android libraries.
111
112For iOS, we provide an additional implementation of the graphics subsystem using Objective C frameworks.
113
114#### Windows
115
116To build the client access engine under Windows, you'll need the following:
117
118* A Windows-native C++ development environment (e.g. MinGW or Visual Studio)
119* Crypto++
120* zlib (until WinHTTP learns how to deal with Content-Encoding: gzip)
121* SQLite or configure `--without-sqlite`
122* FreeImage or configure `--without-freeimage`
123* pthreads (MinGW)
124
125Optional dependency:
126* Sodium, configure `--with-sodium`
127
128To build the reference `megacli.exe` example, you will also need to procure
129development packages (at least headers and `.lib`/`.a` libraries) of:
130
131* GNU Readline/Termcap
132
133### Folder syncing
134
135In this version, the sync functionality is limited in scope and functionality:
136
137* There is no locking between clients accessing the same remote folder.
138Concurrent creation of identically named files and folders can result in
139server-side dupes.
140
141* Syncing between clients with differing filesystem naming semantics can
142lead to loss of data, e.g. when syncing a folder containing `ABC.TXT` and
143`abc.txt` with a Windows client.
144
145* On POSIX platforms, filenames are assumed to be encoded in UTF-8. Invalid
146byte sequences can lead to undefined behaviour.
147
148* Local filesystem items must not be exposed to the sync subsystem more
149than once. Any dupes, whether by nesting syncs or through filesystem links,
150will lead to unexpected results and loss of data.
151
152* No in-place versioning. Deleted remote files can be found in
153`//bin/SyncDebris` (only when syncing to the logged in account's own
154cloud drive - there is no SyncDebris facility on syncs to inbound
155shares), deleted local files in a sync-specific hidden debris
156folder located in the local sync's root folder.
157
158* No delta writes. Changed files are always overwritten as a whole, which
159means that it is not a good idea to sync e.g. live database tables.
160
161* No direct peer-to-peer syncing. Even two machines in the same local subnet
162will still sync via the remote storage infrastructure.
163
164* No support for unidirectional syncing (backup-only, restore-only).
165Syncing to an inbound share requires it to have full access rights.
166
167### `megacli` on Windows
168
169The `megacli` example is currently not handling console Unicode
170input/output correctly if run in `cmd.exe`.
171
172Filename caveats: Please prefix all paths with `\\?\` to avoid the following
173issues:
174
175* The `MAX_PATH` (260 character) length limitation, which would make it
176impossible to access files in deep directory structures
177
178* Prohibited filenames (`con`/`prn`/`aux`/`clock$`/`nul`/`com1`...`com9`/`lpt1`...`lpt9`).
179Such files and folders will still be inaccessible through e.g. Explorer!
180
181Also, disable automatic short name generation to eliminate the risk of
182clashes with existing short names.
183