From 2997923d4769e087df82ebf83938488b408a92fe Mon Sep 17 00:00:00 2001 From: Deeksha Deepak Date: Tue, 22 Apr 2025 15:37:00 +0530 Subject: [PATCH 1/3] SBCOSS-381: Updated mobile app dependencies --- build-ios.sh | 4 +- package-lock.json | 130 +++++++++++++++++++++++----------------------- package.json | 8 +-- 3 files changed, 72 insertions(+), 70 deletions(-) diff --git a/build-ios.sh b/build-ios.sh index b357d45aa2..8d9b885934 100755 --- a/build-ios.sh +++ b/build-ios.sh @@ -75,11 +75,11 @@ ionic cordova plugin rm com.jjdltc.cordova.plugin.zip ionic cordova plugin add https://github.com/Sunbird-Ed/sb-cordova-plugin-db.git --variable USESWIFTLANGUAGEVERSION=4 ionic cordova plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID="${REVERSED_CLIENT_ID}" ionic cordova plugin add cordova-plugin-add-swift-support@2.0.2 -ionic cordova plugin add https://github.com/vishwanath1004/cordova-plugin-file-transfer.git +ionic cordova plugin add https://github.com/Sunbird-Ed/cordova-plugin-file-transfer.git ionic cordova plugin add https://github.com/Sunbird-Ed/jjdltc-cordova-plugin-zip.git ionic cordova plugin add cordova-plugin-sign-in-with-apple ionic cordova plugin rm cordova-plugin-inappupdatemanager -ionic cordova plugin add https://github.com/subranil/cordova-plugin-inappupdatemanager.git +ionic cordova plugin add https://github.com/Sunbird-Ed/cordova-plugin-inappupdatemanager.git ionic cordova plugin add https://github.com/521dimensions/cordova-plugin-screen-orientation ionic cordova plugin add ionic-plugin-deeplinks --variable URL_SCHEME="${URL_SCHEME}" --variable DEEPLINK_SCHEME=https --variable DEEPLINK_HOST="${DEEPLINK_HOST}" #Temporary Workaround to generate build as webpack was complaining of Heap Space diff --git a/package-lock.json b/package-lock.json index 6075b29e0d..174a6e33ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -155,14 +155,14 @@ "cordova-plugin-document-viewer": "1.0.0", "cordova-plugin-fcm-with-dependecy-updated": "github:Sunbird-Ed/sb-cordova-plugin-fcm#release-7.6.0", "cordova-plugin-file": "8.0.1", - "cordova-plugin-file-transfer": "github:shikshalokam/cordova-plugin-file-transfer", + "cordova-plugin-file-transfer": "github:Sunbird-Ed/cordova-plugin-file-transfer", "cordova-plugin-googleplus": "8.5.2", - "cordova-plugin-inappupdatemanager": "github:subranil/cordova-plugin-inappupdatemanager#release-3.7.0", + "cordova-plugin-inappupdatemanager": "github:Sunbird-Ed/cordova-plugin-inappupdatemanager", "cordova-plugin-media": "7.0.0", "cordova-plugin-network-information": "^2.0.2", - "cordova-plugin-printer": "git+https://github.com/vpPavithra/cordova-plugin-printer.git#release-7.0.0_cap", + "cordova-plugin-printer": "git+https://github.com/Sunbird-Ed/cordova-plugin-printer", "cordova-plugin-streaming-media": "^2.3.0", - "cordova-plugin-telerik-imagepicker": "git+https://github.com/vpPavithra/ImagePicker.git#release-7.0.0_cap", + "cordova-plugin-telerik-imagepicker": "git+https://github.com/Sunbird-Ed/cordova-plugin-telerik-imagepicker", "cordova-plugin-webview-checker": "1.0.1", "cordova-sqlite-storage": "6.0.0", "cordova-zip-plugin": "github:Sunbird-Ed/jjdltc-cordova-plugin-zip.git", @@ -828,10 +828,9 @@ "license": "MIT" }, "node_modules/@angular/cdk": { - "version": "19.2.9", - "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-19.2.9.tgz", - "integrity": "sha512-4If3BjWQPwW/xqRUCL7Mx0dHS0SuZY7Tq/Ocf7liwYTYCmSv8Ew7NqaiPA4RS3FnyUJcZW/UAd231uWI/ZHChg==", - "license": "MIT", + "version": "19.2.10", + "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-19.2.10.tgz", + "integrity": "sha512-lWBKGZtZ2JMB7r/2xLQIVtiMM2B70WJqSWT3sXyzTNzFBHtCQvH2kqdG7RuLr+2OZih4I/SgiBK2i8FzjwRIgA==", "dependencies": { "parse5": "^7.1.2", "tslib": "^2.3.0" @@ -4165,9 +4164,9 @@ } }, "node_modules/@capawesome/capacitor-android-edge-to-edge-support": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@capawesome/capacitor-android-edge-to-edge-support/-/capacitor-android-edge-to-edge-support-7.1.0.tgz", - "integrity": "sha512-VHPK90xA/lYkuB2fCOyfnO2PJLxMqzaulZmwiC+78JJWmfOePWvlzrvfEscTCjnoPrNgsA+9sDcEeGEZDG0z5w==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@capawesome/capacitor-android-edge-to-edge-support/-/capacitor-android-edge-to-edge-support-7.1.1.tgz", + "integrity": "sha512-xEsqphARMFWJPd9xsod6wYPQM+fnHMEN/H9Z+0d00wQDLLotsskfPafHmokCFYiMHVFqMPfYvpVGcXxMbWYQQA==", "funding": [ { "type": "github", @@ -5018,12 +5017,11 @@ } }, "node_modules/@ionic/angular": { - "version": "8.5.4", - "resolved": "https://registry.npmjs.org/@ionic/angular/-/angular-8.5.4.tgz", - "integrity": "sha512-MjaqSSrwPKYjHFS4f3r6KFSggw0uyPujLGI3R44iIbCD/5DIQo+/Tuehvx4uFLipa3COXLWc2AQA1yI8VHV0gw==", - "license": "MIT", + "version": "8.5.5", + "resolved": "https://registry.npmjs.org/@ionic/angular/-/angular-8.5.5.tgz", + "integrity": "sha512-QgEPURvmlg9cNbM9yTBxpNSC8OfaKvh9/13bPyjK3G0Wol+Cex2rb+VQBD7U7YiMVisGNIiKAdjVvFMdSg6nnw==", "dependencies": { - "@ionic/core": "8.5.4", + "@ionic/core": "8.5.5", "ionicons": "^7.0.0", "jsonc-parser": "^3.0.0", "tslib": "^2.3.0" @@ -5215,10 +5213,9 @@ "license": "0BSD" }, "node_modules/@ionic/core": { - "version": "8.5.4", - "resolved": "https://registry.npmjs.org/@ionic/core/-/core-8.5.4.tgz", - "integrity": "sha512-SLtTdvH42owno3rBjrq88W37v2TANDZntg7X1iZlwC1atbkpCC60BcY1Twsl48LzSOIO9eNeo6JDBmwN3NKKNQ==", - "license": "MIT", + "version": "8.5.5", + "resolved": "https://registry.npmjs.org/@ionic/core/-/core-8.5.5.tgz", + "integrity": "sha512-CrV93791fMLLmr+U81yTjNuHVFCDTspnB+TBhsWxdAHd5ErBzhlWn4tLjfyL/mRUO1vUy6sxU2oU4X6ooXi4Mg==", "dependencies": { "@stencil/core": "4.20.0", "ionicons": "^7.2.2", @@ -7980,6 +7977,18 @@ "rxjs": ">=6.5.3" } }, + "node_modules/@noble/hashes": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", + "dev": true, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -8272,9 +8281,9 @@ } }, "node_modules/@npmcli/redact": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@npmcli/redact/-/redact-3.1.1.tgz", - "integrity": "sha512-3Hc2KGIkrvJWJqTbvueXzBeZlmvoOxc2jyX00yzr3+sNFquJg0N8hH4SAPLPVrkWIRQICVpVgjrss971awXVnA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@npmcli/redact/-/redact-3.2.0.tgz", + "integrity": "sha512-NyJXHoZwJE0iUsCDTclXf1bWHJTsshtnp5xUN6F2vY+OLJv6d2cNc4Do6fKNkmPToB0GzoffxRh405ibTwG+Og==", "dev": true, "license": "ISC", "engines": { @@ -8325,6 +8334,15 @@ "node": "^18.17.0 || >=20.5.0" } }, + "node_modules/@paralleldrive/cuid2": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.2.2.tgz", + "integrity": "sha512-ZOBkgDwEdoYVlSeRbYYXs0S9MejQofiVYoTbKzy/6GQa39/q5tQU2IX46+shYnUkpEl3wc+J6wRlar7r2EK2xA==", + "dev": true, + "dependencies": { + "@noble/hashes": "^1.1.5" + } + }, "node_modules/@parcel/watcher": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.1.tgz", @@ -12494,9 +12512,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001713", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001713.tgz", - "integrity": "sha512-wCIWIg+A4Xr7NfhTuHdX+/FKh3+Op3LBbSp2N5Pfx6T/LhdQy3GTyoTg48BReaW/MyMNZAkTadsBtai3ldWK0Q==", + "version": "1.0.30001715", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001715.tgz", + "integrity": "sha512-7ptkFGMm2OAOgvZpwgA4yjQ5SQbrNVGdRjzH0pBdy1Fasvcr+KAeECmbCAECzTuDuoX0FCY8KzUxjf9+9kfZEw==", "funding": [ { "type": "opencollective", @@ -13968,7 +13986,7 @@ }, "node_modules/cordova-plugin-file-transfer": { "version": "2.0.1-dev", - "resolved": "git+ssh://git@github.com/shikshalokam/cordova-plugin-file-transfer.git#8b94f73a9dc43fb5dc1134366d5374e99110eadf", + "resolved": "git+ssh://git@github.com/Sunbird-Ed/cordova-plugin-file-transfer.git#9aa5da7f476dc67cd08718f8c4da439b98d5ecc7", "dev": true, "license": "Apache-2.0", "engines": { @@ -14027,9 +14045,8 @@ }, "node_modules/cordova-plugin-inappupdatemanager": { "version": "1.0.0", - "resolved": "git+ssh://git@github.com/subranil/cordova-plugin-inappupdatemanager.git#4b93183f4fcfe8f907b9b81f4fda4e8223964918", - "dev": true, - "license": "ISC" + "resolved": "git+ssh://git@github.com/Sunbird-Ed/cordova-plugin-inappupdatemanager.git#986769a6855a11ff1004e76449b0448743985cc6", + "dev": true }, "node_modules/cordova-plugin-media": { "version": "7.0.0", @@ -14073,7 +14090,7 @@ }, "node_modules/cordova-plugin-printer": { "version": "0.8.0", - "resolved": "git+ssh://git@github.com/vpPavithra/cordova-plugin-printer.git#01e9a6737ae3b18354807d6427d3f3285d26118c", + "resolved": "git+ssh://git@github.com/Sunbird-Ed/cordova-plugin-printer.git#b3c03def0eebd888248f6a3df8ad0b8d3d902815", "dev": true, "engines": [ { @@ -14108,7 +14125,7 @@ }, "node_modules/cordova-plugin-telerik-imagepicker": { "version": "2.3.6", - "resolved": "git+ssh://git@github.com/vpPavithra/ImagePicker.git#1f539c91bbeb4518e440dc97f1c522eea52851a6", + "resolved": "git+ssh://git@github.com/Sunbird-Ed/cordova-plugin-telerik-imagepicker.git#f8a0e83e3e8ccff79575121e482af208ce852731", "dev": true, "license": "MIT", "engines": { @@ -14142,8 +14159,7 @@ }, "node_modules/cordova-zip-plugin": { "version": "1.1.0", - "resolved": "git+ssh://git@github.com/Sunbird-Ed/jjdltc-cordova-plugin-zip.git#d45bff3832527606c14a23cefabef6a98f5e6f88", - "license": "MIT", + "resolved": "git+ssh://git@github.com/Sunbird-Ed/jjdltc-cordova-plugin-zip.git#a9a406587959844295fb1887a065bd8aa85a9b53", "engines": { "cordovaDependencies": { "1.1.0": { @@ -15642,10 +15658,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.136", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.136.tgz", - "integrity": "sha512-kL4+wUTD7RSA5FHx5YwWtjDnEEkIIikFgWHR4P6fqjw1PPLlqYkxeOb++wAauAssat0YClCy8Y3C5SxgSkjibQ==", - "license": "ISC" + "version": "1.5.140", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.140.tgz", + "integrity": "sha512-o82Rj+ONp4Ip7Cl1r7lrqx/pXhbp/lh9DpKcMNscFJdh8ebyRofnc7Sh01B4jx403RI0oqTBvlZ7OBIZLMr2+Q==" }, "node_modules/elementtree": { "version": "0.1.7", @@ -17075,11 +17090,10 @@ } }, "node_modules/fdir": { - "version": "6.4.3", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", - "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", + "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", "dev": true, - "license": "MIT", "peerDependencies": { "picomatch": "^3 || ^4" }, @@ -17431,14 +17445,14 @@ } }, "node_modules/formidable": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-3.5.2.tgz", - "integrity": "sha512-Jqc1btCy3QzRbJaICGwKcBfGWuLADRerLzDqi2NwSt/UkXLsHJw2TVResiaoBufHVHy9aSgClOHCeJsSsFLTbg==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-3.5.3.tgz", + "integrity": "sha512-pQEHGLZjLRyfLCe6r6n8IQGqHEceKfYR5tIf/iUDn5SabaitfVR/pIskxnyvSSl122J63rFY17i68hrfK0BVOA==", "dev": true, "license": "MIT", "dependencies": { + "@paralleldrive/cuid2": "^2.2.2", "dezalgo": "^1.0.4", - "hexoid": "^2.0.0", "once": "^1.4.0" }, "funding": { @@ -18559,16 +18573,6 @@ "he": "bin/he" } }, - "node_modules/hexoid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-2.0.0.tgz", - "integrity": "sha512-qlspKUK7IlSQv2o+5I7yhUd7TxlOG2Vr5LTa3ve2XSNVKAL/n/u/7KLvKmFNimomDIKvZFXWHv0T12mv7rT8Aw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/hoek": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.3.1.tgz", @@ -23857,7 +23861,6 @@ "version": "1.54.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", - "license": "MIT", "engines": { "node": ">= 0.6" } @@ -24902,6 +24905,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "deprecated": "Use your platform's native DOMException instead", "funding": [ { "type": "github", @@ -29431,8 +29435,7 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.1.tgz", "integrity": "sha512-3jatXi9ObIsPGr3N5hGw/vWWcTkq6hUYhpQz4k0wLC+owqWi/LiugIw9x0EdNZ2yGedKN/HzePiBvaJRXa0Ujg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/sax": { "version": "1.1.4", @@ -32024,13 +32027,12 @@ } }, "node_modules/tinyglobby": { - "version": "0.2.12", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", - "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==", + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.13.tgz", + "integrity": "sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==", "dev": true, - "license": "MIT", "dependencies": { - "fdir": "^6.4.3", + "fdir": "^6.4.4", "picomatch": "^4.0.2" }, "engines": { diff --git a/package.json b/package.json index 0846fc6b41..fe3514e826 100644 --- a/package.json +++ b/package.json @@ -187,14 +187,14 @@ "cordova-plugin-document-viewer": "1.0.0", "cordova-plugin-fcm-with-dependecy-updated": "github:Sunbird-Ed/sb-cordova-plugin-fcm#release-7.6.0", "cordova-plugin-file": "8.0.1", - "cordova-plugin-file-transfer": "github:shikshalokam/cordova-plugin-file-transfer", + "cordova-plugin-file-transfer": "github:Sunbird-Ed/cordova-plugin-file-transfer", "cordova-plugin-googleplus": "8.5.2", - "cordova-plugin-inappupdatemanager": "github:subranil/cordova-plugin-inappupdatemanager#release-3.7.0", + "cordova-plugin-inappupdatemanager": "github:Sunbird-Ed/cordova-plugin-inappupdatemanager", "cordova-plugin-media": "7.0.0", "cordova-plugin-network-information": "^2.0.2", - "cordova-plugin-printer": "git+https://github.com/vpPavithra/cordova-plugin-printer.git#release-7.0.0_cap", + "cordova-plugin-printer": "git+https://github.com/Sunbird-Ed/cordova-plugin-printer", "cordova-plugin-streaming-media": "^2.3.0", - "cordova-plugin-telerik-imagepicker": "git+https://github.com/vpPavithra/ImagePicker.git#release-7.0.0_cap", + "cordova-plugin-telerik-imagepicker": "git+https://github.com/Sunbird-Ed/cordova-plugin-telerik-imagepicker", "cordova-plugin-webview-checker": "1.0.1", "cordova-sqlite-storage": "6.0.0", "cordova-zip-plugin": "github:Sunbird-Ed/jjdltc-cordova-plugin-zip.git", From 8dc1d7a0b51612fb2bf980b84187d1c066e167aa Mon Sep 17 00:00:00 2001 From: Deeksha Deepak Date: Tue, 22 Apr 2025 16:03:47 +0530 Subject: [PATCH 2/3] SBCOSS-381: Updated files --- .github/workflows/android.yml | 140 ++++++++++++++++++++++++---------- README.md | 58 ++++++++++++++ android/app/build.gradle | 3 + 3 files changed, 160 insertions(+), 41 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index d329fc855a..29e7bf2923 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -3,7 +3,7 @@ name: Android on: push: tags: - - '*' + - '*debug' jobs: build: @@ -12,26 +12,49 @@ jobs: steps: - uses: actions/checkout@v3 - - name: set up JDK 17 + - name: set up JDK 21 uses: actions/setup-java@v3 with: - java-version: '17' + java-version: '21' distribution: 'zulu' cache: gradle - + + - name: Setup Android SDK + uses: android-actions/setup-android@v2 + + - name: Install specific platform and build tools + run: | + echo "y" | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --install "platforms;android-35" + echo "y" | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --install "build-tools;34.0.0" + echo "y" | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --licenses + + - name: Check Android SDK versions + run: | + echo "ANDROID_HOME: $ANDROID_HOME" + echo "Available Android platforms:" + ls -la $ANDROID_SDK_ROOT/platforms/ + echo "Available build tools:" + ls -la $ANDROID_SDK_ROOT/build-tools/ + - name: Setup Gradle uses: gradle/gradle-build-action@v2 - name: Install Node.js uses: actions/setup-node@v1 with: - node-version: 16.x + node-version: 22.x - name: Install Ionic run: npm install -g @ionic/cli - name: Install app dependencies - run: npm install + run: npm install --legacy-peer-deps + + - name: Upload App Icon + run: node scripts/uploadAppIcon.js + + - name: Generate App Assets + run: npx @capacitor/assets generate --iconBackgroundColor '#ffffff' --iconBackgroundColorDark '#222222' --splashBackgroundColor '#ffffff' --splashBackgroundColorDark '#111111' - name: Convert Windows line endings to Linux from the gradlew file run: sudo apt update && sudo apt install dos2unix && cd android && dos2unix ./gradlew && cd .. @@ -45,47 +68,82 @@ jobs: with: fileName: 'google-services.json' fileDir: '/home/runner/work/SunbirdEd-mobile-app/SunbirdEd-mobile-app/configurations/' - encodedString: ${{ secrets.GOOGLE_SERVICE_CONTENT }} - - - name: Decode env file - id: decode_env - uses: timheuer/base64-to-file@v1.2 - with: - fileName: 'configuration.prod.ts' - fileDir: '/home/runner/work/SunbirdEd-mobile-app/SunbirdEd-mobile-app/configurations/' - encodedString: ${{ secrets.ENV }} - - - name: Build Ionic assets - run: ionic build --prod && npx cap sync + encodedString: ${{ secrets.DEBUG_GOOGLE_SERVICE_CONTENT }} + - name: Replace secrets in gradle.properties + run: | + sed -i 's|^base_url=.*|base_url=${{ vars.BASE_URL }}|' android/gradle.properties + sed -i 's|^channel_id=.*|channel_id=${{ vars.CHANNEL_ID }}|' android/gradle.properties + sed -i 's|^mobile_app_key=.*|mobile_app_key=${{ secrets.DEBUG_MOBILE_APP_KEY }}|' android/gradle.properties + sed -i 's|^mobile_app_secret=.*|mobile_app_secret=${{ secrets.DEBUG_MOBILE_APP_SECRET }}|' android/gradle.properties + - name: Decode Keystore id: decode_keystore uses: timheuer/base64-to-file@v1.2 with: fileName: 'android_keystore.jks' fileDir: '/home/runner/work/SunbirdEd-mobile-app/SunbirdEd-mobile-app/android/app/keystore/' - encodedString: ${{ secrets.KEYSTORE }} + encodedString: ${{ secrets.DEBUG_KEYSTORE }} + + - name: Create signing.properties from JSON secret + run: | + mkdir -p ${{ github.workspace }}/android/app/keystore - - name: Decode signing properties - id: decode_properties - uses: timheuer/base64-to-file@v1.2 - with: - fileName: 'signing.properties' - fileDir: '/home/runner/work/SunbirdEd-mobile-app/SunbirdEd-mobile-app/android/' - encodedString: ${{ secrets.PROPERTIES }} - - - name: Build bundle - run: cd android && ./gradlew app:bundleRelease - env: - SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} - SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} - SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }} - - - name: Build APK - run: cd android && ./gradlew assembleDebug - - - name: Upload APK - uses: actions/upload-artifact@v3.1.2 + trap 'rm -f signing.json' EXIT + + echo "${{ secrets.DEBUG_SIGNING_KEYS }}" | base64 --decode > signing.json + + KEYSTORE_PASSWORD=$(jq -r '.DEBUG_SIGNING_STORE_PASSWORD' signing.json) + KEYSTORE_ALIAS=$(jq -r '.DEBUG_SIGNING_KEY_ALIAS' signing.json) + KEYSTORE_ALIAS_PASSWORD=$(jq -r '.DEBUG_SIGNING_KEY_PASSWORD' signing.json) + + touch ${{ github.workspace }}/android/signing.properties + echo "KEYSTORE_FILE=${{ github.workspace }}/android/app/keystore/android_keystore.jks" >> ${{ github.workspace }}/android/signing.properties + echo "KEYSTORE_PASSWORD=$KEYSTORE_PASSWORD" >> ${{ github.workspace }}/android/signing.properties + echo "KEYSTORE_ALIAS=$KEYSTORE_ALIAS" >> ${{ github.workspace }}/android/signing.properties + echo "KEYSTORE_ALIAS_PASSWORD=$KEYSTORE_ALIAS_PASSWORD" >> ${{ github.workspace }}/android/signing.properties + + - name: Build Ionic assets + run: ionic build --prod + + - name: Capacitor Sync + run: npx cap sync android + + - name: Copy and update android + run: npx cap copy android && npx cap update android + + - name: Copy content-player files to Android assets + run: | + if [ ! -d "www/content-player" ]; then + echo "Source directory www/content-player does not exist!" + exit 1 + fi + mkdir -p android/app/src/main/assets/public/content-player + cp -r www/content-player/* android/app/src/main/assets/public/content-player/ + ls -R android/app/src/main/assets/public/content-player + + - name: Decode and export signing config + id: signing + run: | + trap 'rm -f signing.json' EXIT + + echo "${{ secrets.DEBUG_APK_SIGNING_KEYS }}" | base64 --decode > signing.json + + echo "SIGNING_KEY_ALIAS=$(jq -r '.DEBUG_SIGNING_KEY_ALIAS' signing.json)" >> $GITHUB_ENV + echo "SIGNING_KEY_PASSWORD=$(jq -r '.DEBUG_SIGNING_KEY_PASSWORD' signing.json)" >> $GITHUB_ENV + echo "SIGNING_STORE_PASSWORD=$(jq -r '.DEBUG_SIGNING_STORE_PASSWORD' signing.json)" >> $GITHUB_ENV + + - name: Cleanup + if: always() + run: | + rm -f signing.json + + - name: Build debug APK + run: cd android && ./gradlew assembleDebug -PenforceReleaseSigningForDebug=true + + - name: Upload Debug APK + if: success() + uses: actions/upload-artifact@v4 with: - name: app-release - path: ${{ github.workspace }}/android/app/build/outputs/ \ No newline at end of file + name: debug-apk + path: android/app/build/outputs/ \ No newline at end of file diff --git a/README.md b/README.md index 45054f3541..87813ba2b9 100644 --- a/README.md +++ b/README.md @@ -313,3 +313,61 @@ Configure the tabs page according to the requirement. Fllowing are the configura - Open chrome and enter `chrome://inspect` - Select app + +## Debug APK Generation Workflow + +The project uses GitHub Actions to automatically generate debug APKs when new tags ending with name `debug` are pushed. Here's how to set up the repository for debug APK generation: + +### Firebase Configuration +1. Generate the SHA-1 fingerprint of your debug keystore: +```bash +cd android/app/keystore +keytool -list -v -keystore android_keystore.jks -alias your_key_alias -storepass your_store_password -keypass your_key_password +``` + +2. Add the SHA-1 fingerprint to your Firebase project: + - Go to Firebase Console + - Select your project + - Go to Project Settings > Your apps + - Click on the Android app + - Add the SHA-1 certificate fingerprint + +### Repository Variables +Add these variables in your GitHub repository settings (Settings > Secrets and variables > Actions > Variables): + +1. `BASE_URL` - Base URL for the application (e.g., https://sandbox.sunbirded.org) +2. `CHANNEL_ID` - Channel ID for the application + +These values should match the ones in your `android/gradle.properties` file. + +### Repository Secrets +Add these secrets in your GitHub repository settings (Settings > Secrets and variables > Actions > Secrets): + +1. `DEBUG_MOBILE_APP_KEY` - Mobile app key from your configuration +2. `DEBUG_MOBILE_APP_SECRET` - Mobile app secret from your configuration +3. `DEBUG_GOOGLE_SERVICE_CONTENT` - Base64 encoded content of your `google-services.json` file +4. `DEBUG_KEYSTORE` - Base64 encoded content of your debug keystore file `android_keystore.jks` +5. `DEBUG_SIGNING_KEYS` - Base64 encoded JSON file containing signing keys: + +```json +{ + "DEBUG_SIGNING_KEY_ALIAS": "your_key_alias", + "DEBUG_SIGNING_KEY_PASSWORD": "your_key_password", + "DEBUG_SIGNING_STORE_PASSWORD": "your_store_password" +} +``` + +### Generating Debug APK +To generate a debug APK: + +1. Create a new tag with the `debug` suffix: +```bash +git tag tag_name_debug +``` + +2. Push the tag to trigger the workflow: +```bash +git push origin tag_name_debug +``` + +You can download the generated debug APK from the workflow run artifacts. diff --git a/android/app/build.gradle b/android/app/build.gradle index 7db56a19c5..b07fdcf9a8 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -38,6 +38,9 @@ android { } buildTypes { debug { + if (project.hasProperty('enforceReleaseSigningForDebug')) { + signingConfig signingConfigs.release + } buildConfigField "String", "SUPPORT_EMAIL","\"${support_email}\"" buildConfigField 'String', 'BASE_URL', "\"${base_url}\"" buildConfigField 'String', 'MOBILE_APP_KEY', "\"${mobile_app_key}\"" From a2201ab9884b1d8a292618a925763010dd4970e2 Mon Sep 17 00:00:00 2001 From: Deeksha Deepak Date: Tue, 22 Apr 2025 16:09:35 +0530 Subject: [PATCH 3/3] SBCOSS-381: Updated package.json file --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index fe3514e826..7e22de4ff7 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "@project-sunbird/sunbird-epub-player-web-component": "1.4.1", "@project-sunbird/sunbird-pdf-player-web-component": "1.1.0", "@project-sunbird/sunbird-quml-player-web-component": "3.0.3", - "@project-sunbird/sunbird-sdk": "7.6.1", + "@project-sunbird/sunbird-sdk": "7.6.2", "@project-sunbird/sunbird-video-player-web-component": "^1.0.1", "chart.js": "4.1.1", "chartjs-plugin-datalabels": "2.2.0", @@ -197,7 +197,7 @@ "cordova-plugin-telerik-imagepicker": "git+https://github.com/Sunbird-Ed/cordova-plugin-telerik-imagepicker", "cordova-plugin-webview-checker": "1.0.1", "cordova-sqlite-storage": "6.0.0", - "cordova-zip-plugin": "github:Sunbird-Ed/jjdltc-cordova-plugin-zip.git", + "cordova-zip-plugin": "https://github.com/Sunbird-Ed/jjdltc-cordova-plugin-zip.git", "es6-promise-plugin": "4.2.2", "fs-extra": "8.1.0", "jest": "29.5.0",