1
0
mirror of https://github.com/gilshahar7/AVLock.git synced 2025-06-28 00:46:45 +00:00

Version 1.0.3

Added a12 compatability.

Fixed a bug where AVLock's button was overlapping.
This commit is contained in:
2019-06-22 15:35:41 +03:00
committed by GitHub
parent 713095850c
commit d0fd47ccba
3 changed files with 30 additions and 18 deletions

View File

@ -1,5 +1,5 @@
ARCHS = armv7 arm64 ARCHS = armv7 arm64 arm64e
export TARGET = iphone:clang:11.2:7.0
include $(THEOS)/makefiles/common.mk include $(THEOS)/makefiles/common.mk
TWEAK_NAME = AVLock TWEAK_NAME = AVLock

View File

@ -21,7 +21,8 @@
@end @end
//#import <AudioToolbox/AudioToolbox.h>
//#import <AudioToolbox/AudioServices.h>
extern "C" CFNotificationCenterRef CFNotificationCenterGetDistributedCenter(void); extern "C" CFNotificationCenterRef CFNotificationCenterGetDistributedCenter(void);
@ -96,13 +97,24 @@ CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),
} }
%end %end
double delayInSeconds = 0.13;
%hook AVPlaybackControlsVisibilityControllerItem
-(BOOL)wantsAnimatedTransitionToHidden:(BOOL)arg1 alpha:(double)arg2{
if(!arg1){
delayInSeconds = 0.0;
[[NSNotificationCenter defaultCenter] postNotificationName:UIDeviceOrientationDidChangeNotification object:nil];
//AudioServicesPlaySystemSound(1103);
delayInSeconds = 0.13;
}
return %orig;
}
%end
%hook AVTransportControlsView %hook AVTransportControlsView
int test = 30; int test = 30;
// iOS 12 // iOS 12
-(AVTransportControlsView *)initWithFrame:(CGRect)frame styleSheet:(id)arg2 captureView:(id)arg3{ -(AVTransportControlsView *)initWithFrame:(CGRect)frame styleSheet:(id)arg2 captureView:(id)arg3{
AVTransportControlsView *origself = %orig(frame,arg2,arg3); AVTransportControlsView *origself = %orig(frame,arg2,arg3);
@ -178,7 +190,7 @@ int test = 30;
%new %new
-(void)deviceOrientationDidChange{ -(void)deviceOrientationDidChange{
double delayInSeconds = 0.13;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ dispatch_after(popTime, dispatch_get_main_queue(), ^(void){

Binary file not shown.