{"id":13419596,"url":"https://github.com/meganz/sdk","last_synced_at":"2025-05-12T15:34:21.198Z","repository":{"id":11981272,"uuid":"14556029","full_name":"meganz/sdk","owner":"meganz","description":"MEGA C++ SDK","archived":false,"fork":false,"pushed_at":"2025-05-12T13:42:51.000Z","size":102579,"stargazers_count":1369,"open_issues_count":18,"forks_count":515,"subscribers_count":141,"default_branch":"master","last_synced_at":"2025-05-12T14:57:34.636Z","etag":null,"topics":["cloud-storage","end-to-end-encryption","mega","privacy","sdk"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meganz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".gitlab/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-11-20T12:33:53.000Z","updated_at":"2025-05-12T13:42:58.000Z","dependencies_parsed_at":"2023-02-18T07:15:59.474Z","dependency_job_id":"45cda754-c8b6-420c-898e-ab3e545c3bc3","html_url":"https://github.com/meganz/sdk","commit_stats":{"total_commits":18561,"total_committers":151,"mean_commits":122.9205298013245,"dds":0.8873444318732827,"last_synced_commit":"36f8cb69b1a06f7af5a42472471bc78d19fa05cd"},"previous_names":[],"tags_count":270,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meganz%2Fsdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meganz%2Fsdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meganz%2Fsdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meganz%2Fsdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meganz","download_url":"https://codeload.github.com/meganz/sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253766242,"owners_count":21960874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-storage","end-to-end-encryption","mega","privacy","sdk"],"created_at":"2024-07-30T22:01:18.192Z","updated_at":"2025-05-12T15:34:21.181Z","avatar_url":"https://github.com/meganz.png","language":"C++","funding_links":[],"categories":["TODO scan for Android support in followings","C++"],"sub_categories":[],"readme":"# MEGA SDK - Client Access Engine\n\nMEGA --- _The Privacy Company_ --- is a Secure Cloud Storage provider\nthat protects your data thanks to end-to-end encryption. We call it User Controlled Encryption,\nor UCE, and all our clients automatically manage it.\n\nAll files stored on MEGA are encrypted. All data transfers from and to MEGA are encrypted. And while\nmost cloud storage providers can and do claim the same, MEGA is different – unlike the industry norm\nwhere the cloud storage provider holds the decryption key, with MEGA, you control the encryption,\nyou hold the keys, and you decide who you grant or deny access to your files.\n\nThis SDK brings you all the power of our client applications and lets you create\nyour own or analyze the security of our products. Are you ready to start? Please continue reading.\n\n## SDK Contents\n\nIn this SDK, you can find our low level SDK, that was already released few months after the MEGA launch,\na new intermediate layer to make it easier to use and to bind with other programming languages, and\nexample apps for all our currently supported platforms (Android, GNU/Linux, iOS, macOS and Windows).\n\nIn the [examples](examples) folder you can find example apps using:\n\n1. The low level SDK:\n  - megacli (a powerful command line tool that allows to use all SDK features)\n\n2. The public API:\n  - A plain C++ example app in `examples/simple_client`\n  - An example app for Android (using Java bindings based on SWIG) in `examples/android`\n  - An example app for iOS (using Objective-C bindings) in `examples/iOS`\n\n[MEGAcmd](https://github.com/meganz/megacmd), a higher level command line application that uses the SDK to provide interactive and scriptable access to MEGA. You can use it by running megacmd-server and talk to it from PHP/Python code, for instance.\n\n## How to build the SDK library\n\nFor the SDK development and compilation we use CMake as the cross-platform project configuration tool. We also use VCPKG to manage the required dependencies to build the SDK in most platforms: GNU/Linux, macOS and Windows.\n\n### Building tools\n\nSome common development tools should be available in the system to be able to build the MEGA SDK and the needed dependencies:\n\n- Git: Use the one from your system package manager or install it from https://git-scm.com\n- CMake 3.19 or higher: Use the one from your system package manager or install it from https://cmake.org\n\n#### Windows\n\nEnsure you have installed Visual Studio, with the necessary components for building C++ sources, and the Windows SDK on your system:\n\n - [Visual Studio 2022](https://visualstudio.microsoft.com/vs/)\n - MSVC v142\n - Windows 10 SDK (10.0.19041.0)\n\n#### MacOS\n\nXcode and the Developer tools are needed. To install the\nDeveloper tools, run the following command and follow the instructions:\n\n\t$ xcode-select --install\n\nThe following packages should be available in the system as well:\n\n - autoconf, autoconf-archive, automake, pkg-config, nasm and libtool.\n\nYou can use any package manager if you have one installed or build and install them from sources\n\n#### Linux\n\nFor debian-based distributions, you can install the needed compilers and tools using the following command:\n\n\tsudo apt install build-essential curl zip unzip autoconf autoconf-archive nasm libtool-bin\n\nPackage names may vary for other Linux distros, but it should build successfully with similar packages to the ones listed above.\n\n### Prepare the sources\n\nFirst of all, prepare a directory of your choice to work with the MEGA SDK. The `mega` directory\nwill be used as the workspace directory in the examples in this document.\n\n\tmkdir mega\n\tcd mega\n\nThen, clone the MEGA SDK repository to obtain the source code for the MEGA SDK.\n\n\tgit clone https://github.com/meganz/sdk\n\nNext to the MEGA SDK, clone the VCPKG repository. If you are already using VCPKG and have a local clone of the VCPKG repository, you can skip this step and use the VCPKG you already have in your system.\n\n\tgit clone https://github.com/microsoft/vcpkg\n\n**Note**: VCPKG local repository needs to be updated from time to time. If never done, it will eventually fail to find new dependencies or others updated to versions newer than what it already had.\nThe solution is simple: go to VCPKG local repository and run `git pull`.\n\n### Configuration\n\nThe following instructions are for configuring the project from the CLI, but cmake-gui or any editor or IDE\ncompatible with CMake should be suitable if the same CMake parameters are configured.\n\nThe SDK is configured like any other regular CMake project. The only parameter that is always needed is the VCPKG directory\nto manage the third-party dependencies. To configure the SDK with the default options, from the workspace (`mega` directory), run CMake:\n\n\tcmake -DVCPKG_ROOT=vcpkg -DCMAKE_BUILD_TYPE=Debug -S sdk -B build_dir\n\n**Note**: The `-DCMAKE_BUILD_TYPE=\u003cDebug|Release\u003e` may not be needed for multiconfig generators, like Visual Studio.\n\nIn the command above, relative paths have been used for simplicity. If you want to change the location of VCPKG, the SDK or the build directory, simply provide a valid relative or absolute path for any of them.\n\nDuring the configuration of the project, VCPKG will build and configure the necessary libraries for the platform. It may take a while on the first run, but once the libraries are built, VCPKG will retrieve them from the binary cache.\n\nSome options to configure the SDK library can be found in the [sdklib_options.cmake](cmake/modules/sdklib_options.cmake) file, like ENABLE_SYNC or USE_PDFIUM.\nThe options to manage the examples and tests are in the [CMakeLists.txt](CMakeLists.txt).\n\n### Building the sources\n\nOnce the MEGA SDK is configured, simply build the complete project:\n\n\tcmake --build build_dir\n\nYou can specify `--target=\u003ctarget\u003e` like `SDKlib` or `megacli`, or just leave the command as it is to build all the tagets.\nAdditionally, `-j\u003cN\u003e` can be added to manage concurrency and speed up the build.\n\nOnce the build is finished, binaries will be available in the `build_dir`\n\n### Run megacli\n\nTo run the example app `megacli`, go to the `examples/megacli` directory in the `build_dir` and execute the `megacli` binary.\n\n## Minimum supported OS versions\n\n### Android\n\n- Android 8.0\n\n### DMS\n\n- DMS 7.2\n\n### GNU/Linux\n\n- Arch\n- Debian 11\n- Fedora 38\n- OpenSUSE Leap 15.5\n- Raspberry Pi OS Lite (Debian 11)\n- Ubuntu 20.04 LTS\n\n### iOS\n\n- iOS 15\n\n### macOS\n\n- macOS 10.15 (Intel)\n- macOS 11.1 (Apple silicon)\n\n### Windows\n\n- Windows 7\n- Windows Server 2008\n\n## Usage\n\nThe low level SDK doesn't have inline documentation yet. If you want to use it,\nplease check our example app `examples/megacli`.\n\nThe intermediate layer has been documented using Doxygen. The only public header that you need\nto include to use is `include/megaapi.h`. You can read the documentation in that header file.\n\n## Additional info\n\n### Folder syncing\n\nIn this version, the sync functionality is limited in scope and functionality:\n\n* There is no locking between clients accessing the same remote folder.\nConcurrent creation of identically named files and folders can result in\nserver-side dupes.\n\n* Syncing between clients with differing filesystem naming semantics can\nlead to loss of data, e.g. when syncing a folder containing `ABC.TXT` and\n`abc.txt` with a Windows client.\n\n* On POSIX platforms, filenames are assumed to be encoded in UTF-8. Invalid\nbyte sequences can lead to undefined behaviour.\n\n* Local filesystem items must not be exposed to the sync subsystem more\nthan once. Any dupes, whether by nesting syncs or through filesystem links,\nwill lead to unexpected results and loss of data.\n\n* No in-place versioning. Deleted remote files can be found in\n`//bin/SyncDebris` (only when syncing to the logged in account's own\ncloud drive - there is no SyncDebris facility on syncs to inbound\nshares), deleted local files in a sync-specific hidden debris\nfolder located in the local sync's root folder.\n\n* No delta writes. Changed files are always overwritten as a whole, which\nmeans that it is not a good idea to sync e.g. live database tables.\n\n* No direct peer-to-peer syncing. Even two machines in the same local subnet\nwill still sync via the remote storage infrastructure.\n\n* No support for unidirectional syncing (backup-only, restore-only).\nSyncing to an inbound share requires it to have full access rights.\n\n### `megacli` on Windows\n\nThe `megacli` example is currently not handling console Unicode\ninput/output correctly if run in `cmd.exe`.\n\nFilename caveats: Please prefix all paths with `\\\\?\\` to avoid the following\nissues:\n\n* The `MAX_PATH` (260 character) length limitation, which would make it\nimpossible to access files in deep directory structures\n\n* Prohibited filenames (`con`/`prn`/`aux`/`clock$`/`nul`/`com1`...`com9`/`lpt1`...`lpt9`).\nSuch files and folders will still be inaccessible through e.g. Explorer!\n\nAlso, disable automatic short name generation to eliminate the risk of\nclashes with existing short names.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeganz%2Fsdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeganz%2Fsdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeganz%2Fsdk/lists"}