diff --git a/.env b/.env index d58987cb..0615df93 100644 --- a/.env +++ b/.env @@ -1,10 +1,11 @@ # 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-1201-b2.mosip.net +MIMOTO_HOST=https://api.qatriple.mosip.net #MIMOTO_HOST=http://mock.mimoto.newlogic.dev GOOGLE_NEARBY_MESSAGES_API_KEY= #Application Theme can be ( orange | purple ) APPLICATION_THEME=orange -USE_BLE_SHARE=true +#environment can be changed if it is toggled +CREDENTIAL_REGISTRY_EDIT=true diff --git a/.github/workflows/android.yml b/.github/workflows/android-build-verify.yml similarity index 52% rename from .github/workflows/android.yml rename to .github/workflows/android-build-verify.yml index 48ad22e4..35b0ca4a 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: @@ -10,6 +13,13 @@ on: - 0.9 tags: - '*' + pull_request: + types: [ opened, synchronize ] + branches: + - develop + - 'release-**' + tags: + - '*' jobs: build-android: @@ -19,8 +29,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: '16.x' - - # Cache stuff for faster build + - name: Cache local npm repository uses: actions/cache@v3.0.11 with: @@ -34,7 +43,7 @@ jobs: path: | ~/.gradle/caches ~/.gradle/wrapper - + - name: Install npm dependencies run: | npm ci @@ -43,33 +52,65 @@ 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 + yes | sudo gem install bundler + yes | sudo fastlane install_plugins + bundle exec fastlane android_build_verify + 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 index 1db70d51..a780670a 100644 --- a/.github/workflows/android-custom-build.yml +++ b/.github/workflows/android-custom-build.yml @@ -1,7 +1,7 @@ -name: ID PASS - MOSIP Resident Application Custom build +name: Android Custom Build env: - backendServiceDefaultUrl: https://api.qa-121.mosip.net + backendServiceDefaultUrl: https://api.sandbox.mosip.net on: workflow_dispatch: @@ -9,7 +9,7 @@ on: backendServiceUrl: description: 'Backend service URL' required: true - default: 'https://api.qa-121.mosip.net' + default: 'https://api.sandbox.mosip.net' type: string theme: description: 'Application Theme' @@ -19,6 +19,14 @@ on: options: - orange - purple + registry_edit: + description: 'Edit Registry' + required: true + default: 'true' + type: choice + options: + - false + - true jobs: build-android: @@ -28,8 +36,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: '16.x' - - # Cache stuff for faster build + - name: Cache local npm repository uses: actions/cache@v3.0.11 with: @@ -46,21 +53,70 @@ jobs: - name: Install npm dependencies run: | - npm install + npm ci + - name: Create .env.local file run: | echo "${{ secrets.ENV_FILE }}" > .env.local > android/local.properties - - name: Build App Newlogic Release + + - 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 - ./gradlew :app:assembleNewlogicRelease + 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: Bump version code + uses: chkfung/android-version-actions@v1.2.1 + with: + gradlePath: android/app/build.gradle + versionCode: ${{github.run_number}} + + - name: Run Build + run: | + cd android/scripts + ./run-fastlane.sh env: MIMOTO_HOST: ${{ github.event.inputs.backendServiceUrl }} - FIREBASE_SECRET: ${{ secrets.FIREBASE_SECRET }} - - name: Upload Artifact + APPLICATION_THEME: ${{ github.event.inputs.theme }} + RELEASE_KEYSTORE_ALIAS: androidreleasekey + RELEASE_KEYSTORE_PASSWORD: '${{secrets.INJI_ANDROID_RELEASE_STOREPASS}}' + CREDENTIAL_REGISTRY_EDIT: ${{ github.event.inputs.registry_edit }} + + - name: Upload Artifact to Actions uses: actions/upload-artifact@v3.1.1 with: - name: apk-output - path: android/app/build/outputs/apk/newlogic/release/ - retention-days: 5 + name: Inji + path: android/app/build/outputs/apk/mosip/release/ + retention-days: 10 \ 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/.gitignore b/.gitignore index 1d2e7563..51312e66 100644 --- a/.gitignore +++ b/.gitignore @@ -60,8 +60,6 @@ yarn-error.log # BUCK buck-out/ \.buckd/ -*.keystore -!debug.keystore # Bundle artifacts *.jsbundle 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..31bfeda1 --- /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) + fastlane-plugin-increment_version_name (0.0.10) + 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 + +BUNDLED WITH + 2.4.10 diff --git a/android/app/build.gradle b/android/app/build.gradle index a9f1aae3..40bd15ba 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' } @@ -133,6 +133,7 @@ def enableHermes = project.ext.react.get("enableHermes", false); androidGitVersion { baseCode 1 + format '% tag %%commit_%%branch%' } android { @@ -154,11 +155,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 +176,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 +187,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" @@ -321,4 +319,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 index 364e105e..5b5acaea 100644 Binary files a/android/app/debug.keystore and b/android/app/debug.keystore 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/values/strings.xml b/android/app/src/main/res/values/strings.xml index fa793d07..ff10a980 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -1,6 +1,6 @@ - MOSIP Resident App + Inji MOSIP Resident App - Mosip/Inji MOSIP Resident App - Newlogic MOSIP Resident App - PH diff --git a/android/build.gradle b/android/build.gradle index dd920685..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() diff --git a/android/fastlane/Appfile b/android/fastlane/Appfile new file mode 100644 index 00000000..256c40bc --- /dev/null +++ b/android/fastlane/Appfile @@ -0,0 +1,2 @@ +json_key_file("") +package_name("io.mosip.residentapp") diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile new file mode 100644 index 00000000..f27478bf --- /dev/null +++ b/android/fastlane/Fastfile @@ -0,0 +1,15 @@ +default_platform(:android) + +desc "Verify Build for Android" +lane :android_build_verify do + gradle( + task: "assembleMosipDebug", + ) +end + +desc "Build for Android" +lane :android_build do + gradle( + task: "assembleMosipRelease", + ) +end diff --git a/android/fastlane/README.md b/android/fastlane/README.md new file mode 100644 index 00000000..42b1d87f --- /dev/null +++ b/android/fastlane/README.md @@ -0,0 +1,37 @@ +## 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 + +### test_android_build + +```sh +[bundle exec] fastlane test_android_build +``` + +Verify Build for Android + +### build_android + +```sh +[bundle exec] fastlane build_android +``` + +Build Android and increase version code + +--- + +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/scripts/run-fastlane.sh b/android/scripts/run-fastlane.sh new file mode 100755 index 00000000..877355d5 --- /dev/null +++ b/android/scripts/run-fastlane.sh @@ -0,0 +1,7 @@ +cd .. + +yes | sudo gem install bundler + +yes | sudo fastlane install_plugins + +bundle exec fastlane android_build \ No newline at end of file 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 7743e799..92da0424 100644 --- a/app.config.ts +++ b/app.config.ts @@ -1,6 +1,6 @@ export default { - name: 'MOSIP Resident App', - slug: 'mosip-resident-app', + name: 'Inji', + slug: 'inji', version: '1.0.0', orientation: 'portrait', icon: './assets/icon.png', 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/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/components/ActivityLogText.tsx b/components/ActivityLogText.tsx index e20e0bb2..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'; @@ -27,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/EditableListItem.tsx b/components/EditableListItem.tsx index c3ad6c71..bbf995fe 100644 --- a/components/EditableListItem.tsx +++ b/components/EditableListItem.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useEffect, useState } from 'react'; import { Dimensions, I18nManager } from 'react-native'; import { Icon, ListItem, Overlay, Input } from 'react-native-elements'; import { Text, Column, Row, Button } from './ui'; @@ -9,6 +9,13 @@ export const EditableListItem: React.FC = (props) => { const { t } = useTranslation('common'); const [isEditing, setIsEditing] = useState(false); const [newValue, setNewValue] = useState(props.value); + const [overlayOpened, setOverlayOpened] = useState(true); + + useEffect(() => { + if (props.credentialRegistryResponse === 'success') { + closePopup(); + } + }, [props.credentialRegistryResponse]); return ( setIsEditing(true)}> @@ -25,6 +32,7 @@ export const EditableListItem: React.FC = (props) => { {props.label} + {props.value} = (props) => { textAlign: I18nManager.isRTL ? 'right' : 'left', }} /> + {props.credentialRegistryResponse === 'error' && ( + + please try again after sometime... + + )} + {props.credentialRegistryResponse === 'success' && + overlayOpened && + closePopup()} + + ); + } + + function allowLocationComponent() { + return ( + + + + {controller.locationError.message} + + + +