OpenPassport App
Requirements
| Requirement | Version | Installation Guide |
|---|---|---|
| nodejs | > v18 | Install nodejs |
| circom | Latest | Install circom |
| snarkjs | Latest | Install snarkjs |
Android
| Requirement | Version | Installation Guide |
|---|---|---|
| Java | 17 | Install Java |
| Android Studio | Latest | Install Android Studio |
| Android SDK | Latest | Install Android SDK |
| Android Ndk | 23.1.7779620 | Install NDK or GPT4 guide |
iOS
| Requirement | Version | Installation Guide |
|---|---|---|
| Xcode | Latest | Install Xcode |
| cocoapods | Latest | Install cocoapods |
Installation
yarn install-app
Run the app
First, connect your phone to your computer and allow access.
Android
Create the file android/local.properties with the following content:
sdk.dir=/Users/<your-user-name>/Library/Android/sdk
Launch the react-native server:
yarn start
Press a to open the app on Android.
To see the Android logs you'll have to use the Android Studio Logcat.
EDIT: to test the app on android, see this issue temporarily
iOS
⚠️ To run the app on iOS, you will need a paying Apple Developer account. Free accounts can't run apps that use NFC reading.
Contact us if you need it to contribute.
Open the ios project on Xcode and add your provisionning profile in Targets > OpenPassport > Signing and Capabilities
Then, install pods:
cd ios
pod install
And run the app in Xcode.
Modify the circuits
If you want to modify the circuits, you'll have to adapt a few things.
First, go to the circuit folder of the monorepo, modify the circuits and build them.
Then, upload the zipped zkeys and dat files at publicly available urls and replace the urls in app/src/utils/zkeyDownload.ts.
Adapt the input generation in common/src/utils/generateInputs.ts, and adapt and redeploy the contracts.
Android
Find your android ndk path. It should be something like /Users/<your-user-name>/Library/Android/sdk/ndk/23.1.7779620
Build the android native module:
export ANDROID_NDK="<your-android-ndk-path>"
./scripts/build_android_module.sh
iOS
Find your development team id and run:
export DEVELOPMENT_TEAM="<your-development-team-id>"
./scripts/build_ios_module.sh
Export a new release
Android
Export as apk
cd android
./gradlew assembleRelease
The built apk it located at android/app/build/outputs/apk/release/app-release.apk
Publish on the Play Store
As explained here, first setup android/app/my-upload-key.keystore and the private vars in ~/.gradle/gradle.properties, then run:
npx react-native build-android --mode=release
This builds android/app/build/outputs/bundle/release/app-release.aab.
Then to test the release on an android phone, delete the previous version of the app and run:
yarn android --mode release
Don't forget to bump versionCode in android/app/build.gradle.
iOS
In Xcode, go to Product>Archive then follow the flow.
Don't forget to bump the build number.
FAQ
If you get something like this:
'std::__1::system_error: open: /openpassport/app: Operation not permitted'
You might want to try this:
watchman watch-del-all
watchman shutdown-server