<commit_before>#import "AppInfo.h"
#import "Common.h"
#import "EAGLView.h"
#import "LocalNotificationManager.h"
#import "LocationManager.h"
#import "MapsAppDelegate.h"
#import "MapViewController.h"
#import "MWMAlertViewController.h"
#import "MWMAuthorizationCommon.h"
#import "MWMController.h"
#import "MWMFrameworkListener.h"
#import "MWMFrameworkObservers.h"
#import "MWMTextToSpeech.h"
#import "Preferences.h"
#import "RouteState.h"
#import "Statistics.h"
#import "UIColor+MapsMeColor.h"
#import "UIFont+MapsMeFonts.h"
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <Parse/Parse.h>
#import <ParseFacebookUtilsV4/PFFacebookUtils.h>

#import "3party/Alohalytics/src/alohalytics_objc.h"

#include <sys/xattr.h>

#include "base/sunrise_sunset.hpp"
#include "indexer/osm_editor.hpp"
#include "map/gps_tracker.hpp"
#include "platform/http_thread_apple.h"
#include "platform/settings.hpp"
#include "platform/platform.hpp"
#include "platform/preferred_languages.hpp"
#include "std/target_os.hpp"
#include "storage/storage_defines.hpp"

// If you have a "missing header error" here, then please run configure.sh script in the root repo folder.
#import "../../../private.h"

#ifdef OMIM_PRODUCTION

#import <Crashlytics/Crashlytics.h>
#import <Fabric/Fabric.h>
#import <HockeySDK/HockeySDK.h>

#endif

extern NSString * const MapsStatusChangedNotification = @"MapsStatusChangedNotification";
// Alert keys.
static NSString * const kUDLastLaunchDateKey = @"LastLaunchDate";
extern NSString * const kUDAlreadyRatedKey = @"UserAlreadyRatedApp";
static NSString * const kUDSessionsCountKey = @"SessionsCount";
static NSString * const kUDFirstVersionKey = @"FirstVersion";
static NSString * const kUDLastRateRequestDate = @"LastRateRequestDate";
extern NSString * const kUDAlreadySharedKey = @"UserAlreadyShared";
static NSString * const kUDLastShareRequstDate = @"LastShareRequestDate";
static NSString * const kUDAutoNightModeOff = @"AutoNightModeOff";
static NSString * const kPushDeviceTokenLogEvent = @"iOSPushDeviceToken";
static NSString * const kIOSIDFA = @"IFA";
static NSString * const kBundleVersion = @"BundleVersion";

extern string const kCountryCodeKey;
extern string const kUniqueIdKey;
extern string const kLanguageKey;
extern NSString * const kUserDefaultsTTSLanguageBcp47;
extern NSString * const kUserDafaultsNeedToEnableTTS;

extern char const * kAdServerForbiddenKey;

/// Adds needed localized strings to C++ code
/// @TODO Refactor localization mechanism to make it simpler
void InitLocalizedStrings()
{
  Framework & f = GetFramework();
  // Texts on the map screen when map is not downloaded or is downloading
  f.AddString("country_status_added_to_queue", [L(@"country_status_added_to_queue") UTF8String]);
  f.AddString("country_status_downloading", [L(@"country_status_downloading") UTF8String]);
  f.AddString("country_status_download", [L(@"country_status_download") UTF8String]);
  f.AddString("country_status_download_without_routing", [L(@"country_status_download_without_routing") UTF8String]);
  f.AddString("country_status_download_failed", [L(@"country_status_download_failed") UTF8String]);
  f.AddString("cancel", [L(@"cancel") UTF8String]);
  f.AddString("try_again", [L(@"try_again") UTF8String]);
  // Default texts for bookmarks added in C++ code (by URL Scheme API)
  f.AddString("dropped_pin", [L(@"dropped_pin") UTF8String]);
  f.AddString("my_places", [L(@"my_places") UTF8String]);
  f.AddString("my_position", [L(@"my_position") UTF8String]);
  f.AddString("routes", [L(@"routes") UTF8String]);
  f.AddString("wifi", L(@"wifi").UTF8String);

  f.AddString("routing_failed_unknown_my_position", [L(@"routing_failed_unknown_my_position") UTF8String]);
  f.AddString("routing_failed_has_no_routing_file", [L(@"routing_failed_has_no_routing_file") UTF8String]);
  f.AddString("routing_failed_start_point_not_found", [L(@"routing_failed_start_point_not_found") UTF8String]);
  f.AddString("routing_failed_dst_point_not_found", [L(@"routing_failed_dst_point_not_found") UTF8String]);
  f.AddString("routing_failed_cross_mwm_building", [L(@"routing_failed_cross_mwm_building") UTF8String]);
  f.AddString("routing_failed_route_not_found", [L(@"routing_failed_route_not_found") UTF8String]);
  f.AddString("routing_failed_internal_error", [L(@"routing_failed_internal_error") UTF8String]);
}

void InitCrashTrackers()
{
#ifdef OMIM_PRODUCTION
  if (![Statistics isStatisticsEnabled])
    return;

  NSString * hockeyKey = @(HOCKEY_APP_KEY);
  if (hockeyKey.length != 0)
  {
    // Initialize Hockey App SDK.
    BITHockeyManager * hockeyManager = [BITHockeyManager sharedHockeyManager];
    [hockeyManager configureWithIdentifier:hockeyKey];
    [hockeyManager.crashManager setCrashManagerStatus: BITCrashManagerStatusAutoSend];
    [hockeyManager startManager];
  }

  NSString * fabricKey = @(CRASHLYTICS_IOS_KEY);
  if (fabricKey.length != 0)
  {
    // Initialize Fabric/Crashlytics SDK.
    [Fabric with:@[[Crashlytics class]]];
  }
#endif
}

using namespace osm_auth_ios;

@interface MapsAppDelegate () <MWMFrameworkStorageObserver>

@property (nonatomic) NSInteger standbyCounter;

@property (weak, nonatomic) NSTimer * checkAdServerForbiddenTimer;
@property (weak, nonatomic) NSTimer * mapStyleSwitchTimer;

@property (nonatomic, readwrite) LocationManager * locationManager;<commit_msg>[new downloader] iOS build bugfix.<commit_after>#import "AppInfo.h"
#import "Common.h"
#import "EAGLView.h"
#import "LocalNotificationManager.h"
#import "LocationManager.h"
#import "MapsAppDelegate.h"
#import "MapViewController.h"
#import "MWMAlertViewController.h"
#import "MWMAuthorizationCommon.h"
#import "MWMController.h"
#import "MWMFrameworkListener.h"
#import "MWMFrameworkObservers.h"
#import "MWMTextToSpeech.h"
#import "Preferences.h"
#import "RouteState.h"
#import "Statistics.h"
#import "UIColor+MapsMeColor.h"
#import "UIFont+MapsMeFonts.h"
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <Parse/Parse.h>
#import <ParseFacebookUtilsV4/PFFacebookUtils.h>

#import "3party/Alohalytics/src/alohalytics_objc.h"

#include <sys/xattr.h>

#include "base/sunrise_sunset.hpp"
#include "indexer/osm_editor.hpp"
#include "map/gps_tracker.hpp"
#include "platform/http_thread_apple.h"
#include "platform/settings.hpp"
#include "platform/platform.hpp"
#include "platform/preferred_languages.hpp"
#include "std/target_os.hpp"
#include "storage/storage_defines.hpp"

// If you have a "missing header error" here, then please run configure.sh script in the root repo folder.
#import "../../../private.h"

#ifdef OMIM_PRODUCTION

#import <Crashlytics/Crashlytics.h>
#import <Fabric/Fabric.h>
#import <HockeySDK/HockeySDK.h>

#endif

extern NSString * const MapsStatusChangedNotification = @"MapsStatusChangedNotification";
// Alert keys.
static NSString * const kUDLastLaunchDateKey = @"LastLaunchDate";
extern NSString * const kUDAlreadyRatedKey = @"UserAlreadyRatedApp";
static NSString * const kUDSessionsCountKey = @"SessionsCount";
static NSString * const kUDFirstVersionKey = @"FirstVersion";
static NSString * const kUDLastRateRequestDate = @"LastRateRequestDate";
extern NSString * const kUDAlreadySharedKey = @"UserAlreadyShared";
static NSString * const kUDLastShareRequstDate = @"LastShareRequestDate";
static NSString * const kUDAutoNightModeOff = @"AutoNightModeOff";
static NSString * const kPushDeviceTokenLogEvent = @"iOSPushDeviceToken";
static NSString * const kIOSIDFA = @"IFA";
static NSString * const kBundleVersion = @"BundleVersion";

extern string const kCountryCodeKey;
extern string const kUniqueIdKey;
extern string const kLanguageKey;
extern NSString * const kUserDefaultsTTSLanguageBcp47;
extern NSString * const kUserDafaultsNeedToEnableTTS;

extern char const * kAdServerForbiddenKey;

/// Adds needed localized strings to C++ code
/// @TODO Refactor localization mechanism to make it simpler
void InitLocalizedStrings()
{
  Framework & f = GetFramework();
  // Texts on the map screen when map is not downloaded or is downloading
  f.AddString("country_status_added_to_queue", [L(@"country_status_added_to_queue") UTF8String]);
  f.AddString("country_status_downloading", [L(@"country_status_downloading") UTF8String]);
  f.AddString("country_status_download", [L(@"country_status_download") UTF8String]);
  f.AddString("country_status_download_without_routing", [L(@"country_status_download_without_routing") UTF8String]);
  f.AddString("country_status_download_failed", [L(@"country_status_download_failed") UTF8String]);
  f.AddString("cancel", [L(@"cancel") UTF8String]);
  f.AddString("try_again", [L(@"try_again") UTF8String]);
  // Default texts for bookmarks added in C++ code (by URL Scheme API)
  f.AddString("dropped_pin", [L(@"dropped_pin") UTF8String]);
  f.AddString("my_places", [L(@"my_places") UTF8String]);
  f.AddString("my_position", [L(@"my_position") UTF8String]);
  f.AddString("routes", [L(@"routes") UTF8String]);
  f.AddString("wifi", L(@"wifi").UTF8String);

  f.AddString("routing_failed_unknown_my_position", [L(@"routing_failed_unknown_my_position") UTF8String]);
  f.AddString("routing_failed_has_no_routing_file", [L(@"routing_failed_has_no_routing_file") UTF8String]);
  f.AddString("routing_failed_start_point_not_found", [L(@"routing_failed_start_point_not_found") UTF8String]);
  f.AddString("routing_failed_dst_point_not_found", [L(@"routing_failed_dst_point_not_found") UTF8String]);
  f.AddString("routing_failed_cross_mwm_building", [L(@"routing_failed_cross_mwm_building") UTF8String]);
  f.AddString("routing_failed_route_not_found", [L(@"routing_failed_route_not_found") UTF8String]);
  f.AddString("routing_failed_internal_error", [L(@"routing_failed_internal_error") UTF8String]);
}

void InitCrashTrackers()
{
#ifdef OMIM_PRODUCTION
  if (![[Statistics instance] isStatisticsEnabled])
    return;

  NSString * hockeyKey = @(HOCKEY_APP_KEY);
  if (hockeyKey.length != 0)
  {
    // Initialize Hockey App SDK.
    BITHockeyManager * hockeyManager = [BITHockeyManager sharedHockeyManager];
    [hockeyManager configureWithIdentifier:hockeyKey];
    [hockeyManager.crashManager setCrashManagerStatus: BITCrashManagerStatusAutoSend];
    [hockeyManager startManager];
  }

  NSString * fabricKey = @(CRASHLYTICS_IOS_KEY);
  if (fabricKey.length != 0)
  {
    // Initialize Fabric/Crashlytics SDK.
    [Fabric with:@[[Crashlytics class]]];
  }
#endif
}

using namespace osm_auth_ios;

@interface MapsAppDelegate () <MWMFrameworkStorageObserver>

@property (nonatomic) NSInteger standbyCounter;

@property (weak, nonatomic) NSTimer * checkAdServerForbiddenTimer;
@property (weak, nonatomic) NSTimer * mapStyleSwitchTimer;

@property (nonatomic, readwrite) LocationManager * locationManager;
{'fraction_non_alphanumeric': 0.12386342549638152, 'fraction_numerical': 0.004639079606606049, 'mean_word_length': 7.480723839496459, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 25, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3001169', 'n_tokens_mistral': 3701, 'n_tokens_neox': 3501, 'n_words': 702}