{"id":13809077,"url":"https://github.com/meganz/android","last_synced_at":"2026-04-02T10:49:42.113Z","repository":{"id":37612287,"uuid":"58047859","full_name":"meganz/android","owner":"meganz","description":"MEGA Android App","archived":false,"fork":false,"pushed_at":"2025-05-12T09:38:16.000Z","size":454799,"stargazers_count":1671,"open_issues_count":146,"forks_count":383,"subscribers_count":239,"default_branch":"master","last_synced_at":"2025-05-12T10:46:19.831Z","etag":null,"topics":["android","android-studio","end-to-end-encryption","java","kotlin","mega","privacy"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","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":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-05-04T11:46:20.000Z","updated_at":"2025-05-12T09:38:31.000Z","dependencies_parsed_at":"2023-02-12T21:01:26.043Z","dependency_job_id":"b1f81264-a570-4e54-9701-ce593dbc4f75","html_url":"https://github.com/meganz/android","commit_stats":{"total_commits":23280,"total_committers":63,"mean_commits":369.5238095238095,"dds":0.8576460481099657,"last_synced_commit":"cb6c726edd037e38475f378754d8e187871380b2"},"previous_names":[],"tags_count":183,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meganz%2Fandroid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meganz%2Fandroid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meganz%2Fandroid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meganz%2Fandroid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meganz","download_url":"https://codeload.github.com/meganz/android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254092656,"owners_count":22013290,"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":["android","android-studio","end-to-end-encryption","java","kotlin","mega","privacy"],"created_at":"2024-08-04T01:02:00.701Z","updated_at":"2026-01-22T06:33:11.744Z","avatar_url":"https://github.com/meganz.png","language":"Kotlin","readme":"MEGA Android Client\n================\n\nA fully-featured client to access your Cloud Storage provided by MEGA.\n\nThis document will guide you to build the application on a Linux/MacOS machine with Android Studio.\n\n### 1. Setup development environment\n\n* [Android Studio](https://developer.android.com/studio)\n\n* [Android SDK Tools](https://developer.android.com/studio#Other)\n\n* [Android NDK](https://developer.android.com/ndk/downloads)\n\n* JDK 21\n\n### 2. Build \u0026 Run the application\n\n1. Get the source code.\n\n```\ngit clone --recursive https://github.com/meganz/android.git\n```\n\n### 3. NDK Configuration\n\n#### 3.1 Linux\n\nInstall in the system the **[Android NDK 27b](https://dl.google.com/android/repository/android-ndk-r27b-linux.zip)** (latest version tested: NDK r27b, version number: 27.1.12297006).\n\nExport  `NDK_ROOT`  variable or create a symbolic link at  `${HOME}/android-ndk`  to point to your Android NDK installation path.\n\n`export NDK_ROOT=/path/to/ndk`\n\n`ln -s /path/to/ndk ${HOME}/android-ndk`\n\n#### 3.2 MacOS\n\nInstall NDK r27b by Android Studio following [these instructions](https://developer.android.com/studio/projects/install-ndk#specific-version) (pay attention to the bottom-right `Show Package Details` checkbox to display the available versions. Latest version tested: NDK r27b, version number: 27.1.12297006)\n\nExport  `NDK_ROOT`  variable or create a symbolic link at  `${HOME}/android-ndk`  to point to your Android NDK installation path.\n\nDefault macOS path:  `export NDK_ROOT=\"/Users/${USER}/Library/Android/sdk/ndk/27.1.12297006\"`\n\n`ln -s /path/to/ndk ${HOME}/android-ndk`\n\n### 4. ANDROID_HOME Configuration\n\n#### 4.1 Linux\n\nExport  `ANDROID_HOME`  variable or create a symbolic link at  `${HOME}/android-sdk`  to point to your Android SDK installation path.\n\n`export ANDROID_HOME=/path/to/sdk`\n\n`ln -s /path/to/sdk ${HOME}/android-sdk`\n\n#### 4.2 MacOS\n\nExport  `ANDROID_HOME`  variable or create a symbolic link at  `${HOME}/android-sdk`  to point to your Android SDK installation path.\n\nDefault macOS path: `export ANDROID_HOME=\"/Users/${USER}/Library/Android/sdk/\"`)\n\n`ln -s /path/to/sdk ${HOME}/android-sdk`\n\n### 5. JAVA_HOME Configuration\n\n#### 5.1 Linux\n\nExport  `JAVA_HOME`  variable or create a symbolic link at  `${HOME}/android-java`  to point to your Java installation path.\n\nYou can use the path in Android Studio, which you can find in  `Preferences \u003e Build, Execution, Deployment \u003e Build Tools \u003e Gradle \u003e Gradle JDK (default)`\n\n`export JAVA_HOME=/path/to/jdk`\n\n`ln -s /path/to/jdk ${HOME}/android-java`\n\n#### 5.2 MacOS\n\nExport  `JAVA_HOME`  variable or create a symbolic link at  `${HOME}/android-java`  to point to your Java installation path.\n\nYou can use the path in Android Studio, which you can find in  `Preferences \u003e Build, Execution, Deployment \u003e Build Tools \u003e Gradle \u003e Gradle JDK (default)`\n\nDefault macOS path:  `export JAVA_HOME=\"/Applications/Android Studio.app/Contents/jre/Contents/Home\"`)\n\n`ln -s /path/to/jdk ${HOME}/android-java`\n\n### 6. Download WEBRTC files\n\n1. Download the link https://mega.nz/file/N2k2XRaA#bS9iudrjiULmMaGbBKErsYosELbnU22b8Zj213Ti1nE, uncompress it and put the folder `webrtc` in the path `sdk/src/main/jni/megachat/`.Be mindful that the download link of webrtc may varies over time, please keep it in line with the one written in build.sh\n\n### 7. Prerequisites of running the build script\n\n#### 7.1 Linux\n\nBefore running the SDK building script, install the required packages. For example for Ubuntu or other Debian-based distro:\n\n`sudo apt install build-essential swig automake libtool autoconf cmake ninja-build`\n\n**ATTENTION:** After upgrading ExoPlayer to 2.18.1, we need to use CMake version 3.22.1\n\nThen install CMake version 3.22.1 in `Android Studio \u003e Tools \u003e SDK Manager \u003e SDK Tools \u003e CMake`.\n\nAfter installation, add below line in `~/.bashrc`\n\n`export PATH=\"/home/$USER/Android/Sdk/cmake/3.22.1/bin:$PATH\"`\n\nYou will need to source your `~/.bashrc` or logout/login (or restart the terminal) for the changes to take effect. To source your `~/.bashrc`, simply type:\n\n`source ~/.bashrc`\n\n#### 7.2 MacOS\n\nBefore running the SDK building script, install the required dependencies via HomeBrew:\n\nExcept below tools, please do not use HomeBrew to install other tools, according to SysAdmin's advice.\n\n`brew install bash gnu-sed gnu-tar autoconf automake cmake coreutils libtool swig wget xz python3`\n\nThen reboot MacOS - to ensure newly installed latest bash (v5.x) overrides default v3.x in PATH\n\nThen edit PATH env (Please make sure the gnu paths are setup in front of $PATH):\n\n-   For Intel chip, add below lines in  `~/.zshrc`\n\n`export PATH=\"/usr/local/opt/gnu-tar/libexec/gnubin:$PATH\"`  \n`export PATH=\"/usr/local/opt/gnu-sed/libexec/gnubin:$PATH\"`\n\n-   For Apple chip, add below lines in  `~/.zshrc`\n\n`export PATH=\"/opt/homebrew/opt/gnu-tar/libexec/gnubin:$PATH\"`  \n`export PATH=\"/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH\"`\n\n`ln -s /opt/homebrew/bin/python3 /opt/homebrew/bin/python`\n\n**ATTENTION:** After upgrading ExoPlayer to 2.18.1, we need to use CMake version 3.22.1\n\nThen install CMake version 3.22.1 in `Android Studio \u003e Tools \u003e SDK Manager \u003e SDK Tools \u003e CMake`.\n\nYou have to tick checkbox 'Show Package Details' to display this specific version. After installation, add below line in  `~/.zshrc`\n\n`export PATH=\"/Users/${USER}/Library/Android/sdk/cmake/3.22.1/bin:$PATH\"`\n\n### 8. Running the Build Script\n\nBuild SDK by running `./build.sh all` at `sdk/src/main/jni/`. You could also run `./build.sh clean` to clean the previous configuration.\n\n**IMPORTANT:** check that the build process finished successfully, it should finish with the **Task finished OK** message. Otherwise, modify `LOG_FILE` variable in `build.sh` from `/dev/null` to a certain text file and run `./build.sh all` again for viewing the build errors.\n\nIn case of an error (seen in the log file mentioned) due to licenses not accepted, you can read and accept the licenses with the sdkmanager command-line tool (if you downloaded them)\n\n`/path-to-cmdline-tools/bin/sdkmanager --sdk_root=$ANDROID_HOME --licenses`\n\n### 9. Download Required Files\n\nDownload the link https://mega.nz/#!1tcl3CrL!i23zkmx7ibnYy34HQdsOOFAPOqQuTo1-2iZ5qFlU7-k, uncompress it and put the folders `debug` and `release` in the path `app/src/`.\n\n### 10. Disable pre-built SDK\nOpen `buildSrc/src/main/kotlin/mega/privacy/android/build/Util.kt`, change method `shouldUsePrebuiltSdk()` to below.\n```kotlin\nfun shouldUsePrebuiltSdk(): Boolean = false\n//        System.getenv(\"USE_PREBUILT_SDK\")?.let { it != \"false\" } ?: true\n```\n\nOpen `settings.gradle.kts`, change method `shouldUsePrebuiltSdk()` to below:\n```kotlin\nfun shouldUsePrebuiltSdk(): Boolean = false\n//        System.getenv(\"USE_PREBUILT_SDK\")?.let { it != \"false\" } ?: true\n```\n\n### 11. Build mobile analytics library locally \n**Note: You need to occasionally redo this section to make sure latest analytics library is used.**\n\n1. Download and build [Mobile Analytics](https://github.com/meganz/mobile-analytics) source code. \n\n    ```shell\n    git clone --recursive https://github.com/meganz/mobile-analytics.git\n    cd mobile-analytics\n    git checkout main\n    ./gradlew --no-daemon assembleRelease\n    ```\n\n2. Copy below generated libraries to root of MEGA code\n   - `shared/build/outputs/aar/shared-release.aar`\n   - `analytics-core/build/outputs/aar/analytics-core-release.aar`\n   - `analytics-annotations/build/outputs/aar/analytics-annotations-release.aar`\n\n3. Modify MEGA code to depend on local AAR files\n\n    1. Search `implementation(lib.mega.analytics)` in whole project, and replace all occurrences with below code. Note you may need to add a `..` to the path if the `build.gradle.kts` is in a subproject.  \n        ```kotlin\n        //    implementation(lib.mega.analytics)\n            implementation(files(\"../shared-release.aar\"))\n            implementation(files(\"../analytics-core-release.aar\"))\n            implementation(files(\"../analytics-annotations-release.aar\")) \n        ```\n       \n### 12. Disable library dependencies\n1. in root `build.gradle.kts`, comment out below codes.\n   ```kotlin\n   id(\"mega.android.release\")\n   ```\n2. in `settings.gradle.kts`, comment out below code\n    ```kotlin\n     maven {\n         url =\n             uri(\"${System.getenv(\"ARTIFACTORY_BASE_URL\")}/artifactory/mega-gradle/megagradle\")\n     }\n    ```\n   and\n    ```kotlin\n    resolutionStrategy {\n        eachPlugin {\n            if (requested.id.id == \"mega.android.release\") {\n                useModule(\"mega.privacy:megagradle:${requested.version}\")\n            }\n        }\n    }\n    ```\n\n### 13. Run the project\n\nOpen the project with Android Studio, let it build the project and hit _*Run*_.\n\n\n##### If the build script fails to detect cmake when building ffmpeg extension on a mac\n\n1. In Android studio, open the SDK manager (Or through Settings\u003eAppearance \u0026 Behaviour\u003eSystem Settings\u003eAndroid SDK)\n2. Go to the SDK Tools tab\n3. Check the \"Show package details\" box\n4. Expand the CMake section in the list\n5. Select 3.22.1\n6. Click \"OK\"\n7. Add the following to your PATH:\n    `export PATH=\"/Users/{USERNAME}/Library/Android/sdk/cmake/3.22.1/bin:$PATH\"`\n8. Retry the build\n\n### Notice\n\nTo use the *geolocation feature* you need a *Google Maps API key*:\n\n1. To get one, follow the directions here: https://developers.google.com/maps/documentation/android/signup.\n\n2. Once you have your key, replace the \"google_maps_key\" string in these files: `app/src/debug/res/values/google_maps_api.xml` and `app/src/release/res/values/google_maps_api.xml`.\n","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeganz%2Fandroid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeganz%2Fandroid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeganz%2Fandroid/lists"}