Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions .cursorignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ contracts/test/utils/smt.json
circuits/circuits/utils/crypto/ec/powers/

# Test data files
app/android/android-passport-reader/app/src/main/assets/tessdata/
app/android/android-passport-nfc-reader/app/src/main/assets/tessdata/

# ========================================
# Development & Testing
Expand Down Expand Up @@ -197,7 +197,7 @@ app/ios/App Thinning Size Report.txt
*.iml
.gradle/
local.properties
app/android/android-passport-reader/examples/
app/android/android-passport-nfc-reader/examples/

# React Native config
app/react-native.config.cjs
Expand Down
24 changes: 12 additions & 12 deletions .github/actions/clone-android-passport-reader/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Clone android-passport-reader
description: "Clones the android-passport-reader repository if it does not exist"
name: Clone android-passport-nfc-reader
description: "Clones the android-passport-nfc-reader repository if it does not exist"

inputs:
working_directory:
Expand All @@ -13,7 +13,7 @@ inputs:
runs:
using: "composite"
steps:
- name: Clone android-passport-reader
- name: Clone android-passport-nfc-reader
shell: bash
run: |
set -euo pipefail
Expand All @@ -26,25 +26,25 @@ runs:

cd "${{ inputs.working_directory }}"

if [ ! -d "android/android-passport-reader" ]; then
echo "📦 Cloning android-passport-reader for build..."
if [ ! -d "android/android-passport-nfc-reader" ]; then
echo "📦 Cloning android-passport-nfc-reader for build..."
cd android

# Clone using PAT (embed temporarily, then scrub)
if git clone --depth 1 --quiet "https://${{ inputs.selfxyz_internal_pat }}@github.com/selfxyz/android-passport-reader.git"; then
echo "✅ android-passport-reader cloned successfully"
if git clone --depth 1 --quiet "https://${{ inputs.selfxyz_internal_pat }}@github.com/selfxyz/android-passport-nfc-reader.git"; then
echo "✅ android-passport-nfc-reader cloned successfully"
# Immediately scrub the credential from remote URL for security
git -C android-passport-reader remote set-url origin https://github.com/selfxyz/android-passport-reader.git || true
git -C android-passport-nfc-reader remote set-url origin https://github.com/selfxyz/android-passport-nfc-reader.git || true
else
echo "❌ Failed to clone android-passport-reader"
echo "❌ Failed to clone android-passport-nfc-reader"
echo "Please ensure a valid SELFXYZ internal PAT is provided to this action"
exit 1
fi
elif [ "$CI" = "true" ]; then
echo "⚠️ android-passport-reader exists in CI - this is unexpected"
echo "⚠️ android-passport-nfc-reader exists in CI - this is unexpected"
echo "📁 Directory contents:"
ls -la android/android-passport-reader/ || true
ls -la android/android-passport-nfc-reader/ || true
else
echo "📁 android-passport-reader already exists - preserving existing directory"
echo "📁 android-passport-nfc-reader already exists - preserving existing directory"
echo "ℹ️ Local development environment detected - your changes are safe"
fi
4 changes: 2 additions & 2 deletions .github/workflows/mobile-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,8 @@ jobs:
run: |
echo "Cache miss for built dependencies. Building now..."
yarn workspace @selfxyz/mobile-app run build:deps
- name: Clone android-passport-reader
uses: ./.github/actions/clone-android-passport-reader
- name: Clone android-passport-nfc-reader
uses: ./.github/actions/clone-android-passport-nfc-reader
with:
working_directory: ${{ env.APP_PATH }}
selfxyz_internal_pat: ${{ secrets.SELFXYZ_INTERNAL_REPO_PAT }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mobile-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -854,9 +854,9 @@ jobs:
python -m pip install --upgrade pip
pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client

- name: Clone android-passport-reader
- name: Clone android-passport-nfc-reader
if: inputs.platform != 'ios'
uses: ./.github/actions/clone-android-passport-reader
uses: ./.github/actions/clone-android-passport-nfc-reader
with:
working_directory: ${{ env.APP_PATH }}
selfxyz_internal_pat: ${{ secrets.SELFXYZ_INTERNAL_REPO_PAT }}
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/mobile-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ jobs:
echo "Building dependencies..."
yarn workspace @selfxyz/mobile-app run build:deps || { echo "❌ Dependency build failed"; exit 1; }
echo "✅ Dependencies built successfully"
- name: Clone android-passport-reader
uses: ./.github/actions/clone-android-passport-reader
- name: Clone android-passport-nfc-reader
uses: ./.github/actions/clone-android-passport-nfc-reader
with:
working_directory: app
selfxyz_internal_pat: ${{ secrets.SELFXYZ_INTERNAL_REPO_PAT }}
Expand All @@ -120,7 +120,7 @@ jobs:
chmod +x app/android/gradlew
(cd app/android && ./gradlew assembleDebug --quiet --parallel --build-cache --no-configuration-cache) || { echo "❌ Android build failed"; exit 1; }
echo "✅ Android build succeeded"
- name: Verify APK and android-passport-reader integration
- name: Verify APK and android-passport-nfc-reader integration
run: |
echo "🔍 Verifying build artifacts..."
APK_PATH="app/android/app/build/outputs/apk/debug/app-debug.apk"
Expand All @@ -131,15 +131,15 @@ jobs:
APK_SIZE=$(stat -f%z "$APK_PATH" 2>/dev/null || stat -c%s "$APK_PATH" 2>/dev/null || echo "unknown")
echo "📱 APK size: $APK_SIZE bytes"

# Verify android-passport-reader was properly integrated (skip for forks)
# Verify android-passport-nfc-reader was properly integrated (skip for forks)
if [ -z "${SELFXYZ_INTERNAL_REPO_PAT:-}" ]; then
echo "🔕 No PAT available — skipping private module verification"
elif [ -d "app/android/android-passport-reader" ]; then
echo "✅ android-passport-reader directory exists"
echo "📁 android-passport-reader contents:"
ls -la app/android/android-passport-reader/ | head -10
elif [ -d "app/android/android-passport-nfc-reader" ]; then
echo "✅ android-passport-nfc-reader directory exists"
echo "📁 android-passport-nfc-reader contents:"
ls -la app/android/android-passport-nfc-reader/ | head -10
else
echo "❌ android-passport-reader directory not found"
echo "❌ android-passport-nfc-reader directory not found"
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ mobile-sdk-alpha-ci.tgz
dataInput.d.ts

# Private Android modules (cloned at build time)
app/android/android-passport-reader/
app/android/android-passport-nfc-reader/
2 changes: 1 addition & 1 deletion app/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ includeBuild('../../node_modules/@react-native/gradle-plugin')
include ':react-native-passport-reader'
project(':react-native-passport-reader').projectDir = new File(rootProject.projectDir, './react-native-passport-reader/android')
include ':passportreader'
project(':passportreader').projectDir = new File(rootProject.projectDir, './android-passport-reader/app')
project(':passportreader').projectDir = new File(rootProject.projectDir, './android-passport-nfc-reader/app')
22 changes: 11 additions & 11 deletions app/scripts/mobile-ci-build-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,40 +87,40 @@ cd "$PROJECT_ROOT"

log "Working directory: $(pwd)"

# Clone android-passport-reader if it doesn't exist (for local development)
# Clone android-passport-nfc-reader if it doesn't exist (for local development)
# Note: In CI, this is usually handled by GitHub action, but we keep this as fallback
if [[ ! -d "app/android/android-passport-reader" ]]; then
log "Cloning android-passport-reader for build..."
if [[ ! -d "app/android/android-passport-nfc-reader" ]]; then
log "Cloning android-passport-nfc-reader for build..."
cd app/android

# Use different clone methods based on environment
if is_ci && [[ -n "${SELFXYZ_INTERNAL_REPO_PAT:-}" ]]; then
# CI environment with PAT (fallback if action didn't run)
git clone "https://${SELFXYZ_INTERNAL_REPO_PAT}@github.com/selfxyz/android-passport-reader.git" || {
log "ERROR: Failed to clone android-passport-reader with PAT"
git clone "https://${SELFXYZ_INTERNAL_REPO_PAT}@github.com/selfxyz/android-passport-nfc-reader.git" || {
log "ERROR: Failed to clone android-passport-nfc-reader with PAT"
exit 1
}
elif [[ -n "${SSH_AUTH_SOCK:-}" ]] || [[ -f "${HOME}/.ssh/id_rsa" ]] || [[ -f "${HOME}/.ssh/id_ed25519" ]]; then
# Local development with SSH
git clone "[email protected]:selfxyz/android-passport-reader.git" || {
log "ERROR: Failed to clone android-passport-reader with SSH"
git clone "[email protected]:selfxyz/android-passport-nfc-reader.git" || {
log "ERROR: Failed to clone android-passport-nfc-reader with SSH"
log "Please ensure you have SSH access to the repository or set SELFXYZ_INTERNAL_REPO_PAT"
exit 1
}
else
log "ERROR: No authentication method available for cloning android-passport-reader"
log "ERROR: No authentication method available for cloning android-passport-nfc-reader"
log "Please either:"
log " - Set up SSH access (for local development)"
log " - Set SELFXYZ_INTERNAL_REPO_PAT environment variable (for CI)"
exit 1
fi

cd ../../
log "✅ android-passport-reader cloned successfully"
log "✅ android-passport-nfc-reader cloned successfully"
elif is_ci; then
log "📁 android-passport-reader exists (likely cloned by GitHub action)"
log "📁 android-passport-nfc-reader exists (likely cloned by GitHub action)"
else
log "📁 android-passport-reader already exists - preserving existing directory"
log "📁 android-passport-nfc-reader already exists - preserving existing directory"
fi

# Build and package the SDK with timeout
Expand Down
9 changes: 6 additions & 3 deletions app/scripts/setup-private-modules.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ const path = require('path');
const SCRIPT_DIR = __dirname;
const APP_DIR = path.dirname(SCRIPT_DIR);
const ANDROID_DIR = path.join(APP_DIR, 'android');
const PRIVATE_MODULE_PATH = path.join(ANDROID_DIR, 'android-passport-reader');
const PRIVATE_MODULE_PATH = path.join(
ANDROID_DIR,
'android-passport-nfc-reader',
);

const GITHUB_ORG = 'selfxyz';
const REPO_NAME = 'android-passport-reader';
const REPO_NAME = 'android-passport-nfc-reader';
const BRANCH = 'main';

// Environment detection
Expand Down Expand Up @@ -163,7 +166,7 @@ function clonePrivateRepo() {
// Security: Use quiet mode for credentialed URLs to prevent token exposure
const isCredentialedUrl = isCI && repoToken;
const quietFlag = isCredentialedUrl ? '--quiet' : '';
const cloneCommand = `git clone --branch ${BRANCH} --single-branch --depth 1 ${quietFlag} "${cloneUrl}" android-passport-reader`;
const cloneCommand = `git clone --branch ${BRANCH} --single-branch --depth 1 ${quietFlag} "${cloneUrl}" android-passport-nfc-reader`;

try {
if (isCredentialedUrl) {
Expand Down
Loading