Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

### Android

| Requirement | Version | Installation Guide |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier

| --------------------------- | ------------- | ------------------------------------------------------------------------------------- |
| Java | 17 | [Install Java](https://www.oracle.com/java/technologies/javase-jdk17-downloads.html) |
| Android Studio (Optional)* | Latest | [Install Android Studio](https://developer.android.com/studio) |
| Android SDK | Latest | See instructions for Android below |
| Android NDK | 27.0.11718014 | See instructions for Android below |
| Requirement | Version | Installation Guide |
| --------------------------- | ------------- | ------------------------------------------------------------------------------------ |
| Java | 17 | [Install Java](https://www.oracle.com/java/technologies/javase-jdk17-downloads.html) |
| Android Studio (Optional)\* | Latest | [Install Android Studio](https://developer.android.com/studio) |
| Android SDK | Latest | See instructions for Android below |
| Android NDK | 27.0.11718014 | See instructions for Android below |

\* To facilitate the installation of the SDK and the NDK, and to pair with development devices with a conventient QR code, you can use Android Studio.

Expand Down Expand Up @@ -62,39 +62,40 @@ Under **SDK Platforms**, install the platform with the highest API number

Under **SDK Tools**, check the **Show Package Details** checkbox, expand **NDK (Side by side)**, select version **27.0.11718014** and install.


#### Using sdkmanager via CLI

Create a directory for the Android SDK. For example `~/android_sdk`. Define the environment variable `ANDROID_HOME` to point that directory.

Install sdkmanager under `ANDROID_HOME` according to the instructions on https://developer.android.com/tools/sdkmanager



List available SDK platforms

```bash
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --list | grep platforms
```

In the list of platforms, find the latest version and install it. (Replace *NN* with the latest version number)
In the list of platforms, find the latest version and install it. (Replace _NN_ with the latest version number)

```bash
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "platforms;android-NN"
```

Comment on lines 71 to 82
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add license acceptance; without it, CLI installs fail at build time

sdkmanager requires accepting licenses or Gradle builds will error later. Include this step right after listing/installing platforms.

 List available SDK platforms
 ```bash
 $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --list | grep platforms

+Accept licenses (required):
+bash +$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses +
In the list of platforms, find the latest version and install it. (Replace NN with the latest version number)

$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "platforms;android-NN"

<details>
<summary>🤖 Prompt for AI Agents</summary>

In app/README.md around lines 71 to 82, the docs list and install Android
platforms but omit accepting SDK licenses; add an instruction to run the
sdkmanager --licenses command immediately after listing platforms (or right
before installing the chosen platform) so CI/local builds won't fail due to
unaccepted licenses; update the ordering to: list platforms, run sdkmanager
--licenses to accept all prompts, then install the selected
"platforms;android-NN".


</details>

<!-- fingerprinting:phantom:triton:chinchilla -->

<!-- This is an auto-generated comment by CodeRabbit -->

Install the NDK

```bash
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "ndk;27.0.11718014"
```

Define the environment variable `ANDROID_NDK_VERSION` to `27.0.11718014` and `ANDROID_NDK` to `$ANDROID_HOME/ndk/27.0.11718014`

Comment on lines 83 to 90
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Use standard NDK env var naming and document ndk.dir option

ANDROID_NDK isn’t a standard variable. Prefer ANDROID_NDK_ROOT or ndk.dir in android/local.properties to avoid ambiguity. Keep Gradle ndkVersion as the source of truth.

-Define the environment variable `ANDROID_NDK_VERSION` to `27.0.11718014` and `ANDROID_NDK` to `$ANDROID_HOME/ndk/27.0.11718014`
+Define `ANDROID_NDK_VERSION=27.0.11718014` and either:
+- `ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/27.0.11718014`, or
+- set `ndk.dir` in `android/local.properties`.
+Gradle’s `android.ndkVersion` must match the version above.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Install the NDK
```bash
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "ndk;27.0.11718014"
```
Define the environment variable `ANDROID_NDK_VERSION` to `27.0.11718014` and `ANDROID_NDK` to `$ANDROID_HOME/ndk/27.0.11718014`
Install the NDK
🤖 Prompt for AI Agents
In app/README.md around lines 83 to 90, the docs currently recommend setting a
nonstandard ANDROID_NDK env var; change this to recommend the standard
ANDROID_NDK_ROOT (or documenting adding ndk.dir in android/local.properties) and
explicitly instruct users to keep Gradle's ndkVersion as the source of truth.
Update the instructions to show setting ANDROID_NDK_ROOT to the installed NDK
path (and/or adding a ndk.dir=... line to android/local.properties) and note
that ndkVersion in build.gradle should match that NDK.

Install Platform Tools, needed for the `adb` tool

```bash
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install platform-tools
```

Add `$ANDROID_HOME/platform-tools` to your `$PATH` variable


## Run the app

### Android
Expand All @@ -108,11 +109,13 @@ In Android Studio, use Device Manager to pair with and connect to your phone.
##### Using adb

In your phone's developer settings, select **Wireless debugging** > **Pair the device using a pairing code**. Using the displayed information, run

```
adb pair PHONE_IP:PAIRING_PORT PAIRING_CODE
```

To connect to the device, find the IP number and port (different port than in the pairing step) directly under Wireless debugging, and run

```
adb connect PHONE_IP:DEVELOPMENT_PORT
```
Expand All @@ -126,11 +129,11 @@ sdk.dir=/path/to/your/android/sdk
```

or create it with

```bash
echo sdk.dir=$ANDROID_HOME > android/local.properties
```

Comment on lines 131 to 136
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Show ndk.dir in local.properties example to match NDK guidance

This prevents Gradle from resolving the wrong NDK when multiple versions are present.

 Create the file `android/local.properties` specifying the SDK directory, for example:
 

sdk.dir=/path/to/your/android/sdk
+ndk.dir=/path/to/your/android/sdk/ndk/27.0.11718014


or create it with
```bash
echo sdk.dir=$ANDROID_HOME > android/local.properties
+echo ndk.dir=$ANDROID_HOME/ndk/27.0.11718014 >> android/local.properties

<details>
<summary>🤖 Prompt for AI Agents</summary>

In app/README.md around lines 131 to 136, the local.properties example only sets
sdk.dir which can let Gradle pick an unintended NDK; add an ndk.dir entry
showing the expected NDK path and update the shell example to append ndk.dir to
android/local.properties (use the specific ndk path under the SDK, e.g.,
$ANDROID_HOME/ndk/) so Gradle resolves the correct NDK when multiple
versions exist.


</details>

<!-- fingerprinting:phantom:triton:chinchilla -->

<!-- This is an auto-generated comment by CodeRabbit -->


Launch the React Native server:

```bash
Expand Down Expand Up @@ -160,6 +163,7 @@ pod install
And run the app in Xcode.

#### Simulator Build

> **Note:** iOS Simulator on Apple Silicon Macs requires Rosetta (x86_64) mode due to simulator architecture compatibility. If you're using a Silicon Mac (M1/M2/M3/M4), you may find that the Rosetta simulator build option is not available by default in Xcode.

To enable it, open Xcode and go to **Product > Destination > Show All Run Destinations**. This will unlock the ability to select the Rosetta build simulator, allowing you to run the app in the iOS Simulator.
Expand Down Expand Up @@ -235,6 +239,7 @@ Deployments happen automatically when you merge PRs:
2. **Merge to `main`** → Deploys to production

To control versions with PR labels:

- `version:major` - Major version bump
- `version:minor` - Minor version bump
- `version:patch` - Patch version bump (default for main)
Expand All @@ -257,6 +262,7 @@ git push && git push --tags
```

The release script will:

- Check for uncommitted changes
- Bump the version in package.json
- Update iOS and Android native versions
Expand Down Expand Up @@ -310,7 +316,9 @@ bundle exec fastlane ios build_local
### Troubleshooting Deployments

#### Version Already Exists

The build system auto-increments build numbers. If you get version conflicts:

```bash
# Check current versions
node scripts/version.cjs status
Expand All @@ -321,6 +329,7 @@ node scripts/version.cjs bump-build android
```

#### Certificate Issues (iOS)

```bash
# Check certificate validity
bundle exec fastlane ios check_certs
Expand All @@ -332,18 +341,22 @@ bundle exec fastlane ios check_certs
```

#### Play Store Upload Issues

If automated upload fails, the AAB is saved locally:

- Location: `android/app/build/outputs/bundle/release/app-release.aab`
- Upload manually via Play Console

### Build Optimization

The CI/CD pipeline uses extensive caching:

- **iOS builds**: ~15 minutes (with cache)
- **Android builds**: ~10 minutes (with cache)
- **First build**: ~25 minutes (no cache)

To speed up local builds:

```bash
# Clean only what's necessary
yarn clean:build # Clean build artifacts only
Expand Down
4 changes: 2 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"clean:xcode": "rm -rf ~/Library/Developer/Xcode/DerivedData",
"clean:xcode-env-local": "rm -f ios/.xcode.env.local",
"find:type-imports": "node scripts/find-type-import-issues.mjs",
"fmt": "prettier --check .",
"fmt:fix": "prettier --write .",
"fmt": "yarn prettier --check .",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise it might try to use the global prettier if you have it

"fmt:fix": "yarn prettier --write .",
"format": "yarn nice",
"ia": "yarn install-app",
"imports:fix": "node ./scripts/alias-imports.cjs",
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/NavBar/HomeNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
import { Clipboard as ClipboardIcon } from '@tamagui/lucide-icons';

import type { SelfApp } from '@selfxyz/common/utils/appType';
import { useSelfAppStore } from '@selfxyz/mobile-sdk-alpha/stores';

import { NavBar } from '@/components/NavBar/BaseNavBar';
import ActivityIcon from '@/images/icons/activity.svg';
import ScanIcon from '@/images/icons/qr_scan.svg';
import SettingsIcon from '@/images/icons/settings.svg';
import { useSelfAppStore } from '@/stores/selfAppStore';
import { black, charcoal, neutral400, slate50, white } from '@/utils/colors';

Check warning on line 19 in app/src/components/NavBar/HomeNavBar.tsx

View workflow job for this annotation

GitHub Actions / build-deps

'white' is defined but never used

Check warning on line 19 in app/src/components/NavBar/HomeNavBar.tsx

View workflow job for this annotation

GitHub Actions / build-deps

'neutral400' is defined but never used
import { extraYPadding } from '@/utils/constants';
import { buttonTap } from '@/utils/haptic';

Expand Down
4 changes: 2 additions & 2 deletions app/src/screens/prove/ConfirmBelongingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ const ConfirmBelongingScreen: React.FC<ConfirmBelongingScreenProps> = () => {
if (permissionGranted) {
const token = await getFCMToken();
if (token) {
setFcmToken(token);
setFcmToken(token, selfClient);
trackEvent(ProofEvents.FCM_TOKEN_STORED);
}
}

// Mark as user confirmed - proving will start automatically when ready
setUserConfirmed();
setUserConfirmed(selfClient);

// Navigate to loading screen
navigate();
Expand Down
2 changes: 1 addition & 1 deletion app/src/screens/prove/ProofRequestStatusScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useIsFocused } from '@react-navigation/native';

import { useSelfClient } from '@selfxyz/mobile-sdk-alpha';
import { ProofEvents } from '@selfxyz/mobile-sdk-alpha/constants/analytics';
import { useSelfAppStore } from '@selfxyz/mobile-sdk-alpha/stores';

import loadingAnimation from '@/assets/animations/loading/misc.json';
import failAnimation from '@/assets/animations/proof_failed.json';
Expand All @@ -24,7 +25,6 @@ import useHapticNavigation from '@/hooks/useHapticNavigation';
import { ExpandableBottomLayout } from '@/layouts/ExpandableBottomLayout';
import { ProofStatus } from '@/stores/proof-types';
import { useProofHistoryStore } from '@/stores/proofHistoryStore';
import { useSelfAppStore } from '@/stores/selfAppStore';
import { black, white } from '@/utils/colors';
import {
buttonTap,
Expand Down
4 changes: 2 additions & 2 deletions app/src/screens/prove/ProveScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import type { SelfAppDisclosureConfig } from '@selfxyz/common/utils/appType';
import { formatEndpoint } from '@selfxyz/common/utils/scope';
import { useSelfClient } from '@selfxyz/mobile-sdk-alpha';
import { ProofEvents } from '@selfxyz/mobile-sdk-alpha/constants/analytics';
import { useSelfAppStore } from '@selfxyz/mobile-sdk-alpha/stores';

import miscAnimation from '@/assets/animations/loading/misc.json';
import { HeldPrimaryButtonProveScreen } from '@/components/buttons/HeldPrimaryButtonProveScreen';
Expand All @@ -37,7 +38,6 @@ import {
} from '@/providers/passportDataProvider';
import { ProofStatus } from '@/stores/proof-types';
import { useProofHistoryStore } from '@/stores/proofHistoryStore';
import { useSelfAppStore } from '@/stores/selfAppStore';
import { black, slate300, white } from '@/utils/colors';
import { formatUserId } from '@/utils/formatUserId';
import { buttonTap } from '@/utils/haptic';
Expand Down Expand Up @@ -149,7 +149,7 @@ const ProveScreen: React.FC = () => {
);

function onVerify() {
provingStore.setUserConfirmed();
provingStore.setUserConfirmed(selfClient);
buttonTap();
trackEvent(ProofEvents.PROOF_VERIFY_CONFIRMATION_ACCEPTED, {
appName: selectedApp?.appName,
Expand Down
2 changes: 1 addition & 1 deletion app/src/screens/prove/QRCodeViewFinderScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {

import { useSelfClient } from '@selfxyz/mobile-sdk-alpha';
import { ProofEvents } from '@selfxyz/mobile-sdk-alpha/constants/analytics';
import { useSelfAppStore } from '@selfxyz/mobile-sdk-alpha/stores';

import qrScanAnimation from '@/assets/animations/qr_scan.json';
import { SecondaryButton } from '@/components/buttons/SecondaryButton';
Expand All @@ -26,7 +27,6 @@ import useConnectionModal from '@/hooks/useConnectionModal';
import useHapticNavigation from '@/hooks/useHapticNavigation';
import QRScan from '@/images/icons/qr_code.svg';
import { ExpandableBottomLayout } from '@/layouts/ExpandableBottomLayout';
import { useSelfAppStore } from '@/stores/selfAppStore';
import { black, slate800, white } from '@/utils/colors';
import { parseAndValidateUrlParams } from '@/utils/deeplinks';

Expand Down
2 changes: 1 addition & 1 deletion app/src/utils/deeplinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { Linking, Platform } from 'react-native';

import { countries } from '@selfxyz/common/constants/countries';
import type { IdDocInput } from '@selfxyz/common/utils';
import { useSelfAppStore } from '@selfxyz/mobile-sdk-alpha/stores';

import { navigationRef } from '@/navigation';
import { useSelfAppStore } from '@/stores/selfAppStore';
import useUserStore from '@/stores/userStore';

// Validation patterns for each expected parameter
Expand Down
31 changes: 0 additions & 31 deletions app/src/utils/proving/provingInputs.ts

This file was deleted.

Loading
Loading