Skip to content

Commit

Permalink
refactor(analytocs): obfuscate android id
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-elimu committed Aug 26, 2024
1 parent bdfc51d commit f4f6e6a
Show file tree
Hide file tree
Showing 3 changed files with 462 additions and 456 deletions.
7 changes: 6 additions & 1 deletion src/main/java/ai/elimu/model/analytics/LearningEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ public void setTimestamp(Calendar timestamp) {
}

public String getAndroidId() {
return androidId;
if (!androidId.contains("***")) {
// Hide parts of the Android ID, e.g. "7161a85a0e4751cd" --> "7161***51cd"
return androidId.substring(0, 4) + "***" + androidId.substring(12);
} else {
return androidId;
}
}

public void setAndroidId(String androidId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public void handleRequest(
);

csvPrinter.flush();
csvPrinter.close();
}

String csvFileContent = stringWriter.toString();
Expand Down
Loading

0 comments on commit f4f6e6a

Please sign in to comment.