diff --git a/.env b/.env index 6ed93c8c..6f09c5b5 100644 --- a/.env +++ b/.env @@ -1,3 +1,14 @@ -MIMOTO_HOST=https://api.qa-121.mosip.net/residentmobileapp +# after making changes to the env file, ensure to start the bundler (or the project) with a --reset-cache +# eg . npm build android:newlogic --reset-cache + +MIMOTO_HOST=https://api.qa-inji.mosip.net #MIMOTO_HOST=http://mock.mimoto.newlogic.dev GOOGLE_NEARBY_MESSAGES_API_KEY= +#Application Theme can be ( orange | purple ) +APPLICATION_THEME=orange + +#environment can be changed if it is toggled +CREDENTIAL_REGISTRY_EDIT=true + +#supported languages( en, fil, ar, hi, kn, ta) +APPLICATION_LANGUAGE=en diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index a9d4c52c..36dfa14e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,10 +1,10 @@ --- - name: Bug report about: Create a report to help us improve title: '' labels: bug, triage -assignees: +assignees: +--- **Describe the bug** A clear and concise description of what the bug is. @@ -20,18 +20,33 @@ Steps to reproduce the behavior: **Expected behavior** A clear and concise description of what you expected to happen. +**Actual behavior** +A clear and concise description of what factually occurred. + **Screenshots** -If applicable, add screenshots to help explain your problem. +If applicable, add screenshots to help explain your problem. + +**Add the screenshot of the profile page with commit id** **Smartphone (please complete the following information):** -- Device: [e.g. iPhone6] -- OS: [e.g. iOS8.1] +- Wallet Device: [e.g. iPhone6] + - Phone make/model: [e.g. :Vivo Y73] + - OS: [e.g. iOS8.1] + - BLE version : [e.g. 4.2] + +- Verifier Device: [e.g. iPhone6] + - Phone make/model: [e.g. :Vivo Y73] + - OS: [e.g. iOS8.1] + - BLE version : [e.g. 4.2] + - Inji app version: [e.g 0.3.0] - Mimoto version: [e.g 1.2.x] - MOSIP Version: [e.g. 1.2.1] -- Mimoto server: [e.g. https://.....com] -- MOSIP server: [e.g. https://...mosip.com] + +**Where does the issue occur: Wallet/Verifier?** + +**Logs of wallet and verifier:** **Additional context** Add any other context about the problem here. diff --git a/.github/workflows/android-beta-build.yml b/.github/workflows/android-beta-build.yml new file mode 100644 index 00000000..4747fcd6 --- /dev/null +++ b/.github/workflows/android-beta-build.yml @@ -0,0 +1,142 @@ +name: Android Beta Build + +env: + backendServiceDefaultUrl: https://api.sandbox.mosip.net + +on: + workflow_dispatch: + inputs: + tag: + description: 'Tag to be published' + required: true + default: 'v1.2.3' + type: string + body: + description: 'Release body message' + required: true + default: 'Changes in this Release' + type: string + pre-release: + description: 'Pre-release? True/False' + required: true + default: False + type: string + backendServiceUrl: + description: 'Backend service URL' + required: true + default: 'https://api.sandbox.mosip.net' + type: string + theme: + description: 'Application Theme' + required: true + default: 'orange' + type: choice + options: + - orange + - purple + buildDescription: + description: 'What to test' + required: true + default: 'QA-Triple environment' + type: string + registry_edit: + description: 'Edit Registry' + required: true + default: 'true' + type: choice + options: + - false + - true + +jobs: + build-android: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3.1.0 + - uses: actions/setup-node@v3 + with: + node-version: '16.x' + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + with: + tag_name: ${{ github.event.inputs.tag }} + release_name: ${{ github.event.inputs.tag }} + body: ${{ github.event.inputs.body }} + draft: false + prerelease: ${{fromJSON(github.event.inputs.pre-release)}} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Check for git tag + run: | + cd android/scripts + ./git-tag.sh + + - name: Install npm dependencies + run: | + npm ci + + - name: Create .env.local file + run: | + echo "${{ secrets.ENV_FILE }}" > .env.local > android/local.properties + + - name: Setup branch and env + run: | + # Strip git ref prefix from version + echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV + echo "GPG_TTY=$(tty)" >> $GITHUB_ENV + + - name: Setup branch and GPG public key + run: | + # Strip git ref prefix from version + echo ${{ env.BRANCH_NAME }} + echo ${{ env.GPG_TTY }} + + sudo apt-get --yes install gnupg2 + gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg + gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg + + - name: Setup Firebase + run: | + cd android + if [ ! -z "$FIREBASE_SECRET" ] && [ -f app/google-services.json.gpg ];then rm -f app/google-services.json;gpg2 --quiet --batch --passphrase=$FIREBASE_SECRET --pinentry-mode loopback --decrypt --output app/google-services.json app/mosip-google-services.json.gpg;fi + env: + FIREBASE_SECRET: ${{ secrets.GPG_SECRET }} + + - name: Generate keystore + run: | + echo "$ANDROID_KEYSTORE_FILE" > release.keystore.b64 + base64 -d -i release.keystore.b64 > android/app/release.keystore + env: + ANDROID_KEYSTORE_FILE: ${{ secrets.INJI_ANDROID_RELEASE_KEYSTORE }} + + - name: Export variables for keystore + run: | + cd android/app + export RELEASE_KEYSTORE_ALIAS=androidreleasekey + export RELEASE_KEYSTORE_PASSWORD=$RELEASE_KEYSTORE_PASSWORD + env: + RELEASE_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_RELEASE_STOREPASS}}' + + - name: Create Google Play Config file + run : | + cd android + echo "$INJI_ANDROID_PLAY_STORE_CONFIG_JSON" > play_config.json.b64 + base64 -d -i play_config.json.b64 > play_config.json + env: + INJI_ANDROID_PLAY_STORE_CONFIG_JSON: ${{ secrets.INJI_ANDROID_PLAY_STORE_CONFIG_JSON }} + + - name: Run Build + run: | + cd android/scripts + ./beta-build.sh + env: + MIMOTO_HOST: ${{ github.event.inputs.backendServiceUrl }} + APPLICATION_THEME: ${{ github.event.inputs.theme }} + RELEASE_KEYSTORE_ALIAS: androidreleasekey + RELEASE_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_RELEASE_STOREPASS}}' + SLACK_URL: '${{ secrets.SLACK_WEBHOOK_DEVOPS }}' + PLAY_CONSOLE_RELEASE_DESCRIPTION: ${{ github.event.inputs.buildDescription }} + CREDENTIAL_REGISTRY_EDIT: ${{ github.event.inputs.registry_edit }} \ No newline at end of file diff --git a/.github/workflows/android.yml b/.github/workflows/android-build-verify.yml similarity index 51% rename from .github/workflows/android.yml rename to .github/workflows/android-build-verify.yml index a1f4db45..6ca8c2b5 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android-build-verify.yml @@ -1,4 +1,7 @@ -name: ID PASS - MOSIP Resident Application +name: PR - Android build verification + +env: + backendServiceDefaultUrl: https://api.sandbox.mosip.net on: push: @@ -7,16 +10,26 @@ on: - develop - demobranch - qa-develop + - 0.9 tags: - '*' + pull_request: + types: [ opened, synchronize ] + branches: + - develop + - 'release-**' + tags: + - '*' jobs: build-android: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3.1.0 - - # Cache stuff for faster build + - uses: actions/setup-node@v3 + with: + node-version: '16.x' + - name: Cache local npm repository uses: actions/cache@v3.0.11 with: @@ -30,7 +43,7 @@ jobs: path: | ~/.gradle/caches ~/.gradle/wrapper - + - name: Install npm dependencies run: | npm ci @@ -39,33 +52,63 @@ jobs: run: | echo "${{ secrets.ENV_FILE }}" > .env.local > android/local.properties - - name: Setup branch and env + - name: Setup branch and env run: | # Strip git ref prefix from version echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV echo "GPG_TTY=$(tty)" >> $GITHUB_ENV - - name: Setup branch and GPG public key + + - name: Setup branch and GPG public key run: | # Strip git ref prefix from version - echo ${{ env.BRANCH_NAME }} - echo ${{ env.GPG_TTY }} + sudo apt-get --yes install gnupg2 gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg - gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg + gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg - - name: Build App Newlogic Release + - name: Setup Firebase run: | cd android if [ ! -z "$FIREBASE_SECRET" ] && [ -f app/google-services.json.gpg ];then rm -f app/google-services.json;gpg2 --quiet --batch --passphrase=$FIREBASE_SECRET --pinentry-mode loopback --decrypt --output app/google-services.json app/mosip-google-services.json.gpg;fi - ./gradlew :app:assembleNewlogicRelease env: FIREBASE_SECRET: ${{ secrets.GPG_SECRET }} + + - name: Generate keystore + run: | + keytool \ + -genkey -v \ + -storetype PKCS12 \ + -keyalg RSA \ + -keysize 2048 \ + -validity 10000 \ + -storepass $DEBUG_KEYSTORE_PASSWORD \ + -keypass $DEBUG_KEYSTORE_PASSWORD \ + -alias androiddebugkey \ + -keystore android/app/debug.keystore \ + -dname "CN=io.mosip.residentapp,OU=,O=,L=,S=,C=US" + env: + DEBUG_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_DEBUG_STOREPASS}}' - - name: Upload Artifact - uses: actions/upload-artifact@v3.1.1 + - name: Export variables for keystore + run: | + cd android/app + export DEBUG_KEYSTORE_ALIAS=androiddebugkey + export DEBUG_KEYSTORE_PASSWORD=$DEBUG_KEYSTORE_PASSWORD + env: + DEBUG_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_DEBUG_STOREPASS}}' + + - name: Bump version code + uses: chkfung/android-version-actions@v1.2.1 with: - name: output - path: android/app/build/outputs/apk/newlogic/release/ - retention-days: 1 + gradlePath: android/app/build.gradle + versionCode: ${{github.run_number}} + + - name: Run Build using Fastlane + run: | + cd android/scripts + ./verify-build.sh + env: + DEBUG_KEYSTORE_ALIAS: androiddebugkey + DEBUG_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_DEBUG_STOREPASS}}' \ No newline at end of file diff --git a/.github/workflows/android-custom-build.yml b/.github/workflows/android-custom-build.yml deleted file mode 100644 index 653938b8..00000000 --- a/.github/workflows/android-custom-build.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: ID PASS - MOSIP Resident Application Custom build - -env: - backendServiceDefaultUrl: https://api.qa-121.mosip.net/residentmobileapp - -on: - workflow_dispatch: - inputs: - backendServiceUrl: - description: 'Backend service URL' - required: true - default: 'https://api.qa-121.mosip.net/residentmobileapp' - type: string - -jobs: - build-android: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.1.0 - - # Cache stuff for faster build - - name: Cache local npm repository - uses: actions/cache@v3.0.11 - with: - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - path: ~/.npm - - - name: Cache local gradle repository - uses: actions/cache@v3.0.11 - with: - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - path: | - ~/.gradle/caches - ~/.gradle/wrapper - - - name: Install npm dependencies - run: | - npm install - - - name: Create .env.local file - run: | - echo "${{ secrets.ENV_FILE }}" > .env.local > android/local.properties - - - name: Setup branch and env - run: | - # Strip git ref prefix from version - echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV - echo "GPG_TTY=$(tty)" >> $GITHUB_ENV - - - name: Setup branch and GPG public key - run: | - # Strip git ref prefix from version - - echo ${{ env.BRANCH_NAME }} - - echo ${{ env.GPG_TTY }} - sudo apt-get --yes install gnupg2 - gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg - gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg - - - name: Build App Newlogic Release - run: | - cd android - if [ ! -z "$FIREBASE_SECRET" ] && [ -f app/google-services.json.gpg ];then rm -f app/google-services.json;gpg2 --quiet --batch --passphrase=$FIREBASE_SECRET --pinentry-mode loopback --decrypt --output app/google-services.json app/mosip-google-services.json.gpg;fi - ./gradlew :app:assembleNewlogicRelease - env: - MIMOTO_HOST: ${{ github.event.inputs.backendServiceUrl }} - FIREBASE_SECRET: ${{ secrets.GPG_SECRET }} - - name: Upload Artifact - uses: actions/upload-artifact@v3.1.1 - with: - name: apk-output - path: android/app/build/outputs/apk/newlogic/release/ - retention-days: 10 diff --git a/.github/workflows/android-internal-build.yml b/.github/workflows/android-internal-build.yml new file mode 100644 index 00000000..9e0622e8 --- /dev/null +++ b/.github/workflows/android-internal-build.yml @@ -0,0 +1,124 @@ +name: Android Internal Build + +env: + backendServiceDefaultUrl: https://api.sandbox.mosip.net + +on: + workflow_dispatch: + inputs: + backendServiceUrl: + description: 'Backend service URL' + required: true + default: 'https://api.sandbox.mosip.net' + type: string + theme: + description: 'Application Theme' + required: true + default: 'orange' + type: choice + options: + - orange + - purple + buildDescription: + description: 'What to test' + required: true + default: 'QA-Triple environment' + type: string + registry_edit: + description: 'Edit Registry' + required: true + default: 'true' + type: choice + options: + - false + - true + +jobs: + build-android: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3.1.0 + - uses: actions/setup-node@v3 + with: + node-version: '16.x' + + - name: Cache local npm repository + uses: actions/cache@v3.0.11 + with: + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + path: ~/.npm + + - name: Cache local gradle repository + uses: actions/cache@v3.0.11 + with: + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + path: | + ~/.gradle/caches + ~/.gradle/wrapper + + - name: Install npm dependencies + run: | + npm ci + + - name: Create .env.local file + run: | + echo "${{ secrets.ENV_FILE }}" > .env.local > android/local.properties + + - name: Setup branch and env + run: | + # Strip git ref prefix from version + echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV + echo "GPG_TTY=$(tty)" >> $GITHUB_ENV + + - name: Setup branch and GPG public key + run: | + # Strip git ref prefix from version + echo ${{ env.BRANCH_NAME }} + echo ${{ env.GPG_TTY }} + + sudo apt-get --yes install gnupg2 + gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg + gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg + + - name: Setup Firebase + run: | + cd android + if [ ! -z "$FIREBASE_SECRET" ] && [ -f app/google-services.json.gpg ];then rm -f app/google-services.json;gpg2 --quiet --batch --passphrase=$FIREBASE_SECRET --pinentry-mode loopback --decrypt --output app/google-services.json app/mosip-google-services.json.gpg;fi + env: + FIREBASE_SECRET: ${{ secrets.GPG_SECRET }} + + - name: Generate keystore + run: | + echo "$ANDROID_KEYSTORE_FILE" > release.keystore.b64 + base64 -d -i release.keystore.b64 > android/app/release.keystore + env: + ANDROID_KEYSTORE_FILE: ${{ secrets.INJI_ANDROID_RELEASE_KEYSTORE }} + + - name: Export variables for keystore + run: | + cd android/app + export RELEASE_KEYSTORE_ALIAS=androidreleasekey + export RELEASE_KEYSTORE_PASSWORD=$RELEASE_KEYSTORE_PASSWORD + env: + RELEASE_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_RELEASE_STOREPASS}}' + + - name: Create Google Play Config file + run : | + cd android + echo "$INJI_ANDROID_PLAY_STORE_CONFIG_JSON" > play_config.json.b64 + base64 -d -i play_config.json.b64 > play_config.json + env: + INJI_ANDROID_PLAY_STORE_CONFIG_JSON: ${{ secrets.INJI_ANDROID_PLAY_STORE_CONFIG_JSON }} + + - name: Run Build + run: | + cd android/scripts + ./internal-build.sh + env: + MIMOTO_HOST: ${{ github.event.inputs.backendServiceUrl }} + APPLICATION_THEME: ${{ github.event.inputs.theme }} + RELEASE_KEYSTORE_ALIAS: androidreleasekey + RELEASE_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_RELEASE_STOREPASS}}' + SLACK_URL: '${{ secrets.SLACK_WEBHOOK_DEVOPS }}' + PLAY_CONSOLE_RELEASE_DESCRIPTION: ${{ github.event.inputs.buildDescription }} + CREDENTIAL_REGISTRY_EDIT: ${{ github.event.inputs.registry_edit }} \ No newline at end of file diff --git a/.github/workflows/clear_artifacts.yml b/.github/workflows/clear_artifacts.yml index 0af8038e..d880e16c 100644 --- a/.github/workflows/clear_artifacts.yml +++ b/.github/workflows/clear_artifacts.yml @@ -1,4 +1,7 @@ name: 'Delete old artifacts' +on: + workflow_dispatch: +name: 'Delete old artifacts' on: workflow_dispatch: @@ -8,5 +11,5 @@ jobs: steps: - uses: kolpav/purge-artifacts-action@v1 with: - token: ${{ secrets. access_token }} + token: ${{ secrets.ACTION_PAT }} expire-in: 2days # Setting this to 0 will delete all artifacts \ No newline at end of file diff --git a/.github/workflows/ios-build-verify.yml b/.github/workflows/ios-build-verify.yml new file mode 100644 index 00000000..b61f464c --- /dev/null +++ b/.github/workflows/ios-build-verify.yml @@ -0,0 +1,59 @@ +name: PR - IOS build verification + +on: + push: + branches: + - main + - develop + - demobranch + - qa-develop + - 0.9 + tags: + - '*' + pull_request: + types: [ opened, synchronize ] + branches: + - develop + - 'release-**' + tags: + - '*' + +jobs: + build_ios: + name: Building the IPA + runs-on: macos-13 + + steps: + - uses: actions/checkout@v3.1.0 + - uses: actions/setup-node@v3 + with: + node-version: '16.x' + + - name: Install npm dependencies + run: | + npm install + + - name: Install Pod + run: | + cd ios + pod install + + - name: Building the IPA + run: | + cd ios + fastlane build_verify + env: + APP_STORE_CONNECT_TEAM_ID: '${{ secrets.APP_STORE_CONNECT_TEAM_ID }}' + DEVELOPER_APP_ID: '${{ secrets.IOS_INJI_DEVELOPER_APP_ID }}' + INJI_IOS_DEVELOPER_APP_IDENTIFIER: '${{ secrets.INJI_IOS_DEVELOPER_APP_IDENTIFIER }}' + INJI_IOS_DEVELOPER_PORTAL_TEAM_ID: '${{ secrets.INJI_IOS_DEVELOPER_PORTAL_TEAM_ID }}' + INJI_IOS_FASTLANE_APPLE_ID: '${{ secrets.INJI_IOS_FASTLANE_APPLE_ID }}' + INJI_IOS_FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: '${{ secrets.INJI_IOS_FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}' + GIT_AUTHORIZATION: '${{ secrets.GIT_AUTHORIZATION }}' + INJI_IOS_PROVISIONING_PROFILE_SPECIFIER: '${{ secrets.INJI_IOS_PROVISIONING_PROFILE_SPECIFIER }}' + INJI_IOS_TEMP_KEYCHAIN_PASSWORD: '${{ secrets.INJI_IOS_TEMP_KEYCHAIN_PASSWORD }}' + INJI_IOS_TEMP_KEYCHAIN_USER: '${{ secrets.INJI_IOS_TEMP_KEYCHAIN_USER }}' + APPLE_KEY_ID: '${{ secrets.APPLE_KEY_ID }}' + APPLE_ISSUER_ID: '${{ secrets.APPLE_ISSUER_ID }}' + APPLE_KEY_CONTENT: '${{ secrets.APPLE_KEY_CONTENT }}' + MATCH_PASSWORD: '${{ secrets.INJI_IOS_MATCH_PASSWORD }}' \ No newline at end of file diff --git a/.github/workflows/ios-build.yml b/.github/workflows/ios-build.yml new file mode 100644 index 00000000..2a955c5d --- /dev/null +++ b/.github/workflows/ios-build.yml @@ -0,0 +1,88 @@ +name: Inji iOS build + +on: + workflow_dispatch: + inputs: + backendServiceUrl: + description: 'Backend service URL' + required: true + default: 'https://api.sandbox.mosip.net' + type: string + theme: + description: 'Application Theme' + required: true + default: 'orange' + type: choice + options: + - orange + - purple + registry_edit: + description: 'Edit Registry' + required: true + default: 'true' + type: choice + options: + - false + - true + internal-testers: + description: 'Internal Testers Group' + required: true + default: 'QA-Triple' + type: choice + options: + - Dev-testing + - MEC + - QA + - MOSIP-Collab + - MOSIP-Dev-testing + buildDescription: + description: 'What to test' + required: true + default: 'QA-Triple environment build' + type: string + +jobs: + build_ios: + name: Deploying to Testflight + runs-on: macos-13 + + steps: + - uses: actions/checkout@v3.1.0 + - uses: actions/setup-node@v3 + with: + node-version: '16.x' + + - name: Install npm dependencies + run: | + npm install + + - name: Install Pod + run: | + cd ios + pod install + + - name: Deploy iOS Beta to TestFlight + run: | + cd ios + fastlane beta + env: + APP_STORE_CONNECT_TEAM_ID: '${{ secrets.APP_STORE_CONNECT_TEAM_ID }}' + DEVELOPER_APP_ID: '${{ secrets.IOS_INJI_DEVELOPER_APP_ID }}' + INJI_IOS_DEVELOPER_APP_IDENTIFIER: '${{ secrets.INJI_IOS_DEVELOPER_APP_IDENTIFIER }}' + INJI_IOS_DEVELOPER_PORTAL_TEAM_ID: '${{ secrets.INJI_IOS_DEVELOPER_PORTAL_TEAM_ID }}' + INJI_IOS_FASTLANE_APPLE_ID: '${{ secrets.INJI_IOS_FASTLANE_APPLE_ID }}' + INJI_IOS_FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: '${{ secrets.INJI_IOS_FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}' + GIT_AUTHORIZATION: '${{ secrets.GIT_AUTHORIZATION }}' + INJI_IOS_PROVISIONING_PROFILE_SPECIFIER: '${{ secrets.INJI_IOS_PROVISIONING_PROFILE_SPECIFIER }}' + INJI_IOS_TEMP_KEYCHAIN_PASSWORD: '${{ secrets.INJI_IOS_TEMP_KEYCHAIN_PASSWORD }}' + INJI_IOS_TEMP_KEYCHAIN_USER: '${{ secrets.INJI_IOS_TEMP_KEYCHAIN_USER }}' + APPLE_KEY_ID: '${{ secrets.APPLE_KEY_ID }}' + APPLE_ISSUER_ID: '${{ secrets.APPLE_ISSUER_ID }}' + APPLE_KEY_CONTENT: '${{ secrets.APPLE_KEY_CONTENT }}' + SLACK_URL: '${{ secrets.SLACK_WEBHOOK_DEVOPS }}' + MATCH_PASSWORD: '${{ secrets.INJI_IOS_MATCH_PASSWORD }}' + APPLICATION_THEME: ${{ github.event.inputs.theme }} + CREDENTIAL_REGISTRY_EDIT: ${{ github.event.inputs.registry_edit }} + MIMOTO_HOST: ${{ github.event.inputs.backendServiceUrl }} + TESTFLIGHT_INTERNAL_TESTERS_GROUP: ${{ github.event.inputs.internal-testers }} + TESTFLIGHT_BETA_APP_DESCRIPTION: ${{ github.event.inputs.buildDescription }} diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml deleted file mode 100644 index c216c4b2..00000000 --- a/.github/workflows/tag.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: Tagging of repos - -env: - tag: v1.2.3 - -on: - workflow_dispatch: - inputs: - tag: - description: 'Tag to be published' - required: true - default: 'v1.2.3' - type: string - body: - description: 'Release body message' - required: true - default: 'Changes in this Release' - type: string - pre-release: - description: 'Pre-release? True/False' - required: true - default: False - type: string - -jobs: - build: - name: Create Release - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3.1.0 - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ github.event.inputs.tag }} - release_name: ${{ github.event.inputs.tag }} - body: | - ${{ github.event.inputs.body }} - draft: false - prerelease: ${{fromJSON(github.event.inputs.pre-release)}} diff --git a/.gitignore b/.gitignore index 9427ae30..dc099a79 100644 --- a/.gitignore +++ b/.gitignore @@ -60,8 +60,6 @@ yarn-error.log # BUCK buck-out/ \.buckd/ -*.keystore -!debug.keystore # Bundle artifacts *.jsbundle @@ -90,4 +88,9 @@ dist/ .vscode/ temp/ .eslintcache -.env.local \ No newline at end of file +.env.local + +.yalc/ +yalc.lock + +android/app/debug.keystore diff --git a/App.tsx b/App.tsx index 6b94c86e..8f9f5799 100644 --- a/App.tsx +++ b/App.tsx @@ -1,20 +1,105 @@ -import React, { useContext } from 'react'; +import React, { useContext, useEffect } from 'react'; import AppLoading from 'expo-app-loading'; import { AppLayout } from './screens/AppLayout'; import { useFont } from './shared/hooks/useFont'; import { GlobalContextProvider } from './components/GlobalContextProvider'; import { GlobalContext } from './shared/GlobalContext'; import { useSelector } from '@xstate/react'; -import { selectIsReady } from './machines/app'; +import { useTranslation } from 'react-i18next'; +import { + selectIsDecryptError, + selectIsKeyInvalidateError, + selectIsReadError, + selectIsReady, +} from './machines/app'; +import { DualMessageOverlay } from './components/DualMessageOverlay'; +import { useApp } from './screens/AppController'; +import { Alert } from 'react-native'; +import { ErrorMessageOverlay } from './components/MessageOverlay'; +import SecureKeystore from 'react-native-secure-keystore'; +import { isCustomSecureKeystore } from './shared/cryptoutil/cryptoUtil'; +import i18n from './i18n'; -import './i18n'; +// kludge: this is a bad practice but has been done temporarily to surface +// an occurance of a bug with minimal residual code changes, this should +// be removed once the bug cause is determined & fixed, ref: INJI-222 +const DecryptErrorAlert = (controller, t) => { + const heading = t('errors.decryptionFailed'); + const desc = t('errors.decryptionFailed'); + const ignoreBtnTxt = t('ignore'); + Alert.alert(heading, desc, [ + { + text: ignoreBtnTxt, + onPress: () => controller.ignoreDecrypt(), + style: 'cancel', + }, + ]); +}; + +const AppLayoutWrapper: React.FC = () => { + const { appService } = useContext(GlobalContext); + const isDecryptError = useSelector(appService, selectIsDecryptError); + const controller = useApp(); + const { t } = useTranslation('WelcomeScreen'); + if (isDecryptError) { + DecryptErrorAlert(controller, t); + } + return ; +}; + +const AppLoadingWrapper: React.FC = () => { + const { appService } = useContext(GlobalContext); + const isReadError = useSelector(appService, selectIsReadError); + const isKeyInvalidateError = useSelector( + appService, + selectIsKeyInvalidateError + ); + const controller = useApp(); + const { t } = useTranslation('WelcomeScreen'); + return ( + <> + + + + + {isReadError ? ( + + ) : null} + + ); +}; const AppInitialization: React.FC = () => { const { appService } = useContext(GlobalContext); - const hasFontsLoaded = useFont(); const isReady = useSelector(appService, selectIsReady); + const hasFontsLoaded = useFont(); + const { t } = useTranslation('common'); - return isReady && hasFontsLoaded ? : ; + useEffect(() => { + if (isCustomSecureKeystore()) { + SecureKeystore.updatePopup( + t('biometricPopup.title'), + t('biometricPopup.description') + ); + } + }, [i18n.language]); + + return isReady && hasFontsLoaded ? ( + + ) : ( + + ); }; export default function App() { diff --git a/AppMetaData.md b/AppMetaData.md new file mode 100644 index 00000000..63a9751a --- /dev/null +++ b/AppMetaData.md @@ -0,0 +1 @@ +Inji is a mobile app that can be used as a digital wallet to store credentials. It also allows verification of identity in both offline and online modes, at any place and time. diff --git a/README.md b/README.md index 6593015a..ef19c1bb 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Be sure to have the following build tools installed before proceeding: ## Generate keystore for APK signing ```shell + # Generate and use Debug keystore for development and testing purposes keytool \ -genkey -v \ -storetype PKCS12 \ @@ -23,6 +24,21 @@ keytool \ -validity 10000 \ -storepass 'android' \ -keypass 'android' \ + -alias androiddebugkey \ + -keystore android/app/debug.keystore \ + -dname "CN=io.mosip.residentapp,OU=,O=,L=,S=,C=US" +``` + +```shell + # Generate and use Release keystore for Publishing to Play store + keytool \ + -genkey -v \ + -storetype PKCS12 \ + -keyalg RSA \ + -keysize 2048 \ + -validity 10000 \ + -storepass '' \ + -keypass '' \ -alias androidreleasekey \ -keystore android/app/release.keystore \ -dname "CN=io.mosip.residentapp,OU=,O=,L=,S=,C=US" @@ -93,15 +109,19 @@ You need Android SDK CLI to build APK. # 1. Install dependencies npm install -# Setup the environment variable for keystore -export RELEASE_KEYSTORE=release.keystore +# 2. Setup the environment variables for the keystore + +# Debug keystore +export DEBUG_KEYSTORE_ALIAS=androiddebugkey +export DEBUG_KEYSTORE_PASSWORD=android + +# Release keystore export RELEASE_KEYSTORE_ALIAS=androidreleasekey -export RELEASE_KEYSTORE_PASSWORD=android +export RELEASE_KEYSTORE_PASSWORD= + # https://hostname/residentmobileapp is the Mimoto service url export BACKEND_SERVICE_URL=https://hostname/residentmobileapp -# Use DEBUG_KEYSTORE, DEBUG_KEYSTORE_ALIAS, DEBUG_KEYSTORE_PASSWORD for debug build - # Use one of following command to build the flavor you need. # Build for Mosip Philippines test npm run build:android:ph @@ -143,6 +163,14 @@ More info here: - [React Native - Publishing to the App Store](https://reactnative.dev/docs/publishing-to-app-store) - [Apple Developer - Distributing Your App for Beta Testing and Releases](https://developer.apple.com/documentation/xcode/distributing-your-app-for-beta-testing-and-releases) +## View the complete DB : + +1. Connect your phone to the laptop and open Android Studio. +2. On the bottom right vertical tab you will find a `Device File Explorer` button. Click on it and select you phone. +3. Navigate to `data -> data -> io.mosip.residentapp ->databases`. You will find a file named `RKStorage` in it. Download it. +4. Download [DB Browser for SQLite](https://sqlitebrowser.org/dl/) . +5. Open the file in this application. Click on `Browse Data` button and select `catalystLocalStorage` table. Now you should be able to view the entire DB of Inji. + ## Credits Credits listed [here](/Credits.md) diff --git a/android/.project b/android/.project index 03a28c13..69649cfb 100644 --- a/android/.project +++ b/android/.project @@ -1,6 +1,6 @@ - MOSIP Resident App + Inji Project android created by Buildship. diff --git a/android/Gemfile b/android/Gemfile new file mode 100644 index 00000000..cdd3a6b3 --- /dev/null +++ b/android/Gemfile @@ -0,0 +1,6 @@ +source "https://rubygems.org" + +gem "fastlane" + +plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') +eval_gemfile(plugins_path) if File.exist?(plugins_path) diff --git a/android/Gemfile.lock b/android/Gemfile.lock new file mode 100644 index 00000000..8e33dcae --- /dev/null +++ b/android/Gemfile.lock @@ -0,0 +1,220 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.6) + rexml + addressable (2.8.4) + public_suffix (>= 2.0.2, < 6.0) + artifactory (3.0.15) + atomos (0.1.3) + aws-eventstream (1.2.0) + aws-partitions (1.765.0) + aws-sdk-core (3.172.0) + aws-eventstream (~> 1, >= 1.0.2) + aws-partitions (~> 1, >= 1.651.0) + aws-sigv4 (~> 1.5) + jmespath (~> 1, >= 1.6.1) + aws-sdk-kms (1.64.0) + aws-sdk-core (~> 3, >= 3.165.0) + aws-sigv4 (~> 1.1) + aws-sdk-s3 (1.122.0) + aws-sdk-core (~> 3, >= 3.165.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.4) + aws-sigv4 (1.5.2) + aws-eventstream (~> 1, >= 1.0.2) + babosa (1.0.4) + claide (1.1.0) + colored (1.2) + colored2 (3.1.2) + commander (4.6.0) + highline (~> 2.0.0) + declarative (0.0.20) + digest-crc (0.6.4) + rake (>= 12.0.0, < 14.0.0) + domain_name (0.5.20190701) + unf (>= 0.0.5, < 1.0.0) + dotenv (2.8.1) + emoji_regex (3.2.3) + excon (0.99.0) + faraday (1.10.3) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-cookie_jar (0.0.7) + faraday (>= 0.8.0) + http-cookie (~> 1.0.0) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.4) + multipart-post (~> 2) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.0) + faraday (~> 1.0) + fastimage (2.2.6) + fastlane (2.212.2) + CFPropertyList (>= 2.3, < 4.0.0) + addressable (>= 2.8, < 3.0.0) + artifactory (~> 3.0) + aws-sdk-s3 (~> 1.0) + babosa (>= 1.0.3, < 2.0.0) + bundler (>= 1.12.0, < 3.0.0) + colored + commander (~> 4.6) + dotenv (>= 2.1.1, < 3.0.0) + emoji_regex (>= 0.1, < 4.0) + excon (>= 0.71.0, < 1.0.0) + faraday (~> 1.0) + faraday-cookie_jar (~> 0.0.6) + faraday_middleware (~> 1.0) + fastimage (>= 2.1.0, < 3.0.0) + gh_inspector (>= 1.1.2, < 2.0.0) + google-apis-androidpublisher_v3 (~> 0.3) + google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-storage (~> 1.31) + highline (~> 2.0) + json (< 3.0.0) + jwt (>= 2.1.0, < 3) + mini_magick (>= 4.9.4, < 5.0.0) + multipart-post (~> 2.0.0) + naturally (~> 2.2) + optparse (~> 0.1.1) + plist (>= 3.1.0, < 4.0.0) + rubyzip (>= 2.0.0, < 3.0.0) + security (= 0.1.3) + simctl (~> 1.6.3) + terminal-notifier (>= 2.0.0, < 3.0.0) + terminal-table (>= 1.4.5, < 2.0.0) + tty-screen (>= 0.6.3, < 1.0.0) + tty-spinner (>= 0.8.0, < 1.0.0) + word_wrap (~> 1.0.0) + xcodeproj (>= 1.13.0, < 2.0.0) + xcpretty (~> 0.3.0) + xcpretty-travis-formatter (>= 0.0.3) + fastlane-plugin-increment_version_code (0.4.3) + gh_inspector (1.1.3) + google-apis-androidpublisher_v3 (0.42.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-core (0.11.0) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.16.2, < 2.a) + httpclient (>= 2.8.1, < 3.a) + mini_mime (~> 1.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.a) + rexml + webrick + google-apis-iamcredentials_v1 (0.17.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-playcustomapp_v1 (0.13.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-storage_v1 (0.19.0) + google-apis-core (>= 0.9.0, < 2.a) + google-cloud-core (1.6.0) + google-cloud-env (~> 1.0) + google-cloud-errors (~> 1.0) + google-cloud-env (1.6.0) + faraday (>= 0.17.3, < 3.0) + google-cloud-errors (1.3.1) + google-cloud-storage (1.44.0) + addressable (~> 2.8) + digest-crc (~> 0.4) + google-apis-iamcredentials_v1 (~> 0.1) + google-apis-storage_v1 (~> 0.19.0) + google-cloud-core (~> 1.6) + googleauth (>= 0.16.2, < 2.a) + mini_mime (~> 1.0) + googleauth (1.5.2) + faraday (>= 0.17.3, < 3.a) + jwt (>= 1.4, < 3.0) + memoist (~> 0.16) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (>= 0.16, < 2.a) + highline (2.0.3) + http-cookie (1.0.5) + domain_name (~> 0.5) + httpclient (2.8.3) + jmespath (1.6.2) + json (2.6.3) + jwt (2.7.0) + memoist (0.16.2) + mini_magick (4.12.0) + mini_mime (1.1.2) + multi_json (1.15.0) + multipart-post (2.0.0) + nanaimo (0.3.0) + naturally (2.2.1) + optparse (0.1.1) + os (1.1.4) + plist (3.7.0) + public_suffix (5.0.1) + rake (13.0.6) + representable (3.2.0) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) + retriable (3.1.2) + rexml (3.2.5) + rouge (2.0.7) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) + security (0.1.3) + signet (0.17.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + simctl (1.6.10) + CFPropertyList + naturally + terminal-notifier (2.0.0) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + trailblazer-option (0.1.2) + tty-cursor (0.7.1) + tty-screen (0.8.1) + tty-spinner (0.9.3) + tty-cursor (~> 0.7) + uber (0.1.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.8.2) + unicode-display_width (1.8.0) + webrick (1.8.1) + word_wrap (1.0.0) + xcodeproj (1.22.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.3.0) + rexml (~> 3.2.4) + xcpretty (0.3.0) + rouge (~> 2.0.7) + xcpretty-travis-formatter (1.0.1) + xcpretty (~> 0.2, >= 0.0.7) + +PLATFORMS + arm64-darwin-21 + +DEPENDENCIES + fastlane + fastlane-plugin-increment_version_code + +BUNDLED WITH + 2.4.10 diff --git a/android/app/build.gradle b/android/app/build.gradle index cbebac64..d689d91a 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,4 +1,4 @@ -plugins { +plugins { id 'com.gladed.androidgitversion' version '0.4.14' } @@ -132,7 +132,9 @@ def jscFlavor = 'org.webkit:android-jsc:+' def enableHermes = project.ext.react.get("enableHermes", false); androidGitVersion { - baseCode 1 + baseCode 0 + codeFormat 'MXXNXXPXX' + format '% tag %%commit_%%branch%' } android { @@ -142,7 +144,7 @@ android { APP_NAME_RELEASE = "@string/app_name" APP_NAME_PH = "@string/app_name_ph" APP_NAME_MOSIP = "@string/app_name_mosip" - APP_NAME_NEWLOGIC = "@string/app_name_newlogic" + APP_NAME_BETA = "@string/app_name_beta" } compileOptions { @@ -154,11 +156,8 @@ android { applicationId 'io.mosip.residentapp' minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - // Update versionName and/or versionCode via git tag - // More info here: - // https://github.com/gladed/gradle-android-git-version#3-use-a-git-tag-to-specify-your-version-number-see-semantic-versioning versionName androidGitVersion.name() - versionCode androidGitVersion.code() + versionCode 1 Properties properties = new Properties() properties.load(project.rootProject.file('local.properties').newDataInputStream()) @@ -178,9 +177,9 @@ android { } signingConfigs { release { - def keystore = System.getenv("RELEASE_KEYSTORE") ?: "debug.keystore" - def keystoreAlias = System.getenv("RELEASE_KEYSTORE_ALIAS") ?: "androiddebugkey" - def keystorePass = System.getenv("RELEASE_KEYSTORE_PASSWORD") ?: "android" + def keystore = file('release.keystore') + def keystoreAlias = System.getenv("RELEASE_KEYSTORE_ALIAS") + def keystorePass = System.getenv("RELEASE_KEYSTORE_PASSWORD") storeFile file("$keystore") storePassword "$keystorePass" keyAlias "$keystoreAlias" @@ -189,9 +188,9 @@ android { v1SigningEnabled false } debug { - def keystore = System.getenv("DEBUG_KEYSTORE") ?: "debug.keystore" - def keystoreAlias = System.getenv("DEBUG_KEYSTORE_ALIAS") ?: "androiddebugkey" - def keystorePass = System.getenv("DEBUG_KEYSTORE_PASSWORD") ?: "android" + def keystore = file('debug.keystore') + def keystoreAlias = System.getenv("DEBUG_KEYSTORE_ALIAS") + def keystorePass = System.getenv("DEBUG_KEYSTORE_PASSWORD") storeFile file("$keystore") storePassword "$keystorePass" keyAlias "$keystoreAlias" @@ -205,6 +204,10 @@ android { signingConfig signingConfigs.debug } release { + lintOptions { + checkReleaseBuilds false + abortOnError false + } // Caution! In production, you need to generate your own keystore file. // see https://reactnative.dev/docs/signed-apk-android. signingConfig signingConfigs.release @@ -217,16 +220,16 @@ android { productFlavors { mosip { - versionName defaultConfig.versionName + "-mosip" + versionName defaultConfig.versionName manifestPlaceholders = [ APP_NAME: APP_NAME_MOSIP ] dimension "inji" } - newlogic { - versionName defaultConfig.versionName + "-newlogic" + beta { + versionName defaultConfig.versionName manifestPlaceholders = [ - APP_NAME: APP_NAME_NEWLOGIC + APP_NAME: APP_NAME_BETA ] dimension "inji" } @@ -252,6 +255,7 @@ dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+"// From node_modules + implementation 'com.facebook.soloader:soloader:0.10.1+' def isGifEnabled = (findProperty('expo.gif.enabled') ?: "") == "true"; def isWebpEnabled = (findProperty('expo.webp.enabled') ?: "") == "true"; @@ -320,4 +324,4 @@ try { } } catch(Exception e) { logger.warn("google-services.json not found, google-services plugin not applied. Push Notifications won't work") -} +} \ No newline at end of file diff --git a/android/app/debug.keystore b/android/app/debug.keystore deleted file mode 100644 index 364e105e..00000000 Binary files a/android/app/debug.keystore and /dev/null differ diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 50a047e6..a1bdc91d 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -2,6 +2,15 @@ xmlns:tools="http://schemas.android.com/tools"> + + + + + + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 775353ea..047aeb58 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,10 +1,15 @@ - - + + + + + + @@ -31,7 +36,8 @@ - + + @@ -45,4 +51,4 @@ - \ No newline at end of file + diff --git a/android/app/src/main/java/io/mosip/residentapp/MainActivity.java b/android/app/src/main/java/io/mosip/residentapp/MainActivity.java index ef1e17f8..9add08ff 100644 --- a/android/app/src/main/java/io/mosip/residentapp/MainActivity.java +++ b/android/app/src/main/java/io/mosip/residentapp/MainActivity.java @@ -29,9 +29,7 @@ public class MainActivity extends ReactActivity { Manifest.permission.BLUETOOTH_ADMIN, Manifest.permission.ACCESS_WIFI_STATE, Manifest.permission.CHANGE_WIFI_STATE, - Manifest.permission.CHANGE_WIFI_MULTICAST_STATE, - Manifest.permission.ACCESS_COARSE_LOCATION, - Manifest.permission.ACCESS_FINE_LOCATION, + Manifest.permission.CHANGE_WIFI_MULTICAST_STATE }; private static final int REQUEST_CODE_REQUIRED_PERMISSIONS = 1; diff --git a/android/app/src/main/res/drawable-hdpi/splashscreen_image.png b/android/app/src/main/res/drawable-hdpi/splashscreen_image.png index 7855a1f2..74f09d47 100644 Binary files a/android/app/src/main/res/drawable-hdpi/splashscreen_image.png and b/android/app/src/main/res/drawable-hdpi/splashscreen_image.png differ diff --git a/android/app/src/main/res/drawable-mdpi/splashscreen_image.png b/android/app/src/main/res/drawable-mdpi/splashscreen_image.png index 7855a1f2..b3c779cd 100644 Binary files a/android/app/src/main/res/drawable-mdpi/splashscreen_image.png and b/android/app/src/main/res/drawable-mdpi/splashscreen_image.png differ diff --git a/android/app/src/main/res/drawable-xhdpi/splashscreen_image.png b/android/app/src/main/res/drawable-xhdpi/splashscreen_image.png index 7855a1f2..f0bc985d 100644 Binary files a/android/app/src/main/res/drawable-xhdpi/splashscreen_image.png and b/android/app/src/main/res/drawable-xhdpi/splashscreen_image.png differ diff --git a/android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png b/android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png index 7855a1f2..8b9628b1 100644 Binary files a/android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png and b/android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png b/android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png index 7855a1f2..11c27057 100644 Binary files a/android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png and b/android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png differ diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml index 85f04e2e..a2e76939 100644 --- a/android/app/src/main/res/values/colors.xml +++ b/android/app/src/main/res/values/colors.xml @@ -1,6 +1,6 @@ - #ffffff + #FFFFFF #FFFFFF #023c69 #ffffff diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 4bf71150..ff10a980 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -1,9 +1,9 @@ - MOSIP Resident App + Inji MOSIP Resident App - Mosip/Inji MOSIP Resident App - Newlogic MOSIP Resident App - PH - contain + cover false \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 902d3dbb..423b7179 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -4,8 +4,8 @@ buildscript { ext { buildToolsVersion = "29.0.3" minSdkVersion = 23 - compileSdkVersion = 30 - targetSdkVersion = 30 + compileSdkVersion = 31 + targetSdkVersion = 31 } repositories { google() @@ -34,6 +34,11 @@ allprojects { // Android JSC is installed from npm url(new File(["node", "--print", "require.resolve('jsc-android/package.json')"].execute(null, rootDir).text.trim(), "../dist")) } + configurations.all { + resolutionStrategy { + force "com.facebook.soloader:soloader:0.10.1" + } + } google() gradlePluginPortal() diff --git a/android/fastlane/Appfile b/android/fastlane/Appfile new file mode 100644 index 00000000..f1cb5278 --- /dev/null +++ b/android/fastlane/Appfile @@ -0,0 +1,2 @@ +json_key_file("play_config.json") +package_name("io.mosip.residentapp") diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile new file mode 100644 index 00000000..6b3ebfad --- /dev/null +++ b/android/fastlane/Fastfile @@ -0,0 +1,86 @@ +default_platform(:android) + +MIMOTO_HOST = ENV["MIMOTO_HOST"] +APPLICATION_THEME = ENV["APPLICATION_THEME"] +RELEASE_KEYSTORE_ALIAS = ENV["RELEASE_KEYSTORE_ALIAS"] +RELEASE_KEYSTORE_PASSWORD = ENV["RELEASE_KEYSTORE_PASSWORD"] +PLAY_CONSOLE_RELEASE_DESCRIPTION = ENV["PLAY_CONSOLE_RELEASE_DESCRIPTION"] +SLACK_URL = ENV["SLACK_URL"] +CREDENTIAL_REGISTRY_EDIT = ENV["CREDENTIAL_REGISTRY_EDIT"] + +desc "Verify Build for Android" +lane :android_build_verify do + gradle( + task: "assembleMosipDebug", + ) +end + +desc "Deploy an Internal testing version to the Google Play" +lane :android_build_internal do + previous_build_number = google_play_track_version_codes( + package_name: "io.mosip.residentapp", + track: "internal", + json_key: "play_config.json", + )[0] + + current_build_number = previous_build_number + 1 + + increment_version_code( + gradle_file_path: "app/build.gradle", + version_code: current_build_number + ) + + git_commit = sh('git rev-parse --short HEAD').strip + git_branch = sh('git rev-parse --abbrev-ref HEAD').strip + + versionName = "#{git_commit}-#{git_branch}" + + gradle(task: "clean bundleMosipRelease") + upload_to_play_store( + track: 'internal', + release_status: 'completed', + version_name: versionName, + ) + + slack( + message: "Inji - #{versionName} (#{current_build_number}) is uploaded to Play store. Description : #{PLAY_CONSOLE_RELEASE_DESCRIPTION}.", + success: true, + slack_url: "#{SLACK_URL}", + default_payloads: [:git_branch, :last_git_commit] + ) +end + +desc "Deploy an Beta version to the Google Play" +lane :android_build_beta do + + git_tag = sh('git describe --abbrev=0 --tags --exact-match HEAD').strip + + def convert_tag_to_code(version) + parts = version.split('.') + version_code = parts[0].to_i * 1000000 + parts[1].to_i * 1000 + parts[2].to_i + return version_code + end + + versionCode = convert_tag_to_code(git_tag) + + increment_version_code( + gradle_file_path: "app/build.gradle", + version_code: versionCode + ) + + versionName = "Inji #{git_tag}" + + gradle(task: "clean bundleBetaRelease") + upload_to_play_store( + track: 'alpha', + release_status: 'completed', + version_name: versionName, + ) + + slack( + message: "Inji [Beta]- #{versionName} is uploaded to Play store. Description : #{PLAY_CONSOLE_RELEASE_DESCRIPTION}.", + success: true, + slack_url: "#{SLACK_URL}", + default_payloads: [:git_branch, :last_git_commit] + ) +end \ No newline at end of file diff --git a/android/fastlane/Pluginfile b/android/fastlane/Pluginfile new file mode 100644 index 00000000..412c2ff9 --- /dev/null +++ b/android/fastlane/Pluginfile @@ -0,0 +1,5 @@ +# Autogenerated by fastlane +# +# Ensure this file is checked in to source control! + +gem 'fastlane-plugin-increment_version_code' diff --git a/android/fastlane/README.md b/android/fastlane/README.md new file mode 100644 index 00000000..4421f86d --- /dev/null +++ b/android/fastlane/README.md @@ -0,0 +1,45 @@ +## fastlane documentation + +# Installation + +Make sure you have the latest version of the Xcode command line tools installed: + +```sh +xcode-select --install +``` + +For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane) + +# Available Actions + +### android_build_verify + +```sh +[bundle exec] fastlane android_build_verify +``` + +Verify Build for Android + +### android_build_internal + +```sh +[bundle exec] fastlane android_build_internal +``` + +Deploy an Internal testing version to the Google Play + +### android_build_beta + +```sh +[bundle exec] fastlane android_build_beta +``` + +Deploy an Beta version to the Google Play + +--- + +This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. + +More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools). + +The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools). diff --git a/android/gradle.properties b/android/gradle.properties index 16bffe90..099c1dd0 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -38,4 +38,7 @@ expo.gif.enabled=true expo.webp.enabled=true # Enable animated webp support (~3.4 MB increase) # Disabled by default because iOS doesn't support animated webp -expo.webp.animated=false \ No newline at end of file +expo.webp.animated=false + +# If the AsyncStorage_db_size_in_MB is not configured, Default DB_MAX_SIZE is 6MB in Android +AsyncStorage_db_size_in_MB=30 diff --git a/android/scripts/beta-build.sh b/android/scripts/beta-build.sh new file mode 100755 index 00000000..48d2f687 --- /dev/null +++ b/android/scripts/beta-build.sh @@ -0,0 +1,10 @@ +#As react-native/location npm package is old, We need to run this to map androidX source code +(cd ../../ && npx jetify) + +cd .. + +yes | sudo gem install bundler + +yes | sudo fastlane install_plugins + +bundle exec fastlane android_build_beta diff --git a/android/scripts/git-tag.sh b/android/scripts/git-tag.sh new file mode 100755 index 00000000..cd4a5f19 --- /dev/null +++ b/android/scripts/git-tag.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +TAG=$(git describe --abbrev=0 --tags --exact-match HEAD 2>/dev/null) + +if [[ -z "$TAG" ]]; then + echo "No tag found for the current commit. Please provide a Tag to proceed with the Build." + exit 1 +else + echo "Tag for the current commit: $TAG" +fi \ No newline at end of file diff --git a/android/scripts/internal-build.sh b/android/scripts/internal-build.sh new file mode 100755 index 00000000..cde4e745 --- /dev/null +++ b/android/scripts/internal-build.sh @@ -0,0 +1,10 @@ +#As react-native/location npm package is old, We need to run this to map androidX source code +(cd ../../ && npx jetify) + +cd .. + +yes | sudo gem install bundler + +yes | sudo fastlane install_plugins + +bundle exec fastlane android_build_internal diff --git a/android/scripts/verify-build.sh b/android/scripts/verify-build.sh new file mode 100755 index 00000000..48fab851 --- /dev/null +++ b/android/scripts/verify-build.sh @@ -0,0 +1,10 @@ +#As react-native/location npm package is old, We need to run this to map androidX source code +(cd ../../ && npx jetify) + +cd .. + +yes | sudo gem install bundler + +yes | sudo fastlane install_plugins + +bundle exec fastlane android_build_verify diff --git a/android/settings.gradle b/android/settings.gradle index ee5198af..e02da8a7 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,4 +1,4 @@ -rootProject.name = 'MOSIP Resident App' +rootProject.name = 'Inji' apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle"); useExpoModules() diff --git a/app.config.ts b/app.config.ts index a06abec8..92da0424 100644 --- a/app.config.ts +++ b/app.config.ts @@ -1,12 +1,12 @@ export default { - name: 'MOSIP Resident App', - slug: 'mosip-resident-app', + name: 'Inji', + slug: 'inji', version: '1.0.0', orientation: 'portrait', icon: './assets/icon.png', splash: { image: './assets/splash.png', - resizeMode: 'contain', + resizeMode: 'cover', backgroundColor: '#ffffff', }, updates: { diff --git a/assets/Secure-Sharing.png b/assets/Secure-Sharing.png new file mode 100644 index 00000000..f635f8da Binary files /dev/null and b/assets/Secure-Sharing.png differ diff --git a/assets/Secure-Sharing2.png b/assets/Secure-Sharing2.png new file mode 100644 index 00000000..ae2d449d Binary files /dev/null and b/assets/Secure-Sharing2.png differ diff --git a/assets/biometric-unlock-icon.png b/assets/biometric-unlock-icon.png new file mode 100644 index 00000000..1a6f1077 Binary files /dev/null and b/assets/biometric-unlock-icon.png differ diff --git a/assets/camera-flip-icon.png b/assets/camera-flip-icon.png new file mode 100644 index 00000000..de7a69df Binary files /dev/null and b/assets/camera-flip-icon.png differ diff --git a/assets/digital-identity-icon.png b/assets/digital-identity-icon.png new file mode 100644 index 00000000..5a678a4d Binary files /dev/null and b/assets/digital-identity-icon.png differ diff --git a/assets/features-walkaround-icon.png b/assets/features-walkaround-icon.png new file mode 100644 index 00000000..b6a36310 Binary files /dev/null and b/assets/features-walkaround-icon.png differ diff --git a/assets/help-icon.png b/assets/help-icon.png new file mode 100644 index 00000000..3346d8fc Binary files /dev/null and b/assets/help-icon.png differ diff --git a/assets/icon.png b/assets/icon.png index 48c75eb7..ce339f7d 100644 Binary files a/assets/icon.png and b/assets/icon.png differ diff --git a/assets/inji-home-logo.png b/assets/inji-home-logo.png new file mode 100644 index 00000000..f8c59595 Binary files /dev/null and b/assets/inji-home-logo.png differ diff --git a/assets/inji-logo-white.png b/assets/inji-logo-white.png new file mode 100644 index 00000000..85505a13 Binary files /dev/null and b/assets/inji-logo-white.png differ diff --git a/assets/inji_small_logo.png b/assets/inji_small_logo.png new file mode 100644 index 00000000..f7009186 Binary files /dev/null and b/assets/inji_small_logo.png differ diff --git a/assets/intro-scanner.png b/assets/intro-scanner.png new file mode 100644 index 00000000..fd8876e3 Binary files /dev/null and b/assets/intro-scanner.png differ diff --git a/assets/intro-wallet-binding.png b/assets/intro-wallet-binding.png new file mode 100644 index 00000000..fa59b5de Binary files /dev/null and b/assets/intro-wallet-binding.png differ diff --git a/assets/legal-notices-icon.png b/assets/legal-notices-icon.png new file mode 100644 index 00000000..69884e7c Binary files /dev/null and b/assets/legal-notices-icon.png differ diff --git a/assets/lock-icon.png b/assets/lock-icon.png new file mode 100644 index 00000000..147780f8 Binary files /dev/null and b/assets/lock-icon.png differ diff --git a/assets/magnifier-zoom.png b/assets/magnifier-zoom.png new file mode 100644 index 00000000..cbbc2153 Binary files /dev/null and b/assets/magnifier-zoom.png differ diff --git a/assets/mosip-logo.png b/assets/mosip-logo.png index 48c75eb7..e065ff5c 100644 Binary files a/assets/mosip-logo.png and b/assets/mosip-logo.png differ diff --git a/assets/otp-mobile-logo.png b/assets/otp-mobile-logo.png index 4e6eaa73..8a8a4a52 100644 Binary files a/assets/otp-mobile-logo.png and b/assets/otp-mobile-logo.png differ diff --git a/assets/phone_mockup_1.png b/assets/phone_mockup_1.png new file mode 100644 index 00000000..5e52fdc8 Binary files /dev/null and b/assets/phone_mockup_1.png differ diff --git a/assets/progressing-logo.png b/assets/progressing-logo.png new file mode 100644 index 00000000..dc8d0b74 Binary files /dev/null and b/assets/progressing-logo.png differ diff --git a/assets/receive-card-icon.png b/assets/receive-card-icon.png new file mode 100644 index 00000000..b0db01a0 Binary files /dev/null and b/assets/receive-card-icon.png differ diff --git a/assets/received-cards-icon.png b/assets/received-cards-icon.png new file mode 100644 index 00000000..52afc034 Binary files /dev/null and b/assets/received-cards-icon.png differ diff --git a/assets/splash.png b/assets/splash.png index 48c75eb7..df0075df 100644 Binary files a/assets/splash.png and b/assets/splash.png differ diff --git a/components/ActivityLogText.strings.json b/components/ActivityLogText.strings.json index 22e5d29e..13c6d906 100644 --- a/components/ActivityLogText.strings.json +++ b/components/ActivityLogText.strings.json @@ -10,5 +10,8 @@ "VC_RECEIVED_BUT_PRESENCE_VERIFICATION_FAILED": "received. Presence verification failed", "PRESENCE_VERIFIED_AND_VC_SHARED": "verified and shared", "PRESENCE_VERIFICATION_FAILED": "verification failed", - "QRLOGIN_SUCCESFULL": "QRLogin sucessfull" + "QRLOGIN_SUCCESFULL": "QRLogin successful", + "WALLET_BINDING_SUCCESSFULL": "Activation successful", + "WALLET_BINDING_FAILURE": "Activation failed", + "VC_REMOVED":"Removed from wallet" } \ No newline at end of file diff --git a/components/ActivityLogText.tsx b/components/ActivityLogText.tsx index 524cad8f..937873c8 100644 --- a/components/ActivityLogText.tsx +++ b/components/ActivityLogText.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { formatDistanceToNow } from 'date-fns'; import { useTranslation } from 'react-i18next'; -import * as DateFnsLocale from '../lib/date-fns/locale'; +import * as DateFnsLocale from 'date-fns/locale'; import { ActivityLog } from '../machines/activityLog'; import { TextItem } from './ui/TextItem'; @@ -14,6 +14,7 @@ export const ActivityLogText: React.FC<{ activity: ActivityLog }> = (props) => { ); }; @@ -26,6 +27,6 @@ function getActionLabel(activity: ActivityLog, language: string) { locale: DateFnsLocale[language], }), ] - .filter((label) => label.trim() !== '') + .filter((label) => label?.trim() !== '') .join(' · '); } diff --git a/components/CopyButton.tsx b/components/CopyButton.tsx new file mode 100644 index 00000000..1d4f97a9 --- /dev/null +++ b/components/CopyButton.tsx @@ -0,0 +1,35 @@ +import React, { useState } from 'react'; +import { Pressable } from 'react-native'; +import { Theme } from './ui/styleUtils'; +import Clipboard from '@react-native-clipboard/clipboard'; +import { Icon } from 'react-native-elements'; +import { Text } from './ui'; +import { useTranslation } from 'react-i18next'; + +export const CopyButton: React.FC = ({ content }) => { + const { t } = useTranslation('common'); + const [buttonText, setButtonText] = useState(t('clipboard.copy')); + + return ( + { + setButtonText(t('clipboard.copied')); + setTimeout(() => setButtonText(t('clipboard.copy')), 3000); + Clipboard.setString(content); + }}> + + {buttonText} + + ); +}; + +interface CopyButtonProps { + content: string; +} diff --git a/components/DeviceInfoList.tsx b/components/DeviceInfoList.tsx index 2ea52905..954dd4ec 100644 --- a/components/DeviceInfoList.tsx +++ b/components/DeviceInfoList.tsx @@ -10,15 +10,15 @@ export const DeviceInfoList: React.FC = (props) => { ); }; interface DeviceInfoProps { - of: 'sender' | 'receiver'; deviceInfo: DeviceInfo; + of?: string; } export interface DeviceInfo { diff --git a/components/DualMessageOverlay.tsx b/components/DualMessageOverlay.tsx new file mode 100644 index 00000000..645df54c --- /dev/null +++ b/components/DualMessageOverlay.tsx @@ -0,0 +1,106 @@ +import React from 'react'; +import { useTranslation } from 'react-i18next'; +import { Dimensions, View } from 'react-native'; +import { Overlay } from 'react-native-elements'; +import { Column, Row, Text } from './ui'; +import { Button } from './ui/Button'; +import { Theme } from './ui/styleUtils'; + +/** + * DualMessageOverlay is like MessageOverlay but with two buttons + * + * NOTE: This has been added for surfacing bugs and needs to be refactored + * before use. + */ +export const DualMessageOverlay: React.FC = ( + props +) => { + const { t } = useTranslation('common'); + return ( + + + + {props.title && ( + + {props.title} + + )} + {props.message && ( + + {props.message} + + )} + {props.hint && ( + + {props.hint} + + )} + {props.children} + + + + {!props.children && props.onTryAgain ? ( + + + ); + } + + function allowNearbyDevicesPermissionComponent() { + return ( + + + + {t('errors.nearbyDevicesPermissionDenied.message')} + + + + + + ); + } + + function allowLocationComponent() { + return ( + + + + {controller.locationError.message} + + + +