Skip to content

Commit 63ea444

Browse files
authored
Merge pull request #560 from adjust/v4331
Version 4.33.1
2 parents 00bac49 + 3dadf32 commit 63ea444

File tree

33 files changed

+395
-22
lines changed

33 files changed

+395
-22
lines changed

Adjust/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ ext {
99
coreMinSdkVersion = 9
1010
coreCompileSdkVersion = 33
1111
coreTargetSdkVersion = 33
12-
coreVersionName = '4.33.0'
12+
coreVersionName = '4.33.1'
1313
defaultVersionCode = 1
1414
webbridgeMinSdkVersion = 17
1515
samsungReferrerMinSdkVersion = 18
16+
vivoReferrerMinSdkVersion = 23
1617

1718
// POM.
1819
adjustGroupId = 'com.adjust.sdk'

Adjust/sdk-core/src/main/java/com/adjust/sdk/ActivityHandler.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import static com.adjust.sdk.Constants.ACTIVITY_STATE_FILENAME;
3838
import static com.adjust.sdk.Constants.ATTRIBUTION_FILENAME;
3939
import static com.adjust.sdk.Constants.REFERRER_API_SAMSUNG;
40+
import static com.adjust.sdk.Constants.REFERRER_API_VIVO;
4041
import static com.adjust.sdk.Constants.REFERRER_API_XIAOMI;
4142
import static com.adjust.sdk.Constants.SESSION_CALLBACK_PARAMETERS_FILENAME;
4243
import static com.adjust.sdk.Constants.SESSION_PARTNER_PARAMETERS_FILENAME;
@@ -1260,6 +1261,7 @@ private void processSessionI() {
12601261
installReferrerHuawei.readReferrer();
12611262
readInstallReferrerSamsung();
12621263
readInstallReferrerXiaomi();
1264+
readInstallReferrerVivo();
12631265

12641266
return;
12651267
}
@@ -1291,6 +1293,18 @@ public void run() {
12911293
});
12921294
}
12931295

1296+
private void readInstallReferrerVivo() {
1297+
executor.submit(new Runnable() {
1298+
@Override
1299+
public void run() {
1300+
ReferrerDetails referrerDetails = Reflection.getVivoReferrer(getContext(), logger);
1301+
if (referrerDetails != null) {
1302+
sendInstallReferrer(referrerDetails, REFERRER_API_VIVO);
1303+
}
1304+
}
1305+
});
1306+
}
1307+
12941308
private void trackNewSessionI(final long now) {
12951309
long lastInterval = now - activityState.lastActivity;
12961310

@@ -1719,6 +1733,7 @@ private void checkAfterNewStartI(SharedPreferencesManager sharedPreferencesManag
17191733
installReferrerHuawei.readReferrer();
17201734
readInstallReferrerSamsung();
17211735
readInstallReferrerXiaomi();
1736+
readInstallReferrerVivo();
17221737
}
17231738

17241739
private void setOfflineModeI(boolean offline) {
@@ -2650,6 +2665,20 @@ private void checkForInstallReferrerInfo(final SdkClickResponseData responseData
26502665
return;
26512666
}
26522667

2668+
boolean isInstallReferrerVivo =
2669+
responseData.referrerApi != null &&
2670+
(responseData.referrerApi.equalsIgnoreCase(REFERRER_API_VIVO));
2671+
2672+
if (isInstallReferrerVivo) {
2673+
activityState.clickTimeVivo = responseData.clickTime;
2674+
activityState.installBeginVivo = responseData.installBegin;
2675+
activityState.installReferrerVivo = responseData.installReferrer;
2676+
activityState.installVersionVivo = responseData.installVersion;
2677+
2678+
writeActivityStateI();
2679+
return;
2680+
}
2681+
26532682
activityState.clickTime = responseData.clickTime;
26542683
activityState.installBegin = responseData.installBegin;
26552684
activityState.installReferrer = responseData.installReferrer;

Adjust/sdk-core/src/main/java/com/adjust/sdk/ActivityState.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ public class ActivityState implements Serializable, Cloneable {
6060
new ObjectStreamField("clickTimeSamsung", long.class),
6161
new ObjectStreamField("installBeginSamsung", long.class),
6262
new ObjectStreamField("installReferrerSamsung", String.class),
63+
new ObjectStreamField("clickTimeVivo", long.class),
64+
new ObjectStreamField("installBeginVivo", long.class),
65+
new ObjectStreamField("installReferrerVivo", String.class),
66+
new ObjectStreamField("installVersionVivo", String.class),
6367
};
6468

6569
// persistent data
@@ -113,6 +117,11 @@ public class ActivityState implements Serializable, Cloneable {
113117
protected long installBeginSamsung;
114118
protected String installReferrerSamsung;
115119

120+
protected long clickTimeVivo;
121+
protected long installBeginVivo;
122+
protected String installReferrerVivo;
123+
protected String installVersionVivo;
124+
116125
protected ActivityState() {
117126
logger = AdjustFactory.getLogger();
118127
// create UUID for new devices
@@ -153,6 +162,10 @@ protected ActivityState() {
153162
clickTimeSamsung = 0;
154163
installBeginSamsung = 0;
155164
installReferrerSamsung = null;
165+
clickTimeVivo = 0;
166+
installBeginVivo = 0;
167+
installReferrerVivo = null;
168+
installVersionVivo = null;
156169
}
157170

158171
protected void resetSessionAttributes(long now) {
@@ -232,6 +245,10 @@ public boolean equals(Object other) {
232245
if (!Util.equalLong(clickTimeSamsung, otherActivityState.clickTimeSamsung)) return false;
233246
if (!Util.equalLong(installBeginSamsung, otherActivityState.installBeginSamsung)) return false;
234247
if (!Util.equalString(installReferrerSamsung, otherActivityState.installReferrerSamsung)) return false;
248+
if (!Util.equalLong(clickTimeVivo, otherActivityState.clickTimeVivo)) return false;
249+
if (!Util.equalLong(installBeginVivo, otherActivityState.installBeginVivo)) return false;
250+
if (!Util.equalString(installReferrerVivo, otherActivityState.installReferrerVivo)) return false;
251+
if (!Util.equalString(installVersionVivo, otherActivityState.installVersionVivo)) return false;
235252
return true;
236253
}
237254

@@ -274,6 +291,10 @@ public int hashCode() {
274291
hashCode = 37 * hashCode + Util.hashLong(clickTimeSamsung);
275292
hashCode = 37 * hashCode + Util.hashLong(installBeginSamsung);
276293
hashCode = 37 * hashCode + Util.hashString(installReferrerSamsung);
294+
hashCode = 37 * hashCode + Util.hashLong(clickTimeVivo);
295+
hashCode = 37 * hashCode + Util.hashLong(installBeginVivo);
296+
hashCode = 37 * hashCode + Util.hashString(installReferrerVivo);
297+
hashCode = 37 * hashCode + Util.hashString(installVersionVivo);
277298
return hashCode;
278299
}
279300

@@ -325,6 +346,11 @@ private void readObject(ObjectInputStream stream) throws IOException, ClassNotFo
325346
installBeginSamsung = Util.readLongField(fields, "installBeginSamsung", -1l);
326347
installReferrerSamsung = Util.readStringField(fields, "installReferrerSamsung", null);
327348

349+
clickTimeVivo = Util.readLongField(fields, "clickTimeVivo", -1l);
350+
installBeginVivo = Util.readLongField(fields, "installBeginVivo", -1l);
351+
installReferrerVivo = Util.readStringField(fields, "installReferrerVivo", null);
352+
installVersionVivo = Util.readStringField(fields, "installVersionVivo", null);
353+
328354
// create UUID for migrating devices
329355
if (uuid == null) {
330356
uuid = Util.createUuid();

Adjust/sdk-core/src/main/java/com/adjust/sdk/Adjust.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ private Adjust() {
3434
*/
3535
public static synchronized AdjustInstance getDefaultInstance() {
3636
@SuppressWarnings("unused")
37-
String VERSION = "!SDK-VERSION-STRING!:com.adjust.sdk:adjust-android:4.33.0";
37+
String VERSION = "!SDK-VERSION-STRING!:com.adjust.sdk:adjust-android:4.33.1";
3838

3939
if (defaultInstance == null) {
4040
defaultInstance = new AdjustInstance();

Adjust/sdk-core/src/main/java/com/adjust/sdk/AdjustConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public class AdjustConfig {
4949

5050
public static final String URL_STRATEGY_INDIA = "url_strategy_india";
5151
public static final String URL_STRATEGY_CHINA = "url_strategy_china";
52+
public static final String URL_STRATEGY_CN = "url_strategy_cn";
5253
public static final String DATA_RESIDENCY_EU = "data_residency_eu";
5354
public static final String DATA_RESIDENCY_TR = "data_residency_tr";
5455
public static final String DATA_RESIDENCY_US = "data_residency_us";
@@ -210,6 +211,7 @@ public void setUrlStrategy(String urlStrategy) {
210211
}
211212
if (!urlStrategy.equals(URL_STRATEGY_INDIA)
212213
&& !urlStrategy.equals(URL_STRATEGY_CHINA)
214+
&& !urlStrategy.equals(URL_STRATEGY_CN)
213215
&& !urlStrategy.equals(DATA_RESIDENCY_EU)
214216
&& !urlStrategy.equals(DATA_RESIDENCY_TR)
215217
&& !urlStrategy.equals(DATA_RESIDENCY_US))

Adjust/sdk-core/src/main/java/com/adjust/sdk/Constants.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public interface Constants {
2929

3030
String SCHEME = "https";
3131
String AUTHORITY = "app.adjust.com";
32-
String CLIENT_SDK = "android4.33.0";
32+
String CLIENT_SDK = "android4.33.1";
3333
String LOGTAG = "Adjust";
3434
String REFTAG = "reftag";
3535
String INSTALL_REFERRER = "install_referrer";
@@ -38,6 +38,7 @@ public interface Constants {
3838
String REFERRER_API_HUAWEI_APP_GALLERY = "huawei_app_gallery";
3939
String REFERRER_API_SAMSUNG = "samsung";
4040
String REFERRER_API_XIAOMI = "xiaomi";
41+
String REFERRER_API_VIVO = "vivo";
4142
String DEEPLINK = "deeplink";
4243
String PUSH = "push";
4344
String THREAD_PREFIX = "Adjust-";

Adjust/sdk-core/src/main/java/com/adjust/sdk/Reflection.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public static ReferrerDetails getSamsungReferrer(Context context, ILogger logger
6565
new Class[]{Context.class, ILogger.class},
6666
context, logger);
6767
} catch (Exception e) {
68-
logger.error("invoke getSamsungInstallReferrerDetails error: " + e.getMessage());
68+
logger.info("invoke getSamsungInstallReferrerDetails : " + e.getMessage());
6969
}
7070
return referrerDetails;
7171
}
@@ -78,7 +78,20 @@ public static ReferrerDetails getXiaomiReferrer(Context context, ILogger logger)
7878
new Class[]{Context.class, ILogger.class},
7979
context, logger);
8080
} catch (Exception e) {
81-
logger.error("invoke getXiaomiInstallReferrerDetails error: " + e.getMessage());
81+
logger.info("invoke getXiaomiInstallReferrerDetails : " + e.getMessage());
82+
}
83+
return referrerDetails;
84+
}
85+
86+
public static ReferrerDetails getVivoReferrer(Context context, ILogger logger) {
87+
ReferrerDetails referrerDetails = null;
88+
try {
89+
referrerDetails = (ReferrerDetails) invokeStaticMethod("com.adjust.sdk.vivo.Util",
90+
"getVivoInstallReferrerDetails",
91+
new Class[]{Context.class, ILogger.class},
92+
context, logger);
93+
} catch (Exception e) {
94+
logger.info("invoke getVivoInstallReferrerDetails : " + e.getMessage());
8295
}
8396
return referrerDetails;
8497
}

Adjust/sdk-core/src/main/java/com/adjust/sdk/Util.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,8 @@ public static boolean isEqualReferrerDetails(final ReferrerDetails referrerDetai
763763
return isEqualSamsungReferrerDetails(referrerDetails, activityState);
764764
} else if (referrerApi.equals(Constants.REFERRER_API_XIAOMI)) {
765765
return isEqualXiaomiReferrerDetails(referrerDetails, activityState);
766+
} else if (referrerApi.equals(Constants.REFERRER_API_VIVO)) {
767+
return isEqualVivoReferrerDetails(referrerDetails, activityState);
766768
}
767769

768770
return false;
@@ -865,4 +867,12 @@ private static boolean isEqualXiaomiReferrerDetails(final ReferrerDetails referr
865867
&& Util.equalString(referrerDetails.installReferrer, activityState.installReferrerXiaomi)
866868
&& Util.equalString(referrerDetails.installVersion, activityState.installVersionXiaomi);
867869
}
870+
871+
private static boolean isEqualVivoReferrerDetails(final ReferrerDetails referrerDetails,
872+
final ActivityState activityState) {
873+
return referrerDetails.referrerClickTimestampSeconds == activityState.clickTimeVivo
874+
&& referrerDetails.installBeginTimestampSeconds == activityState.installBeginVivo
875+
&& Util.equalString(referrerDetails.installReferrer, activityState.installReferrerVivo)
876+
&& Util.equalString(referrerDetails.installVersion, activityState.installVersionVivo);
877+
}
868878
}

Adjust/sdk-core/src/main/java/com/adjust/sdk/network/UrlStrategy.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import static com.adjust.sdk.AdjustConfig.DATA_RESIDENCY_TR;
1111
import static com.adjust.sdk.AdjustConfig.DATA_RESIDENCY_US;
1212
import static com.adjust.sdk.AdjustConfig.URL_STRATEGY_CHINA;
13+
import static com.adjust.sdk.AdjustConfig.URL_STRATEGY_CN;
1314
import static com.adjust.sdk.AdjustConfig.URL_STRATEGY_INDIA;
1415
import static com.adjust.sdk.AdjustConfig.DATA_RESIDENCY_EU;
1516

@@ -22,6 +23,10 @@ public class UrlStrategy {
2223
private static final String GDPR_URL_CHINA = "https://gdpr.adjust.world";
2324
private static final String SUBSCRIPTION_URL_CHINA = "https://subscription.adjust.world";
2425

26+
private static final String BASE_URL_CN = "https://app.adjust.cn";
27+
private static final String GDPR_URL_CN = "https://gdpr.adjust.com";
28+
private static final String SUBSCRIPTION_URL_CN = "https://subscription.adjust.com";
29+
2530
private static final String BASE_URL_EU = "https://app.eu.adjust.com";
2631
private static final String GDPR_URL_EU = "https://gdpr.eu.adjust.com";
2732
private static final String SUBSCRIPTION_URL_EU = "https://subscription.eu.adjust.com";
@@ -135,6 +140,8 @@ private static List<String> baseUrlChoices(final String urlStrategy)
135140
return Arrays.asList(BASE_URL_INDIA, Constants.BASE_URL);
136141
} else if (URL_STRATEGY_CHINA.equals(urlStrategy)) {
137142
return Arrays.asList(BASE_URL_CHINA, Constants.BASE_URL);
143+
} else if (URL_STRATEGY_CN.equals(urlStrategy)) {
144+
return Arrays.asList(BASE_URL_CN, Constants.BASE_URL);
138145
} else if (DATA_RESIDENCY_EU.equals(urlStrategy)) {
139146
return Collections.singletonList(BASE_URL_EU);
140147
} else if (DATA_RESIDENCY_TR.equals(urlStrategy)) {
@@ -151,6 +158,8 @@ private static List<String> gdprUrlChoices(final String urlStrategy)
151158
return Arrays.asList(GDPR_URL_INDIA, Constants.GDPR_URL);
152159
} else if (URL_STRATEGY_CHINA.equals(urlStrategy)) {
153160
return Arrays.asList(GDPR_URL_CHINA, Constants.GDPR_URL);
161+
} else if (URL_STRATEGY_CN.equals(urlStrategy)) {
162+
return Arrays.asList(GDPR_URL_CN, Constants.GDPR_URL);
154163
} else if (DATA_RESIDENCY_EU.equals(urlStrategy)) {
155164
return Collections.singletonList(GDPR_URL_EU);
156165
} else if (DATA_RESIDENCY_TR.equals(urlStrategy)) {
@@ -167,6 +176,8 @@ private static List<String> subscriptionUrlChoices(final String urlStrategy)
167176
return Arrays.asList(SUBSCRIPTION_URL_INDIA, Constants.SUBSCRIPTION_URL);
168177
} else if (URL_STRATEGY_CHINA.equals(urlStrategy)) {
169178
return Arrays.asList(SUBSCRIPTION_URL_CHINA, Constants.SUBSCRIPTION_URL);
179+
} else if (URL_STRATEGY_CN.equals(urlStrategy)) {
180+
return Arrays.asList(SUBSCRIPTION_URL_CN, Constants.SUBSCRIPTION_URL);
170181
} else if (DATA_RESIDENCY_EU.equals(urlStrategy)) {
171182
return Collections.singletonList(SUBSCRIPTION_URL_EU);
172183
} else if (DATA_RESIDENCY_TR.equals(urlStrategy)) {

Adjust/sdk-plugin-criteo/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dependencies {
2323
// Add SDK via module.
2424
compileOnly project(':sdk-core')
2525
// Add SDK via Maven.
26-
// implementation 'com.adjust.sdk:adjust-android:4.33.0'
26+
// implementation 'com.adjust.sdk:adjust-android:4.33.1'
2727
}
2828

2929
// read local properties

0 commit comments

Comments
 (0)