Fix a few NSKeyedUnarchiver validateAllowedClass Warnings in Xcode Console

Summary:
Running the tests no longer shows these warnings.

Fixed the following warnings when running FBSDKAppEventsStateManagerTests.testPersistingValidState and FBSDKAppEventsTests.testFetchingConfigurationIncludingCertainFeatures

```
Attempted to decode a collection type 'NSString' (subclass of 'NSObject') for key 'NS.keys'. 'NSString' requires its subclasses to be explicitly added to the allowed classes list but it is not present.
allowed unarchiving safe plist type ''NSNumber' (0x7fff863021c8) [/Applications/Xcode_13.0.0_fb.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework]' for key 'NS.objects', even though it was not explicitly included in the client allowed classes set
```

Reviewed By: joesus

Differential Revision: D32606181

fbshipit-source-id: e095005a1904c9b1996df0c3c0ea96482def88de
This commit is contained in:
Jawwad Ahmad
2021-11-22 16:56:31 -08:00
committed by Facebook GitHub Bot
parent 34cf89b3f6
commit a38207417b
2 changed files with 2 additions and 1 deletions

View File

@@ -68,7 +68,7 @@ static NSArray<id<FBSDKEventsProcessing>> *_eventProcessors;
NSString *appID = [decoder decodeObjectOfClass:NSString.class forKey:FBSDK_APPEVENTSSTATE_APPID_KEY];
NSString *tokenString = [decoder decodeObjectOfClass:NSString.class forKey:FBSDK_APPEVENTSSTATE_TOKENSTRING_KEY];
NSArray *events = [FBSDKTypeUtility arrayValue:[decoder decodeObjectOfClasses:
[NSSet setWithArray:@[NSArray.class, NSDictionary.class]]
[NSSet setWithArray:@[NSArray.class, NSDictionary.class, NSString.class, NSNumber.class]]
forKey:FBSDK_APPEVENTSSTATE_EVENTS_KEY]];
NSUInteger numSkipped = [[decoder decodeObjectOfClass:NSNumber.class forKey:FBSDK_APPEVENTSSTATE_NUMSKIPPED_KEY] unsignedIntegerValue];

View File

@@ -474,6 +474,7 @@ static char *const dispatchQueueLabel = "com.facebook.appevents.AEM.FBAEMReporte
NSSet<Class> *classes = [NSSet setWithArray:@[
NSMutableDictionary.class,
NSMutableArray.class,
NSString.class,
FBAEMConfiguration.class,
FBAEMRule.class,
FBAEMEvent.class]];