Skip to content

Commit

Permalink
Pull request #739: Release version 8.11
Browse files Browse the repository at this point in the history
Merge in MOBILE-SDK/app_mobile-sdk-android from release_branch_v8.11 to master

* commit '890fd6f86952004f22d1572eee35dd37fdea3e72':
  updated release note
  release version 8.11
  Pull request #738: Readme file update for Github
  Pull request #735: 6273926 [Android] Added DSA Support
  Pull request #737: Fix HitTestResult for SRC_IMAGE_ANCHOR_TYPE
  Pull request #736: Jenkins Test Update
  • Loading branch information
Ritesh Zaveri committed Feb 15, 2024
2 parents 9e7a7da + 890fd6f commit db5d714
Show file tree
Hide file tree
Showing 17 changed files with 565 additions and 32 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
Appnexus Android SDK
==================

> [!CAUTION]
> We no longer release source code updates of Android SDK to Github. This is not a deprecation of our SDK, only an open-source deprecation as we are taking our Android and iOS Mobile SDKs private.
> Future updates starting from SDK v9.0 will be released only as compiled .aar binary file and will be published via MavenCentral or another equivalent service.
> Please contact your account managers or submit a ticket via the Customer Support Portal: https://help.xandr.com/ if you have any questions.

See our documentation on our wiki at
https://docs.xandr.com/bundle/mobile-sdk/page/xandr-mobile-sdks.html

Get the latest release notes here: https://github.com/appnexus/mobile-sdk-android/releases

To file an issue or request an enhancement please visit the AppNexus Customer Support Portal (https://support.appnexus.com). **We do not accept GitHub issues.**
Get the latest release notes here: https://docs.xandr.com/bundle/mobile-sdk/page/android-sdk-release-notes.html
13 changes: 13 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 8.11

### Announcements:
This is the last minor release in SDK v8.x.
The next major release will be SDK v9.0 and as already announced we will no longer release source code updates of iOS and Android Mobile SDKs to Github. This is not a deprecation of our SDKs, only an open-source deprecation as we are taking our Android and iOS Mobile SDKs private.
There will be no breaking changes from v8.x to v9.0 but keep in mind any new functional changes going forward will be developed only in version v9.x.

### New Feature
+ 6273926 Support for Digital Services Act (DSA) [https://docs.xandr.com/bundle/mobile-sdk/page/sdk-privacy-for-android.html]

### Improvement/Bug Fixes
+ 6273738 Fixed HTML ad that automatically open image resources in an external browser

## 8.10

### New Feature
Expand Down
4 changes: 2 additions & 2 deletions instreamvideo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Project Properties
version = "1.49" // Instream SDK version
version = "1.50" // Instream SDK version

apply plugin: 'com.android.library'

Expand All @@ -10,7 +10,7 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 32
versionCode 48 // An integer value that represents the version of the code, relative to other versions. Increase for each release.
versionCode 49 // An integer value that represents the version of the code, relative to other versions. Increase for each release.
versionName version
consumerProguardFiles 'proguard-project.txt'
}
Expand Down
46 changes: 27 additions & 19 deletions run_tests.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,69 +1,77 @@
EXIT_STATUS=0
DIR_PATH_SDK_REPORT="sdkTestReport"
DIR_PATH_SDK_REPORT_COMBINED="sdkTestReport/Combined"
DIR_PATH_SDK_REPORT_COMBINED_CLASSES="sdkTestReport/Combined/classes"
DIR_PATH_SDK_REPORT_COMBINED_PACKAGES="sdkTestReport/Combined/packages"
DIR="sdk/build/reports/tests/testDebugUnitTest"
DIR_CLASSES="sdk/build/reports/tests/testDebugUnitTest/classes"
DIR_CLASSES_PACKAGES="sdk/build/reports/tests/testDebugUnitTest/packages"


checkIfDeleteDirectory() {
if [ -d "$DIR_PATH_SDK_REPORT" ]; then rm -Rf $DIR_PATH_SDK_REPORT;
else mkdir $DIR_PATH_SDK_REPORT
fi
if [ -d "$DIR_PATH_SDK_REPORT" ]; then rm -Rf $DIR_PATH_SDK_REPORT; fi
mkdir $DIR_PATH_SDK_REPORT
mkdir $DIR_PATH_SDK_REPORT_COMBINED
mkdir $DIR_PATH_SDK_REPORT_COMBINED_CLASSES
mkdir $DIR_PATH_SDK_REPORT_COMBINED_PACKAGES
}

copyIndexHtml(){
cp -r $DIR_CLASSES/* sdkTestReport/classes/
cp -r $DIR_CLASSES_PACKAGES/* sdkTestReport/packages/
cat $DIR/index.html >> sdkTestReport/index.html
cp -r $DIR_CLASSES/* sdkTestReport/Combined/classes/
cp -r $DIR_CLASSES_PACKAGES/* sdkTestReport/Combined/packages/
cat $DIR/index.html >> sdkTestReport/Combined/index.html

mkdir $DIR_PATH_SDK_REPORT/$1
cp -r $DIR/* sdkTestReport/$1/
}

checkIfDeleteDirectory
./gradlew :instreamvideo:testDebugUnitTest --info || EXIT_STATUS=$?
sleep 6
wait $!
./gradlew :sdk:testDebugUnitTest --tests com.appnexus.opensdk.suite.AdRequestTestSuite --scan || EXIT_STATUS=$?
cp -r $DIR/* sdkTestReport || EXIT_STATUS=$?
copyIndexHtml "AdRequestTestSuite" || EXIT_STATUS=$?
sleep 6
wait $!
./gradlew :sdk:testDebugUnitTest --tests com.appnexus.opensdk.suite.AdResponseInfoTestSuite --scan || EXIT_STATUS=$?
copyIndexHtml || EXIT_STATUS=$?
copyIndexHtml "AdResponseInfoTestSuite" || EXIT_STATUS=$?
sleep 6
./gradlew :sdk:testDebugUnitTest --tests com.appnexus.opensdk.suite.AdViewTestSuite --scan || EXIT_STATUS=$?
copyIndexHtml || EXIT_STATUS=$?
copyIndexHtml "AdViewTestSuite" || EXIT_STATUS=$?
sleep 6
./gradlew :sdk:testDebugUnitTest --tests com.appnexus.opensdk.suite.DefaultSettingsTestSuite --scan || EXIT_STATUS=$?
copyIndexHtml || EXIT_STATUS=$?
copyIndexHtml "DefaultSettingsTestSuite" || EXIT_STATUS=$?
sleep 6
./gradlew :sdk:testDebugUnitTest --tests com.appnexus.opensdk.suite.MediationTestSuite --scan || EXIT_STATUS=$?
copyIndexHtml || EXIT_STATUS=$?
copyIndexHtml "MediationTestSuite" || EXIT_STATUS=$?
sleep 6
./gradlew :sdk:testDebugUnitTest --tests com.appnexus.opensdk.suite.MRAIDTestSuite --scan || EXIT_STATUS=$?
copyIndexHtml || EXIT_STATUS=$?
copyIndexHtml "MRAIDTestSuite" || EXIT_STATUS=$?
sleep 6
./gradlew :sdk:testDebugUnitTest --tests com.appnexus.opensdk.suite.NativeAdSDKTestSuite --scan || EXIT_STATUS=$?
copyIndexHtml || EXIT_STATUS=$?
copyIndexHtml "NativeAdSDKTestSuite" || EXIT_STATUS=$?
sleep 6
./gradlew :sdk:testDebugUnitTest --tests com.appnexus.opensdk.suite.OmidTestSuite --scan || EXIT_STATUS=$?
copyIndexHtml
copyIndexHtml "OmidTestSuite" || EXIT_STATUS=$?
sleep 6
./gradlew :sdk:testDebugUnitTest --tests com.appnexus.opensdk.suite.UtAdTestSuite --scan || EXIT_STATUS=$?
copyIndexHtml || EXIT_STATUS=$?
copyIndexHtml "UtAdTestSuite" || EXIT_STATUS=$?
sleep 6
wait $!
./gradlew :sdk:testDebugUnitTest --tests com.appnexus.opensdk.NativeAdSDKFailedTest --scan || EXIT_STATUS=$?
copyIndexHtml || EXIT_STATUS=$?
copyIndexHtml "NativeAdSDKFailedTest" || EXIT_STATUS=$?
sleep 6
wait $!
./gradlew :sdk:testDebugUnitTest --tests com.appnexus.opensdk.NativeRequestTest --scan || EXIT_STATUS=$?
copyIndexHtml || EXIT_STATUS=$?
copyIndexHtml "NativeRequestTest" || EXIT_STATUS=$?
sleep 6
wait $!
./gradlew :sdk:testDebugUnitTest --tests com.appnexus.opensdk.suite.MARTestSuite --scan || EXIT_STATUS=$?
copyIndexHtml || EXIT_STATUS=$?
copyIndexHtml "MARTestSuite" || EXIT_STATUS=$?
sleep 6
wait $!
./gradlew :sdk:testDebugUnitTest --tests com.appnexus.opensdk.suite.Miscellaneous --scan || EXIT_STATUS=$?
copyIndexHtml || EXIT_STATUS=$?
copyIndexHtml "Miscellaneous" || EXIT_STATUS=$?
exit $EXIT_STATUS


Expand Down
4 changes: 2 additions & 2 deletions sdk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Project properties
version = "8.10"
version = "8.11"
group='com.appnexus.opensdk'

// Android build
Expand All @@ -10,7 +10,7 @@ android {
buildToolsVersion '32.0.0'

defaultConfig {
versionCode 107 // An integer value that represents the version of the code, relative to other versions. Increase for each release.
versionCode 108 // An integer value that represents the version of the code, relative to other versions. Increase for each release.
versionName version
consumerProguardFiles 'proguard-project.txt'
minSdkVersion 14
Expand Down
22 changes: 21 additions & 1 deletion sdk/src/com/appnexus/opensdk/ANAdResponseInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class ANAdResponseInfo {
private double cpm;
private double cpmPublisherCurrency;
private String publisherCurrencyCode = "";
ANDSAResponseInfo dsaResponseInfo;


/**
Expand Down Expand Up @@ -154,4 +155,23 @@ public void setPublisherCurrencyCode(String publisherCurrencyCode) {
this.publisherCurrencyCode = publisherCurrencyCode;
}

}
/**
* Retrieves the Digital Services Act (DSA) information associated with this ad response.
* This method returns an ANDSAResponseInfo object, encapsulating details such as behalf, paid, ad render, and transparency information.
*
* @return The ANDSAResponseInfo object containing details such as behalf, paid, ad render, and transparency.
*/
public ANDSAResponseInfo getDSAResponseInfo() {
return dsaResponseInfo;
}

/**
* Sets the Digital Services Act (DSA) information for this ad response.
* This method allows you to set an ANDSAResponseInfo object, encapsulating details such as behalf, paid, ad render, and transparency information.
*
* @param dsaResponseInfo The ANDSAResponseInfo object to be set for this ad response.
*/
public void setDSAResponseInfo(ANDSAResponseInfo dsaResponseInfo) {
this.dsaResponseInfo = dsaResponseInfo;
}
}
155 changes: 155 additions & 0 deletions sdk/src/com/appnexus/opensdk/ANDSAResponseInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
package com.appnexus.opensdk;

import com.appnexus.opensdk.utils.JsonUtil;
import com.appnexus.opensdk.utils.StringUtil;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.ArrayList;

/**
* Represents the response information for Digital Services Act (DSA) related data and transparency information.
* This class includes fields for information such as on whose behalf the ad is displayed, who paid for the ad,
* ad rendering information, and a list of transparency information.
*
* <p>Example Usage:</p>
* <pre>{@code
* ANDSAResponseInfo dsaResponseInfo = getAdResponseInfo().getDSAResponseInfo();
* String behalf = dsaResponseInfo.getBehalf();
* String paid = dsaResponseInfo.getPaid();
* ArrayList<ANDSATransparencyInfo> transparencyList = dsaResponseInfo.getTransparencyList();
* for(int i = 0; i <= transparencyList.size(); i++) {
* ANDSATransparencyInfo tranparencyInfo = transparencyList.get(i);
* String domain = tranparencyInfo.getDomain();
* ArrayList<Integer> params = tranparencyInfo.getDSAParams();
* }
*
* int adRender = dsaResponseInfo.getAdRender();
* }</pre>
*/
public class ANDSAResponseInfo {
private String behalf = "";
private String paid = "";
int adRender = -1;
private ArrayList<ANDSATransparencyInfo> transparencyList = new ArrayList<>();
private static final String RESPONSE_KEY_DSA_BEHALF = "behalf";
private static final String RESPONSE_KEY_DSA_PAID = "paid";
private static final String RESPONSE_KEY_DSA_TRANSPARENCY = "transparency";
private static final String RESPONSE_KEY_DSA_DOMAIN = "domain";
private static final String RESPONSE_KEY_DSA_PARAMS = "dsaparams";
private static final String RESPONSE_KEY_DSA_AD_RENDER = "adrender";

/**
* Process the dsa response from ad object
*
* @param dsaObject JsonObject that contains info of dsa
* @return ANDSAResponseInfo if no issue happened during processing
*/
public ANDSAResponseInfo create(JSONObject dsaObject) {
if (dsaObject == null) {
return null;
}

ANDSAResponseInfo dsaResponseInfo = new ANDSAResponseInfo();
String behalf = JsonUtil.getJSONString(dsaObject, RESPONSE_KEY_DSA_BEHALF);
if (!StringUtil.isEmpty(behalf)) {
dsaResponseInfo.setBehalf(behalf);
}
String paid = JsonUtil.getJSONString(dsaObject, RESPONSE_KEY_DSA_PAID);
if (!StringUtil.isEmpty(paid)) {
dsaResponseInfo.setPaid(paid);
}
JSONArray transparencyArray = JsonUtil.getJSONArray(dsaObject, RESPONSE_KEY_DSA_TRANSPARENCY);
if (transparencyArray != null) {

ArrayList<ANDSATransparencyInfo> transparencyList = new ArrayList<>();
for (int j = 0; j < transparencyArray.length(); j++) {
JSONObject transparencyObject = transparencyArray.optJSONObject(j);
if (transparencyObject != null) {
String domain = JsonUtil.getJSONString(transparencyObject, RESPONSE_KEY_DSA_DOMAIN);
JSONArray paramsArray = JsonUtil.getJSONArray(transparencyObject, RESPONSE_KEY_DSA_PARAMS);

ANDSATransparencyInfo transparencyInfo = new ANDSATransparencyInfo(domain, JsonUtil.getIntegerArrayList(paramsArray));
transparencyList.add(transparencyInfo);
}
}
dsaResponseInfo.setTransparencyList(transparencyList);
}
int adRender = JsonUtil.getJSONInt(dsaObject, RESPONSE_KEY_DSA_AD_RENDER);
if (adRender >= 0) {
dsaResponseInfo.setAdRender(adRender);
}
return dsaResponseInfo;
}

/**
* Retrieve on whose behalf the ad is displayed.
*
* @return The behalf, returns an empty string if not set.
*/
public String getBehalf() {
return behalf;
}

/**
* Set on whose behalf the ad is displayed.
*
* @param behalf The behalf to be set.
*/
public void setBehalf(String behalf) {
this.behalf = behalf;
}

/**
* Retrieve who paid for the ad.
*
* @return The paid, returns an empty string if not set.
*/
public String getPaid() {
return paid;
}

/**
* Set who paid for the ad.
*
* @param paid The paid to be set.
*/
public void setPaid(String paid) {
this.paid = paid;
}

/**
* Retrieve indicating if the buyer/advertiser will render DSA transparency info.
* 0 = buyer/advertiser will not render
* 1 = buyer/advertiser will render
*
* @return The ad render that this ad belongs to.
*/
public int getAdRender() {
return adRender;
}

/**
* Set indicating if the buyer/advertiser will render DSA transparency info.
*
* @param adRender The ad render value to be set.
*/
public void setAdRender(int adRender) {
this.adRender = adRender;
}

/**
* Retrieve the transparency user parameters info
*/
public ArrayList<ANDSATransparencyInfo> getTransparencyList() {
return transparencyList;
}

/**
* Set the transparency list using the provided list of ANDSATransparencyInfo.
*
* @param transparencyList The list of ANDSATransparencyInfo to be set.
*/
public void setTransparencyList(ArrayList<ANDSATransparencyInfo> transparencyList) {
this.transparencyList = transparencyList;
}
}
Loading

0 comments on commit db5d714

Please sign in to comment.