Skip to content

Commit 90cb05c

Browse files
authored
Remove dynamic framework count from diagnostics. (#7311)
* Remove dynamic framework count from diagnostics. This was previously used to help determine if Firebase should switch to using dynamic frameworks, but now developers have the option themselves. Fixes #7310 * Added changelog * Style * Style
1 parent ac4d70e commit 90cb05c

File tree

3 files changed

+4
-42
lines changed

3 files changed

+4
-42
lines changed

Example/CoreDiagnostics/Tests/FIRCoreDiagnosticsTest.m

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ - (void)testProtoPopulation {
160160
});
161161
icoreConfiguration.using_gdt = 1;
162162
icoreConfiguration.has_using_gdt = 1;
163-
FIRPopulateProtoWithNumberOfLinkedFrameworks(&icoreConfiguration);
164163
FIRPopulateProtoWithInfoPlistValues(&icoreConfiguration);
165164
icoreConfiguration.configuration_type =
166165
logs_proto_mobilesdk_ios_ICoreConfiguration_ConfigurationType_CORE;
@@ -198,22 +197,7 @@ - (void)populateProto:(logs_proto_mobilesdk_ios_ICoreConfiguration *)config {
198197
config->has_app_count = 1;
199198
config->use_default_app = 1;
200199
config->has_use_default_app = 1;
201-
202-
int numFrameworks = -1; // Subtract the app binary itself.
203-
unsigned int numImages;
204-
const char **imageNames = objc_copyImageNames(&numImages);
205-
for (unsigned int i = 0; i < numImages; i++) {
206-
NSString *imageName = [NSString stringWithUTF8String:imageNames[i]];
207-
if ([imageName rangeOfString:@"System/Library"].length != 0 // Apple .frameworks
208-
|| [imageName rangeOfString:@"Developer/Library"].length != 0 // Xcode debug .frameworks
209-
|| [imageName rangeOfString:@"usr/lib"].length != 0) { // Public .dylibs
210-
continue;
211-
}
212-
numFrameworks++;
213-
}
214-
free(imageNames);
215-
config->dynamic_framework_count = numFrameworks;
216-
config->has_dynamic_framework_count = 1;
200+
config->has_dynamic_framework_count = 0; // Removed from payload.
217201
config->apple_framework_version = FIREncodeString(combinedVersions);
218202
NSString *minVersion = [[NSBundle mainBundle] infoDictionary][@"MinimumOSVersion"];
219203
if (minVersion) {

Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnostics.m

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
#ifdef FIREBASE_BUILD_ZIP_FILE
3939
static BOOL kUsingZipFile = YES;
40-
#else // FIREBASE_BUILD_ZIP_FILE
40+
#else // FIREBASE_BUILD_ZIP_FILE
4141
static BOOL kUsingZipFile = NO;
4242
#endif // FIREBASE_BUILD_ZIP_FILE
4343

@@ -454,29 +454,6 @@ void FIRPopulateProtoWithInstalledServices(logs_proto_mobilesdk_ios_ICoreConfigu
454454
config->sdk_service_installed_count = (int32_t)sdkServiceInstalledArray.count;
455455
}
456456

457-
/** Populates the proto with the number of linked frameworks.
458-
*
459-
* @param config The proto to populate.
460-
*/
461-
void FIRPopulateProtoWithNumberOfLinkedFrameworks(
462-
logs_proto_mobilesdk_ios_ICoreConfiguration *config) {
463-
int numFrameworks = -1; // Subtract the app binary itself.
464-
unsigned int numImages;
465-
const char **imageNames = objc_copyImageNames(&numImages);
466-
for (unsigned int i = 0; i < numImages; i++) {
467-
NSString *imageName = [NSString stringWithUTF8String:imageNames[i]];
468-
if ([imageName rangeOfString:@"System/Library"].length != 0 // Apple .frameworks
469-
|| [imageName rangeOfString:@"Developer/Library"].length != 0 // Xcode debug .frameworks
470-
|| [imageName rangeOfString:@"usr/lib"].length != 0) { // Public .dylibs
471-
continue;
472-
}
473-
numFrameworks++;
474-
}
475-
free(imageNames);
476-
config->dynamic_framework_count = numFrameworks;
477-
config->has_dynamic_framework_count = 1;
478-
}
479-
480457
/** Populates the proto with Info.plist values.
481458
*
482459
* @param config The proto to populate.
@@ -532,7 +509,6 @@ - (void)sendDiagnosticsData:(nonnull id<FIRCoreDiagnosticsData>)diagnosticsData
532509
FIRPopulateProtoWithInfoFromUserInfoParams(&icore_config, diagnosticObjects);
533510
FIRPopulateProtoWithCommonInfoFromApp(&icore_config, diagnosticObjects);
534511
FIRPopulateProtoWithInstalledServices(&icore_config);
535-
FIRPopulateProtoWithNumberOfLinkedFrameworks(&icore_config);
536512
FIRPopulateProtoWithInfoPlistValues(&icore_config);
537513
[self setHeartbeatFlagIfNeededToConfig:&icore_config];
538514

FirebaseCore/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Unreleased
2+
- [fixed] Fixed potential deadlock with objc_copyImageNames call. (#7310)
13
# Firebase 7.4.0
24
- [changed] Patch update to nanopb 0.3.9.7 that fixes a memory leak and other issues. (#7090)
35
- [added] Zip distribution now includes community supported macOS and tvOS libraries. Product

0 commit comments

Comments
 (0)