Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Application/Dopamine/UI/DOMainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ @interface DOMainViewController ()
@property DOActionMenuButton *updateButton;
@property(nonatomic) BOOL hideStatusBar;
@property(nonatomic) BOOL hideHomeIndicator;
@property(nonatomic) BOOL didAutoStartJailbreak;

@end

Expand All @@ -33,6 +34,25 @@ - (void)viewDidLoad {
[self setupStack];
}

- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];

if (self.didAutoStartJailbreak) return;
self.didAutoStartJailbreak = YES;

BOOL isJailbroken = [[DOEnvironmentManager sharedManager] isJailbroken];
BOOL isSupported = [[DOEnvironmentManager sharedManager] isSupported];
BOOL removeJailbreakEnabled = [[DOPreferenceManager sharedManager] boolPreferenceValueForKey:@"removeJailbreakEnabled" fallback:NO];

if (isJailbroken || !isSupported || removeJailbreakEnabled) return;

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
if (!self.jailbreakBtn.enabled || self.jailbreakBtn.didExpand) return;
[self.jailbreakBtn.button sendActionsForControlEvents:UIControlEventTouchUpInside];
});
}

-(void)setupStack
{
UIStackView *stackView = [[UIStackView alloc] init];
Expand Down