Skip to content

Commit

Permalink
psd removal reordering bug fix - ios SDK
Browse files Browse the repository at this point in the history
Summary: reordered PSD filtering in ios SDK

Reviewed By: KylinChang

Differential Revision: D63471859

fbshipit-source-id: a68ef6d0b41e8a9df101e723dad90b60750bd28f
  • Loading branch information
adityac-meta authored and facebook-github-bot committed Sep 26, 2024
1 parent ee55c29 commit 629eb6f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions FBSDKCoreKit/FBSDKCoreKit/AppEvents/FBSDKAppEvents.m
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,17 @@ - (void) logEvent:(FBSDKAppEventName)eventName
return;
}


BOOL isProtectedModeApplied = (self.protectedModeManager && [FBSDKProtectedModeManager isProtectedModeAppliedWithParameters:parameters]);
if (!isProtectedModeApplied && self.sensitiveParamsManager) {
@try {
parameters = [self.sensitiveParamsManager processParameters:parameters eventName:eventName];
} @catch(NSException *exception) {
[self.logger singleShotLogEntry:FBSDKLoggingBehaviorAppEvents
logEntry:@"FBSDKAppEvents: caught exception while processing sensitiveParamsManager."];
}
}

if (self.macaRuleMatchingManager) {
@try {
parameters = [self.macaRuleMatchingManager processParameters:parameters event:eventName?:@""];
Expand Down Expand Up @@ -1156,19 +1167,14 @@ - (void) logEvent:(FBSDKAppEventName)eventName
// Filter out restrictive keys
parameters = [self.restrictiveDataFilterParameterProcessor processParameters:parameters
eventName:eventName];

// Filter out non-standard params
if (self.protectedModeManager) {
@try {
parameters = [self.protectedModeManager processParameters:parameters eventName:eventName];
} @catch(NSException *exception) {}
}

BOOL isProtectedModeApplied = (self.protectedModeManager && [FBSDKProtectedModeManager isProtectedModeAppliedWithParameters:parameters]);
if (!isProtectedModeApplied && self.sensitiveParamsManager) {
@try {
parameters = [self.sensitiveParamsManager processParameters:parameters eventName:eventName];
} @catch(NSException *exception) {}
}

NSMutableDictionary<FBSDKAppEventParameterName, id> *eventDictionary = [NSMutableDictionary dictionaryWithDictionary:parameters ?: @{}];
[FBSDKTypeUtility dictionary:eventDictionary setObject:eventName forKey:FBSDKAppEventParameterNameEventName];
Expand Down
2 changes: 1 addition & 1 deletion FBSDKCoreKit/FBSDKCoreKit/include/FBSDKFeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ typedef NS_ENUM(NSUInteger, FBSDKFeature) {
FBSDKFeatureIntelligentIntegrity = 0x01010402,
FBSDKFeatureModelRequest = 0x01010403,
FBSDKFeatureProtectedMode = 0x01010404,
FBSDKFeatureFilterSensitiveParams = 0x01010408,
FBSDKFeatureMACARuleMatching = 0x01010405,
FBSDKFeatureBlocklistEvents = 0x01010406,
FBSDKFeatureFilterRedactedEvents = 0x01010407,
FBSDKFeatureFilterSensitiveParams = 0x01010408,
FBSDKFeatureEventDeactivation = 0x01010500,
FBSDKFeatureSKAdNetwork = 0x01010600,
FBSDKFeatureSKAdNetworkConversionValue = 0x01010601,
Expand Down

0 comments on commit 629eb6f

Please sign in to comment.