diff --git a/.github/workflows/build_sample_app.yml b/.github/workflows/build_sample_app.yml new file mode 100644 index 000000000..a0c68f7f5 --- /dev/null +++ b/.github/workflows/build_sample_app.yml @@ -0,0 +1,126 @@ +name: Sample App Build +on: + workflow_dispatch: + inputs: + build_debug_apk: + description: Build Debug APK + type: boolean + default: true + required: false + + build_debug_bundle: + description: Build Debug Bundle + type: boolean + default: false + required: false + + build_signed_release_apk: + description: Build Signed Release APK + type: boolean + default: false + required: false + + build_signed_release_bundle: + description: Build Signed Release Bundle + type: boolean + default: false + required: false + + account_id: + description: 'Clevertap Account ID' + type: string + default: "" + required: true + + account_token: + description: 'Clevertap Account Token' + type: string + default: "" + required: true + + account_region: + description: 'Clevertap Account Region' + type: string + default: eu1 + required: true + + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Output Inputs + run: echo "${{ toJSON(inputs) }}" + + - name: Checkout the code from Repo + uses: actions/checkout@v3 + + - name: Setup JDK 17. + uses: ./.github/mini_flows/setup_jdk + + - name: Decode secret files + env: + GOOGLE_SERVICES_BASE64: ${{ secrets.GOOGLE_SERVICES_BASE64 }} + SAMPLE_KEY_BASE64: ${{ secrets.SAMPLE_KEY_BASE64 }} + LOCAL_PROPERTIES_BASE64: ${{ secrets.LOCAL_PROPERTIES_BASE64 }} + run: | + echo "$GOOGLE_SERVICES_BASE64" | base64 --decode > sample/google-services.json + echo "$SAMPLE_KEY_BASE64" | base64 --decode > sample/SampleKey + echo "$LOCAL_PROPERTIES_BASE64" | base64 --decode > local.properties + + - name: Replace Clevertap Credentials in AndroidManifest.xml + run: | + sed -i "s/YOUR ACCT ID/${{ github.event.inputs.account_id }}/g" sample/src/main/AndroidManifest.xml + sed -i "s/YOUR ACCT TOKEN/${{ github.event.inputs.account_token }}/g" sample/src/main/AndroidManifest.xml + sed -i "s/YOUR ACCT REGION/${{ github.event.inputs.account_region }}/g" sample/src/main/AndroidManifest.xml + + - name: Build Debug APK + if: ${{ inputs.build_debug_apk}} + run: | + ./gradlew :sample:assembleRemoteDebug + + - name: Build Debug Bundle + if: ${{ inputs.build_debug_bundle}} + run: | + ./gradlew :sample:bundleRemoteDebug + + - name: Build Signed Release APK + if: ${{ inputs.build_signed_release_apk}} + run: | + ./gradlew :sample:assembleRemoteSigned + + + - name: Build Signed Release Bundle + if: ${{ inputs.build_signed_release_bundle}} + run: | + ./gradlew :sample:bundleRemoteSigned + + - name: Upload Debug APK + if: ${{ inputs.build_debug_apk}} + uses: actions/upload-artifact@v3 + with: + name: sample-debug-apk + path: sample/build/outputs/apk/remote/debug/*.apk + + - name: Upload Debug Bundle + if: ${{ inputs.build_debug_bundle}} + uses: actions/upload-artifact@v3 + with: + name: sample-debug-bundle + path: sample/build/outputs/bundle/remoteDebug/*.aab + + - name: Upload Signed Release APK + if: ${{ inputs.build_signed_release_apk}} + uses: actions/upload-artifact@v3 + with: + name: sample-signed-release-apk + path: sample/build/outputs/apk/remote/signed/*.apk + + + - name: Upload Signed Release Bundle + if: ${{ inputs.build_signed_release_bundle}} + uses: actions/upload-artifact@v3 + with: + name: sample-signed-release-bundle + path: sample/build/outputs/bundle/remoteSigned/*.aab \ No newline at end of file diff --git a/.github/workflows/manually_validate.yml b/.github/workflows/manually_validate.yml index 86fdeb30b..0b6250095 100644 --- a/.github/workflows/manually_validate.yml +++ b/.github/workflows/manually_validate.yml @@ -74,45 +74,45 @@ jobs: uses: actions/checkout@v3 - name: Mandatory File Changes - if: ${{ github.event.inputs.check_mandatory }} + if: ${{ inputs.check_mandatory }} uses: ./.github/mini_flows/mandatory_filechanges - name: Setup JDK 17. uses: ./.github/mini_flows/setup_jdk - name: Run lint tests and Upload results - if: ${{ github.event.inputs.lint }} + if: ${{ inputs.lint }} uses: ./.github/mini_flows/lint - name: Static Code Check Via detekt - if: ${{ github.event.inputs.detekt }} + if: ${{ inputs.detekt }} uses: ./.github/mini_flows/codechecks_detekt - name: Static Code Check Via checkstyle - if: ${{ github.event.inputs.checkstyle }} + if: ${{ inputs.checkstyle }} uses: ./.github/mini_flows/codechecks_checkstyle - name: Unit Tests and Jacoco Coverage (DEBUG) - if: ${{ github.event.inputs.jacoco_debug }} + if: ${{ inputs.jacoco_debug }} uses: ./.github/mini_flows/test_and_coverage_debug - name: Unit Tests and Jacoco Coverage (RELEASE) - if: ${{ github.event.inputs.jacoco_release }} + if: ${{ inputs.jacoco_release }} uses: ./.github/mini_flows/test_and_coverage_release - name: Unit Tests(DEBUG) - if: ${{ github.event.inputs.test_debug }} + if: ${{ inputs.test_debug }} uses: ./.github/mini_flows/test_debug - name: Unit Tests(RELEASE) - if: ${{ github.event.inputs.test_release }} + if: ${{ inputs.test_release }} uses: ./.github/mini_flows/test_release - name: Build AARs (DEBUG) - if: ${{ github.event.inputs.build_debug }} + if: ${{ inputs.build_debug }} uses: ./.github/mini_flows/build_code_debug - name: Build AARs (RELEASE) - if: ${{ github.event.inputs.build_release }} + if: ${{ inputs.build_release }} uses: ./.github/mini_flows/build_code_release diff --git a/CHANGELOG.md b/CHANGELOG.md index 5be83b563..c394b424f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ ## CHANGE LOG. +### April 11, 2024 + +* [CleverTap Android SDK v6.2.1](docs/CTCORECHANGELOG.md) + ### April 3, 2024 +> ⚠️ **NOTE** +6.2.0 produces a crash, please update to 6.2.1 and above. * [CleverTap Android SDK v6.2.0](docs/CTCORECHANGELOG.md) diff --git a/README.md b/README.md index e170658a2..d11846aa3 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ We publish the SDK to `mavenCentral` as an `AAR` file. Just declare it as depend ```groovy dependencies { - implementation "com.clevertap.android:clevertap-android-sdk:6.2.0" + implementation "com.clevertap.android:clevertap-android-sdk:6.2.1" } ``` @@ -34,7 +34,7 @@ Alternatively, you can download and add the AAR file included in this repo in yo ```groovy dependencies { - implementation (name: "clevertap-android-sdk-6.2.0", ext: 'aar') + implementation (name: "clevertap-android-sdk-6.2.1", ext: 'aar') } ``` @@ -46,7 +46,7 @@ Add the Firebase Messaging library and Android Support Library v4 as dependencie ```groovy dependencies { - implementation "com.clevertap.android:clevertap-android-sdk:6.2.0" + implementation "com.clevertap.android:clevertap-android-sdk:6.2.1" implementation "androidx.core:core:1.9.0" implementation "com.google.firebase:firebase-messaging:23.0.6" implementation "com.google.android.gms:play-services-ads:22.3.0" // Required only if you enable Google ADID collection in the SDK (turned off by default). diff --git a/clevertap-core/src/main/java/com/clevertap/android/sdk/CleverTapInstanceConfig.java b/clevertap-core/src/main/java/com/clevertap/android/sdk/CleverTapInstanceConfig.java index ef681599d..fe7082879 100644 --- a/clevertap-core/src/main/java/com/clevertap/android/sdk/CleverTapInstanceConfig.java +++ b/clevertap-core/src/main/java/com/clevertap/android/sdk/CleverTapInstanceConfig.java @@ -127,7 +127,6 @@ public static CleverTapInstanceConfig createInstance(Context context, @NonNull S this.fcmSenderId = config.fcmSenderId; this.packageName = config.packageName; this.beta = config.beta; - this.allowedPushTypes = config.allowedPushTypes; this.identityKeys = config.identityKeys; this.encryptionLevel = config.encryptionLevel; } @@ -226,10 +225,6 @@ private CleverTapInstanceConfig(String jsonString) throws Throwable { if (configJsonObject.has(Constants.KEY_BETA)) { this.beta = configJsonObject.getBoolean(Constants.KEY_BETA); } - if (configJsonObject.has(Constants.KEY_ALLOWED_PUSH_TYPES)) { - this.allowedPushTypes = (ArrayList) toList( - configJsonObject.getJSONArray(Constants.KEY_ALLOWED_PUSH_TYPES)); - } if (configJsonObject.has(Constants.KEY_IDENTITY_TYPES)) { this.identityKeys = (String[]) toArray(configJsonObject.getJSONArray(Constants.KEY_IDENTITY_TYPES)); } @@ -492,7 +487,6 @@ String toJSONString() { configJsonObject.put(Constants.KEY_ENABLE_CUSTOM_CT_ID, getEnableCustomCleverTapId()); configJsonObject.put(Constants.KEY_PACKAGE_NAME, getPackageName()); configJsonObject.put(Constants.KEY_BETA, isBeta()); - configJsonObject.put(Constants.KEY_ALLOWED_PUSH_TYPES, toJsonArray(allowedPushTypes)); configJsonObject.put(Constants.KEY_ENCRYPTION_LEVEL , getEncryptionLevel()); return configJsonObject.toString(); } catch (Throwable e) { diff --git a/clevertap-core/src/main/java/com/clevertap/android/sdk/Constants.java b/clevertap-core/src/main/java/com/clevertap/android/sdk/Constants.java index 21df15fe6..fa7f7f0bc 100644 --- a/clevertap-core/src/main/java/com/clevertap/android/sdk/Constants.java +++ b/clevertap-core/src/main/java/com/clevertap/android/sdk/Constants.java @@ -236,7 +236,6 @@ public interface Constants { String KEY_ENABLE_CUSTOM_CT_ID = "getEnableCustomCleverTapId"; String KEY_BETA = "beta"; String KEY_PACKAGE_NAME = "packageName"; - String KEY_ALLOWED_PUSH_TYPES = "allowedPushTypes"; String KEY_IDENTITY_TYPES = "identityTypes"; String KEY_ENCRYPTION_LEVEL = "encryptionLevel"; String KEY_ENCRYPTION_FLAG_STATUS = "encryptionFlagStatus"; diff --git a/docs/CTCORECHANGELOG.md b/docs/CTCORECHANGELOG.md index a99de2b88..6f365a2f5 100644 --- a/docs/CTCORECHANGELOG.md +++ b/docs/CTCORECHANGELOG.md @@ -1,6 +1,14 @@ ## CleverTap Android SDK CHANGE LOG +### Version 6.2.1 (April 11, 2024) +This hotfix release addresses the following issue in `v6.2.0`: + +#### Bug Fixes +* Fixes a crash `IllegalArgumentException` caused by `allowedPushType` XPS enum. + ### Version 6.2.0 (April 3, 2024) +> ⚠️ **NOTE** +6.2.0 produces a crash, please update to 6.2.1 and above. #### Bug Fixes * Extends the push primer callback to notify permission denial when cancel button is clicked on `PromptForSettings` alert dialog. diff --git a/docs/CTGEOFENCE.md b/docs/CTGEOFENCE.md index 267f142a9..ad7a3807a 100644 --- a/docs/CTGEOFENCE.md +++ b/docs/CTGEOFENCE.md @@ -17,7 +17,7 @@ Add the following dependencies to the `build.gradle` ```Groovy implementation "com.clevertap.android:clevertap-geofence-sdk:1.3.0" -implementation "com.clevertap.android:clevertap-android-sdk:6.2.0" // 3.9.0 and above +implementation "com.clevertap.android:clevertap-android-sdk:6.2.1" // 3.9.0 and above implementation "com.google.android.gms:play-services-location:21.0.0" implementation "androidx.work:work-runtime:2.7.1" // required for FETCH_LAST_LOCATION_PERIODIC implementation "androidx.concurrent:concurrent-futures:1.1.0" // required for FETCH_LAST_LOCATION_PERIODIC diff --git a/docs/CTPUSHTEMPLATES.md b/docs/CTPUSHTEMPLATES.md index 342f72758..93893b55c 100644 --- a/docs/CTPUSHTEMPLATES.md +++ b/docs/CTPUSHTEMPLATES.md @@ -21,7 +21,7 @@ CleverTap Push Templates SDK helps you engage with your users using fancy push n ```groovy implementation "com.clevertap.android:push-templates:1.2.3" -implementation "com.clevertap.android:clevertap-android-sdk:6.2.0" // 4.4.0 and above +implementation "com.clevertap.android:clevertap-android-sdk:6.2.1" // 4.4.0 and above ``` 2. Add the following line to your Application class before the `onCreate()` diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 80341c968..492fcf862 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -54,7 +54,7 @@ coroutines_test = "1.7.3" installreferrer = "2.2" #SDK Versions -clevertap_android_sdk = "6.2.0" +clevertap_android_sdk = "6.2.1" clevertap_rendermax_sdk = "1.0.3" clevertap_geofence_sdk = "1.3.0" clevertap_hms_sdk = "1.3.4" diff --git a/sample/build.gradle b/sample/build.gradle index 04251bd98..2db7e033c 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -44,6 +44,16 @@ android { } } } + Properties localProperties = loadLocalProperties() + signingConfigs { + create("sampleAppConfig") { + storeFile = getCtProperty("com.clevertap.signing.storeFile", localProperties)?.with {"${projectDir}/${it}" as File } + storePassword = getCtProperty("com.clevertap.signing.storePassword", localProperties) + keyAlias = getCtProperty("com.clevertap.signing.keyAlias", localProperties) + keyPassword = getCtProperty("com.clevertap.signing.keyPassword", localProperties) + } + } + buildTypes { named("debug") { minifyEnabled false @@ -53,6 +63,11 @@ android { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } + signed { + initWith release + signingConfig = signingConfigs["sampleAppConfig"] + matchingFallbacks = ['release'] + } } tasks.withType(KotlinCompile).configureEach { kotlinOptions { @@ -150,6 +165,20 @@ dependencies { stagingImplementation("com.clevertap.android:clevertap-hms-sdk:1.3.4") } +Properties loadLocalProperties() { + def propertiesFile = project.rootProject.file('local.properties') + if (propertiesFile.exists()) { + Properties localProperties = new Properties() + localProperties.load(propertiesFile.newDataInputStream()) + return localProperties + } + return [:] // Return an empty map if properties file doesn't exist +} + +static String getCtProperty(String key, Properties localProperties) { + return localProperties[key] as String +} + apply plugin: 'com.google.gms.google-services' //For Huawei Push //apply plugin: 'com.huawei.agconnect' diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml index 0d99e6fb5..bed752fa5 100644 --- a/sample/src/main/AndroidManifest.xml +++ b/sample/src/main/AndroidManifest.xml @@ -57,7 +57,7 @@ android:value="YOUR ACCT TOKEN" /> + android:value="YOUR ACCT REGION"/> diff --git a/templates/CTCORECHANGELOG.md b/templates/CTCORECHANGELOG.md index a99de2b88..6f365a2f5 100644 --- a/templates/CTCORECHANGELOG.md +++ b/templates/CTCORECHANGELOG.md @@ -1,6 +1,14 @@ ## CleverTap Android SDK CHANGE LOG +### Version 6.2.1 (April 11, 2024) +This hotfix release addresses the following issue in `v6.2.0`: + +#### Bug Fixes +* Fixes a crash `IllegalArgumentException` caused by `allowedPushType` XPS enum. + ### Version 6.2.0 (April 3, 2024) +> ⚠️ **NOTE** +6.2.0 produces a crash, please update to 6.2.1 and above. #### Bug Fixes * Extends the push primer callback to notify permission denial when cancel button is clicked on `PromptForSettings` alert dialog.