diff --git a/.cursorignore b/.cursorignore index fd484e738..caed5f49a 100644 --- a/.cursorignore +++ b/.cursorignore @@ -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 @@ -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 diff --git a/.github/actions/clone-android-passport-reader/action.yml b/.github/actions/clone-android-passport-nfc-reader/action.yml similarity index 58% rename from .github/actions/clone-android-passport-reader/action.yml rename to .github/actions/clone-android-passport-nfc-reader/action.yml index 4b8015fe6..409867ae4 100644 --- a/.github/actions/clone-android-passport-reader/action.yml +++ b/.github/actions/clone-android-passport-nfc-reader/action.yml @@ -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: @@ -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 @@ -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 diff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.yml index 95202a06d..2d1faaeba 100644 --- a/.github/workflows/mobile-ci.yml +++ b/.github/workflows/mobile-ci.yml @@ -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 }} diff --git a/.github/workflows/mobile-deploy.yml b/.github/workflows/mobile-deploy.yml index a3e6a7773..f83171d12 100644 --- a/.github/workflows/mobile-deploy.yml +++ b/.github/workflows/mobile-deploy.yml @@ -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 }} diff --git a/.github/workflows/mobile-e2e.yml b/.github/workflows/mobile-e2e.yml index 2bdb5de48..d7a225eea 100644 --- a/.github/workflows/mobile-e2e.yml +++ b/.github/workflows/mobile-e2e.yml @@ -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 }} @@ -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" @@ -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 diff --git a/.gitignore b/.gitignore index 77a53455a..45acf8eb3 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/app/android/settings.gradle b/app/android/settings.gradle index af8c37eeb..2ed4a8b12 100644 --- a/app/android/settings.gradle +++ b/app/android/settings.gradle @@ -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') diff --git a/app/scripts/mobile-ci-build-android.sh b/app/scripts/mobile-ci-build-android.sh index 29c94ce88..09be650ab 100755 --- a/app/scripts/mobile-ci-build-android.sh +++ b/app/scripts/mobile-ci-build-android.sh @@ -87,28 +87,28 @@ 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 "git@github.com:selfxyz/android-passport-reader.git" || { - log "ERROR: Failed to clone android-passport-reader with SSH" + git clone "git@github.com: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)" @@ -116,11 +116,11 @@ if [[ ! -d "app/android/android-passport-reader" ]]; then 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 diff --git a/app/scripts/setup-private-modules.cjs b/app/scripts/setup-private-modules.cjs index a71ef66ad..6054a5a2d 100644 --- a/app/scripts/setup-private-modules.cjs +++ b/app/scripts/setup-private-modules.cjs @@ -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 @@ -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) {