cgm616 / VolumeBar9

A jailbreak tweak to change the stock volume HUD
https://cgm616.me/repo
MIT License
15 stars 1 forks source link

Activator incompatibility #1

Open cgm616 opened 7 years ago

cgm616 commented 7 years ago

On occasion VolumeBar9 and Activator will crash the Springboard, I think because of the hook on VolumeControl.

Hard to test; hard to reproduce.

Log files:

cgm616 commented 7 years ago

Probably not a incompatibility? All the logs I've seen crash on -[VolumeBar resetTimer]

cgm616 commented 7 years ago

Logs with activator uninstalled:

This confirms that it's definitely something with only VolumeBar9.

cgm616 commented 7 years ago

When adding logging to the tweak, the problem seems to disappear. Still hard to know for sure. Below is what was added.

VolumeBar.xm

-(void)resetTimer {
  HBLogDebug(@"in resetTimer");
  if(hide != nil) {
    HBLogDebug(@"hide exists");
    [hide invalidate];
    HBLogDebug(@"hide invalidated");
    hide = nil;
    HBLogDebug(@"hide = nil now");
    hide = [NSTimer scheduledTimerWithTimeInterval:_delayTime target:self selector:@selector(_hideHUD) userInfo:nil repeats:NO];
    HBLogDebug(@"new hide created");
  }
}

Tweak.xm

%hook VolumeControl

-(void)increaseVolume {
  HBLogDebug(@"hooked increaseVolume");
  if(active && vbar != nil) {
    HBLogDebug(@"calling resetTimer");
    [vbar resetTimer];
  }

  %orig;
}

%end
cgm616 commented 7 years ago

One report has come in that the crash is actually from pressing the volume buttons and calling resetTimer while the banner is animating away.

cgm616 commented 7 years ago

I was able to reproduce it in this way! Sweet, should be a relatively easy fix to disable any functionality of resetTimer after hideHUD has been called.