Skip to content

Commit eaaa504

Browse files
authored
Merge pull request #584 from adjust/v4360
Version 4.36.0
2 parents 88f938f + ae4c069 commit eaaa504

File tree

37 files changed

+600
-19
lines changed

37 files changed

+600
-19
lines changed

Adjust/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ext {
99
coreMinSdkVersion = 9
1010
coreCompileSdkVersion = 33
1111
coreTargetSdkVersion = 33
12-
coreVersionName = '4.35.1'
12+
coreVersionName = '4.36.0'
1313
defaultVersionCode = 1
1414
webbridgeMinSdkVersion = 17
1515
samsungReferrerMinSdkVersion = 18

Adjust/sdk-core/src/main/AndroidManifest.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,10 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
33
<uses-permission android:name="android.permission.INTERNET" />
44
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
5+
<queries>
6+
<package android:name="com.facebook.katana" />
7+
</queries>
8+
<queries>
9+
<package android:name="com.instagram.android" />
10+
</queries>
511
</manifest>

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737
import static com.adjust.sdk.Constants.ACTIVITY_STATE_FILENAME;
3838
import static com.adjust.sdk.Constants.ATTRIBUTION_FILENAME;
39+
import static com.adjust.sdk.Constants.REFERRER_API_META;
3940
import static com.adjust.sdk.Constants.REFERRER_API_SAMSUNG;
4041
import static com.adjust.sdk.Constants.REFERRER_API_VIVO;
4142
import static com.adjust.sdk.Constants.REFERRER_API_XIAOMI;
@@ -79,6 +80,7 @@ public class ActivityHandler implements IActivityHandler {
7980
private SessionParameters sessionParameters;
8081
private InstallReferrer installReferrer;
8182
private InstallReferrerHuawei installReferrerHuawei;
83+
private InstallReferrerMeta installReferrerMeta;
8284

8385
@Override
8486
public void teardown() {
@@ -1013,6 +1015,13 @@ public void onInstallReferrerRead(ReferrerDetails referrerDetails, String referr
10131015
}
10141016
});
10151017

1018+
installReferrerMeta = new InstallReferrerMeta(adjustConfig.context, adjustConfig.fbAppId,
1019+
new InstallReferrerReadListener() {
1020+
@Override
1021+
public void onInstallReferrerRead(ReferrerDetails referrerDetails, String referrerApi) {
1022+
sendInstallReferrer(referrerDetails, referrerApi);
1023+
}
1024+
});
10161025
preLaunchActionsI(adjustConfig.preLaunchActions.preLaunchActionsArray);
10171026
sendReftagReferrerI();
10181027
}
@@ -1310,6 +1319,7 @@ private void processSessionI() {
13101319
// Try to check if there's new referrer information.
13111320
installReferrer.startConnection();
13121321
installReferrerHuawei.readReferrer();
1322+
installReferrerMeta.readReferrer();
13131323
readInstallReferrerSamsung();
13141324
readInstallReferrerXiaomi();
13151325
readInstallReferrerVivo();
@@ -1811,6 +1821,7 @@ private void checkAfterNewStartI(SharedPreferencesManager sharedPreferencesManag
18111821
// try to read and send the install referrer
18121822
installReferrer.startConnection();
18131823
installReferrerHuawei.readReferrer();
1824+
installReferrerMeta.readReferrer();
18141825
readInstallReferrerSamsung();
18151826
readInstallReferrerXiaomi();
18161827
readInstallReferrerVivo();
@@ -2786,6 +2797,19 @@ private void checkForInstallReferrerInfo(final SdkClickResponseData responseData
27862797
return;
27872798
}
27882799

2800+
boolean isInstallReferrerMeta =
2801+
responseData.referrerApi != null &&
2802+
(responseData.referrerApi.equalsIgnoreCase(REFERRER_API_META));
2803+
2804+
if (isInstallReferrerMeta) {
2805+
activityState.clickTimeMeta = responseData.clickTime;
2806+
activityState.installReferrerMeta = responseData.installReferrer;
2807+
activityState.isClickMeta = responseData.isClick;
2808+
2809+
writeActivityStateI();
2810+
return;
2811+
}
2812+
27892813
boolean isInstallReferrerSamsung =
27902814
responseData.referrerApi != null &&
27912815
(responseData.referrerApi.equalsIgnoreCase(REFERRER_API_SAMSUNG));

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public class ActivityPackage implements Serializable {
5959
private long installBeginTimeServerInSeconds;
6060
private String installVersion;
6161
private Boolean googlePlayInstant;
62+
private Boolean isClick;
6263

6364
public String getPath() {
6465
return path;
@@ -168,6 +169,14 @@ public void setGooglePlayInstant(Boolean googlePlayInstant) {
168169
this.googlePlayInstant = googlePlayInstant;
169170
}
170171

172+
public Boolean getIsClick() {
173+
return this.isClick;
174+
}
175+
176+
public void setIsClick(Boolean isClick) {
177+
this.isClick = isClick;
178+
}
179+
171180
public OnPurchaseVerificationFinishedListener getPurchaseVerificationCallback() {
172181
return this.purchaseVerificationCallback;
173182
}

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ public class ActivityState implements Serializable, Cloneable {
6464
new ObjectStreamField("installBeginVivo", long.class),
6565
new ObjectStreamField("installReferrerVivo", String.class),
6666
new ObjectStreamField("installVersionVivo", String.class),
67+
new ObjectStreamField("installReferrerMeta", String.class),
68+
new ObjectStreamField("clickTimeMeta", long.class),
69+
new ObjectStreamField("isClickMeta", Boolean.class),
6770
};
6871

6972
// persistent data
@@ -122,6 +125,10 @@ public class ActivityState implements Serializable, Cloneable {
122125
protected String installReferrerVivo;
123126
protected String installVersionVivo;
124127

128+
protected String installReferrerMeta;
129+
protected long clickTimeMeta;
130+
protected Boolean isClickMeta;
131+
125132
protected ActivityState() {
126133
logger = AdjustFactory.getLogger();
127134
// create UUID for new devices
@@ -166,6 +173,9 @@ protected ActivityState() {
166173
installBeginVivo = 0;
167174
installReferrerVivo = null;
168175
installVersionVivo = null;
176+
installReferrerMeta = null;
177+
clickTimeMeta = 0;
178+
isClickMeta = null;
169179
}
170180

171181
protected void resetSessionAttributes(long now) {
@@ -249,6 +259,9 @@ public boolean equals(Object other) {
249259
if (!Util.equalLong(installBeginVivo, otherActivityState.installBeginVivo)) return false;
250260
if (!Util.equalString(installReferrerVivo, otherActivityState.installReferrerVivo)) return false;
251261
if (!Util.equalString(installVersionVivo, otherActivityState.installVersionVivo)) return false;
262+
if (!Util.equalString(installReferrerMeta, otherActivityState.installReferrerMeta)) return false;
263+
if (!Util.equalLong(clickTimeMeta, otherActivityState.clickTimeMeta)) return false;
264+
if (!Util.equalBoolean(isClickMeta, otherActivityState.isClickMeta)) return false;
252265
return true;
253266
}
254267

@@ -295,6 +308,9 @@ public int hashCode() {
295308
hashCode = Util.hashLong(installBeginVivo, hashCode);
296309
hashCode = Util.hashString(installReferrerVivo, hashCode);
297310
hashCode = Util.hashString(installVersionVivo, hashCode);
311+
hashCode = Util.hashString(installReferrerMeta, hashCode);
312+
hashCode = Util.hashLong(clickTimeMeta, hashCode);
313+
hashCode = Util.hashBoolean(isClickMeta, hashCode);
298314
return hashCode;
299315
}
300316

@@ -351,6 +367,10 @@ private void readObject(ObjectInputStream stream) throws IOException, ClassNotFo
351367
installReferrerVivo = Util.readStringField(fields, "installReferrerVivo", null);
352368
installVersionVivo = Util.readStringField(fields, "installVersionVivo", null);
353369

370+
installReferrerMeta = Util.readStringField(fields, "installReferrerMeta", null);
371+
clickTimeMeta = Util.readLongField(fields, "clickTimeMeta", -1l);
372+
isClickMeta = Util.readObjectField(fields, "isClickMeta", null);
373+
354374
// create UUID for migrating devices
355375
if (uuid == null) {
356376
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.35.1";
37+
String VERSION = "!SDK-VERSION-STRING!:com.adjust.sdk:adjust-android:4.36.0";
3838

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

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,42 @@ public boolean isValid() {
7979
return isValidSource(this.source);
8080
}
8181

82+
public String getSource() {
83+
return source;
84+
}
85+
86+
public Double getRevenue() {
87+
return revenue;
88+
}
89+
90+
public String getCurrency() {
91+
return currency;
92+
}
93+
94+
public Integer getAdImpressionsCount() {
95+
return adImpressionsCount;
96+
}
97+
98+
public String getAdRevenueNetwork() {
99+
return adRevenueNetwork;
100+
}
101+
102+
public String getAdRevenueUnit() {
103+
return adRevenueUnit;
104+
}
105+
106+
public String getAdRevenuePlacement() {
107+
return adRevenuePlacement;
108+
}
109+
110+
public Map<String, String> getCallbackParameters() {
111+
return callbackParameters;
112+
}
113+
114+
public Map<String, String> getPartnerParameters() {
115+
return partnerParameters;
116+
}
117+
82118
private boolean isValidSource(final String param) {
83119
if (param == null) {
84120
logger.error("Missing source");

0 commit comments

Comments
 (0)