Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Mansi-mParticle committed Nov 14, 2024
1 parent 4eb7566 commit 2e832ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
19 changes: 0 additions & 19 deletions android-core/src/main/java/com/mparticle/identity/IdentityApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -350,25 +350,6 @@ private void reset() {
}
}

private String generateHash(String input) {
try {
MessageDigest digest = MessageDigest.getInstance("SHA-256");
byte[] hashBytes = digest.digest(input.getBytes());

// Convert byte array to hex string
StringBuilder hexString = new StringBuilder();
for (byte b : hashBytes) {
String hex = Integer.toHexString(0xff & b);
if (hex.length() == 1) hexString.append('0');
hexString.append(hex);
}
return hexString.toString();
} catch (NoSuchAlgorithmException e) {
//throw new RuntimeException("Hashing algorithm not found", e);
}
return null;

}

private BaseIdentityTask makeIdentityRequest(IdentityApiRequest request, final IdentityNetworkRequestRunnable networkRequest) {
if (request == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public class MParticleIdentityClientImpl extends MParticleBaseClientImpl impleme
public final String LOGIN_CALL = "login";
public final String IDENTIFY_CALL = "identify";
final String IDENTITY_HEADER_TIMEOUT = "X-MP-Max-Age";
static Long maxAgeTimeForIdentityCache = 0L;
private Long maxAgeTimeForIdentityCache = 0L;
private Long maxAgeTime = 86400L;
Long identityCacheTime = 0L;
HashMap<String, IdentityHttpResponse> identityCacheArray = new HashMap<>();

Expand All @@ -87,7 +88,6 @@ public IdentityHttpResponse login(IdentityApiRequest request) throws JSONExcepti
if (existsResponse != null) {
return existsResponse;
}
Long maxAgeTime=86400L;
Logger.verbose("Identity login request: " + jsonObject.toString());
MPConnection connection = getPostConnection(LOGIN_PATH, jsonObject.toString());
String url = connection.getURL().toString();
Expand Down Expand Up @@ -127,7 +127,7 @@ public IdentityHttpResponse identify(IdentityApiRequest request) throws JSONExce
return existsResponse;
}
JSONObject jsonObject = getStateJson(request);
Long maxAgeTime=86400L;

Logger.verbose("Identity identify request: \n" + jsonObject.toString());
MPConnection connection = getPostConnection(IDENTIFY_PATH, jsonObject.toString());
String url = connection.getURL().toString();
Expand Down

0 comments on commit 2e832ca

Please sign in to comment.