Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(analytics): obfuscate android id #1868

Merged
merged 4 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
jo-elimu marked this conversation as resolved.
Show resolved Hide resolved
}

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