mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Disable Authenticator and UpdateManager in TestFlight
This commit is contained in:
@@ -227,7 +227,7 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) {
|
||||
#pragma mark - Expiry
|
||||
|
||||
- (BOOL)expiryDateReached {
|
||||
if ([self isAppStoreEnvironment]) return NO;
|
||||
if ([self isTestFlightEnvironment] || [self isAppStoreEnvironment]) return NO;
|
||||
|
||||
if (_expiryDate) {
|
||||
NSDate *currentDate = [NSDate date];
|
||||
@@ -314,7 +314,7 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) {
|
||||
}
|
||||
|
||||
- (void)stopUsage {
|
||||
if ([self isAppStoreEnvironment]) return;
|
||||
if ([self isTestFlightEnvironment] || [self isAppStoreEnvironment]) return;
|
||||
if ([self expiryDateReached]) return;
|
||||
|
||||
double timeDifference = [[NSDate date] timeIntervalSinceReferenceDate] - [_usageStartTimestamp timeIntervalSinceReferenceDate];
|
||||
@@ -324,7 +324,7 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) {
|
||||
}
|
||||
|
||||
- (void) storeUsageTimeForCurrentVersion:(NSNumber *)usageTime {
|
||||
if ([self isAppStoreEnvironment]) return;
|
||||
if ([self isTestFlightEnvironment] || [self isAppStoreEnvironment]) return;
|
||||
|
||||
NSMutableData *data = [[NSMutableData alloc] init];
|
||||
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
|
||||
@@ -518,7 +518,7 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) {
|
||||
#pragma mark - BetaUpdateUI
|
||||
|
||||
- (BITUpdateViewController *)hockeyViewController:(BOOL)modal {
|
||||
if ([self isAppStoreEnvironment]) {
|
||||
if ([self isTestFlightEnvironment] || [self isAppStoreEnvironment]) {
|
||||
NSLog(@"[HockeySDK] This should not be called from an app store build!");
|
||||
// return an empty view controller instead
|
||||
BITHockeyBaseViewController *blankViewController = [[BITHockeyBaseViewController alloc] initWithModalStyle:modal];
|
||||
@@ -528,7 +528,7 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) {
|
||||
}
|
||||
|
||||
- (void)showUpdateView {
|
||||
if ([self isAppStoreEnvironment]) {
|
||||
if ([self isTestFlightEnvironment] || [self isAppStoreEnvironment]) {
|
||||
NSLog(@"[HockeySDK] This should not be called from an app store build!");
|
||||
return;
|
||||
}
|
||||
@@ -550,7 +550,7 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) {
|
||||
|
||||
|
||||
- (void)showCheckForUpdateAlert {
|
||||
if ([self isAppStoreEnvironment]) return;
|
||||
if ([self isTestFlightEnvironment] || [self isAppStoreEnvironment]) return;
|
||||
if ([self isUpdateManagerDisabled]) return;
|
||||
|
||||
if (!_updateAlertShowing) {
|
||||
@@ -825,7 +825,7 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) {
|
||||
}
|
||||
|
||||
- (void)checkForUpdate {
|
||||
if (![self isAppStoreEnvironment] && ![self isUpdateManagerDisabled]) {
|
||||
if (![self isTestFlightEnvironment] && ![self isAppStoreEnvironment] && ![self isUpdateManagerDisabled]) {
|
||||
if ([self expiryDateReached]) return;
|
||||
if (![self installationIdentified]) return;
|
||||
|
||||
@@ -838,7 +838,7 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) {
|
||||
}
|
||||
|
||||
- (void)checkForUpdateShowFeedback:(BOOL)feedback {
|
||||
if ([self isAppStoreEnvironment]) return;
|
||||
if ([self isTestFlightEnvironment] || [self isAppStoreEnvironment]) return;
|
||||
if (self.isCheckInProgress) return;
|
||||
|
||||
_showFeedback = feedback;
|
||||
@@ -916,7 +916,7 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) {
|
||||
}
|
||||
|
||||
- (BOOL)initiateAppDownload {
|
||||
if ([self isAppStoreEnvironment]) return NO;
|
||||
if ([self isTestFlightEnvironment] || [self isAppStoreEnvironment]) return NO;
|
||||
|
||||
if (!self.isUpdateAvailable) {
|
||||
BITHockeyLog(@"WARNING: No update available. Aborting.");
|
||||
@@ -985,7 +985,7 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) {
|
||||
|
||||
// begin the startup process
|
||||
- (void)startManager {
|
||||
if (![self isAppStoreEnvironment]) {
|
||||
if (![self isTestFlightEnvironment] && ![self isAppStoreEnvironment]) {
|
||||
if ([self isUpdateManagerDisabled]) return;
|
||||
|
||||
BITHockeyLog(@"INFO: Starting UpdateManager");
|
||||
@@ -1040,7 +1040,7 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) {
|
||||
|
||||
self.companyName = (([[json valueForKey:@"company"] isKindOfClass:[NSString class]]) ? [json valueForKey:@"company"] : nil);
|
||||
|
||||
if (![self isAppStoreEnvironment]) {
|
||||
if (![self isTestFlightEnvironment] && ![self isAppStoreEnvironment]) {
|
||||
NSArray *feedArray = (NSArray *)[json valueForKey:@"versions"];
|
||||
|
||||
// remember that we just checked the server
|
||||
|
||||
Reference in New Issue
Block a user