MetaMask / metamask-mobile
Mobile web browser providing access to websites that use the Ethereum blockchain
AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing MetaMask/metamask-mobile in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Overview (README excerpt)
Crawler viewMetaMask Mobile MetaMask is a mobile wallet that provides easy access to websites that use the Ethereum blockchain. For up to the minute news, follow our Twitter or Medium pages. To learn how to develop MetaMask-compatible applications, visit our Developer Docs. To learn how to contribute to the MetaMask codebase, visit our Contributor Docs. Documentation • Architecture • Expo Development Environment Setup • Native Development Environment Setup • Build Troubleshooting • Component View Testing • E2E Testing • On-Ramp Provider Manual Testing • Debugging • Development Process • Performance • Release Build Profiling • Storybook • Miscellaneous • Reassure Performance Testing (pilot) Getting started Infura Project Setup MetaMask Mobile requires an Infura project ID to connect to blockchain networks. Internal Contributors • Grab the file from 1Password, ask around for the correct vault. This file contains the . External Contributors • Go to https://developer.metamask.io and create an account • Generate an API key • Add API key to in • Rename to • Rebuild the app [!CAUTION] > Without an Infura project ID, the app cannot connect to blockchain networks. Using Expo (recommended) Expo is the fastest way to start developing. With the Expo framework, developers don't need to compile the native side of the application as before, hence no need for any native environment setup, developers only need to download a precompiled development build and run the javascript bundler. The development build will then connect with the bundler to load the javascript code. Expo Environment Setup Install node, yarn v4 and watchman. Clone the project Install dependencies Run the bundler Download and install the development build • Expo development builds are hosted in Runway buckets and are made available to all contributors through the public bucket links below. A new build is generated every time a PR is merged into the branch. • For Android: • Download and install an file from this Runway bucket onto your Android device or emulator. • For iOS: • Physical device • Your test device needs to first be registered with our Apple developer account. • Once registered, download and install an file from this Runway bucket onto your device. • Simulator • Download and install an file from this Runway bucket onto your simulator. • Note: Our files are zipped and hosted under in the bucket. Since this hosting additional artifacts in public buckets is a relatively new feature, contributors may find that some builds are missing additional artifacts. Under the hood, these are usually associated with failed or aborted Bitrise builds. We are working with the Runway team to better filter out these builds and are subject to change in the future. Load the app If on a simulator: • use the initial expo screen that appears when starting the development to choose the bundler url • OR press "a" for Android or "i" for iOS on the terminal where the bundler is running If on a physical device: • Use the camera app to scan the QR code presented by the bundler running on the terminal That's it! This will work for any javascript development, if you need to develop or modify native code please see the next section. Native Development If developing or modifying native code or installing any library that introduces or uses native code, it is not possible to use an Expo precompiled development build as you need to compile the native side of the application again. To do so, please follow the steps stated in this section. Native Environment setup Before running the app for native development, make sure your development environment has all the required tools. Several of these tools (ie Node and Ruby) may require specific versions in order to successfully build the app. Setup your development environment Building the app **Clone the project** Firebase Messaging Setup MetaMask uses Firebase Cloud Messaging (FCM) to enable app communications. To integrate FCM, you'll need configuration files for both iOS and Android platforms. Internal Contributor instructions • Grab the file from 1Password, ask around for the correct vault. This file contains the and secrets that will be used to generate the relevant configuration files for IOS/Android. • Install and run & start the application as documented below. External Contributor instructions As an external contributor, you need to provide your own Firebase project configuration files: • ** ** (iOS) • ** ** (Android) • Create a Free Firebase Project • Set up a Firebase project in the Firebase Console. • Configure the project with a client package name matching (IMPORTANT). • Add Configuration Files • Create/Update the and files in: • (for Android) • directory (for iOS) • Create the correct base64 environments variables. [!CAUTION] > In case you don't provide your own Firebase project config file or run the steps above, you will face the error . In case of any doubt, please follow the instructions in the link below to get your Firebase project config file. Firebase Project Quickstart Install dependencies _Not the usual install command, this will run scripts and a lengthy postinstall flow_ Running the app for native development **Run Metro bundler** _Like a local server for the app_ **Run on a iOS device** **Run on an Android device** Development Tools Git Hooks (Husky) This project uses Husky to run pre-commit hooks that automatically format and lint your code before commits. The pre-commit hook runs which executes: • **Prettier** - Code formatting for files • **ESLint** - Linting and auto-fixing for files Disabling Husky Locally If you need to disable Husky pre-commit hooks temporarily (e.g., for emergency commits or debugging), you have several options: Option 1: Skip hooks for a single commit Option 2: Bypass hooks with environment variable **Note:** While these methods allow you to bypass the pre-commit hooks, remember that the CI/CD pipeline will still run linting c…