<commit_before>//
//  UIApplication+ESAdditions.h
//  ESFramework
//
//  Created by <NAME> on 2019/05/05.
//  Copyright © 2019 www.0x123.com. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIApplication (ESAdditions)

@end

@interface UIApplication (ESAppInfo)

/**
 * The app name.
 * @discussion The default value is the executable in the main bundle.
 */
@property (nonatomic, copy) NSString *appName;

/**
 * The channel that app submitted to.
 * @discussion The default value is "App Store".
 */
@property (nullable, nonatomic, copy) NSString *appChannel;

/**
 * The app ID in the App Store, used to generate the app Download link and
 * the app review link.
 */
@property (nullable, nonatomic, copy) NSString *appStoreID;

@property (readonly) NSString *appBundleName;
@property (readonly) NSString *appDisplayName;
@property (readonly) NSString *appBundleIdentifier;
@property (readonly) NSString *appVersion;
@property (readonly) NSString *appBuildVersion;
/// e.g. "1.2.4 (210)"
@property (readonly) NSString *appFullVersion;
@property (readonly) BOOL isUIViewControllerBasedStatusBarAppearance;

@property (readonly) NSDate *appLaunchDate;
@property (readonly) NSTimeInterval appLaunchDuration;

/**
 * Indicates whether the current app launch is a "fresh launch" which means the
 * first time of app launch after the app was installed or upgraded.
 */
@property (readonly) BOOL isFreshLaunch;

/**
 * Returns the app version before the current launching.
 */
@property (nullable, readonly) NSString *appPreviousVersion;

/**
 * Returns the app analytics information.
 * @code
 * {
 *     "os" : "iOS",
 *     "os_version" : "12.2",
 *     "model" : "iPhone",
 *     "model_identifier" : "iPhone9,2",
 *     "model_name" : "iPhone 7 Plus",
 *     "device_name" : "Elf Sundae's iPhone",
 *     "jailbroken" : 0,
 *     "screen_size" : "414x736",
 *     "screen_scale" : "3.00",
 *     "timezone_gmt" : 8,
 *     "locale" : "zh_CN",
 *     "app_name" : "iOS Example",
 *     "app_identifier" : "com.0x123.ESFramework",
 *     "app_channel" : "App Store",
 *     "app_version" : "2.1",
 *     "app_build_version" : 45,
 *     "app_launch" : "0.27",
 *     "app_fresh_launch" : 1,
 *     "app_previous_version" : "1.3",
 *     "network" : "WiFi",
 *     "wwan" : "4G",
 *     "carrier" : "中国电信",
 *     "ssid" : "Elf Sundae's MBP",
 *     "bssid" : "20:c9:d0:e1:78:c9",
 *     "local_ip" : "192.168.2.21",
 *     "local_ipv6" : "fe80::1c04:cf4e:2d7c:c533",
 *     "wwan_ip" : "10.14.58.61",
 *     "wwan_ipv6" : "fe80::18e8:e230:e459:4f68",
 * }
 * @endcode
 */
@property (nonatomic, readonly) NSDictionary *analyticsInfo;

@end

NS_ASSUME_NONNULL_END
<commit_msg>make -analyticsInfo as method<commit_after>//
//  UIApplication+ESAdditions.h
//  ESFramework
//
//  Created by <NAME> on 2019/05/05.
//  Copyright © 2019 www.0x123.com. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIApplication (ESAdditions)

@end

@interface UIApplication (ESAppInfo)

/**
 * The app name.
 * @discussion The default value is the executable in the main bundle.
 */
@property (nonatomic, copy) NSString *appName;

/**
 * The channel that app submitted to.
 * @discussion The default value is "App Store".
 */
@property (nullable, nonatomic, copy) NSString *appChannel;

/**
 * The app ID in the App Store, used to generate the app Download link and
 * the app review link.
 */
@property (nullable, nonatomic, copy) NSString *appStoreID;

@property (readonly) NSString *appBundleName;
@property (readonly) NSString *appDisplayName;
@property (readonly) NSString *appBundleIdentifier;
@property (readonly) NSString *appVersion;
@property (readonly) NSString *appBuildVersion;
/// e.g. "1.2.4 (210)"
@property (readonly) NSString *appFullVersion;
@property (readonly) BOOL isUIViewControllerBasedStatusBarAppearance;

@property (readonly) NSDate *appLaunchDate;
@property (readonly) NSTimeInterval appLaunchDuration;

/**
 * Indicates whether the current app launch is a "fresh launch" which means the
 * first time of app launch after the app was installed or upgraded.
 */
@property (readonly) BOOL isFreshLaunch;

/**
 * Returns the app version before the current launching.
 */
@property (nullable, readonly) NSString *appPreviousVersion;

/**
 * Returns the app analytics information.
 * @code
 * {
 *     "os" : "iOS",
 *     "os_version" : "12.2",
 *     "model" : "iPhone",
 *     "model_identifier" : "iPhone9,2",
 *     "model_name" : "iPhone 7 Plus",
 *     "device_name" : "Elf Sundae's iPhone",
 *     "jailbroken" : 0,
 *     "screen_size" : "414x736",
 *     "screen_scale" : "3.00",
 *     "timezone_gmt" : 8,
 *     "locale" : "zh_CN",
 *     "app_name" : "iOS Example",
 *     "app_identifier" : "com.0x123.ESFramework",
 *     "app_channel" : "App Store",
 *     "app_version" : "2.1",
 *     "app_build_version" : 45,
 *     "app_launch" : "0.27",
 *     "app_fresh_launch" : 1,
 *     "app_previous_version" : "1.3",
 *     "network" : "WiFi",
 *     "wwan" : "4G",
 *     "carrier" : "中国电信",
 *     "ssid" : "<NAME>",
 *     "bssid" : "20:c9:d0:e1:78:c9",
 *     "local_ip" : "192.168.2.21",
 *     "local_ipv6" : "fe80::1c04:cf4e:2d7c:c533",
 *     "wwan_ip" : "10.14.58.61",
 *     "wwan_ipv6" : "fe80::18e8:e230:e459:4f68",
 * }
 * @endcode
 */
- (NSDictionary *)analyticsInfo;

@end

NS_ASSUME_NONNULL_END

{'fraction_non_alphanumeric': 0.15357539829566505, 'fraction_numerical': 0.039273805113004816, 'mean_word_length': 3.638316151202749, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '518900', 'n_tokens_mistral': 2076, 'n_tokens_neox': 1908, 'n_words': 492}