Skip to content

Commit

Permalink
Android Release (#554)
Browse files Browse the repository at this point in the history
* Extract API calls from NetworkManager

* Add TriggerManager to NetworkManagerTests

* task(SDK-3620) - Upgrades AGP to 8.2.1

* task(SDK-3620) - Resolves MissingClasses Detected while Running R8 for core

* task(SDK-3620) - Setup workflows to use JDK 17

* task(SDK-3620) - Resolve workflow issues

* task(SDK-3620) - Resolve workflow issues

* Task/sdk 3639/refactor geofence unit tests (#547)

* task(SDK-3639) - Refactors unit tests to remove powermock dependency, part 1

* task(SDK-3639) - Refactors unit tests to remove powermock dependency, part 2

* task(SDK-3639) - Refactors unit tests to remove powermock dependency, updates mockito version

* task(SDK-3639) - Resolves case where CTGeofenceTaskManager unit tests were failing when run all together

* task(SDK-3620) - Removes changes not specific to this task

* task(SDK-3620) - Adds test namespace for core-sdk

* task(SDK-3620) - Possible fix for failing git actions

* task(SDK-3620) - Possible fix for failing git actions

* task(SDK-3620) - Adds compileOptions for all modules

* task(SDK-3536) - Changes inapp fragment transaction to commitNow() (#540)

* task(SDK-3238) - Fixes Input PT by changing flag to MUTABLE (#544)

* task(SDK-3620) - Adds agp 8 related consumer proguard rules for hms and baidu

* task(SDK-3620) - Updates sample app

* Lp/knock/anr jio (#548)

* Bug: theoretical ANR due to synchronised method

- my jio reported an anr trace which shows in register method of SDK
- while there is nothing major happening to cause this anr, we are removing synchronised keyword because it seems not absolutely necessary.
- Jira : https://wizrocket.atlassian.net/browse/SDK-3630

* Chore: Removal of log

- removed log

* Task/sdk-3622/upgrade to android 14 (#549)

* task(SDK-3629) - Handles deprecated overridePendingTransitionMethod()

* task(SDK-3238) - Adds activity options to PendingIntent.getActivity()

* task(SDK-3238) - Updates compileSDKVersion and targetSDKVersion

* task(SDK-3238) - Fixes unit tests by updating workflow files to target java version 17

* task(SDK-3238) - Fixes unit tests

* task(SDK-3238) - Reverts changes

* task(SDK-3238) - Fixes failing git actions

* task(SDK-3238) - Reverts changes

* task(SDK-3238) - Fixes unit tests

* task(SDK-3622) - Removes targetSDKVersion and deprecated features

* Task/sdk 3236/migrate to work manager (#542)

* task(SDK-3236) - Initial implementation for migration to WorkManager

* task(SDK-3236) - Adds main process check to before init push amo

* task(SDK-3236) - Cleans the code and adds an instrumentation test

* task(SDK-3236) - Removes redundant files

* task(SDK-3236) - Cleans redundant code

* task(SDK-3236) - Updates PushAmpWorker test

* task(SDK-3236) - Updates logic for pingFrequencyUpdate

* task(SDK-3236) - Updates pingFrequency

* task(SDK-3236) - Adds comments and exception handling

* task(SDK-3236) - Updates logic for stopping worker

* task(SDK-3236) - Cancels jobscheduler jobs on app update

* task(SDK-3236) - Moves constants to specific class, removes postAsyncSafely for ping event, improves logging, adds default flex interval

* task(SDK-3236) - Optimizes SDF object creation

* task(SDK-3236) - Optimizes SDF object creation

* task(SDK-3620) - Updates build.gradle for test_shared module

* Feat: Deprecated labels for xiaomi methods (#553)

- xiaomi will be removed after March according to compliance

* Workflow: Git actions for static checks (#555)

* Task/sdk 3659/accessibility ids (#556)

* task(SDK-3659) - Adds accessibility ids for inapp title, message, bgimg and btns

* task(SDK-3659) - Adds accessibility ids for inapp icons

---------

Co-authored-by: anush <[email protected]>

* task(SDK-3620) - Updates AGP to 8.2.2 (#557)

* task(SDK-3620) - Updates libs.versions.toml

* task(SDK-3620) - Updates libs.versions.toml for kotlin_lpugin

* Task/kotlin version (#559)

* Feat: Removal of databinding

- it was creating problems for sample app
- kotlin version 1920 is required for databinding so we were forced

* Feat: downgrading kotlin compilation version

- downgrading kotlin compoilation version
- it was forcing client to upgrade kotlin version in their project
- "org.jetbrains.kotlin:kotlin-gradle-plugin" impacted

* Docs/release cadence feb21 (#560)

* Changelog: Xiaomi deprecations

- deprecations added in xiaomi docs

* Changelog: Xiaomi deprecations contd...

- deprecations added in xiaomi docs

* Changelog: Core SDK changelog

* Changelog: Core SDK changelog

* Changelog: SDK changelogs

- push templates, geofence and huawei change logs updated.

* Changelog: Core changelog

* Changelog: FAQs updated

* Changelog: Main changelog

- hyperlinks individual ones

* Versioning: SDK versions

- bumped for new release
- did for all but xiaomi sdks.

* Chore: Copy templates

- ran copy templates gradle command.

* docs(SDK-3672) - Minor updates to docs

---------

Co-authored-by: anush <[email protected]>

* Docs/release cadence feb21 fix (#562)

* Changelog: Xiaomi deprecations

- deprecations added in xiaomi docs

* Changelog: Xiaomi deprecations contd...

- deprecations added in xiaomi docs

* Changelog: Core SDK changelog

* Changelog: Core SDK changelog

* Changelog: SDK changelogs

- push templates, geofence and huawei change logs updated.

* Changelog: Core changelog

* Changelog: FAQs updated

* Changelog: Main changelog

- hyperlinks individual ones

* Versioning: SDK versions

- bumped for new release
- did for all but xiaomi sdks.

* Chore: Copy templates

- ran copy templates gradle command.

* docs(SDK-3672) - Minor updates to docs

* docs - Update changelog to include github issue fix

---------

Co-authored-by: CTLalit <[email protected]>

---------

Co-authored-by: Vassil Angelov <[email protected]>
Co-authored-by: Darshan Pania <[email protected]>
Co-authored-by: anush <[email protected]>
Co-authored-by: Anush-Shand <[email protected]>
  • Loading branch information
5 people authored Feb 21, 2024
1 parent 46867b5 commit 353a45d
Show file tree
Hide file tree
Showing 133 changed files with 2,432 additions and 2,230 deletions.
4 changes: 2 additions & 2 deletions .github/mini_flows/setup_jdk/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
runs:
using: "composite"
steps:
- name: Setup JDK 11
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
# cache: gradle
2 changes: 1 addition & 1 deletion .github/workflows/manually_validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
if: ${{ github.event.inputs.check_mandatory }}
uses: ./.github/mini_flows/mandatory_filechanges

- name: Setup JDK 11.
- name: Setup JDK 17.
uses: ./.github/mini_flows/setup_jdk

- name: Run lint tests and Upload results
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on_pr_from_develop_to_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Checkout the code from Repo
uses: actions/checkout@v3

- name: Setup JDK 11.
- name: Setup JDK 17.
uses: ./.github/mini_flows/setup_jdk

- name: Mandatory File Changes
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/on_pr_from_task_to_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
lint-staticChecks-test-build:
if: startsWith(github.head_ref, 'task/')
if: startsWith(github.head_ref, 'task/') || startsWith(github.head_ref, 'feat/') || startsWith(github.head_ref, 'bug/')
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -15,7 +15,7 @@ jobs:
- name: Checkout the code from Repo
uses: actions/checkout@v3

- name: Setup JDK 11.
- name: Setup JDK 17.
uses: ./.github/mini_flows/setup_jdk

- name: Run lint tests and Upload results
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on_pr_merged_in_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Checkout the code from Repo
uses: actions/checkout@v3

- name: Setup JDK 11.
- name: Setup JDK 17.
uses: ./.github/mini_flows/setup_jdk

- name: Run lint tests and Upload results
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## CHANGE LOG.

### February 21, 2024

* [CleverTap Android SDK v6.1.0](docs/CTCORECHANGELOG.md)
* [CleverTap Push Templates SDK v1.2.3](docs/CTPUSHTEMPLATESCHANGELOG.md).
* [CleverTap Geofence SDK v1.3.0](docs/CTGEOFENCECHANGELOG.md)
* [CleverTap Huawei Push SDK v1.3.4](docs/CTHUAWEIPUSHCHANGELOG.md)

### January 15, 2024

* [CleverTap Android SDK v6.0.0](docs/CTCORECHANGELOG.md)
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ To get started, sign up [here](https://clevertap.com/live-product-demo/)
We publish the SDK to `mavenCentral` as an `AAR` file. Just declare it as dependency in your `build.gradle` file.

```groovy
dependencies {
implementation "com.clevertap.android:clevertap-android-sdk:6.0.0"
}
dependencies {
implementation "com.clevertap.android:clevertap-android-sdk:6.1.0"
}
```

Alternatively, you can download and add the AAR file included in this repo in your Module libs directory and tell gradle to install it like this:

```groovy
dependencies {
implementation(name: "clevertap-android-sdk-6.0.0", ext: 'aar')
}
dependencies {
implementation (name: "clevertap-android-sdk-6.1.0", ext: 'aar')
}
```


Expand All @@ -45,9 +45,9 @@ Alternatively, you can download and add the AAR file included in this repo in yo
Add the Firebase Messaging library and Android Support Library v4 as dependencies to your Module `build.gradle` file.

```groovy
dependencies {
implementation "com.clevertap.android:clevertap-android-sdk:6.0.0"
implementation "androidx.core:core:1.9.0"
dependencies {
implementation "com.clevertap.android:clevertap-android-sdk:6.1.0"
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).
}
Expand All @@ -70,8 +70,8 @@ Also be sure to include the `google-services.json` classpath in your Project lev
}
dependencies {
classpath "com.android.tools.build:gradle:7.4.2"
classpath "com.google.gms:google-services:4.3.3"
classpath "com.android.tools.build:gradle:8.2.2"
classpath "com.google.gms:google-services:4.4.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -85,11 +85,11 @@ Add your FCM generated `google-services.json` file to your project and add the f
apply plugin: 'com.google.gms.google-services'
```
Interstitial InApp Notification templates support Audio and Video with the help of ExoPlayer. To enable Audio/Video in your Interstitial InApp Notifications, add the following dependencies in your `build.gradle` file :

```groovy
implementation "com.google.android.exoplayer:exoplayer:2.19.1"
implementation "com.google.android.exoplayer:exoplayer-hls:2.19.1"
implementation "com.google.android.exoplayer:exoplayer-ui:2.19.1"
implementation "com.google.android.exoplayer:exoplayer:2.19.1"
implementation "com.google.android.exoplayer:exoplayer-hls:2.19.1"
implementation "com.google.android.exoplayer:exoplayer-ui:2.19.1"
```

Once you've updated your module `build.gradle` file, make sure you have specified `mavenCentral()` and `google()` as a repositories in your project `build.gradle` and then sync your project in File -> Sync Project with Gradle Files.
Expand Down
2 changes: 2 additions & 0 deletions clevertap-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ android {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
namespace 'com.clevertap.android.sdk'
testNamespace 'com.clevertap.demo'
}

dependencies {
Expand Down
3 changes: 2 additions & 1 deletion clevertap-core/consumer-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
-keepnames class * implements android.os.Parcelable {
public static final ** CREATOR;
}

-dontwarn com.clevertap.android.sdk.**
-dontwarn com.baidu.**
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,
SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
6 changes: 4 additions & 2 deletions clevertap-core/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.clevertap.demo"
xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<!-- Required runtime permission to display notifications on Android 13 -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
Expand All @@ -15,6 +14,9 @@
<meta-data
android:name="CLEVERTAP_TOKEN"
android:value="TEST" />
<meta-data
android:name="CLEVERTAP_BACKGROUND_SYNC"
android:value="1" />

</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import android.content.Context
import android.util.Log
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import androidx.work.Configuration
import androidx.work.Constraints.Builder
import androidx.work.NetworkType.CONNECTED
import androidx.work.PeriodicWorkRequest
import androidx.work.WorkInfo
import androidx.work.WorkManager
import androidx.work.testing.SynchronousExecutor
import androidx.work.testing.WorkManagerTestInitHelper
import com.clevertap.android.sdk.CleverTapAPI
import com.clevertap.android.sdk.CleverTapAPI.LogLevel.VERBOSE
import com.clevertap.android.sdk.pushnotification.amp.CTPushAmpWorker
import org.hamcrest.CoreMatchers.*
import org.hamcrest.MatcherAssert.*
import org.junit.*
import org.junit.runner.*
import java.util.concurrent.TimeUnit.MINUTES

@RunWith(AndroidJUnit4::class)
class CTPushAmpWorkerInstrumentationTest {
@Before
fun setup() {
val context = InstrumentationRegistry.getInstrumentation().targetContext
val config = Configuration.Builder()
.setMinimumLoggingLevel(Log.VERBOSE)
.setExecutor(SynchronousExecutor())
.build()

// Initialize WorkManager for instrumentation tests.
WorkManagerTestInitHelper.initializeTestWorkManager(context, config)
}

@Test
fun testWork(){
CleverTapAPI.setDebugLevel(VERBOSE)
val myContext = ApplicationProvider.getApplicationContext<Context>()

val constraints = Builder()
.setRequiredNetworkType(CONNECTED)
.setRequiresCharging(false)
.setRequiresBatteryNotLow(true)
.build()

val request =
PeriodicWorkRequest.Builder(CTPushAmpWorker::class.java, 15, MINUTES, 5, MINUTES)
.setConstraints(constraints).build()

val workManager = WorkManager.getInstance(myContext)
val testDriver = WorkManagerTestInitHelper.getTestDriver(myContext)!!
// Enqueue
workManager.enqueue(request).result.get()
testDriver.setAllConstraintsMet(request.id)
testDriver.setPeriodDelayMet(request.id)
val workInfo = workManager.getWorkInfoById(request.id).get()
println("workInfo = $workInfo")
// Assert
assertThat(workInfo.state, `is`(WorkInfo.State.ENQUEUED))
}
}
12 changes: 5 additions & 7 deletions clevertap-core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.clevertap.android.sdk"
xmlns:android="http://schemas.android.com/apk/res/android">

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Required runtime permission to display notifications on Android 13 -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

Expand All @@ -18,12 +16,12 @@
android:theme="@style/Theme.AppCompat.DayNight.DarkActionBar" />

<receiver
android:name="com.clevertap.android.sdk.pushnotification.CTPushNotificationReceiver"
android:name=".pushnotification.CTPushNotificationReceiver"
android:enabled="true"
android:exported="false" />

<service
android:name="com.clevertap.android.sdk.pushnotification.amp.CTBackgroundIntentService"
android:name=".pushnotification.amp.CTBackgroundIntentService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE">
<intent-filter>
Expand All @@ -32,12 +30,12 @@
</service>

<service
android:name="com.clevertap.android.sdk.pushnotification.amp.CTBackgroundJobService"
android:name=".pushnotification.amp.CTBackgroundJobService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />

<receiver
android:name="com.clevertap.android.sdk.pushnotification.fcm.CTFirebaseMessagingReceiver"
android:name=".pushnotification.fcm.CTFirebaseMessagingReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter android:priority="-1">
Expand Down
Loading

0 comments on commit 353a45d

Please sign in to comment.