From 856f59987a1fb6f9522779c876528437d867f936 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Mon, 15 Jan 2024 14:54:10 +0300 Subject: [PATCH 1/7] fix: local changes fixes --- .../main/java/ly/count/java/demo/Example.java | 11 ++-- .../sdk/java/internal/ModuleUserProfile.java | 4 +- .../ly/count/sdk/java/internal/Transport.java | 64 +++++++++---------- 3 files changed, 39 insertions(+), 40 deletions(-) diff --git a/app-java/src/main/java/ly/count/java/demo/Example.java b/app-java/src/main/java/ly/count/java/demo/Example.java index eb01fa29..20586af6 100755 --- a/app-java/src/main/java/ly/count/java/demo/Example.java +++ b/app-java/src/main/java/ly/count/java/demo/Example.java @@ -57,9 +57,9 @@ static void setUserProfile() { Countly.instance().userProfile().setProperty(PredefinedUserPropertyKeys.EMAIL, "test@test.com"); Countly.instance().userProfile().setProperty(PredefinedUserPropertyKeys.ORGANIZATION, "Tester"); Countly.instance().userProfile().setProperty(PredefinedUserPropertyKeys.PHONE, "+123456789"); - Countly.instance().userProfile().setProperty(PredefinedUserPropertyKeys.PICTURE, new byte[] { 1, 2, 3, 4, 5 }); + //Countly.instance().userProfile().setProperty(PredefinedUserPropertyKeys.PICTURE, new byte[] { 1, 2, 3, 4, 5 }); //Countly.instance().userProfile().setProperty(UserPropertyKeys.PICTURE_PATH, "test.png"); to provide local path - Countly.instance().userProfile().setProperty(PredefinedUserPropertyKeys.PICTURE_PATH, "https://someurl.com/test.png"); + Countly.instance().userProfile().setProperty(PredefinedUserPropertyKeys.PICTURE_PATH, "/Users/euxinos/Documents/Images/frog.png"); Countly.instance().userProfile().save(); } @@ -186,8 +186,8 @@ public static void main(String[] args) throws Exception { Scanner scanner = new Scanner(System.in); - String COUNTLY_SERVER_URL = "https://xxx.server.ly/"; - String COUNTLY_APP_KEY = "COUNTLY_APP_KEY"; + String COUNTLY_SERVER_URL = "https://master.count.ly/"; + String COUNTLY_APP_KEY = "a2a8861870b31fa2e73e5d1deeb57ac5866cca8d"; Map metricOverride = new ConcurrentHashMap<>(); metricOverride.put("aa", "11"); @@ -211,7 +211,8 @@ public static void main(String[] args) throws Exception { .setDeviceIdStrategy(Config.DeviceIdStrategy.UUID) .enableFeatures(Config.Feature.Events, Config.Feature.Sessions, Config.Feature.CrashReporting, Config.Feature.Views, Config.Feature.UserProfiles, Config.Feature.Location, Config.Feature.Feedback) .setRequiresConsent(true) - //.enableParameterTamperingProtection("test-salt-checksum") + .enableForcedHTTPPost() + .enableParameterTamperingProtection("checksum") .setLogListener(new LogCallback() { @Override public void LogHappened(String logMessage, Config.LoggingLevel logLevel) { diff --git a/sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleUserProfile.java b/sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleUserProfile.java index 72cd09a5..4cc80afc 100644 --- a/sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleUserProfile.java +++ b/sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleUserProfile.java @@ -213,9 +213,7 @@ private Params prepareRequestParamsForUserProfile() { Params params = new Params(); final JSONObject json = new JSONObject(); perform(json, params); - if (!json.isEmpty()) { - params.add("user_details", json.toString()); - } + params.add("user_details", json.toString()); return params; } diff --git a/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java b/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java index fb21dd9e..ce313027 100644 --- a/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java +++ b/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java @@ -2,6 +2,7 @@ import java.io.BufferedReader; import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -136,10 +137,6 @@ HttpURLConnection connection(final Request request) throws IOException { byte[] maybePictureData = getPictureDataFromRequest(request); boolean usingGET = !config.isHTTPPostForced() && request.isGettable(config.getServerURL()) && maybePictureData == null; - if (!usingGET && maybePictureData != null) { - path = setProfilePicturePathRequestParams(path, request.params); - } - if (usingGET && config.getParameterTamperingProtectionSalt() != null) { request.params.add(CHECKSUM, Utils.digestHex(PARAMETER_TAMPERING_DIGEST, request.params + config.getParameterTamperingProtectionSalt(), L)); } @@ -158,38 +155,42 @@ HttpURLConnection connection(final Request request) throws IOException { PrintWriter writer = null; try { if (maybePictureData != null) { + StringBuilder stringBuilder = new StringBuilder(); String boundary = Long.toHexString(System.currentTimeMillis()); - connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary); - - output = connection.getOutputStream(); - writer = new PrintWriter(new OutputStreamWriter(output, Utils.UTF8), true); - - addMultipart(output, writer, boundary, "image/jpeg", "binaryFile", "image", maybePictureData); + addMultipart(stringBuilder, boundary, "image/jpeg", "file", "image", maybePictureData); - StringBuilder salting = new StringBuilder(); Map map = request.params.map(); - for (String key : map.keySet()) { - String value = Utils.urldecode(map.get(key)); - salting.append(key).append('=').append(value).append('&'); - addMultipart(output, writer, boundary, "text/plain", key, value, null); + for (Map.Entry kv : map.entrySet()) { + addMultipart(stringBuilder, boundary, "text/plain", kv.getKey(), kv.getValue(), null); } - if (config.getParameterTamperingProtectionSalt() != null) { - addMultipart(output, writer, boundary, "text/plain", CHECKSUM, Utils.digestHex(PARAMETER_TAMPERING_DIGEST, salting.substring(0, salting.length() - 1) + config.getParameterTamperingProtectionSalt(), L), null); + stringBuilder.append("--").append(boundary).append("--").append(Utils.CRLF); + System.out.println(stringBuilder); + + connection = openConnection(path + "checksum256=" + Utils.digestHex(PARAMETER_TAMPERING_DIGEST, stringBuilder + config.getParameterTamperingProtectionSalt(), L), request.params.toString(), usingGET); + connection.setConnectTimeout(1000 * config.getNetworkConnectionTimeout()); + connection.setReadTimeout(1000 * config.getNetworkReadTimeout()); + + if (connection instanceof HttpsURLConnection && sslContext != null) { + HttpsURLConnection https = (HttpsURLConnection) connection; + https.setSSLSocketFactory(sslContext.getSocketFactory()); } + connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary); + output = connection.getOutputStream(); + writer = new PrintWriter(new OutputStreamWriter(output, StandardCharsets.UTF_8), true); - writer.append(Utils.CRLF).append("--").append(boundary).append("--").append(Utils.CRLF).flush(); + writer.append(stringBuilder.toString()).flush(); } else { //picture data is "null". If it was sent, we send "null" to server to clear the image there //we send a normal request in HTTP POST if (config.getParameterTamperingProtectionSalt() != null) { - request.params.add(CHECKSUM, Utils.digestHex(PARAMETER_TAMPERING_DIGEST, request.params.toString() + config.getParameterTamperingProtectionSalt(), L)); + request.params.add(CHECKSUM, Utils.digestHex(PARAMETER_TAMPERING_DIGEST, request.params + config.getParameterTamperingProtectionSalt(), L)); } connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); output = connection.getOutputStream(); - writer = new PrintWriter(new OutputStreamWriter(output, Utils.UTF8), true); + writer = new PrintWriter(new OutputStreamWriter(output, StandardCharsets.UTF_8), true); writer.write(request.params.toString()); writer.flush(); @@ -213,20 +214,19 @@ HttpURLConnection connection(final Request request) throws IOException { return connection; } - void addMultipart(OutputStream output, PrintWriter writer, String boundary, String contentType, String name, String value, Object file) throws IOException { - writer.append("--").append(boundary).append(Utils.CRLF); + void addMultipart(StringBuilder stringBuilder, String boundary, String contentType, String name, String value, byte[] file) throws IOException { + stringBuilder.append("--").append(boundary).append(Utils.CRLF); if (file != null) { - writer.append("Content-Disposition: form-data; name=\"").append(name).append("\"; filename=\"").append(value).append("\"").append(Utils.CRLF); - writer.append("Content-Type: ").append(contentType).append(Utils.CRLF); - writer.append("Content-Transfer-Encoding: binary").append(Utils.CRLF); - writer.append(Utils.CRLF).flush(); - output.write((byte[]) file); - output.flush(); - writer.append(Utils.CRLF).flush(); + stringBuilder.append("Content-Disposition: form-data; name=\"").append(name).append("\"; filename=\"").append(value).append("\"").append(Utils.CRLF); + stringBuilder.append("Content-Type: ").append(contentType).append(Utils.CRLF); + stringBuilder.append(Utils.CRLF); + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(file.length); + byteArrayOutputStream.write(file); + stringBuilder.append(byteArrayOutputStream.toString()); + stringBuilder.append(Utils.CRLF); } else { - writer.append("Content-Disposition: form-data; name=\"").append(name).append("\"").append(Utils.CRLF); - writer.append("Content-Type: ").append(contentType).append("; charset=").append(Utils.UTF8).append(Utils.CRLF); - writer.append(Utils.CRLF).append(value).append(Utils.CRLF).flush(); + stringBuilder.append("Content-Disposition: form-data; name=\"").append(name).append("\"").append(Utils.CRLF); + stringBuilder.append(Utils.CRLF).append(value).append(Utils.CRLF); } } From 6991d18f1d3282f5edbce936846e86bbf8d17b64 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Tue, 16 Jan 2024 12:06:42 +0300 Subject: [PATCH 2/7] revert: example things --- .../src/main/java/ly/count/java/demo/Example.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app-java/src/main/java/ly/count/java/demo/Example.java b/app-java/src/main/java/ly/count/java/demo/Example.java index 20586af6..eb01fa29 100755 --- a/app-java/src/main/java/ly/count/java/demo/Example.java +++ b/app-java/src/main/java/ly/count/java/demo/Example.java @@ -57,9 +57,9 @@ static void setUserProfile() { Countly.instance().userProfile().setProperty(PredefinedUserPropertyKeys.EMAIL, "test@test.com"); Countly.instance().userProfile().setProperty(PredefinedUserPropertyKeys.ORGANIZATION, "Tester"); Countly.instance().userProfile().setProperty(PredefinedUserPropertyKeys.PHONE, "+123456789"); - //Countly.instance().userProfile().setProperty(PredefinedUserPropertyKeys.PICTURE, new byte[] { 1, 2, 3, 4, 5 }); + Countly.instance().userProfile().setProperty(PredefinedUserPropertyKeys.PICTURE, new byte[] { 1, 2, 3, 4, 5 }); //Countly.instance().userProfile().setProperty(UserPropertyKeys.PICTURE_PATH, "test.png"); to provide local path - Countly.instance().userProfile().setProperty(PredefinedUserPropertyKeys.PICTURE_PATH, "/Users/euxinos/Documents/Images/frog.png"); + Countly.instance().userProfile().setProperty(PredefinedUserPropertyKeys.PICTURE_PATH, "https://someurl.com/test.png"); Countly.instance().userProfile().save(); } @@ -186,8 +186,8 @@ public static void main(String[] args) throws Exception { Scanner scanner = new Scanner(System.in); - String COUNTLY_SERVER_URL = "https://master.count.ly/"; - String COUNTLY_APP_KEY = "a2a8861870b31fa2e73e5d1deeb57ac5866cca8d"; + String COUNTLY_SERVER_URL = "https://xxx.server.ly/"; + String COUNTLY_APP_KEY = "COUNTLY_APP_KEY"; Map metricOverride = new ConcurrentHashMap<>(); metricOverride.put("aa", "11"); @@ -211,8 +211,7 @@ public static void main(String[] args) throws Exception { .setDeviceIdStrategy(Config.DeviceIdStrategy.UUID) .enableFeatures(Config.Feature.Events, Config.Feature.Sessions, Config.Feature.CrashReporting, Config.Feature.Views, Config.Feature.UserProfiles, Config.Feature.Location, Config.Feature.Feedback) .setRequiresConsent(true) - .enableForcedHTTPPost() - .enableParameterTamperingProtection("checksum") + //.enableParameterTamperingProtection("test-salt-checksum") .setLogListener(new LogCallback() { @Override public void LogHappened(String logMessage, Config.LoggingLevel logLevel) { From c458a9c0460d6cec08a6c88a008daa7549e90243 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Tue, 16 Jan 2024 12:09:22 +0300 Subject: [PATCH 3/7] feat: trasnport revert --- .../ly/count/sdk/java/internal/Transport.java | 54 +++++++++---------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java b/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java index ce313027..b766cacf 100644 --- a/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java +++ b/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java @@ -2,7 +2,6 @@ import java.io.BufferedReader; import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -155,32 +154,28 @@ HttpURLConnection connection(final Request request) throws IOException { PrintWriter writer = null; try { if (maybePictureData != null) { - StringBuilder stringBuilder = new StringBuilder(); String boundary = Long.toHexString(System.currentTimeMillis()); - addMultipart(stringBuilder, boundary, "image/jpeg", "file", "image", maybePictureData); + connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary); - Map map = request.params.map(); - for (Map.Entry kv : map.entrySet()) { - addMultipart(stringBuilder, boundary, "text/plain", kv.getKey(), kv.getValue(), null); - } + output = connection.getOutputStream(); + writer = new PrintWriter(new OutputStreamWriter(output, Utils.UTF8), true); - stringBuilder.append("--").append(boundary).append("--").append(Utils.CRLF); - System.out.println(stringBuilder); + addMultipart(output, writer, boundary, "image/jpeg", "binaryFile", "image", maybePictureData); - connection = openConnection(path + "checksum256=" + Utils.digestHex(PARAMETER_TAMPERING_DIGEST, stringBuilder + config.getParameterTamperingProtectionSalt(), L), request.params.toString(), usingGET); - connection.setConnectTimeout(1000 * config.getNetworkConnectionTimeout()); - connection.setReadTimeout(1000 * config.getNetworkReadTimeout()); + StringBuilder salting = new StringBuilder(); + Map map = request.params.map(); + for (String key : map.keySet()) { + String value = Utils.urldecode(map.get(key)); + salting.append(key).append('=').append(value).append('&'); + addMultipart(output, writer, boundary, "text/plain", key, value, null); + } - if (connection instanceof HttpsURLConnection && sslContext != null) { - HttpsURLConnection https = (HttpsURLConnection) connection; - https.setSSLSocketFactory(sslContext.getSocketFactory()); + if (config.getParameterTamperingProtectionSalt() != null) { + addMultipart(output, writer, boundary, "text/plain", CHECKSUM, Utils.digestHex(PARAMETER_TAMPERING_DIGEST, salting.substring(0, salting.length() - 1) + config.getParameterTamperingProtectionSalt(), L), null); } - connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary); - output = connection.getOutputStream(); - writer = new PrintWriter(new OutputStreamWriter(output, StandardCharsets.UTF_8), true); - writer.append(stringBuilder.toString()).flush(); + writer.append("--").append(boundary).append("--").append(Utils.CRLF).flush(); } else { //picture data is "null". If it was sent, we send "null" to server to clear the image there //we send a normal request in HTTP POST @@ -214,19 +209,18 @@ HttpURLConnection connection(final Request request) throws IOException { return connection; } - void addMultipart(StringBuilder stringBuilder, String boundary, String contentType, String name, String value, byte[] file) throws IOException { - stringBuilder.append("--").append(boundary).append(Utils.CRLF); + void addMultipart(OutputStream output, PrintWriter writer, String boundary, String contentType, String name, String value, byte[] file) throws IOException { + writer.append("--").append(boundary).append(Utils.CRLF); if (file != null) { - stringBuilder.append("Content-Disposition: form-data; name=\"").append(name).append("\"; filename=\"").append(value).append("\"").append(Utils.CRLF); - stringBuilder.append("Content-Type: ").append(contentType).append(Utils.CRLF); - stringBuilder.append(Utils.CRLF); - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(file.length); - byteArrayOutputStream.write(file); - stringBuilder.append(byteArrayOutputStream.toString()); - stringBuilder.append(Utils.CRLF); + writer.append("Content-Disposition: form-data; name=\"").append(name).append("\"; filename=\"").append(value).append("\"").append(Utils.CRLF); + writer.append("Content-Type: ").append(contentType).append(Utils.CRLF); + writer.append(Utils.CRLF).flush(); + output.write(file); + output.flush(); + writer.append(Utils.CRLF).flush(); } else { - stringBuilder.append("Content-Disposition: form-data; name=\"").append(name).append("\"").append(Utils.CRLF); - stringBuilder.append(Utils.CRLF).append(value).append(Utils.CRLF); + writer.append("Content-Disposition: form-data; name=\"").append(name).append("\"").append(Utils.CRLF); + writer.append(Utils.CRLF).append(value).append(Utils.CRLF).flush(); } } From f481fe51f618601fb64f76aad69a65ed7d4d7197 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Tue, 16 Jan 2024 12:51:56 +0300 Subject: [PATCH 4/7] fix: test thingies --- .../java/ly/count/sdk/java/internal/ModuleUserProfile.java | 5 ++++- .../java/ly/count/sdk/java/internal/UserEditorTests.java | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleUserProfile.java b/sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleUserProfile.java index 4cc80afc..a11cf15c 100644 --- a/sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleUserProfile.java +++ b/sdk-java/src/main/java/ly/count/sdk/java/internal/ModuleUserProfile.java @@ -213,7 +213,10 @@ private Params prepareRequestParamsForUserProfile() { Params params = new Params(); final JSONObject json = new JSONObject(); perform(json, params); - params.add("user_details", json.toString()); + + if (!json.isEmpty() || params.has(PICTURE_BYTES) || params.has(PredefinedUserPropertyKeys.PICTURE_PATH)) { + params.add("user_details", json.toString()); + } return params; } diff --git a/sdk-java/src/test/java/ly/count/sdk/java/internal/UserEditorTests.java b/sdk-java/src/test/java/ly/count/sdk/java/internal/UserEditorTests.java index 964169da..6a4aed96 100644 --- a/sdk-java/src/test/java/ly/count/sdk/java/internal/UserEditorTests.java +++ b/sdk-java/src/test/java/ly/count/sdk/java/internal/UserEditorTests.java @@ -63,7 +63,7 @@ public void setPicturePath_localPath() { //set profile picture url and commit it sessionHandler(() -> Countly.instance().user().edit().setPicturePath(imgFile.getAbsolutePath()).commit()); validatePictureAndPath(imgFile.getAbsolutePath(), null); - validateUserDetailsRequestInRQ(TestUtils.map("picturePath", imgFile.getAbsolutePath())); + validateUserDetailsRequestInRQ(TestUtils.map("user_details", "{}", "picturePath", imgFile.getAbsolutePath())); } /** @@ -111,7 +111,7 @@ public void setPicture_binaryData() { sessionHandler(() -> Countly.instance().user().edit().setPicture(imgData).commit()); validatePictureAndPath(null, imgData); Countly.session().end(); - validateUserDetailsRequestInRQ(TestUtils.map(ModuleUserProfile.PICTURE_BYTES, Utils.Base64.encode(imgData))); + validateUserDetailsRequestInRQ(TestUtils.map("user_details", "{}", ModuleUserProfile.PICTURE_BYTES, Utils.Base64.encode(imgData))); } /** From 454a3531926b1290c14482eb9fe031f148987a21 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Tue, 16 Jan 2024 13:20:36 +0300 Subject: [PATCH 5/7] refactor: delete unsued func --- .../ly/count/sdk/java/internal/Transport.java | 28 +------------------ 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java b/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java index b766cacf..23c722e2 100644 --- a/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java +++ b/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java @@ -209,7 +209,7 @@ HttpURLConnection connection(final Request request) throws IOException { return connection; } - void addMultipart(OutputStream output, PrintWriter writer, String boundary, String contentType, String name, String value, byte[] file) throws IOException { + void addMultipart(OutputStream output, PrintWriter writer, final String boundary, final String contentType, String name, String value, byte[] file) throws IOException { writer.append("--").append(boundary).append(Utils.CRLF); if (file != null) { writer.append("Content-Disposition: form-data; name=\"").append(name).append("\"; filename=\"").append(value).append("\"").append(Utils.CRLF); @@ -496,30 +496,4 @@ public void checkServerTrusted(X509Certificate[] chain, String authType) throws public X509Certificate[] getAcceptedIssuers() { return new X509Certificate[0]; } - - private String setProfilePicturePathRequestParams(String path, Params params) { - Params tempParams = new Params(); - - tempParams.add("device_id", params.remove("device_id")); - tempParams.add("app_key", params.remove("app_key")); - tempParams.add("timestamp", params.remove("timestamp")); - tempParams.add("sdk_name", params.remove("sdk_name")); - tempParams.add("sdk_version", params.remove("sdk_version")); - tempParams.add("tz", params.remove("tz")); - tempParams.add("hour", params.remove("hour")); - tempParams.add("dow", params.remove("dow")); - tempParams.add("rr", params.remove("rr")); - - if (params.has("av")) { - tempParams.add("av", params.remove("av")); - } - //if no user details, add empty user details to indicate that we are sending a picture - if (!params.has("user_details")) { - tempParams.add("user_details", "{}"); - } else { - tempParams.add("user_details", params.remove("user_details")); - } - - return path + tempParams; - } } \ No newline at end of file From 8aaa88e400ac66258cbe04a6b93d0cebc565ca04 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Tue, 16 Jan 2024 15:08:54 +0300 Subject: [PATCH 6/7] fix: codacy final func param --- .../src/main/java/ly/count/sdk/java/internal/Transport.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java b/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java index 23c722e2..f275270f 100644 --- a/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java +++ b/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java @@ -209,7 +209,7 @@ HttpURLConnection connection(final Request request) throws IOException { return connection; } - void addMultipart(OutputStream output, PrintWriter writer, final String boundary, final String contentType, String name, String value, byte[] file) throws IOException { + void addMultipart(OutputStream output, PrintWriter writer, final String boundary, final String contentType, final String name, final String value, final byte[] file) throws IOException { writer.append("--").append(boundary).append(Utils.CRLF); if (file != null) { writer.append("Content-Disposition: form-data; name=\"").append(name).append("\"; filename=\"").append(value).append("\"").append(Utils.CRLF); From 5bb790b079eb1fc5d59702ec929f04799f6a535d Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Mon, 22 Jan 2024 17:42:36 +0300 Subject: [PATCH 7/7] fix: was not possible --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9baeb66b..884e46d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ * Fixed a bug where setting custom user properties would not work. * Fixed a bug where setting organization of the user would not work. +* Fixed a bug where sending a user profile picture with checksum was not possible. * Deprecated "Countly::backendMode()" call, use "Countly::backendM" instead via "instance()" call. * Deprecated "Usage::addLocation(double, double)" call, use "Countly::location::setLocation" instead via "instance()" call.