diff --git a/.gitignore b/.gitignore index 2bead7e..0e23047 100644 --- a/.gitignore +++ b/.gitignore @@ -38,7 +38,6 @@ /dev/integration_tests/**/xcuserdata /dev/integration_tests/**/Pods /packages/flutter/coverage/ -version analysis_benchmark.json # packages file containing multi-root paths diff --git a/CHANGELOG.md b/CHANGELOG.md index f6c0f5a..d9fa954 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +### Version 4.29.2 (18th February 2022) +#### Added +- Added support for `Unity` ad revenue tracking. +- Added support for `Helium Chartboost` ad revenue tracking. + +#### Changed +- Removed deprecated v1 way of plugin registration (https://github.com/adjust/flutter_sdk/issues/64). +- Migrated from `jcenter` to `mavenCentral` repository (https://github.com/adjust/flutter_sdk/pull/72). + +#### Native SDKs +- [iOS@v4.29.7][ios_sdk_v4.29.7] +- [Android@v4.29.1][android_sdk_v4.29.1] + +--- + ### Version 4.29.1 (23rd September 2021) #### Added - Added support for `Admost` ad revenue source. @@ -240,6 +255,7 @@ [ios_sdk_v4.28.0]: https://github.com/adjust/ios_sdk/tree/v4.28.0 [ios_sdk_v4.29.2]: https://github.com/adjust/ios_sdk/tree/v4.29.2 [ios_sdk_v4.29.6]: https://github.com/adjust/ios_sdk/tree/v4.29.6 +[ios_sdk_v4.29.7]: https://github.com/adjust/ios_sdk/tree/v4.29.7 [android_sdk_v4.17.0]: https://github.com/adjust/android_sdk/tree/v4.17.0 [android_sdk_v4.18.0]: https://github.com/adjust/android_sdk/tree/v4.18.0 @@ -251,3 +267,4 @@ [android_sdk_v4.27.0]: https://github.com/adjust/android_sdk/tree/v4.27.0 [android_sdk_v4.28.1]: https://github.com/adjust/android_sdk/tree/v4.28.1 [android_sdk_v4.28.5]: https://github.com/adjust/android_sdk/tree/v4.28.5 +[android_sdk_v4.29.1]: https://github.com/adjust/android_sdk/tree/v4.29.1 diff --git a/README.md b/README.md index d687727..8c0e22d 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ You can add Adjust SDK to your Flutter app by adding following to your `pubspec. ```yaml dependencies: - adjust_sdk: ^4.29.1 + adjust_sdk: ^4.29.2 ``` Then navigate to your project in the terminal and run: @@ -117,10 +117,10 @@ flutter packages get Since the 1st of August of 2014, apps in the Google Play Store must use the [Google Advertising ID][google-ad-id] to uniquely identify devices. To allow the Adjust SDK to use the Google Advertising ID, you must integrate the [Google Play Services][google-play-services]. If you haven't done this yet, please add dependency to Google Play Services library by adding following dependecy to your `dependencies` block of app's `build.gradle` file for Android platform: ```gradle -implementation 'com.google.android.gms:play-services-analytics:16.0.4' +implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' ``` -**Note**: The Adjust SDK is not tied to any specific version of the `play-services-analytics` part of the Google Play Services library, so feel free to always use the latest version of it (or whichever you might need). +**Note**: The Adjust SDK is not tied to any specific version of the `play-services-ads-identifier` part of the Google Play Services library. You can use the latest version of the library, or any other version you need. ### [Android] Add permissions diff --git a/VERSION b/VERSION index 2ff15b2..3660d52 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.29.1 +4.29.2 diff --git a/android/.classpath b/android/.classpath deleted file mode 100644 index eb19361..0000000 --- a/android/.classpath +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/android/.project b/android/.project deleted file mode 100644 index 1fc6206..0000000 --- a/android/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - adjust_sdk - Project adjust_sdk created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - diff --git a/android/.settings/org.eclipse.buildship.core.prefs b/android/.settings/org.eclipse.buildship.core.prefs deleted file mode 100644 index e889521..0000000 --- a/android/.settings/org.eclipse.buildship.core.prefs +++ /dev/null @@ -1,2 +0,0 @@ -connection.project.dir= -eclipse.preferences.version=1 diff --git a/android/build.gradle b/android/build.gradle index 175aea1..e52a8a2 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -3,17 +3,17 @@ version '1.0-SNAPSHOT' buildscript { repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath('com.android.tools.build:gradle:4.1.1') + classpath('com.android.tools.build:gradle:7.1.1') } } rootProject.allprojects { repositories { google() - jcenter() + mavenCentral() } gradle.projectsEvaluated { @@ -24,7 +24,7 @@ rootProject.allprojects { } apply plugin: 'com.android.library' android { - compileSdkVersion 30 + compileSdkVersion 32 defaultConfig { minSdkVersion 16 @@ -36,5 +36,5 @@ android { } dependencies { - api 'com.adjust.sdk:adjust-android:4.28.5' + api 'com.adjust.sdk:adjust-android:4.29.1' } diff --git a/android/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 7a3265e..0000000 Binary files a/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index b72edb0..17fa29b 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue Apr 24 23:20:29 CEST 2018 +#Thu Feb 17 11:59:04 CET 2022 distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip +zipStoreBase=GRADLE_USER_HOME diff --git a/android/gradlew b/android/gradlew deleted file mode 100644 index cccdd3d..0000000 --- a/android/gradlew +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/env sh - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - -exec "$JAVACMD" "$@" diff --git a/android/gradlew.bat b/android/gradlew.bat deleted file mode 100644 index e95643d..0000000 --- a/android/gradlew.bat +++ /dev/null @@ -1,84 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/android/src/main/java/com/adjust/sdk/flutter/AdjustSdk.java b/android/src/main/java/com/adjust/sdk/flutter/AdjustSdk.java index f8bfe61..d4e200d 100644 --- a/android/src/main/java/com/adjust/sdk/flutter/AdjustSdk.java +++ b/android/src/main/java/com/adjust/sdk/flutter/AdjustSdk.java @@ -3,7 +3,7 @@ // Adjust SDK // // Created by Srdjan Tubin (@2beens) on 25th April 2018. -// Copyright (c) 2018-2021 Adjust GmbH. All rights reserved. +// Copyright (c) 2018-Present Adjust GmbH. All rights reserved. // package com.adjust.sdk.flutter; @@ -47,7 +47,6 @@ import io.flutter.plugin.common.MethodChannel.MethodCallHandler; import io.flutter.plugin.common.MethodChannel.Result; import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.PluginRegistry.Registrar; import static com.adjust.sdk.flutter.AdjustUtils.*; @@ -56,31 +55,10 @@ public class AdjustSdk implements FlutterPlugin, ActivityAware, MethodCallHandle private static boolean launchDeferredDeeplink = true; private MethodChannel channel; private Context applicationContext; - private boolean v2Plugin; - private boolean v2Attached = false; - - AdjustSdk(MethodChannel channel, Context applicationContext) { - this.channel = channel; - this.applicationContext = applicationContext; - - v2Plugin = false; - } - - public AdjustSdk() { - v2Plugin = true; - } // FlutterPlugin @Override public void onAttachedToEngine(FlutterPluginBinding binding) { - if (!v2Plugin) { - return; - } - if (v2Attached) { - return; - } - - v2Attached = true; applicationContext = binding.getApplicationContext(); channel = new MethodChannel(binding.getBinaryMessenger(), "com.adjust.sdk/api"); channel.setMethodCallHandler(this); @@ -88,7 +66,6 @@ public void onAttachedToEngine(FlutterPluginBinding binding) { @Override public void onDetachedFromEngine(FlutterPluginBinding binding) { - v2Attached = false; applicationContext = null; if (channel != null) { channel.setMethodCallHandler(null); @@ -108,8 +85,7 @@ public void onDetachedFromActivityForConfigChanges() { @Override public void onReattachedToActivityForConfigChanges( - ActivityPluginBinding binding) - { + ActivityPluginBinding binding) { } @Override @@ -117,12 +93,6 @@ public void onDetachedFromActivity() { Adjust.onPause(); } - // Plugin registration. - public static void registerWith(Registrar registrar) { - final MethodChannel channel = new MethodChannel(registrar.messenger(), "com.adjust.sdk/api"); - channel.setMethodCallHandler(new AdjustSdk(channel, registrar.context())); - } - @Override public void onMethodCall(MethodCall call, final Result result) { switch (call.method) { diff --git a/android/src/main/java/com/adjust/sdk/flutter/AdjustUtils.java b/android/src/main/java/com/adjust/sdk/flutter/AdjustUtils.java index 596f213..ea252df 100644 --- a/android/src/main/java/com/adjust/sdk/flutter/AdjustUtils.java +++ b/android/src/main/java/com/adjust/sdk/flutter/AdjustUtils.java @@ -3,7 +3,7 @@ // Adjust SDK // // Created by Srdjan Tubin (@2beens) on 5th May 2018. -// Copyright (c) 2018-2021 Adjust GmbH. All rights reserved. +// Copyright (c) 2018-Present Adjust GmbH. All rights reserved. // package com.adjust.sdk.flutter; diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index a55f5d8..546eb71 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -26,21 +26,17 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 30 + compileSdkVersion 32 sourceSets { main.java.srcDirs += 'src/main/kotlin' } - lintOptions { - disable 'InvalidPackage' - checkReleaseBuilds false - } defaultConfig { applicationId "com.adjust.examples" minSdkVersion 16 - targetSdkVersion 30 + targetSdkVersion 32 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } @@ -52,6 +48,10 @@ android { signingConfig signingConfigs.debug } } + lint { + checkReleaseBuilds false + disable 'InvalidPackage' + } } flutter { @@ -59,5 +59,4 @@ flutter { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 168d205..8c7eb34 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -14,7 +14,8 @@ android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" - android:windowSoftInputMode="adjustResize"> + android:windowSoftInputMode="adjustResize" + android:exported="true">