Skip to content

Commit b5d60e4

Browse files
authored
Merge pull request #417 from Countly/staging
Staging 24.7.5
2 parents 09d7817 + 8683e36 commit b5d60e4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2043
-453
lines changed

.github/workflows/build_and_test_sdk.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ on:
1818
branches:
1919
- master
2020
- staging
21-
2221
jobs:
2322
setup:
2423
runs-on: ubuntu-latest
@@ -51,6 +50,9 @@ jobs:
5150

5251
- name: Connect to the Emulator
5352
run: adb connect localhost:5555
53+
54+
- name: Set AAPT2 for android 35
55+
run: echo "android.aapt2FromMavenOverride=/usr/local/lib/android/sdk/build-tools/35.0.0/aapt2" | tee -a ${{ github.workspace }}/gradle.properties
5456

5557
- name: Build the SDK
5658
if: always()

CHANGELOG.md

+40
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
1+
## 24.7.5
2+
* ! Minor breaking change ! All active views will now automatically stop when consent for "views" is revoked.
3+
4+
* The Android SDK now supports Android 15 (API level 35)
5+
* The views will be stopped and restarted now while going to the background or foreground instead of resuming and pausing.
6+
* Added further intent redirection vulnarability checks.
7+
* Added new functions to ease the presenting the feedback widgets. Functions present the first matching feedback widget from the list.
8+
* presentNPS(Context)
9+
* presentNPS(Context, String)
10+
* presentNPS(Context, String, FeedbackCallback)
11+
* presentSurvey(Context)
12+
* presentSurvey(Context, String)
13+
* presentSurvey(Context, String, FeedbackCallback)
14+
* presentRating(Context)
15+
* presentRating(Context, String)
16+
* presentRating(Context, String, FeedbackCallback)
17+
18+
* Mitigated an issue where content communication was done twice.
19+
* Mititgated an issue where a segmentation key was removed if it included a list with an unsupported value instead of sanitizing.
20+
* Mitigated a concurrency issue while restarting stopped views.
21+
* Fixed an issue where SDK was not able to set experimental visibility flag correctly by adding additional foreground state capture.
22+
23+
## 24.7.4
24+
* Disabled caching for webviews.
25+
* Expanded the flag (enablePreviousNameRecording) to add current view name as segmentation to custom events. (Experimental!)
26+
27+
* Fixed an issue where the validation of the parameters during content retrieval was improper.
28+
* Mitigated an issue where a session could have started while the app was in the background when the device ID was changed (non-merge).
29+
* Mitigated an issue that density calculation was missing while resizing content.
30+
* Mitigated an issue where content fetching was enabled after initialization of the SDK.
31+
32+
## 24.7.3
33+
* Automatic view pause/resumes are changed with stop/start for better data consistency.
34+
* Added the config interface 'experimental' to group experimental features.
35+
* Added a flag (enablePreviousNameRecording) to add previous event and view names as segmentation. (Experimental!)
36+
* Added a flag (enableVisibilityTracking) to add app visibility info to views and events. (Experimental!)
37+
* Added Content feature methods:
38+
* enterContentZone, to start Content checks (Experimental!)
39+
* exitContentZone, to stop Content checks (Experimental!)
40+
141
## 24.7.2
242
* Mitigated an issue in the upload plugin that prevented the upload of a symbol file
343

app-benchmark/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ apply plugin: 'kotlin-android'
77

88
android {
99
namespace 'ly.count.android.benchmark'
10-
compileSdk 34
10+
compileSdk 35
1111

1212
defaultConfig {
1313
applicationId "ly.count.android.benchmark"
1414
minSdk 21
15-
targetSdk 34
15+
targetSdk 35
1616
versionCode 1
1717
versionName "1.0"
1818

app-kotlin/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ plugins {
66
}
77

88
android {
9-
compileSdkVersion 33
9+
compileSdkVersion 35
1010

1111
defaultConfig {
1212
applicationId "ly.count.android.demo.kotlin"
1313
minSdk 21
14-
targetSdkVersion 34
14+
targetSdkVersion 35
1515
versionCode 1
1616
versionName "1.0"
1717

app-kotlin/src/main/AndroidManifest.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="ly.count.android.demo.kotlin">
3+
package="ly.count.android.demo.kotlin">
44

5-
<uses-permission android:name="android.permission.INTERNET" />
6-
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
5+
<uses-permission android:name="android.permission.INTERNET"/>
6+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
77

88
<application
99
android:name=".App"
@@ -15,9 +15,9 @@
1515
android:name=".MainActivity"
1616
android:exported="true">
1717
<intent-filter>
18-
<action android:name="android.intent.action.MAIN" />
18+
<action android:name="android.intent.action.MAIN"/>
1919

20-
<category android:name="android.intent.category.LAUNCHER" />
20+
<category android:name="android.intent.category.LAUNCHER"/>
2121
</intent-filter>
2222
</activity>
2323
</application>

app-native/build.gradle

+64-68
Original file line numberDiff line numberDiff line change
@@ -4,87 +4,83 @@ apply plugin: 'com.android.application'
44
// apply plugin: ly.count.android.plugins.UploadSymbolsPlugin
55

66
android {
7-
compileSdkVersion 31
8-
9-
defaultConfig {
10-
applicationId "ly.count.android.demo.crash"
11-
minSdk 21
12-
targetSdkVersion 34
13-
versionCode 1
14-
versionName "1.0"
15-
16-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17-
18-
19-
}
20-
21-
buildTypes {
22-
release {
23-
minifyEnabled false
24-
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
25-
}
26-
}
27-
28-
// You can add Countly plugin tasks to release task like this
29-
/*
30-
afterEvaluate {
31-
assembleRelease.finalizedBy(uploadJavaSymbols)
7+
compileSdkVersion 35
8+
9+
defaultConfig {
10+
applicationId "ly.count.android.demo.crash"
11+
minSdk 21
12+
targetSdkVersion 35
13+
versionCode 1
14+
versionName "1.0"
15+
16+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17+
}
18+
19+
buildTypes {
20+
release {
21+
minifyEnabled false
22+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
3223
}
33-
*/
34-
35-
externalNativeBuild {
36-
cmake {
37-
path file('src/main/cpp/CMakeLists.txt')
38-
}
39-
}
40-
ndkVersion '21.0.6113669'
41-
42-
// Use this if you are working with sdk-native subproject instead of maven library.
43-
// Change also the dependency config below.
44-
/*
45-
sourceSets {
46-
main {
47-
// let gradle pack the shared library into apk
48-
jniLibs.srcDirs = ['../sdk-native/libs']
49-
}
24+
}
25+
26+
// You can add Countly plugin tasks to release task like this
27+
/*
28+
afterEvaluate {
29+
assembleRelease.finalizedBy(uploadJavaSymbols)
30+
}
31+
*/
32+
33+
externalNativeBuild {
34+
cmake {
35+
path file('src/main/cpp/CMakeLists.txt')
5036
}
51-
*/
52-
37+
}
38+
ndkVersion '21.0.6113669'
39+
40+
// Use this if you are working with sdk-native subproject instead of maven library.
41+
// Change also the dependency config below.
42+
/*
43+
sourceSets {
44+
main {
45+
// let gradle pack the shared library into apk
46+
jniLibs.srcDirs = ['../sdk-native/libs']
47+
}
48+
}
49+
*/
5350
}
5451

5552
repositories {
56-
// needed for using sdk-native from countly maven repo
57-
mavenCentral()
53+
// needed for using sdk-native from countly maven repo
54+
mavenCentral()
5855
}
5956

6057
// sdk and sdk-native are pulled from submodules of the project.
6158
// If you are running app independently, you may pull their latest version from our maven repo using the commented lines.
6259
dependencies {
63-
implementation fileTree(dir: 'libs', include: ['*.jar'])
64-
implementation 'androidx.appcompat:appcompat:1.2.0'
65-
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
66-
implementation project(':sdk')
67-
//implementation 'ly.count.android:sdk:21.11.0'
68-
implementation project(':sdk-native')
69-
//implementation 'ly.count.android:sdk-native:21.11.0'
70-
71-
// testImplementation 'junit:junit:4.13.2'
72-
// androidTestImplementation 'androidx.test:runner:1.3.0'
73-
// androidTestImplementation 'androidx.test:core:1.3.0'
74-
// androidTestImplementation 'androidx.test.ext:junit:1.1.2'
75-
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
60+
implementation fileTree(dir: 'libs', include: ['*.jar'])
61+
implementation 'androidx.appcompat:appcompat:1.2.0'
62+
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
63+
implementation project(':sdk')
64+
//implementation 'ly.count.android:sdk:21.11.0'
65+
implementation project(':sdk-native')
66+
//implementation 'ly.count.android:sdk-native:21.11.0'
67+
68+
// testImplementation 'junit:junit:4.13.2'
69+
// androidTestImplementation 'androidx.test:runner:1.3.0'
70+
// androidTestImplementation 'androidx.test:core:1.3.0'
71+
// androidTestImplementation 'androidx.test.ext:junit:1.1.2'
72+
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
7673
}
7774

7875
buildscript {
79-
repositories {
80-
mavenCentral()
81-
}
82-
dependencies {
83-
classpath group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.14.1'
84-
// classpath files('../upload-plugin/build/libs/upload-plugin.jar')
85-
//classpath group: 'ly.count.android', 'name': 'sdk-plugin', 'version': '20.11.8'
86-
87-
}
76+
repositories {
77+
mavenCentral()
78+
}
79+
dependencies {
80+
classpath group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.14.1'
81+
// classpath files('../upload-plugin/build/libs/upload-plugin.jar')
82+
//classpath group: 'ly.count.android', 'name': 'sdk-plugin', 'version': '20.11.8'
83+
}
8884
}
8985

9086
// the following closure is used to configure Countly plugin tasks
+17-17
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="ly.count.android.demo.crash">
4-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
5-
<application
6-
android:name=".App"
7-
android:icon="@mipmap/ic_launcher"
8-
android:label="@string/app_name"
9-
android:roundIcon="@mipmap/ic_launcher_round"
10-
android:supportsRtl="true"
11-
android:theme="@style/AppTheme">
12-
<activity android:name=".MainActivity"
13-
android:exported="true">
14-
<intent-filter>
15-
<action android:name="android.intent.action.MAIN" />
4+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
5+
<application
6+
android:name=".App"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:roundIcon="@mipmap/ic_launcher_round"
10+
android:supportsRtl="true"
11+
android:theme="@style/AppTheme">
12+
<activity android:name=".MainActivity"
13+
android:exported="true">
14+
<intent-filter>
15+
<action android:name="android.intent.action.MAIN"/>
1616

17-
<category android:name="android.intent.category.LAUNCHER" />
18-
</intent-filter>
19-
</activity>
20-
</application>
17+
<category android:name="android.intent.category.LAUNCHER"/>
18+
</intent-filter>
19+
</activity>
20+
</application>
2121

22-
</manifest>
22+
</manifest>

app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ repositories {
2929
}
3030

3131
android {
32-
compileSdk 34
32+
compileSdk 35
3333
namespace 'ly.count.android.demo'
3434

3535
signingConfigs {
@@ -46,7 +46,7 @@ android {
4646
defaultConfig {
4747
applicationId "ly.count.android.demo"
4848
minSdk 21
49-
targetSdk 34
49+
targetSdk 35
5050
versionCode 1
5151
versionName "1.0"
5252
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

app/src/main/java/ly/count/android/demo/ActivityExampleOthers.java

+8
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,12 @@ public void onClickUpdateSession(View v) {
137137
public void onClickEndSession(View v) {
138138
Countly.sharedInstance().sessions().endSession();
139139
}
140+
141+
public void onClickFetchContents(View v) {
142+
Countly.sharedInstance().contents().enterContentZone();
143+
}
144+
145+
public void onClickExitContents(View v) {
146+
Countly.sharedInstance().contents().exitContentZone();
147+
}
140148
}

app/src/main/java/ly/count/android/demo/App.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import android.os.StrictMode;
1616
import android.util.Log;
1717
import androidx.annotation.NonNull;
18+
import androidx.core.content.ContextCompat;
1819
import com.google.android.gms.tasks.OnCompleteListener;
1920
import com.google.android.gms.tasks.Task;
2021
import com.google.firebase.messaging.FirebaseMessaging;
@@ -296,10 +297,7 @@ public void onReceive(Context context, Intent intent) {
296297
};
297298
IntentFilter filter = new IntentFilter();
298299
filter.addAction(CountlyPush.SECURE_NOTIFICATION_BROADCAST);
299-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
300-
registerReceiver(messageReceiver, filter, getPackageName() + COUNTLY_BROADCAST_PERMISSION_POSTFIX, null, Context.RECEIVER_VISIBLE_TO_INSTANT_APPS | Context.RECEIVER_NOT_EXPORTED);
301-
} else {
302-
registerReceiver(messageReceiver, filter, getPackageName() + COUNTLY_BROADCAST_PERMISSION_POSTFIX, null);
303-
}
300+
301+
ContextCompat.registerReceiver(getApplicationContext(), messageReceiver, filter, getPackageName() + COUNTLY_BROADCAST_PERMISSION_POSTFIX, null, ContextCompat.RECEIVER_NOT_EXPORTED);
304302
}
305303
}

app/src/main/res/layout/activity_example_others.xml

+16
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@
111111
android:text="Begin Session"
112112
/>
113113

114+
<Button
115+
android:id="@+id/button75"
116+
android:layout_width="match_parent"
117+
android:layout_height="wrap_content"
118+
android:onClick="onClickExitContents"
119+
android:text="Exit Content"
120+
/>
114121
<Button
115122
android:id="@+id/button72"
116123
android:layout_width="match_parent"
@@ -126,5 +133,14 @@
126133
android:onClick="onClickEndSession"
127134
android:text="End Session"
128135
/>
136+
137+
<Button
138+
android:id="@+id/button74"
139+
android:layout_width="match_parent"
140+
android:layout_height="wrap_content"
141+
android:onClick="onClickFetchContents"
142+
android:text="Show Avaliable Content"
143+
/>
144+
129145
</LinearLayout>
130146
</ScrollView>

0 commit comments

Comments
 (0)