summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/Pods/FirebaseCrashlytics/Crashlytics/Shared/FIRCLSMachO/FIRCLSMachOSlice.m
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-08-31 23:07:20 +0200
committerJules Laplace <julescarbon@gmail.com>2020-08-31 23:07:20 +0200
commit22721a013bdd10d5eb395ba18453585f5f3f1f7f (patch)
tree5a920e31d6026ed5dc55265e5fd057febccc50e3 /StoneIsland/platforms/ios/Pods/FirebaseCrashlytics/Crashlytics/Shared/FIRCLSMachO/FIRCLSMachOSlice.m
parentd22d51a1ae49680015326857360eb699f31efced (diff)
rebuild the ios platform and the plugins
Diffstat (limited to 'StoneIsland/platforms/ios/Pods/FirebaseCrashlytics/Crashlytics/Shared/FIRCLSMachO/FIRCLSMachOSlice.m')
-rw-r--r--StoneIsland/platforms/ios/Pods/FirebaseCrashlytics/Crashlytics/Shared/FIRCLSMachO/FIRCLSMachOSlice.m93
1 files changed, 93 insertions, 0 deletions
diff --git a/StoneIsland/platforms/ios/Pods/FirebaseCrashlytics/Crashlytics/Shared/FIRCLSMachO/FIRCLSMachOSlice.m b/StoneIsland/platforms/ios/Pods/FirebaseCrashlytics/Crashlytics/Shared/FIRCLSMachO/FIRCLSMachOSlice.m
new file mode 100644
index 00000000..d28626b8
--- /dev/null
+++ b/StoneIsland/platforms/ios/Pods/FirebaseCrashlytics/Crashlytics/Shared/FIRCLSMachO/FIRCLSMachOSlice.m
@@ -0,0 +1,93 @@
+// Copyright 2019 Google
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#import "Crashlytics/Shared/FIRCLSMachO/FIRCLSMachOSlice.h"
+
+#include <mach-o/loader.h>
+
+// this is defined only if __OPEN_SOURCE__ is *not* defined in the TVOS SDK's mach-o/loader.h
+// also, it has not yet made it back to the OSX SDKs, for example
+#ifndef LC_VERSION_MIN_TVOS
+#define LC_VERSION_MIN_TVOS 0x2F
+#endif
+
+@implementation FIRCLSMachOSlice
+
++ (id)runningSlice {
+ struct FIRCLSMachOSlice slice;
+
+ slice = FIRCLSMachOSliceGetCurrent();
+
+ return [[self alloc] initWithSlice:&slice];
+}
+
+@synthesize minimumOSVersion = _minimumOSVersion;
+@synthesize linkedSDKVersion = _linkedSDKVersion;
+
+- (id)initWithSlice:(FIRCLSMachOSliceRef)sliceRef {
+ self = [super init];
+ if (self) {
+ NSMutableArray* dylibs;
+
+ _slice = *sliceRef;
+
+ _minimumOSVersion.major = 0;
+ _minimumOSVersion.minor = 0;
+ _minimumOSVersion.bugfix = 0;
+
+ _linkedSDKVersion.major = 0;
+ _linkedSDKVersion.minor = 0;
+ _linkedSDKVersion.bugfix = 0;
+
+ dylibs = [NSMutableArray array];
+
+ FIRCLSMachOSliceEnumerateLoadCommands(
+ &_slice, ^(uint32_t type, uint32_t size, const struct load_command* cmd) {
+ switch (type) {
+ case LC_UUID:
+ self->_uuidString =
+ [FIRCLSMachONormalizeUUID((CFUUIDBytes*)FIRCLSMachOGetUUID(cmd)) copy];
+ break;
+ case LC_LOAD_DYLIB:
+ [dylibs addObject:[NSString stringWithUTF8String:FIRCLSMachOGetDylibPath(cmd)]];
+ break;
+ case LC_VERSION_MIN_IPHONEOS:
+ case LC_VERSION_MIN_MACOSX:
+ case LC_VERSION_MIN_WATCHOS:
+ case LC_VERSION_MIN_TVOS:
+ self->_minimumOSVersion = FIRCLSMachOGetMinimumOSVersion(cmd);
+ self->_linkedSDKVersion = FIRCLSMachOGetLinkedSDKVersion(cmd);
+ break;
+ }
+ });
+
+ _linkedDylibs = [dylibs copy];
+ }
+
+ return self;
+}
+
+- (NSString*)architectureName {
+ return [NSString stringWithUTF8String:FIRCLSMachOSliceGetArchitectureName(&_slice)];
+}
+
+- (NSString*)uuid {
+ return _uuidString;
+}
+
+- (NSArray*)linkedDylibs {
+ return _linkedDylibs;
+}
+
+@end