Skip to content

Commit

Permalink
Remove md5 checksum
Browse files Browse the repository at this point in the history
Summary: We were using MD5 checksum to for event name integrity, but this is not necessary now, and we can remove it.

Reviewed By: sway-git, ryantobinmeta

Differential Revision: D61683842

fbshipit-source-id: 436d6177803f269dfd6872cc06d89145c0331c01
  • Loading branch information
Zilin Zhang authored and facebook-github-bot committed Aug 23, 2024
1 parent 22083fb commit 4c70d8d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ class AppEvent : Serializable {
}

eventObject.put(Constants.EVENT_NAME_EVENT_KEY, finalEventName)
eventObject.put(Constants.EVENT_NAME_MD5_EVENT_KEY, md5Checksum(finalEventName))
eventObject.put(Constants.LOG_TIME_APP_EVENT_KEY, System.currentTimeMillis() / 1000)
eventObject.put("_ui", contextName)
if (currentSessionId != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ package com.facebook.appevents.internal
object Constants {
const val LOG_TIME_APP_EVENT_KEY = "_logTime"
const val EVENT_NAME_EVENT_KEY = "_eventName"
const val EVENT_NAME_MD5_EVENT_KEY = "_eventName_md5"

// The following are for Automatic Analytics events and parameters
const val AA_TIME_SPENT_EVENT_NAME = "fb_aa_time_spent_on_view"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ class AppEventTest : FacebookPowerMockTestCase() {
whenever(FacebookSdk.isInitialized()).thenReturn(true)
}

@Test
fun testChecksumOfAppEventName() {
val appEvent = AppEventTestUtilities.getTestAppEvent()
val eventNameMd5 = appEvent.getJSONObject().getString(Constants.EVENT_NAME_MD5_EVENT_KEY)
assertThat(eventNameMd5).isEqualTo("e0cf6877da9df873a85a2137fb5d2e26")
}

@Test
fun testChecksumOfAppEvent() {
val appEvent = AppEventTestUtilities.getTestAppEvent()
Expand Down

0 comments on commit 4c70d8d

Please sign in to comment.