Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 4.28.0 #58

Merged
merged 4 commits into from
Apr 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
### Version 4.28.0 (2nd April 2021)
#### Changed
- Removed native iOS legacy code.

#### Native SDKs
- [iOS@v4.28.0][ios_sdk_v4.28.0]
- [Android@v4.27.0][android_sdk_v4.27.0]

---

### Version 4.22.1 (5th January 2021)
#### Fixed
- Fixed `AppTrackingTransparency` framework linking issue which caused crashes on pre iOS 14 devices.
Expand Down Expand Up @@ -483,6 +493,7 @@
[ios_sdk_v4.21.1]: https://github.com/adjust/ios_sdk/tree/v4.21.1
[ios_sdk_v4.21.3]: https://github.com/adjust/ios_sdk/tree/v4.21.3
[ios_sdk_v4.24.0]: https://github.com/adjust/ios_sdk/tree/v4.24.0
[ios_sdk_v4.28.0]: https://github.com/adjust/ios_sdk/tree/v4.28.0

[android_sdk_v2.1.3]: https://github.com/adjust/android_sdk/tree/v2.1.3
[android_sdk_v2.1.4]: https://github.com/adjust/android_sdk/tree/v2.1.4
Expand All @@ -505,3 +516,4 @@
[android_sdk_v4.18.4]: https://github.com/adjust/android_sdk/tree/v4.18.4
[android_sdk_v4.21.1]: https://github.com/adjust/android_sdk/tree/v4.21.1
[android_sdk_v4.25.0]: https://github.com/adjust/android_sdk/tree/v4.25.0
[android_sdk_v4.27.0]: https://github.com/adjust/android_sdk/tree/v4.27.0
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.22.1
4.28.0
2 changes: 1 addition & 1 deletion doc/migrate.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Migrate your Adjust SDK for Adobe AIR to 4.22.1 from 3.4.3
## Migrate your Adjust SDK for Adobe AIR to 4.28.0 from 3.4.3

### SDK initialization

Expand Down
2 changes: 1 addition & 1 deletion example/Main-app.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://ns.adobe.com/air/application/33.1">
<id>com.adjust.examples</id>
<versionNumber>4.22.1</versionNumber>
<versionNumber>4.28.0</versionNumber>
<filename>Adjust AIR SDK Demo</filename>

<initialWindow>
Expand Down
Binary file removed example/lib/Adjust-4.22.1.ane
Binary file not shown.
Binary file added example/lib/Adjust-4.28.0.ane
Binary file not shown.
2 changes: 1 addition & 1 deletion ext/android/sdk
Submodule sdk updated 92 files
+4 −3 Adjust/build.gradle
+2 −2 Adjust/example-app-fbpixel/build.gradle
+1 −0 Adjust/example-app-fbpixel/src/main/assets/AdjustExample-FbPixel.html
+1 −1 Adjust/example-app-java/build.gradle
+1 −1 Adjust/example-app-keyboard/build.gradle
+1 −1 Adjust/example-app-kotlin/build.gradle
+1 −1 Adjust/example-app-tv/build.gradle
+2 −2 Adjust/example-app-webbridge/build.gradle
+1 −0 Adjust/example-app-webbridge/src/main/assets/AdjustExample-WebView.html
+0 −1 Adjust/sdk-core/build.gradle
+198 −33 Adjust/sdk-core/src/main/java/com/adjust/sdk/ActivityHandler.java
+11 −1 Adjust/sdk-core/src/main/java/com/adjust/sdk/ActivityKind.java
+1 −2 Adjust/sdk-core/src/main/java/com/adjust/sdk/ActivityPackage.java
+13 −1 Adjust/sdk-core/src/main/java/com/adjust/sdk/Adjust.java
+0 −1 Adjust/sdk-core/src/main/java/com/adjust/sdk/AdjustAttribution.java
+10 −37 Adjust/sdk-core/src/main/java/com/adjust/sdk/AdjustConfig.java
+58 −167 Adjust/sdk-core/src/main/java/com/adjust/sdk/AdjustFactory.java
+76 −32 Adjust/sdk-core/src/main/java/com/adjust/sdk/AdjustInstance.java
+0 −1 Adjust/sdk-core/src/main/java/com/adjust/sdk/AdjustPlayStoreSubscription.java
+24 −0 Adjust/sdk-core/src/main/java/com/adjust/sdk/AdjustPreinstallReferrerReceiver.java
+0 −1 Adjust/sdk-core/src/main/java/com/adjust/sdk/AdjustTestOptions.java
+33 −0 Adjust/sdk-core/src/main/java/com/adjust/sdk/AdjustThirdPartySharing.java
+75 −44 Adjust/sdk-core/src/main/java/com/adjust/sdk/AttributionHandler.java
+4 −17 Adjust/sdk-core/src/main/java/com/adjust/sdk/Constants.java
+6 −6 Adjust/sdk-core/src/main/java/com/adjust/sdk/IActivityHandler.java
+5 −1 Adjust/sdk-core/src/main/java/com/adjust/sdk/IAttributionHandler.java
+6 −11 Adjust/sdk-core/src/main/java/com/adjust/sdk/IPackageHandler.java
+0 −9 Adjust/sdk-core/src/main/java/com/adjust/sdk/IRequestHandler.java
+5 −1 Adjust/sdk-core/src/main/java/com/adjust/sdk/ISdkClickHandler.java
+33 −7 Adjust/sdk-core/src/main/java/com/adjust/sdk/InstallReferrer.java
+0 −1 Adjust/sdk-core/src/main/java/com/adjust/sdk/InstallReferrerHuawei.java
+256 −75 Adjust/sdk-core/src/main/java/com/adjust/sdk/PackageBuilder.java
+60 −55 Adjust/sdk-core/src/main/java/com/adjust/sdk/PackageHandler.java
+0 −5 Adjust/sdk-core/src/main/java/com/adjust/sdk/Reflection.java
+0 −198 Adjust/sdk-core/src/main/java/com/adjust/sdk/RequestHandler.java
+18 −2 Adjust/sdk-core/src/main/java/com/adjust/sdk/ResponseData.java
+84 −93 Adjust/sdk-core/src/main/java/com/adjust/sdk/SdkClickHandler.java
+0 −5 Adjust/sdk-core/src/main/java/com/adjust/sdk/SessionParameters.java
+34 −2 Adjust/sdk-core/src/main/java/com/adjust/sdk/SharedPreferencesManager.java
+0 −62 Adjust/sdk-core/src/main/java/com/adjust/sdk/UrlFactory.java
+0 −465 Adjust/sdk-core/src/main/java/com/adjust/sdk/UtilNetworking.java
+698 −0 Adjust/sdk-core/src/main/java/com/adjust/sdk/network/ActivityPackageSender.java
+19 −0 Adjust/sdk-core/src/main/java/com/adjust/sdk/network/IActivityPackageSender.java
+160 −0 Adjust/sdk-core/src/main/java/com/adjust/sdk/network/UrlStrategy.java
+97 −0 Adjust/sdk-core/src/main/java/com/adjust/sdk/network/UtilNetworking.java
+0 −2 Adjust/sdk-core/src/main/java/com/adjust/sdk/scheduler/TimerOnce.java
+1 −1 Adjust/sdk-plugin-criteo/build.gradle
+1 −1 Adjust/sdk-plugin-imei/build.gradle
+2 −2 Adjust/sdk-plugin-oaid/build.gradle
+ Adjust/sdk-plugin-oaid/libs/oaid_sdk_1.0.23.aar
+ Adjust/sdk-plugin-oaid/libs/oaid_sdk_1.0.25.aar
+1 −1 Adjust/sdk-plugin-play/build.gradle
+1 −1 Adjust/sdk-plugin-sociomantic/build.gradle
+1 −1 Adjust/sdk-plugin-trademob/build.gradle
+2 −2 Adjust/sdk-plugin-webbridge/build.gradle
+13 −8 Adjust/sdk-plugin-webbridge/src/main/assets/adjust.js
+4 −0 Adjust/sdk-plugin-webbridge/src/main/assets/adjust_config.js
+10 −0 Adjust/sdk-plugin-webbridge/src/main/assets/adjust_third_party_sharing.js
+59 −111 Adjust/sdk-plugin-webbridge/src/main/java/com/adjust/sdk/webbridge/AdjustBridgeInstance.java
+100 −1 Adjust/sdk-plugin-webbridge/src/main/java/com/adjust/sdk/webbridge/AdjustBridgeUtil.java
+3 −1 Adjust/settings.gradle
+2 −1 Adjust/test-app-core/build.gradle
+39 −2 Adjust/test-app-core/src/main/java/com/adjust/testapp/AdjustCommandExecutor.java
+100 −0 Adjust/test-app-core/src/main/java/com/adjust/testapp/Util.java
+3 −3 Adjust/test-app-webbridge/build.gradle
+1 −0 Adjust/test-app-webbridge/src/main/assets/AdjustTestApp-WebView.html
+28 −1 Adjust/test-app-webbridge/src/main/assets/command_executor.js
+6 −0 Adjust/test-app-webbridge/src/main/assets/test_library.js
+1 −1 Adjust/test-app-webbridge/src/main/java/com/example/testappwebbridge/MainActivity.java
+117 −1 Adjust/test-app-webbridge/src/main/java/com/example/testappwebbridge/TestLibraryBridge.java
+1 −2 Adjust/test-kotlin/build.gradle
+1 −1 Adjust/test-library/src/main/AndroidManifest.xml
+1 −0 Adjust/test-options/.gitignore
+19 −0 Adjust/test-options/build.gradle
+0 −0 Adjust/test-options/consumer-rules.pro
+21 −0 Adjust/test-options/proguard-rules.pro
+5 −0 Adjust/test-options/src/main/AndroidManifest.xml
+110 −0 Adjust/test-options/src/main/java/com/adjust/test_options/TLSSocketFactory.java
+71 −0 Adjust/test-options/src/main/java/com/adjust/test_options/TestConnectionOptions.java
+1 −1 Adjust/test-unit/src/androidTest/java/com/adjust/sdk/TestActivityPackage.java
+30 −0 CHANGELOG.md
+201 −11 README.md
+1 −1 VERSION
+643 −366 doc/chinese/README.md
+2 −2 doc/chinese/plugins/oaid.md
+1 −1 doc/english/migration/migrate.md
+2 −2 doc/english/plugins/oaid.md
+601 −324 doc/japanese/README.md
+1 −1 doc/japanese/migration/migrate.md
+2 −2 doc/japanese/plugins/oaid.md
+693 −416 doc/korean/README.md
+2 −2 doc/korean/plugins/oaid.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
import android.net.Uri;
import android.os.Handler;

import com.adjust.sdk.network.ActivityPackageSender;
import com.adjust.sdk.network.IActivityPackageSender;
import com.adjust.sdk.network.UtilNetworking;
import com.adjust.sdk.scheduler.SingleThreadCachedScheduler;
import com.adjust.sdk.scheduler.ThreadExecutor;
import com.adjust.sdk.scheduler.TimerCycle;
Expand Down Expand Up @@ -358,6 +361,7 @@ public void run() {
public void finishedTrackingActivity(ResponseData responseData) {
// redirect session responses to attribution handler to check for attribution information
if (responseData instanceof SessionResponseData) {
logger.debug("Finished tracking session");
attributionHandler.checkSessionResponse((SessionResponseData)responseData);
return;
}
Expand Down Expand Up @@ -466,6 +470,16 @@ public void run() {
});
}

@Override
public void sendPreinstallReferrer() {
executor.submit(new Runnable() {
@Override
public void run() {
sendPreinstallReferrerI();
}
});
}

@Override
public void sendInstallReferrer(final ReferrerDetails referrerDetails,
final String referrerApi) {
Expand Down Expand Up @@ -628,6 +642,26 @@ public void run() {
});
}

@Override
public void trackThirdPartySharing(final AdjustThirdPartySharing adjustThirdPartySharing) {
executor.submit(new Runnable() {
@Override
public void run() {
trackThirdPartySharingI(adjustThirdPartySharing);
}
});
}

@Override
public void trackMeasurementConsent(final boolean consentMeasurement) {
executor.submit(new Runnable() {
@Override
public void run() {
trackMeasurementConsentI(consentMeasurement);
}
});
}

@Override
public void trackAdRevenue(final String source, final JSONObject adRevenueJson) {
executor.submit(new Runnable() {
Expand Down Expand Up @@ -694,21 +728,6 @@ public AdjustAttribution getAttribution() {
return attribution;
}

@Override
public String getBasePath() {
return this.basePath;
}

@Override
public String getGdprPath() {
return this.gdprPath;
}

@Override
public String getSubscriptionPath() {
return this.subscriptionPath;
}

public InternalState getInternalState() {
return internalState;
}
Expand All @@ -730,10 +749,7 @@ private void initI() {
readSessionPartnerParametersI(adjustConfig.context);

if (adjustConfig.startEnabled != null) {
if (adjustConfig.preLaunchActionsArray == null) {
adjustConfig.preLaunchActionsArray = new ArrayList<IRunActivityHandler>();
}
adjustConfig.preLaunchActionsArray.add(new IRunActivityHandler() {
adjustConfig.preLaunchActions.preLaunchActionsArray.add(new IRunActivityHandler() {
@Override
public void run(ActivityHandler activityHandler) {
activityHandler.setEnabledI(adjustConfig.startEnabled);
Expand Down Expand Up @@ -799,8 +815,24 @@ public void run(ActivityHandler activityHandler) {
SharedPreferencesManager sharedPreferencesManager = new SharedPreferencesManager(getContext());
if (sharedPreferencesManager.getGdprForgetMe()) {
gdprForgetMe();
} else if (sharedPreferencesManager.getDisableThirdPartySharing()) {
disableThirdPartySharing();
} else {
if (sharedPreferencesManager.getDisableThirdPartySharing()) {
disableThirdPartySharing();
}
for (AdjustThirdPartySharing adjustThirdPartySharing :
adjustConfig.preLaunchActions.preLaunchAdjustThirdPartySharingArray)
{
trackThirdPartySharing(adjustThirdPartySharing);
}
if (adjustConfig.preLaunchActions.lastMeasurementConsentTracked != null) {
trackMeasurementConsent(
adjustConfig.preLaunchActions.
lastMeasurementConsentTracked.booleanValue());
}

adjustConfig.preLaunchActions.preLaunchAdjustThirdPartySharingArray =
new ArrayList<>();
adjustConfig.preLaunchActions.lastMeasurementConsentTracked = null;
}
}

Expand Down Expand Up @@ -841,15 +873,44 @@ public void run() {

UtilNetworking.setUserAgent(adjustConfig.userAgent);

this.basePath = adjustConfig.basePath;
this.gdprPath = adjustConfig.gdprPath;
this.subscriptionPath = adjustConfig.subscriptionPath;

packageHandler = AdjustFactory.getPackageHandler(this, adjustConfig.context, toSendI(false));

attributionHandler = AdjustFactory.getAttributionHandler(this, toSendI(false));

sdkClickHandler = AdjustFactory.getSdkClickHandler(this, toSendI(true));
IActivityPackageSender packageHandlerActivitySender =
new ActivityPackageSender(
adjustConfig.urlStrategy,
adjustConfig.basePath,
adjustConfig.gdprPath,
adjustConfig.subscriptionPath,
deviceInfo.clientSdk);
packageHandler = AdjustFactory.getPackageHandler(
this,
adjustConfig.context,
toSendI(false),
packageHandlerActivitySender);

IActivityPackageSender attributionHandlerActivitySender =
new ActivityPackageSender(
adjustConfig.urlStrategy,
adjustConfig.basePath,
adjustConfig.gdprPath,
adjustConfig.subscriptionPath,
deviceInfo.clientSdk);

attributionHandler = AdjustFactory.getAttributionHandler(
this,
toSendI(false),
attributionHandlerActivitySender);

IActivityPackageSender sdkClickHandlerActivitySender =
new ActivityPackageSender(
adjustConfig.urlStrategy,
adjustConfig.basePath,
adjustConfig.gdprPath,
adjustConfig.subscriptionPath,
deviceInfo.clientSdk);

sdkClickHandler = AdjustFactory.getSdkClickHandler(
this,
toSendI(true),
sdkClickHandlerActivitySender);

if (isToUpdatePackagesI()) {
updatePackagesI();
Expand All @@ -869,14 +930,18 @@ public void onInstallReferrerRead(ReferrerDetails referrerDetails) {
}
});

preLaunchActionsI(adjustConfig.preLaunchActionsArray);
preLaunchActionsI(adjustConfig.preLaunchActions.preLaunchActionsArray);
sendReftagReferrerI();
}

private void checkForPreinstallI() {
if (activityState == null) return;
if (!activityState.enabled) return;
if (activityState.isGdprForgotten) return;

// sending preinstall referrer doesn't require preinstall tracking flag to be enabled
sendPreinstallReferrerI();

if (!adjustConfig.preinstallTrackingEnabled) return;
if (internalState.hasPreinstallBeenRead()) return;

Expand Down Expand Up @@ -1082,6 +1147,21 @@ private void startFirstSessionI() {
if (sharedPreferencesManager.getDisableThirdPartySharing()) {
disableThirdPartySharingI();
}
for (AdjustThirdPartySharing adjustThirdPartySharing :
adjustConfig.preLaunchActions.preLaunchAdjustThirdPartySharingArray)
{
trackThirdPartySharingI(adjustThirdPartySharing);
}
if (adjustConfig.preLaunchActions.lastMeasurementConsentTracked != null) {
trackMeasurementConsentI(
adjustConfig.preLaunchActions.
lastMeasurementConsentTracked.booleanValue());
}

adjustConfig.preLaunchActions.preLaunchAdjustThirdPartySharingArray =
new ArrayList<>();
adjustConfig.preLaunchActions.lastMeasurementConsentTracked = null;


activityState.sessionCount = 1; // this is the first session
transferSessionPackageI(now);
Expand Down Expand Up @@ -1306,6 +1386,8 @@ private void launchSdkClickResponseTasksI(SdkClickResponseData sdkClickResponseD
}

private void launchSessionResponseTasksI(SessionResponseData sessionResponseData) {
logger.debug("Launching SessionResponse tasks");

// try to update adid from response
updateAdidI(sessionResponseData.adid);

Expand Down Expand Up @@ -1511,12 +1593,29 @@ private void setEnabledI(boolean enabled) {

if (sharedPreferencesManager.getGdprForgetMe()) {
gdprForgetMeI();
} else if (sharedPreferencesManager.getDisableThirdPartySharing()) {
disableThirdPartySharingI();
} else {
if (sharedPreferencesManager.getDisableThirdPartySharing()) {
disableThirdPartySharingI();
}
for (AdjustThirdPartySharing adjustThirdPartySharing :
adjustConfig.preLaunchActions.preLaunchAdjustThirdPartySharingArray)
{
trackThirdPartySharingI(adjustThirdPartySharing);
}
if (adjustConfig.preLaunchActions.lastMeasurementConsentTracked != null) {
trackMeasurementConsentI(
adjustConfig.preLaunchActions.
lastMeasurementConsentTracked.booleanValue());
}

adjustConfig.preLaunchActions.preLaunchAdjustThirdPartySharingArray =
new ArrayList<>();
adjustConfig.preLaunchActions.lastMeasurementConsentTracked = null;
}

// check if install was tracked
if (!sharedPreferencesManager.getInstallTracked()) {
logger.debug("Detected that install was not tracked at enable time");
long now = System.currentTimeMillis();
trackNewSessionI(now);
}
Expand Down Expand Up @@ -1639,6 +1738,25 @@ private void sendReftagReferrerI() {
sdkClickHandler.sendReftagReferrers();
}

private void sendPreinstallReferrerI() {
if (!isEnabledI()) {
return;
}
if (internalState.hasFirstSdkStartNotOcurred()) {
return;
}

SharedPreferencesManager sharedPreferencesManager =
new SharedPreferencesManager(getContext());
String referrerPayload = sharedPreferencesManager.getPreinstallReferrer();

if (referrerPayload == null || referrerPayload.isEmpty()) {
return;
}

sdkClickHandler.sendPreinstallPayload(referrerPayload, Constants.SYSTEM_INSTALLER_REFERRER);
}

private void sendInstallReferrerI(ReferrerDetails referrerDetails, String referrerApi) {
if (!isEnabledI()) {
return;
Expand Down Expand Up @@ -2112,6 +2230,53 @@ private void disableThirdPartySharingI() {
}
}

private void trackThirdPartySharingI(final AdjustThirdPartySharing adjustThirdPartySharing) {
if (!checkActivityStateI(activityState)) {
adjustConfig.preLaunchActions.preLaunchAdjustThirdPartySharingArray.add(
adjustThirdPartySharing);
return;
}
if (!isEnabledI()) { return; }
if (activityState.isGdprForgotten) { return; }

long now = System.currentTimeMillis();
PackageBuilder packageBuilder = new PackageBuilder(
adjustConfig, deviceInfo, activityState, sessionParameters, now);

ActivityPackage activityPackage =
packageBuilder.buildThirdPartySharingPackage(adjustThirdPartySharing);
packageHandler.addPackage(activityPackage);

if (adjustConfig.eventBufferingEnabled) {
logger.info("Buffered event %s", activityPackage.getSuffix());
} else {
packageHandler.sendFirstPackage();
}
}

private void trackMeasurementConsentI(final boolean consentMeasurement) {
if (!checkActivityStateI(activityState)) {
adjustConfig.preLaunchActions.lastMeasurementConsentTracked = consentMeasurement;
return;
}
if (!isEnabledI()) { return; }
if (activityState.isGdprForgotten) { return; }

long now = System.currentTimeMillis();
PackageBuilder packageBuilder = new PackageBuilder(
adjustConfig, deviceInfo, activityState, sessionParameters, now);

ActivityPackage activityPackage =
packageBuilder.buildMeasurementConsentPackage(consentMeasurement);
packageHandler.addPackage(activityPackage);

if (adjustConfig.eventBufferingEnabled) {
logger.info("Buffered event %s", activityPackage.getSuffix());
} else {
packageHandler.sendFirstPackage();
}
}

private void trackAdRevenueI(String source, JSONObject adRevenueJson) {
if (!checkActivityStateI(activityState)) { return; }
if (!isEnabledI()) { return; }
Expand Down
Loading