Install nodejs v18
, circom and snarkjs
For Android, install Java, Android Studio and the Android SDK
For iOS, install Xcode and cocoapods
yarn
In /common
, also run:
yarn
First, connect your phone to your computer and allow access.
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.
To run the app on iOS, you will need an Apple Developer account. Free accounts can't run apps that use NFC reading.
Open the ios project on Xcode and add your provisionning profile in Targets > ProofOfPassport > Signing and Capabilities
Then, install pods:
cd ios
pod install
And run the app in Xcode.
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 built at publicly available urls and replace the urls in app/src/utils/zkeyDownload.ts
. Be sure the zkey is named <circuit_name>.zkey
before you zip it, and the zip is then named <circuit_name>.zkey.zip
.
Adapt the inputs you pass in app/src/utils/prover.ts
, and adapt and redeploy the contracts.
Run the common init script:
./scripts/common.sh
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
Find your development team id and run:
export DEVELOPMENT_TEAM="<your-development-team-id>"
./scripts/build_ios_module.sh
cd android
./gradlew assembleRelease
The built apk it located at android/app/build/outputs/apk/release/app-release.apk
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
.
In Xcode, go to Product>Archive
then follow the flow.
Don't forget to bump the build number.
If you get something like this:
'std::__1::system_error: open: /proof-of-passport/app: Operation not permitted'
You might want to try this:
watchman watch-del-all
watchman shutdown-server