Skip to content

Commit 2e832ca

Browse files
Address review comments
1 parent 4eb7566 commit 2e832ca

File tree

2 files changed

+3
-22
lines changed

2 files changed

+3
-22
lines changed

android-core/src/main/java/com/mparticle/identity/IdentityApi.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -350,25 +350,6 @@ private void reset() {
350350
}
351351
}
352352

353-
private String generateHash(String input) {
354-
try {
355-
MessageDigest digest = MessageDigest.getInstance("SHA-256");
356-
byte[] hashBytes = digest.digest(input.getBytes());
357-
358-
// Convert byte array to hex string
359-
StringBuilder hexString = new StringBuilder();
360-
for (byte b : hashBytes) {
361-
String hex = Integer.toHexString(0xff & b);
362-
if (hex.length() == 1) hexString.append('0');
363-
hexString.append(hex);
364-
}
365-
return hexString.toString();
366-
} catch (NoSuchAlgorithmException e) {
367-
//throw new RuntimeException("Hashing algorithm not found", e);
368-
}
369-
return null;
370-
371-
}
372353

373354
private BaseIdentityTask makeIdentityRequest(IdentityApiRequest request, final IdentityNetworkRequestRunnable networkRequest) {
374355
if (request == null) {

android-core/src/main/java/com/mparticle/identity/MParticleIdentityClientImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ public class MParticleIdentityClientImpl extends MParticleBaseClientImpl impleme
6969
public final String LOGIN_CALL = "login";
7070
public final String IDENTIFY_CALL = "identify";
7171
final String IDENTITY_HEADER_TIMEOUT = "X-MP-Max-Age";
72-
static Long maxAgeTimeForIdentityCache = 0L;
72+
private Long maxAgeTimeForIdentityCache = 0L;
73+
private Long maxAgeTime = 86400L;
7374
Long identityCacheTime = 0L;
7475
HashMap<String, IdentityHttpResponse> identityCacheArray = new HashMap<>();
7576

@@ -87,7 +88,6 @@ public IdentityHttpResponse login(IdentityApiRequest request) throws JSONExcepti
8788
if (existsResponse != null) {
8889
return existsResponse;
8990
}
90-
Long maxAgeTime=86400L;
9191
Logger.verbose("Identity login request: " + jsonObject.toString());
9292
MPConnection connection = getPostConnection(LOGIN_PATH, jsonObject.toString());
9393
String url = connection.getURL().toString();
@@ -127,7 +127,7 @@ public IdentityHttpResponse identify(IdentityApiRequest request) throws JSONExce
127127
return existsResponse;
128128
}
129129
JSONObject jsonObject = getStateJson(request);
130-
Long maxAgeTime=86400L;
130+
131131
Logger.verbose("Identity identify request: \n" + jsonObject.toString());
132132
MPConnection connection = getPostConnection(IDENTIFY_PATH, jsonObject.toString());
133133
String url = connection.getURL().toString();

0 commit comments

Comments
 (0)