Skip to content

Commit

Permalink
Merge pull request #349 from adjust/v4150
Browse files Browse the repository at this point in the history
Version 4.15.0
  • Loading branch information
nonelse authored Aug 31, 2018
2 parents 64ae499 + 349fd29 commit 60275af
Show file tree
Hide file tree
Showing 146 changed files with 5,376 additions and 1,950 deletions.
4 changes: 2 additions & 2 deletions Adjust/adjust/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.library'

def getVersionName() {
return "4.14.0"
return "4.15.0"
}

android {
Expand All @@ -18,7 +18,7 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
implementation fileTree(dir: 'libs', include: ['*.jar'])
}

task makeReleaseJar(type: Copy) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,12 @@ private void launchSessionResponseTasksI(SessionResponseData sessionResponseData
launchAttributionListenerI(handler);
}

// if attribution didn't update and it's still null
// ask for attribution
if (this.attribution == null && activityState.askingAttribution == false) {
this.attributionHandler.getAttribution();
}

// mark install as tracked on success
if (sessionResponseData.success) {
SharedPreferencesManager sharedPreferencesManager = new SharedPreferencesManager(getContext());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public String getExtendedString() {
if (parameters != null) {
builder.append("Parameters:");
SortedMap<String,String> sortedParameters = new TreeMap<String,String>(parameters);
List<String> stringsToExclude = Arrays.asList("app_secret", "secret_id");
List<String> stringsToExclude = Arrays.asList("app_secret", "secret_id", "event_callback_id");
for (Map.Entry<String,String> entry : sortedParameters.entrySet() ) {
String key = entry.getKey();
if (stringsToExclude.contains(key)) {
Expand Down
2 changes: 1 addition & 1 deletion Adjust/adjust/src/main/java/com/adjust/sdk/Adjust.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private Adjust() {
*/
public static synchronized AdjustInstance getDefaultInstance() {
@SuppressWarnings("unused")
String VERSION = "!SDK-VERSION-STRING!:com.adjust.sdk:adjust-android:4.14.0";
String VERSION = "!SDK-VERSION-STRING!:com.adjust.sdk:adjust-android:4.15.0";

if (defaultInstance == null) {
defaultInstance = new AdjustInstance();
Expand Down
4 changes: 2 additions & 2 deletions Adjust/adjust/src/main/java/com/adjust/sdk/AdjustConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public class AdjustConfig {
boolean startOffline;
String secretId;
String appSecret;
boolean readMobileEquipmentIdentity;

public static final String ENVIRONMENT_SANDBOX = "sandbox";
public static final String ENVIRONMENT_PRODUCTION = "production";
Expand Down Expand Up @@ -143,8 +142,9 @@ public void setAppSecret(long secretId, long info1, long info2, long info3, long
this.appSecret = Util.formatString("%d%d%d%d", info1, info2, info3, info4);
}

@Deprecated
public void setReadMobileEquipmentIdentity(boolean readMobileEquipmentIdentity) {
this.readMobileEquipmentIdentity = readMobileEquipmentIdentity;
logger.warn("This method has been deprecated and shouldn't be used anymore");
}

public boolean isValid() {
Expand Down
5 changes: 5 additions & 0 deletions Adjust/adjust/src/main/java/com/adjust/sdk/AdjustEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class AdjustEvent {
Map<String, String> callbackParameters;
Map<String, String> partnerParameters;
String orderId;
String callbackId;

private static ILogger logger = AdjustFactory.getLogger();

Expand Down Expand Up @@ -63,6 +64,10 @@ public void setOrderId(String orderId) {
this.orderId = orderId;
}

public void setCallbackId(String callbackId) {
this.callbackId = callbackId;
}

public boolean isValid() {
return eventToken != null;
}
Expand Down
21 changes: 14 additions & 7 deletions Adjust/adjust/src/main/java/com/adjust/sdk/AdjustEventFailure.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,29 @@

import org.json.JSONObject;

import java.util.Locale;

/**
* Created by pfms on 04/01/16.
* Adjust SDK
* Created by Pedro Silva (@nonelse) on 4th January 2016.
* Copyright © 2016-2018 Adjust GmbH. All rights reserved.
*/
public class AdjustEventFailure {
public boolean willRetry;
public String adid;
public String message;
public String timestamp;
public String adid;
public String eventToken;
public boolean willRetry;
public String callbackId;
public JSONObject jsonResponse;

@Override
public String toString() {
return Util.formatString("Event Failure msg:%s time:%s adid:%s event:%s retry:%b json:%s",
message, timestamp, adid, eventToken, willRetry, jsonResponse);
return Util.formatString("Event Failure msg:%s time:%s adid:%s event:%s cid:%s retry:%b json:%s",
message,
timestamp,
adid,
eventToken,
callbackId,
willRetry,
jsonResponse);
}
}
18 changes: 12 additions & 6 deletions Adjust/adjust/src/main/java/com/adjust/sdk/AdjustEventSuccess.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,27 @@

import org.json.JSONObject;

import java.util.Locale;

/**
* Created by pfms on 04/01/16.
* Adjust SDK
* Created by Pedro Silva (@nonelse) on 4th January 2016.
* Copyright © 2016-2018 Adjust GmbH. All rights reserved.
*/
public class AdjustEventSuccess {
public String adid;
public String message;
public String timestamp;
public String adid;
public String eventToken;
public String callbackId;
public JSONObject jsonResponse;

@Override
public String toString() {
return Util.formatString("Event Success msg:%s time:%s adid:%s event:%s json:%s",
message, timestamp, adid, eventToken, jsonResponse);
return Util.formatString("Event Success msg:%s time:%s adid:%s event:%s cid:%s json:%s",
message,
timestamp,
adid,
eventToken,
callbackId,
jsonResponse);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,25 @@

import org.json.JSONObject;

import java.util.Locale;

/**
* Created by pfms on 16/02/16.
* Adjust SDK
* Created by Pedro Silva (@nonelse) on 16th February 2016.
* Copyright © 2016-2018 Adjust GmbH. All rights reserved.
*/
public class AdjustSessionFailure {
public boolean willRetry;
public String adid;
public String message;
public String timestamp;
public String adid;
public boolean willRetry;
public JSONObject jsonResponse;

@Override
public String toString() {
return Util.formatString("Session Failure msg:%s time:%s adid:%s retry:%b json:%s",
message, timestamp, adid, willRetry, jsonResponse);
message,
timestamp,
adid,
willRetry,
jsonResponse);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@

import org.json.JSONObject;

import java.util.Locale;

/**
* Created by pfms on 16/02/16.
* Adjust SDK
* Created by Pedro Silva (@nonelse) on 16th February 2016.
* Copyright © 2016-2018 Adjust GmbH. All rights reserved.
*/
public class AdjustSessionSuccess {
public String adid;
public String message;
public String timestamp;
public String adid;
public JSONObject jsonResponse;

@Override
public String toString() {
return Util.formatString("Session Success msg:%s time:%s adid:%s json:%s",
message, timestamp, adid, jsonResponse);
message,
timestamp,
adid,
jsonResponse);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.adjust.sdk.plugin;
package com.adjust.sdk;

import android.content.Context;
import android.provider.Settings.Secure;
Expand Down
5 changes: 1 addition & 4 deletions Adjust/adjust/src/main/java/com/adjust/sdk/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface Constants {
String GDPR_URL = "https://gdpr.adjust.com";
String SCHEME = "https";
String AUTHORITY = "app.adjust.com";
String CLIENT_SDK = "android4.14.0";
String CLIENT_SDK = "android4.15.0";
String LOGTAG = "Adjust";
String REFTAG = "reftag";
String INSTALL_REFERRER = "install_referrer";
Expand Down Expand Up @@ -63,7 +63,4 @@ public interface Constants {
String PARTNER_PARAMETERS = "partner_params";

int MAX_INSTALL_REFERRER_RETRIES = 2;

// List of known plugins, possibly not active
List<String> PLUGINS = Arrays.asList();
}
41 changes: 26 additions & 15 deletions Adjust/adjust/src/main/java/com/adjust/sdk/DeviceInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.DisplayMetrics;

import java.util.Date;
Expand Down Expand Up @@ -56,10 +54,8 @@ class DeviceInfo {
String hardwareName;
String abi;
String buildName;
String vmInstructionSet;
String appInstallTime;
String appUpdateTime;
Map<String, String> pluginKeys;

DeviceInfo(Context context, String sdkPrefix) {
Resources resources = context.getResources();
Expand Down Expand Up @@ -88,18 +84,40 @@ class DeviceInfo {
displayHeight = getDisplayHeight(displayMetrics);
clientSdk = getClientSdk(sdkPrefix);
fbAttributionId = getFacebookAttributionId(context);
pluginKeys = Util.getPluginKeys(context);
hardwareName = getHardwareName();
abi = getABI();
buildName = getBuildName();
vmInstructionSet = getVmInstructionSet();
appInstallTime = getAppInstallTime(context);
appUpdateTime = getAppUpdateTime(context);
}

void reloadDeviceIds(Context context) {
isTrackingEnabled = Util.isPlayTrackingEnabled(context);
playAdId = Util.getPlayAdId(context);
for (int i = 0; i < 3; i += 1) {
try {
GooglePlayServicesClient.GooglePlayServicesInfo gpsInfo = GooglePlayServicesClient.getGooglePlayServicesInfo(context);
playAdId = gpsInfo.getGpsAdid();
if (playAdId != null) {
break;
}
} catch (Exception e) {}
playAdId = Util.getPlayAdId(context);
if (playAdId != null) {
break;
}
}
for (int i = 0; i < 3; i += 1) {
try {
GooglePlayServicesClient.GooglePlayServicesInfo gpsInfo = GooglePlayServicesClient.getGooglePlayServicesInfo(context);
isTrackingEnabled = gpsInfo.isTrackingEnabled();
if (isTrackingEnabled != null) {
break;
}
} catch (Exception e) {}
isTrackingEnabled = Util.isPlayTrackingEnabled(context);
if (isTrackingEnabled != null) {
break;
}
}

if (playAdId == null && !nonGoogleIdsRead) {
if (!Util.checkPermission(context, android.Manifest.permission.ACCESS_WIFI_STATE)) {
Expand All @@ -108,9 +126,7 @@ void reloadDeviceIds(Context context) {
String macAddress = Util.getMacAddress(context);
macSha1 = getMacSha1(macAddress);
macShortMd5 = getMacShortMd5(macAddress);

androidId = Util.getAndroidId(context);

nonGoogleIdsRead = true;
}
}
Expand Down Expand Up @@ -308,11 +324,6 @@ private String getABI() {
return SupportedABIS[0];
}

private String getVmInstructionSet() {
String instructionSet = Util.getVmInstructionSet();
return instructionSet;
}

private String getAppInstallTime(Context context) {
try {
PackageManager packageManager = context.getPackageManager();
Expand Down
Loading

0 comments on commit 60275af

Please sign in to comment.