






#import "MiddleInfo.h"
#import "DegreeNearConfig.h"
#import "MoleItalicsAddressInvertedProximity.h"

@import AdSupport;
@import AppTrackingTransparency;
@import UIKit;

#import <CoreTelephony/CTTelephonyNetworkInfo.h>
#import <CoreTelephony/CTCarrier.h>
#import <SystemConfiguration/SystemConfiguration.h>

#import "sys/utsname.h" //utsname


#import <AdServices/AdServices.h>

@implementation MiddleInfo

+ (UIImage *)beenDecisionLambdaGlobalAdjustedImage {
    NSDictionary *whoOunces = [[NSBundle mainBundle] infoDictionary];
    NSString *icon = [[whoOunces valueForKeyPath:@"CFBundleIcons.CFBundlePrimaryIcon.CFBundleIconFiles"] lastObject];
    return [UIImage imageNamed:icon];
}

+ (NSString *)noiseMuteAliveIdentifier {
    return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"];
}

+ (NSString *)returnsPresentedOutsideLoopsDaily {
    return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
}

+ (NSString *)bodyTextName {
    NSString *displayName = [[NSBundle mainBundle] localizedInfoDictionary][@"CFBundleDisplayName"];

    if (!displayName) {
        displayName = [[NSBundle mainBundle] infoDictionary][@"CFBundleDisplayName"];
    }

    if (!displayName) {
        displayName = [[NSBundle mainBundle] infoDictionary][@"CFBundleName"];
    }

    return displayName;
}

+ (NSString *)mapShowCubeName {
    return [UIDevice currentDevice].name;
}

+ (NSString *)createdDetailsFailConsumerSymbols {
    return [ASIdentifierManager sharedManager].advertisingIdentifier.UUIDString;
}

+ (NSString *)advertiseEmergencyUpperEggAffiliate {
    return [UIDevice currentDevice].identifierForVendor.UUIDString;
}

+ (NSString *)nowMillAwayModel {
    struct utsname systemInfo;
    uname(&systemInfo);
    NSString *deviceModel = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
    return deviceModel;
}

+ (NSString *)illFullyThirdSamplerAbsolute {
    return [UIDevice currentDevice].systemVersion;
}

+ (NSString *)schedulerEightTapWinPackagePath {
    return NSHomeDirectory().lastPathComponent;
}

+ (BOOL)forBaselinesEnsureDemandKeys {
    CTTelephonyNetworkInfo *info = [[CTTelephonyNetworkInfo alloc] init];
    NSDictionary<NSString *, CTCarrier *> *evictSin = info.serviceSubscriberCellularProviders;
    if (evictSin.count == 0) {
        return NO;
    }
    NSDictionary<NSString *, NSString *> *shakeExecute = info.serviceCurrentRadioAccessTechnology; 
    for (NSString *boostGasp in evictSin.allKeys) {
        CTCarrier *carrier = evictSin[boostGasp];
        if (!carrier) { continue; }
        NSString *hit = carrier.mobileCountryCode ?: @"";
        NSString *odd = carrier.mobileNetworkCode ?: @"";
        NSInteger oldRed = hit.integerValue;
        NSInteger purple = odd.integerValue;
        BOOL peerEast = (hit.length > 0) && (oldRed > 0);
        BOOL thinCell = (odd.length > 0) && (purple > 0);
        NSString *bar = shakeExecute[boostGasp];
        BOOL penOur = (bar.length > 0);
        if (peerEast && thinCell && penOur) {
            return YES;
        }
    }
    return NO;
}

+ (NSString *)passSurfaceToken {
    
    if (@available(iOS 14.3, *)) {
        NSError *error = nil;
        NSString *token = [AAAttribution attributionTokenWithError:&error];
        
        if (token) {
            
            
            return token;
        } else {
            
            return @"";
        }
    } else {
        
        return @"";
    }
}


+ (void)kinEraserEllipsePublishIndigoCluster:(void (^)(void))albumHit {
    static dispatch_once_t rareToken;
    static BOOL useIllSupply = NO;

    
    if (useIllSupply) {
        SoundInfo(awayWrapShe.supplyDogDaysPubSpecifierPressesPage);
        return;
    }	

    dispatch_once(&rareToken, ^{
        useIllSupply = YES;
        SoundInfo(awayWrapShe.triangleLigatureHourlyPenForeverPromotion);

        if (@available(iOS 14, *)) {
            ATTrackingManagerAuthorizationStatus status = [ATTrackingManager trackingAuthorizationStatus];

            NSString *fairIndoor = [self eulerBriefFormStatus:status];

            SoundInfo(awayWrapShe.versionsEffectBlackProceedHisSocket, fairIndoor, (long)status);

            switch (status) {
                case ATTrackingManagerAuthorizationStatusAuthorized:
                    SoundInfo(awayWrapShe.disablesMakeDegradedMakerFlowKeyIncoming);
                    useIllSupply = NO;
                    if (albumHit) {
                        albumHit();
                    }
                    break;

                case ATTrackingManagerAuthorizationStatusDenied:
                    SoundInfo(awayWrapShe.lambdaTapMatchUppercaseChat);
                    useIllSupply = NO;
                    if (albumHit) {
                        albumHit();
                    }
                    break;

                case ATTrackingManagerAuthorizationStatusRestricted:
                    SoundInfo(awayWrapShe.toneWaitLostIndexingSubmitLocale);
                    useIllSupply = NO;
                    if (albumHit) {
                        albumHit();
                    }
                    break;

                case ATTrackingManagerAuthorizationStatusNotDetermined:
                    SoundInfo(awayWrapShe.stackKilobytesEmptySiteUnableOpt);
                    [self warpCarbonBeginningClimbingFathomsMarginLibraries:^{
                        useIllSupply = NO;
                        if (albumHit) {
                            albumHit();
                        }
                    }];
                    break;
            }
        } else {
            SoundInfo(awayWrapShe.languageEvaluatePasteWorldPagerVolume);
            useIllSupply = NO;
            if (albumHit) {
                albumHit();
            }
        }
    });
}

+ (void)warpCarbonBeginningClimbingFathomsMarginLibraries:(void (^)(void))completion {
    SoundInfo(awayWrapShe.canonPubOrnamentSixInternalHalf);

    
    static int themeDayMask = 6;

    __block id bitsAtom = [[NSNotificationCenter defaultCenter]
        addObserverForName:UIApplicationDidBecomeActiveNotification
                    object:nil
                     queue:[NSOperationQueue mainQueue]
                usingBlock:^(NSNotification *notification) {

        SoundInfo(awayWrapShe.resizeTrainerMayHumidityWorkoutTruncate, themeDayMask);

        
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(themeDayMask * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{


            UIApplicationState currentState = [UIApplication sharedApplication].applicationState;

            NSString *halfWelsh = [self detectorTeluguState:currentState];

            SoundInfo(awayWrapShe.collapsedKinBuiltFrameBoxWhite, halfWelsh);

            if (currentState == UIApplicationStateActive) {
                SoundInfo(awayWrapShe.denyArcadeUptimeCompoundMapActualChamber);
                [self toggleRevertRequest:completion];
            } else {

                SoundInfo(awayWrapShe.maximumUpperLessIndianWarpCommon, halfWelsh);
                SoundInfo(awayWrapShe.multiplyDryOccurredKelvinSilentIll);
                bitsAtom = [[NSNotificationCenter defaultCenter]
                    addObserverForName:UIApplicationDidBecomeActiveNotification
                                object:nil
                                 queue:[NSOperationQueue mainQueue]
                            usingBlock:^(NSNotification *notification) {
                    
                    SoundInfo(awayWrapShe.forbidLocaleStoneCyrillicOwnModern);
                    [[NSNotificationCenter defaultCenter] removeObserver:bitsAtom];
                    SoundInfo(awayWrapShe.answerCentralsRevertingResponseNiacinWorldWait);
                    [self toggleRevertRequest:completion];
                }];
            }

        });

        SoundInfo(awayWrapShe.decomposeRecognizeButtonAlongMagnitudeArts);
        
        [[NSNotificationCenter defaultCenter] removeObserver:bitsAtom];
    }];
}

+ (void)toggleRevertRequest:(void (^)(void))completion {
    if (@available(iOS 14, *)) {
        SoundInfo(awayWrapShe.pageTipDecodeSeekingWetStale);

        [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
            ATTrackingManagerAuthorizationStatus fathomsStatus = [ATTrackingManager trackingAuthorizationStatus];

            NSString *literalNothingShowersPresentPast = [self eulerBriefFormStatus:status];
            NSString *emailLockColumnsChangedBetter = [self eulerBriefFormStatus:fathomsStatus];

            SoundInfo(awayWrapShe.deepBasePacketsBedAuditLeaky);
            SoundInfo(awayWrapShe.ellipsisRankNoteJumpTrackAdjective, literalNothingShowersPresentPast, (long)status);
            SoundInfo(awayWrapShe.firmwareCapturingColorOverPhotosIdenticalPager, emailLockColumnsChangedBetter, (long)fathomsStatus);

            
            
            
            
            BOOL sunProducing = (fathomsStatus == ATTrackingManagerAuthorizationStatusAuthorized) ||
                               (status == ATTrackingManagerAuthorizationStatusAuthorized);

            if (sunProducing) {
                SoundInfo(awayWrapShe.compressShortcutChatterTopLexiconInuitWet);
                if (completion) {
                    completion();
                }
            } else if (fathomsStatus == ATTrackingManagerAuthorizationStatusNotDetermined) {
                SoundInfo(awayWrapShe.overrideAppendedElderLightWayExpiredWon);
                [self mediumQuantizeExecLowBuddyCourseSystem:completion midWonPenGenre:0];
            } else {
                SoundInfo(awayWrapShe.blackKilogramsCurrencyClangAchievedNotUnion);
                if (completion) {
                    completion();
                }
            }
        }];
    }
}


+ (NSString *)eulerBriefFormStatus:(ATTrackingManagerAuthorizationStatus)status  API_AVAILABLE(ios(14)){
    if (@available(iOS 14, *)) {
        switch (status) {
            case ATTrackingManagerAuthorizationStatusNotDetermined:
                return awayWrapShe.assistiveSamplerPinchTabWaxLogoTap;
            case ATTrackingManagerAuthorizationStatusRestricted:
                return awayWrapShe.disablingVisiblePasteIssuerToneFactor;
            case ATTrackingManagerAuthorizationStatusDenied:
                return awayWrapShe.compressSpellSeventeenEffectiveEndStarting;
            case ATTrackingManagerAuthorizationStatusAuthorized:
                return awayWrapShe.figurePrologFavoritesUnboundMenSigma;
            default:
                return [NSString stringWithFormat:awayWrapShe.dividingLogBlurScrollingRowExclusive, (long)status];
        }
    }
    return awayWrapShe.agePascalMetabolicAbortedCallbacksHandlerCommon;
}

+ (NSString *)detectorTeluguState:(UIApplicationState)state {
    switch (state) {
        case UIApplicationStateActive:
            return awayWrapShe.boldLiveDelayWinMildLate;
        case UIApplicationStateInactive:
            return awayWrapShe.useLocalFirstHeadphoneWasGuest;
        case UIApplicationStateBackground:
            return awayWrapShe.wrappedInsulinComposerArmSobAngular;
        default:
            return [NSString stringWithFormat:awayWrapShe.lookFitSaturateTimeBarrierHosting, (long)state];
    }
}


+ (void)mediumQuantizeExecLowBuddyCourseSystem:(void (^)(void))albumHit midWonPenGenre:(NSInteger)midWonPenGenre {
    NSInteger alarmCount = 10;

    if (@available(iOS 14, *)) {
        ATTrackingManagerAuthorizationStatus fathomsStatus = [ATTrackingManager trackingAuthorizationStatus];

        NSString *fairIndoor = [self eulerBriefFormStatus:fathomsStatus];

        SoundInfo(awayWrapShe.spokenButFocusingMostlyCollectorEquality,
              (long)(midWonPenGenre + 1), (long)alarmCount, fairIndoor);

        
        if (fathomsStatus == ATTrackingManagerAuthorizationStatusNotDetermined && midWonPenGenre < alarmCount) {
            SoundInfo(awayWrapShe.fitEndpointBinCityProminentNow, (long)(midWonPenGenre + 2));

            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0f * NSEC_PER_SEC)),
                          dispatch_get_main_queue(), ^{
                [self mediumQuantizeExecLowBuddyCourseSystem:albumHit midWonPenGenre:midWonPenGenre + 1];
            });
            return;
        } else {
            
            
            if (midWonPenGenre >= alarmCount) {
                SoundInfo(awayWrapShe.maximumDebuggingIdleHandshakeRawPlural, (long)alarmCount);
                SoundInfo(awayWrapShe.unsafeAdaptiveTexturedItsCallingAccurate, fairIndoor);
            } else {
                SoundInfo(awayWrapShe.adjustedGurationPrefixesYiddishSiteAllocator, fairIndoor);

                if (fathomsStatus == ATTrackingManagerAuthorizationStatusAuthorized) {
                    SoundInfo(awayWrapShe.exponentBlinkEsperantoUniformSockPotassium);
                } else if (fathomsStatus == ATTrackingManagerAuthorizationStatusDenied) {
                    SoundInfo(awayWrapShe.normalizeApplierProcessedNearestAccessingNanograms);
                } else if (fathomsStatus == ATTrackingManagerAuthorizationStatusRestricted) {
                    SoundInfo(awayWrapShe.decigramsSawPastReceiveAdapterLeaky);
                }
            }

            SoundInfo(awayWrapShe.centerEarlyHueEstonianNoneBrand);
            if (albumHit) {
                albumHit();
            }
        }
    } else {
        SoundInfo(awayWrapShe.synthesisPashtoAltitudeExposureSideAppearsSin);
        if (albumHit) {
            albumHit();
        }
    }
}
@end
