React Native Expo
MacOS:
Install watchman
brew install watchman
Run iOS on Simulator:
npx expo run:ios
Install OpenJDK for Android dev:
brew install openjdk@17
# Add to path
sudo ln -sfn /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk
# Test if Java works on CLI
java --version
Make sure NDK is installed:
- Open Android Studio.
- Go to:
Preferences > Appearance & Behavior > System Settings > Android SDK > SDK Tools tab
. - Check NDK (Side by side).
- Click Apply or OK to install it.
If getting node
errors in Android studio, close and re-open Android Studio from CLI via:
open -a "Android Studio"
Unit tests
The iOS project contains unit tests that test the VaultStoreKit
native Swift implementation. The VaultStoreKit
logic is responsible for handling vault encryption/decryption, contains the SQLite client and acts as a proxy for all queries made by the React Native and autofill components.
Tests can be ran via XCode test interface.
In order to test this query logic behavior the tests contain a static encrypted client vault (SQLite database) that is provided to the tests.
This static encrypted database can be (re)generated by running the apps/server/Tests/AliasVault.E2ETests/Tests/Extensions/TestVaultGeneratorTests.cs
in the .NET solution. This E2E test generates a deterministic vault and saves it to a local temporary file. This file can then be used as the input for these unittests.
React Native Turbo Module VaultManager
The AliasVault React Native app uses the Turbo Module method for implementing the native VaultManager functionality which allows the app to store the AliasVault vault and encryption key safely on the native level enabling the use of low-level keychain secure storage methods.
In order to update the Native Turbo Module scheme, edit the specs file in: specs/NativeVaultManager.ts
. Afterwards:
- For iOS, run pod install (see instructions below). Then make sure to implement the new or changed methods in the actual NativeVaultManager implementation of which the files are located in the
ios/NativeVaultManager
directory.
Install/update Pods for iOS
- Go to root of mobile-app directory
- Run
npx pod-install
(don’t runpod install
directly from ios directory as this can cause errors)