Skip to content

Commit

Permalink
Merge pull request #584 from adjust/v4360
Browse files Browse the repository at this point in the history
Version 4.36.0
  • Loading branch information
shashanksu committed Oct 19, 2023
2 parents 88f938f + ae4c069 commit eaaa504
Show file tree
Hide file tree
Showing 37 changed files with 600 additions and 19 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 = 9
coreCompileSdkVersion = 33
coreTargetSdkVersion = 33
coreVersionName = '4.35.1'
coreVersionName = '4.36.0'
defaultVersionCode = 1
webbridgeMinSdkVersion = 17
samsungReferrerMinSdkVersion = 18
Expand Down
6 changes: 6 additions & 0 deletions Adjust/sdk-core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
<queries>
<package android:name="com.facebook.katana" />
</queries>
<queries>
<package android:name="com.instagram.android" />
</queries>
</manifest>
24 changes: 24 additions & 0 deletions Adjust/sdk-core/src/main/java/com/adjust/sdk/ActivityHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

import static com.adjust.sdk.Constants.ACTIVITY_STATE_FILENAME;
import static com.adjust.sdk.Constants.ATTRIBUTION_FILENAME;
import static com.adjust.sdk.Constants.REFERRER_API_META;
import static com.adjust.sdk.Constants.REFERRER_API_SAMSUNG;
import static com.adjust.sdk.Constants.REFERRER_API_VIVO;
import static com.adjust.sdk.Constants.REFERRER_API_XIAOMI;
Expand Down Expand Up @@ -79,6 +80,7 @@ public class ActivityHandler implements IActivityHandler {
private SessionParameters sessionParameters;
private InstallReferrer installReferrer;
private InstallReferrerHuawei installReferrerHuawei;
private InstallReferrerMeta installReferrerMeta;

@Override
public void teardown() {
Expand Down Expand Up @@ -1013,6 +1015,13 @@ public void onInstallReferrerRead(ReferrerDetails referrerDetails, String referr
}
});

installReferrerMeta = new InstallReferrerMeta(adjustConfig.context, adjustConfig.fbAppId,
new InstallReferrerReadListener() {
@Override
public void onInstallReferrerRead(ReferrerDetails referrerDetails, String referrerApi) {
sendInstallReferrer(referrerDetails, referrerApi);
}
});
preLaunchActionsI(adjustConfig.preLaunchActions.preLaunchActionsArray);
sendReftagReferrerI();
}
Expand Down Expand Up @@ -1310,6 +1319,7 @@ private void processSessionI() {
// Try to check if there's new referrer information.
installReferrer.startConnection();
installReferrerHuawei.readReferrer();
installReferrerMeta.readReferrer();
readInstallReferrerSamsung();
readInstallReferrerXiaomi();
readInstallReferrerVivo();
Expand Down Expand Up @@ -1811,6 +1821,7 @@ private void checkAfterNewStartI(SharedPreferencesManager sharedPreferencesManag
// try to read and send the install referrer
installReferrer.startConnection();
installReferrerHuawei.readReferrer();
installReferrerMeta.readReferrer();
readInstallReferrerSamsung();
readInstallReferrerXiaomi();
readInstallReferrerVivo();
Expand Down Expand Up @@ -2786,6 +2797,19 @@ private void checkForInstallReferrerInfo(final SdkClickResponseData responseData
return;
}

boolean isInstallReferrerMeta =
responseData.referrerApi != null &&
(responseData.referrerApi.equalsIgnoreCase(REFERRER_API_META));

if (isInstallReferrerMeta) {
activityState.clickTimeMeta = responseData.clickTime;
activityState.installReferrerMeta = responseData.installReferrer;
activityState.isClickMeta = responseData.isClick;

writeActivityStateI();
return;
}

boolean isInstallReferrerSamsung =
responseData.referrerApi != null &&
(responseData.referrerApi.equalsIgnoreCase(REFERRER_API_SAMSUNG));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public class ActivityPackage implements Serializable {
private long installBeginTimeServerInSeconds;
private String installVersion;
private Boolean googlePlayInstant;
private Boolean isClick;

public String getPath() {
return path;
Expand Down Expand Up @@ -168,6 +169,14 @@ public void setGooglePlayInstant(Boolean googlePlayInstant) {
this.googlePlayInstant = googlePlayInstant;
}

public Boolean getIsClick() {
return this.isClick;
}

public void setIsClick(Boolean isClick) {
this.isClick = isClick;
}

public OnPurchaseVerificationFinishedListener getPurchaseVerificationCallback() {
return this.purchaseVerificationCallback;
}
Expand Down
20 changes: 20 additions & 0 deletions Adjust/sdk-core/src/main/java/com/adjust/sdk/ActivityState.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public class ActivityState implements Serializable, Cloneable {
new ObjectStreamField("installBeginVivo", long.class),
new ObjectStreamField("installReferrerVivo", String.class),
new ObjectStreamField("installVersionVivo", String.class),
new ObjectStreamField("installReferrerMeta", String.class),
new ObjectStreamField("clickTimeMeta", long.class),
new ObjectStreamField("isClickMeta", Boolean.class),
};

// persistent data
Expand Down Expand Up @@ -122,6 +125,10 @@ public class ActivityState implements Serializable, Cloneable {
protected String installReferrerVivo;
protected String installVersionVivo;

protected String installReferrerMeta;
protected long clickTimeMeta;
protected Boolean isClickMeta;

protected ActivityState() {
logger = AdjustFactory.getLogger();
// create UUID for new devices
Expand Down Expand Up @@ -166,6 +173,9 @@ protected ActivityState() {
installBeginVivo = 0;
installReferrerVivo = null;
installVersionVivo = null;
installReferrerMeta = null;
clickTimeMeta = 0;
isClickMeta = null;
}

protected void resetSessionAttributes(long now) {
Expand Down Expand Up @@ -249,6 +259,9 @@ public boolean equals(Object other) {
if (!Util.equalLong(installBeginVivo, otherActivityState.installBeginVivo)) return false;
if (!Util.equalString(installReferrerVivo, otherActivityState.installReferrerVivo)) return false;
if (!Util.equalString(installVersionVivo, otherActivityState.installVersionVivo)) return false;
if (!Util.equalString(installReferrerMeta, otherActivityState.installReferrerMeta)) return false;
if (!Util.equalLong(clickTimeMeta, otherActivityState.clickTimeMeta)) return false;
if (!Util.equalBoolean(isClickMeta, otherActivityState.isClickMeta)) return false;
return true;
}

Expand Down Expand Up @@ -295,6 +308,9 @@ public int hashCode() {
hashCode = Util.hashLong(installBeginVivo, hashCode);
hashCode = Util.hashString(installReferrerVivo, hashCode);
hashCode = Util.hashString(installVersionVivo, hashCode);
hashCode = Util.hashString(installReferrerMeta, hashCode);
hashCode = Util.hashLong(clickTimeMeta, hashCode);
hashCode = Util.hashBoolean(isClickMeta, hashCode);
return hashCode;
}

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

installReferrerMeta = Util.readStringField(fields, "installReferrerMeta", null);
clickTimeMeta = Util.readLongField(fields, "clickTimeMeta", -1l);
isClickMeta = Util.readObjectField(fields, "isClickMeta", null);

// create UUID for migrating devices
if (uuid == null) {
uuid = Util.createUuid();
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 @@ -34,7 +34,7 @@ private Adjust() {
*/
public static synchronized AdjustInstance getDefaultInstance() {
@SuppressWarnings("unused")
String VERSION = "!SDK-VERSION-STRING!:com.adjust.sdk:adjust-android:4.35.1";
String VERSION = "!SDK-VERSION-STRING!:com.adjust.sdk:adjust-android:4.36.0";

if (defaultInstance == null) {
defaultInstance = new AdjustInstance();
Expand Down
36 changes: 36 additions & 0 deletions Adjust/sdk-core/src/main/java/com/adjust/sdk/AdjustAdRevenue.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,42 @@ public boolean isValid() {
return isValidSource(this.source);
}

public String getSource() {
return source;
}

public Double getRevenue() {
return revenue;
}

public String getCurrency() {
return currency;
}

public Integer getAdImpressionsCount() {
return adImpressionsCount;
}

public String getAdRevenueNetwork() {
return adRevenueNetwork;
}

public String getAdRevenueUnit() {
return adRevenueUnit;
}

public String getAdRevenuePlacement() {
return adRevenuePlacement;
}

public Map<String, String> getCallbackParameters() {
return callbackParameters;
}

public Map<String, String> getPartnerParameters() {
return partnerParameters;
}

private boolean isValidSource(final String param) {
if (param == null) {
logger.error("Missing source");
Expand Down
Loading

0 comments on commit eaaa504

Please sign in to comment.