Skip to content

Commit

Permalink
Merge pull request #615 from adjust/v501
Browse files Browse the repository at this point in the history
Version 5.0.1
  • Loading branch information
uerceg authored Sep 18, 2024
2 parents 2fa1a0a + 7ec7f13 commit c0f78d2
Show file tree
Hide file tree
Showing 32 changed files with 90 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Adjust/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ext {
coreMinSdkVersion = 21
coreCompileSdkVersion = 34
coreTargetSdkVersion = 34
coreVersionName = '5.0.0'
coreVersionName = '5.0.1'
defaultVersionCode = 1
webbridgeMinSdkVersion = 21
samsungReferrerMinSdkVersion = 21
Expand Down
1 change: 1 addition & 0 deletions Adjust/examples/example-app-fbpixel/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ dependencies {

implementation project(':sdk-core')
implementation project(':plugins:sdk-plugin-webbridge')
implementation 'com.adjust.signature:adjust-android-signature:3+'
}
1 change: 1 addition & 0 deletions Adjust/examples/example-app-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ dependencies {
implementation 'com.google.android.gms:play-services-appset:16.0.2'

implementation project(':sdk-core')
implementation 'com.adjust.signature:adjust-android-signature:3+'
}
1 change: 1 addition & 0 deletions Adjust/examples/example-app-keyboard/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ dependencies {
implementation 'com.google.android.gms:play-services-appset:16.0.2'

implementation project(':sdk-core')
implementation 'com.adjust.signature:adjust-android-signature:3+'
}
1 change: 1 addition & 0 deletions Adjust/examples/example-app-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ dependencies {
implementation 'com.google.android.gms:play-services-appset:16.0.2'

implementation project(':sdk-core')
implementation 'com.adjust.signature:adjust-android-signature:3+'
}
1 change: 1 addition & 0 deletions Adjust/examples/example-app-tv/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ dependencies {
implementation 'com.google.android.gms:play-services-appset:16.0.2'

implementation project(':sdk-core')
implementation 'com.adjust.signature:adjust-android-signature:3+'
}
1 change: 1 addition & 0 deletions Adjust/examples/example-app-webbridge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ dependencies {

implementation project(':sdk-core')
implementation project(':plugins:sdk-plugin-webbridge')
implementation 'com.adjust.signature:adjust-android-signature:3+'
}
2 changes: 1 addition & 1 deletion Adjust/plugins/sdk-plugin-huawei-referrer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':sdk-core')
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:5.0.0'
// implementation 'com.adjust.sdk:adjust-android:5.0.1'
}

// read local properties
Expand Down
2 changes: 1 addition & 1 deletion Adjust/plugins/sdk-plugin-imei/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':sdk-core')
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:5.0.0'
// implementation 'com.adjust.sdk:adjust-android:5.0.1'
}

// read local properties
Expand Down
2 changes: 1 addition & 1 deletion Adjust/plugins/sdk-plugin-meta-referrer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':sdk-core')
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:5.0.0'
// implementation 'com.adjust.sdk:adjust-android:5.0.1'
}

// read local properties
Expand Down
2 changes: 1 addition & 1 deletion Adjust/plugins/sdk-plugin-oaid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':sdk-core')
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:5.0.0'
// implementation 'com.adjust.sdk:adjust-android:5.0.1'
implementation 'com.huawei.hms:ads-identifier:3.4.56.300'
}

Expand Down
2 changes: 1 addition & 1 deletion Adjust/plugins/sdk-plugin-samsung-clouddev/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':sdk-core')
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:5.0.0'
// implementation 'com.adjust.sdk:adjust-android:5.0.1'

// Add Samsung clouddev lib.
compileOnly fileTree(include: ['*.aar'], dir: 'libs')
Expand Down
2 changes: 1 addition & 1 deletion Adjust/plugins/sdk-plugin-samsung-referrer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':sdk-core')
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:5.0.0'
// implementation 'com.adjust.sdk:adjust-android:5.0.1'

// Add Samsung referrer lib via Maven.
implementation 'store.galaxy.samsung.installreferrer:samsung_galaxystore_install_referrer:3.0.1'
Expand Down
2 changes: 1 addition & 1 deletion Adjust/plugins/sdk-plugin-vivo-referrer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':sdk-core')
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:5.0.0'
// implementation 'com.adjust.sdk:adjust-android:5.0.1'
}

// read local properties
Expand Down
2 changes: 1 addition & 1 deletion Adjust/plugins/sdk-plugin-webbridge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':sdk-core')
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:5.0.0'
// implementation 'com.adjust.sdk:adjust-android:5.0.1'
}

// read local properties
Expand Down
18 changes: 17 additions & 1 deletion Adjust/plugins/sdk-plugin-webbridge/src/main/assets/adjust.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,40 @@ var Adjust = {

addGlobalCallbackParameter: function(key, value) {
if (AdjustBridge) {
if (typeof key !== 'string' || typeof value !== 'string') {
console.log('[Adjust]: Passed key or value is not of string type');
return;
}
AdjustBridge.addGlobalCallbackParameter(key, value);
}
},

addGlobalPartnerParameter: function(key, value) {
if (AdjustBridge) {
if (typeof key !== 'string' || typeof value !== 'string') {
console.log('[Adjust]: Passed key or value is not of string type');
return;
}
AdjustBridge.addGlobalPartnerParameter(key, value);
}
},

removeGlobalCallbackParameter: function(key) {
if (AdjustBridge) {
if (typeof key !== 'string') {
console.log('[Adjust]: Passed key is not of string type');
return;
}
AdjustBridge.removeGlobalCallbackParameter(key);
}
},

removeGlobalPartnerParameter: function(key) {
if (AdjustBridge) {
if (typeof key !== 'string') {
console.log('[Adjust]: Passed key is not of string type');
return;
}
AdjustBridge.removeGlobalPartnerParameter(key);
}
},
Expand Down Expand Up @@ -243,7 +259,7 @@ var Adjust = {
if (this.adjustConfig) {
return this.adjustConfig.getSdkPrefix();
} else {
return 'web-bridge5.0.0';
return 'web-bridge5.0.1';
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@ AdjustEvent.prototype.setRevenue = function(revenue, currency) {
};

AdjustEvent.prototype.addCallbackParameter = function(key, value) {
if (typeof key !== 'string' || typeof value !== 'string') {
console.log('[Adjust]: Passed key or value is not of string type');
return;
}
this.callbackParameters.push(key);
this.callbackParameters.push(value);
};

AdjustEvent.prototype.addPartnerParameter = function(key, value) {
if (typeof key !== 'string' || typeof value !== 'string') {
console.log('[Adjust]: Passed key or value is not of string type');
return;
}
this.partnerParameters.push(key);
this.partnerParameters.push(value);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@ function AdjustThirdPartySharing(isEnabled) {
}

AdjustThirdPartySharing.prototype.addGranularOption = function(partnerName, key, value) {
if (typeof partnerName !== 'string' || typeof key !== 'string' || typeof value !== 'string') {
console.log('[Adjust]: Passed partnerName, key or value is not of string type');
return;
}
this.granularOptions.push(partnerName);
this.granularOptions.push(key);
this.granularOptions.push(value);
};

AdjustThirdPartySharing.prototype.addPartnerSharingSetting = function(partnerName, key, value) {
if (typeof partnerName !== 'string' || typeof key !== 'string' || typeof value !== 'boolean') {
console.log('[Adjust]: Passed partnerName or key is not of string type or value is not of boolean type');
return;
}
this.partnerSharingSettings.push(partnerName);
this.partnerSharingSettings.push(key);
this.partnerSharingSettings.push(value);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package com.adjust.sdk.webbridge;

import android.annotation.TargetApi;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.app.Activity;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import android.app.Application;
Expand Down Expand Up @@ -185,7 +182,7 @@ public void initSdk(String adjustConfigString) {
} else if (logLevelString.equalsIgnoreCase(LOG_LEVEL_ASSERT)) {
adjustConfig.setLogLevel(LogLevel.ASSERT);
} else if (logLevelString.equalsIgnoreCase(LOG_LEVEL_SUPPRESS)) {
adjustConfig.setLogLevel(LogLevel.SUPRESS);
adjustConfig.setLogLevel(LogLevel.SUPPRESS);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Adjust/plugins/sdk-plugin-xiaomi-referrer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {
// Add SDK via module.
compileOnly project(':sdk-core')
// Add SDK via Maven.
// implementation 'com.adjust.sdk:adjust-android:5.0.0'
// implementation 'com.adjust.sdk:adjust-android:5.0.1'

// Add xiaomi referrer lib via Maven.
implementation 'com.miui.referrer:homereferrer:1.0.0.6'
Expand Down
2 changes: 1 addition & 1 deletion Adjust/sdk-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def customizePomForAar(pom) {
dependency {
groupId 'com.adjust.signature'
artifactId 'adjust-android-signature'
version '3+'
version '[3.20.0, 4.0.0)'
scope 'compile'
}
}
Expand Down
2 changes: 1 addition & 1 deletion Adjust/sdk-core/src/main/java/com/adjust/sdk/Adjust.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private Adjust() {
*/
public static synchronized AdjustInstance getDefaultInstance() {
@SuppressWarnings("unused")
String VERSION = "!SDK-VERSION-STRING!:com.adjust.sdk:adjust-android:5.0.0";
String VERSION = "!SDK-VERSION-STRING!:com.adjust.sdk:adjust-android:5.0.1";

if (defaultInstance == null) {
defaultInstance = new AdjustInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private void init(Context context, String appToken, String environment, boolean
logger = AdjustFactory.getLogger();
// default values
if (allowSuppressLogLevel && AdjustConfig.ENVIRONMENT_PRODUCTION.equals(environment)) {
setLogLevel(LogLevel.SUPRESS, environment);
setLogLevel(LogLevel.SUPPRESS, environment);
} else {
setLogLevel(LogLevel.INFO, environment);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import android.content.Context;

import com.adjust.sdk.scheduler.AsyncTaskExecutor;
import com.adjust.sdk.scheduler.SingleThreadCachedScheduler;
import com.adjust.sdk.scheduler.ThreadExecutor;

import java.util.List;
import java.util.ArrayList;
Expand Down Expand Up @@ -780,7 +782,8 @@ private String getCachedDeeplink(final Context context) {
* @param context Application context
*/
private void setSendingReferrersAsNotSent(final Context context) {
SharedPreferencesManager.getDefaultInstance(context).setSendingReferrersAsNotSent();
ThreadExecutor executor = new SingleThreadCachedScheduler("AdjustInstance");
executor.submit(() -> SharedPreferencesManager.getDefaultInstance(context).setSendingReferrersAsNotSent());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public interface Constants {

String SCHEME = "https";
String AUTHORITY = "app.adjust.com";
String CLIENT_SDK = "android5.0.0";
String CLIENT_SDK = "android5.0.1";
String LOGTAG = "Adjust";
String REFTAG = "reftag";
String INSTALL_REFERRER = "install_referrer";
Expand Down
2 changes: 1 addition & 1 deletion Adjust/sdk-core/src/main/java/com/adjust/sdk/LogLevel.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Created by pfms on 11/03/15.
*/
public enum LogLevel {
VERBOSE(Log.VERBOSE), DEBUG(Log.DEBUG), INFO(Log.INFO), WARN(Log.WARN), ERROR(Log.ERROR), ASSERT(Log.ASSERT), SUPRESS(8);
VERBOSE(Log.VERBOSE), DEBUG(Log.DEBUG), INFO(Log.INFO), WARN(Log.WARN), ERROR(Log.ERROR), ASSERT(Log.ASSERT), SUPPRESS(8);
final int androidLogLevel;

LogLevel(final int androidLogLevel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ public void run() {

totalWaitTimeSeconds += waitTimeSeconds;

logger.verbose("Waiting for %s seconds before retrying the %d time", secondsString, retries);
logger.verbose("Waiting for %s seconds before retrying %s for the %d time",
secondsString,
responseData.activityPackage.getActivityKind().toString(),
retries);
scheduler.schedule(runnable, waitTimeMilliSeconds);
responseData.activityPackage.setWaitBeforeSendTimeSeconds(responseData.activityPackage.getWaitBeforeSendTimeSeconds() + waitTimeSeconds);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,6 @@ private DataOutputStream configConnectionForPOST(final HttpsURLConnection connec
sendingParameters,
signedParameters);

logger.debug("Post body: %s", postBodyString);

if (postBodyString == null) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.adjust.sdk.OnDeferredDeeplinkResponseListener;
import com.adjust.sdk.OnEventTrackingFailedListener;
import com.adjust.sdk.OnEventTrackingSucceededListener;
import com.adjust.sdk.OnLastDeeplinkReadListener;
import com.adjust.sdk.OnPurchaseVerificationFinishedListener;
import com.adjust.sdk.OnSessionTrackingFailedListener;
import com.adjust.sdk.OnSessionTrackingSucceededListener;
Expand Down Expand Up @@ -93,6 +94,7 @@ public void executeCommand(final Command sentCommand) {
case "verifyTrack": verifyTrack(); break;
case "processDeeplink" : processDeeplink(); break;
case "attributionGetter" : attributionGetter(); break;
case "getLastDeeplink" : getLastDeeplink(); break;
//case "testBegin": testBegin(); break;
// case "testEnd": testEnd(); break;
}
Expand Down Expand Up @@ -265,7 +267,7 @@ private void config() {
break;
case "assert": logLevel = LogLevel.ASSERT;
break;
case "suppress": logLevel = LogLevel.SUPRESS;
case "suppress": logLevel = LogLevel.SUPPRESS;
break;
}
Log.d("TestApp", logLevel.toString());
Expand Down Expand Up @@ -883,6 +885,17 @@ private void attributionGetter() {
});
}

private void getLastDeeplink() {
final String localBasePath = basePath;
Adjust.getLastDeeplink(context, new OnLastDeeplinkReadListener() {
@Override
public void onLastDeeplinkRead(Uri deeplink) {
MainActivity.testLibrary.addInfoToSend("last_deeplink", deeplink == null ? "" : deeplink.toString());
MainActivity.testLibrary.sendInfoToServer(localBasePath);
}
});
}

/*
private void testBegin() {
if (command.containsParameter("teardown")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ AdjustCommandExecutor.prototype.thirdPartySharing = function(params) {
for (var i = 0; i < partnerSharingSettings.length; i = i + 3) {
var partnerName = partnerSharingSettings[i];
var key = partnerSharingSettings[i + 1];
var value = partnerSharingSettings[i + 2];
var value = partnerSharingSettings[i + 2] == 'true';
adjustThirdPartySharing.addPartnerSharingSetting(partnerName, key, value);
}
}
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
### Version 5.0.1 (18th September 2024)
#### Fixed
- Fixed ANR while reading install referrer from Shared Preferences during SDK initialization.
- Fixed typo in `SUPPRESS` log level constant and renamed it from `SUPRESS to SUPPRESS` (https://github.com/adjust/android_sdk/issues/613).

#### Changed
- Added validation when passing callback / partner parameters and third party sharing granular options / partner sharing setting parameters in web bridge.
- Updated some log messages to add more clarity.

---

### Version 5.0.0 (2nd August 2024)

We're excited to release our major new SDK version (v5). Among many internal improvements, our spoofing protection solution is now included out of the box, reinforcing our commitment to accurate, actionable, and fraud-free data.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.0
5.0.1

0 comments on commit c0f78d2

Please sign in to comment.