Skip to content

Commit 0de9525

Browse files
committed
Release 4.0.0
1 parent 03e0cb6 commit 0de9525

File tree

86 files changed

+3772
-488
lines changed

Some content is hidden

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

86 files changed

+3772
-488
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
## 4.0.0
2+
3+
* 支持 HarmonyOS 埋点
4+
* 支持 HarmonyOS 全埋点
5+
6+
## 3.0.1
7+
8+
* 修复页面名称字段错误的问题
9+
10+
## 3.0.0
11+
12+
* 支持全埋点
13+
* Flutter 支持 Web 端数据采集
14+
15+
## 2.8.0
16+
17+
* 新增 namespace 配置以支持 Android AGP 8.0+
18+
19+
## 2.7.0
20+
21+
* register Receiver 适配 API 33 及以上版本
22+
123
## 2.6.0
224

325
* 升级依赖的 Android SDK 版本到 v6.8.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
```yml
1717
dependencies:
1818
# 添加神策 flutter plugin
19-
sensors_analytics_flutter_plugin: ^2.6.0
19+
sensors_analytics_flutter_plugin: ^4.0.0
2020
```
2121
2222
执行 flutter packages get 命令安装插件

android/build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ rootProject.allprojects {
2222
apply plugin: 'com.android.library'
2323

2424
android {
25-
compileSdkVersion 28
25+
26+
if (project.android.hasProperty("namespace")) {
27+
namespace 'com.sensorsdata.analytics.sensorsanalyticsflutterplugin'
28+
}
29+
30+
compileSdkVersion 34
2631

2732
defaultConfig {
2833
minSdkVersion 16
@@ -35,5 +40,4 @@ android {
3540
dependencies {
3641
implementation fileTree(dir: 'libs', include: ['*.jar'])
3742
api 'com.sensorsdata.analytics.android:SensorsAnalyticsSDK:6.8.0'
38-
// implementation 'org.json:json:20220320'
3943
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Wed Nov 13 14:54:44 CST 2024
12
distributionBase=GRADLE_USER_HOME
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
24
distributionPath=wrapper/dists
3-
zipStoreBase=GRADLE_USER_HOME
45
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
6+
zipStoreBase=GRADLE_USER_HOME

android/settings.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
rootProject.name = 'sensors_analytics_flutter_plugin'
1+
package android
2+
3+
plugins {
4+
id "com.android.application" version "3.5.0" apply false
5+
}

android/src/main/java/com/sensorsdata/analytics/sensorsanalyticsflutterplugin/FlutterVisual.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package com.sensorsdata.analytics.sensorsanalyticsflutterplugin;
22

3+
34
import android.content.BroadcastReceiver;
45
import android.content.Context;
56
import android.content.Intent;
67
import android.content.IntentFilter;
8+
import android.os.Build;
79

810
import com.sensorsdata.analytics.android.sdk.SALog;
911

@@ -59,7 +61,11 @@ public synchronized void registerBroadcast(Context context) {
5961
SALog.i(TAG, "registerBroadcast");
6062
IntentFilter filter = new IntentFilter();
6163
filter.addAction(FLUTTER_ACTION);
62-
context.registerReceiver(mDynamicReceiver, filter);
64+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
65+
context.registerReceiver(mDynamicReceiver, filter, Context.RECEIVER_NOT_EXPORTED);
66+
} else {
67+
context.registerReceiver(mDynamicReceiver, filter);
68+
}
6369
isRegister = true;
6470
} catch (Exception e) {
6571
SALog.printStackTrace(e);

example/.metadata

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,27 @@
44
# This file should be version controlled.
55

66
version:
7-
revision: eb6d86ee27deecba4a83536aa20f366a6044895c
8-
channel: stable
7+
revision: 97eb49008bc1a3f004c78d4cfb47f2e1361114ef
8+
channel: master
99

1010
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 97eb49008bc1a3f004c78d4cfb47f2e1361114ef
17+
base_revision: 97eb49008bc1a3f004c78d4cfb47f2e1361114ef
18+
- platform: ohos
19+
create_revision: 97eb49008bc1a3f004c78d4cfb47f2e1361114ef
20+
base_revision: 97eb49008bc1a3f004c78d4cfb47f2e1361114ef
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'

example/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# example
2+
3+
A new Flutter project.
4+
5+
## Getting Started
6+
7+
This project is a starting point for a Flutter application.
8+
9+
A few resources to get you started if this is your first Flutter project:
10+
11+
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12+
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
13+
14+
For help getting started with Flutter development, view the
15+
[online documentation](https://docs.flutter.dev/), which offers tutorials,
16+
samples, guidance on mobile development, and a full API reference.

example/android/app/build.gradle

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
7+
18
def localProperties = new Properties()
29
def localPropertiesFile = rootProject.file('local.properties')
310
if (localPropertiesFile.exists()) {
@@ -6,10 +13,6 @@ if (localPropertiesFile.exists()) {
613
}
714
}
815

9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
1316

1417
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1518
if (flutterVersionCode == null) {
@@ -21,9 +24,9 @@ if (flutterVersionName == null) {
2124
flutterVersionName = '1.0'
2225
}
2326

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27+
//apply plugin: 'com.android.application'
28+
//apply plugin: 'kotlin-android'
29+
//apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2730

2831
android {
2932
compileSdkVersion flutter.compileSdkVersion
@@ -66,6 +69,4 @@ flutter {
6669
source '../..'
6770
}
6871

69-
dependencies {
70-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
71-
}
72+

example/android/build.gradle

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
1-
buildscript {
2-
ext.kotlin_version = '1.6.10'
3-
repositories {
4-
google()
5-
mavenCentral()
6-
}
71

8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.1.2'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
}
12-
}
132

143
allprojects {
154
repositories {
@@ -26,6 +15,6 @@ subprojects {
2615
project.evaluationDependsOn(':app')
2716
}
2817

29-
task clean(type: Delete) {
18+
tasks.register("clean", Delete) {
3019
delete rootProject.buildDir
3120
}

0 commit comments

Comments
 (0)