Skip to content

Latest commit

 

History

History

app

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Proof of Passport App

Requirements

Requirement Version Installation Guide
nodejs > v18 Install nodejs
circom Latest Install circom
snarkjs Latest Install snarkjs

Android

Requirement Version Installation Guide
Java 11 Install Java or GPT4 guide
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.

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 > ProofOfPassport > 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 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

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: /proof-of-passport/app: Operation not permitted'

You might want to try this:

watchman watch-del-all
watchman shutdown-server