From 4c70d8d713f6eacce4af09986502309ce9547ab2 Mon Sep 17 00:00:00 2001 From: Zilin Zhang Date: Fri, 23 Aug 2024 10:37:41 -0700 Subject: [PATCH] Remove md5 checksum 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 --- .../src/main/java/com/facebook/appevents/AppEvent.kt | 1 - .../main/java/com/facebook/appevents/internal/Constants.kt | 1 - .../src/test/kotlin/com/facebook/appevents/AppEventTest.kt | 7 ------- 3 files changed, 9 deletions(-) diff --git a/facebook-core/src/main/java/com/facebook/appevents/AppEvent.kt b/facebook-core/src/main/java/com/facebook/appevents/AppEvent.kt index 1c8d333f18..c4542fa1ea 100644 --- a/facebook-core/src/main/java/com/facebook/appevents/AppEvent.kt +++ b/facebook-core/src/main/java/com/facebook/appevents/AppEvent.kt @@ -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) { diff --git a/facebook-core/src/main/java/com/facebook/appevents/internal/Constants.kt b/facebook-core/src/main/java/com/facebook/appevents/internal/Constants.kt index e5b95d997e..5f9c76167d 100644 --- a/facebook-core/src/main/java/com/facebook/appevents/internal/Constants.kt +++ b/facebook-core/src/main/java/com/facebook/appevents/internal/Constants.kt @@ -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" diff --git a/facebook-core/src/test/kotlin/com/facebook/appevents/AppEventTest.kt b/facebook-core/src/test/kotlin/com/facebook/appevents/AppEventTest.kt index bb6c4cee2a..ace00aa6cb 100644 --- a/facebook-core/src/test/kotlin/com/facebook/appevents/AppEventTest.kt +++ b/facebook-core/src/test/kotlin/com/facebook/appevents/AppEventTest.kt @@ -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()