Skip to content

Commit

Permalink
Merge pull request #275 from adjust/v4113
Browse files Browse the repository at this point in the history
V4113
  • Loading branch information
nonelse authored Apr 5, 2017
2 parents bdbed15 + a0a74c9 commit e902787
Show file tree
Hide file tree
Showing 23 changed files with 258 additions and 331 deletions.
2 changes: 1 addition & 1 deletion Adjust/adjust/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.library'

def getVersionName() {
return "4.11.2"
return "4.11.3"
}

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ public void run() {
}, DELAY_START_TIMER_NAME);
}

Util.setUserAgent(adjustConfig.userAgent);
UtilNetworking.setUserAgent(adjustConfig.userAgent);

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

Expand Down
8 changes: 0 additions & 8 deletions Adjust/adjust/src/main/java/com/adjust/sdk/AdjustFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,6 @@ public static HttpsURLConnection getHttpsURLConnection(URL url) throws IOExcepti
return AdjustFactory.httpsURLConnection;
}

public static URLGetConnection getHttpsURLGetConnection(URL url) throws IOException {
if (AdjustFactory.httpsURLConnection == null) {
return new URLGetConnection((HttpsURLConnection)url.openConnection(), url);
}

return new URLGetConnection(AdjustFactory.httpsURLConnection, url);
}

public static ISdkClickHandler getSdkClickHandler(boolean startsSending) {
if (sdkClickHandler == null) {
return new SdkClickHandler(startsSending);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ public class AttributionHandler implements IAttributionHandler {

private boolean paused;

public URL lastUrlUsed;

@Override
public void teardown() {
logger.verbose("AttributionHandler teardown");
Expand Down Expand Up @@ -204,12 +202,7 @@ private void sendAttributionRequestI() {
logger.verbose("%s", attributionPackage.getExtendedString());

try {
AdjustFactory.URLGetConnection urlGetConnection = Util.createGETHttpsURLConnection(
buildUriI(attributionPackage.getPath(), attributionPackage.getParameters()).toString(),
attributionPackage.getClientSdk());

ResponseData responseData = Util.readHttpResponse(urlGetConnection.httpsURLConnection, attributionPackage);
lastUrlUsed = urlGetConnection.url;
ResponseData responseData = UtilNetworking.createGETHttpsURLConnection(attributionPackage);

if (!(responseData instanceof AttributionResponseData)) {
return;
Expand All @@ -221,23 +214,4 @@ private void sendAttributionRequestI() {
return;
}
}

private Uri buildUriI(String path, Map<String, String> parameters) {
Uri.Builder uriBuilder = new Uri.Builder();

uriBuilder.scheme(Constants.SCHEME);
uriBuilder.authority(Constants.AUTHORITY);
uriBuilder.appendPath(path);

for (Map.Entry<String, String> entry : parameters.entrySet()) {
uriBuilder.appendQueryParameter(entry.getKey(), entry.getValue());
}

long now = System.currentTimeMillis();
String dateString = Util.dateFormatter.format(now);

uriBuilder.appendQueryParameter("sent_at", dateString);

return uriBuilder.build();
}
}
2 changes: 1 addition & 1 deletion Adjust/adjust/src/main/java/com/adjust/sdk/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public interface Constants {
String BASE_URL = "https://app.adjust.com";
String SCHEME = "https";
String AUTHORITY = "app.adjust.com";
String CLIENT_SDK = "android4.11.2";
String CLIENT_SDK = "android4.11.3";
String LOGTAG = "Adjust";
String REFTAG = "reftag";
String DEEPLINK = "deeplink";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,7 @@ private void sendI(ActivityPackage activityPackage, int queueSize) {
String targetURL = Constants.BASE_URL + activityPackage.getPath();

try {
HttpsURLConnection connection = Util.createPOSTHttpsURLConnection(
targetURL,
activityPackage.getClientSdk(),
activityPackage.getParameters(),
queueSize);

ResponseData responseData = Util.readHttpResponse(connection, activityPackage);
ResponseData responseData = UtilNetworking.createPOSTHttpsURLConnection(targetURL, activityPackage, queueSize);

IPackageHandler packageHandler = packageHandlerWeakRef.get();
if (packageHandler == null) {
Expand All @@ -81,7 +75,6 @@ private void sendI(ActivityPackage activityPackage, int queueSize) {
}

packageHandler.sendNextPackage(responseData);

} catch (UnsupportedEncodingException e) {
sendNextPackageI(activityPackage, "Failed to encode parameters", e);
} catch (SocketTimeoutException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,7 @@ private void sendSdkClickI(ActivityPackage sdkClickPackage) {
String targetURL = Constants.BASE_URL + sdkClickPackage.getPath();

try {
HttpsURLConnection connection = Util.createPOSTHttpsURLConnection(
targetURL,
sdkClickPackage.getClientSdk(),
sdkClickPackage.getParameters(),
packageQueue.size() - 1);

ResponseData responseData = Util.readHttpResponse(connection, sdkClickPackage);
ResponseData responseData = UtilNetworking.createPOSTHttpsURLConnection(targetURL, sdkClickPackage, packageQueue.size() - 1);

if (responseData.jsonResponse == null) {
retrySendingI(sdkClickPackage);
Expand Down
Loading

0 comments on commit e902787

Please sign in to comment.