Initial commit
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
.DS_Store
|
||||
.theos
|
||||
packages
|
1
AutoReplay.plist
Normal file
1
AutoReplay.plist
Normal file
@ -0,0 +1 @@
|
||||
{ Filter = { Bundles = ( "com.apple.mobileslideshow" ); }; }
|
11
Makefile
Normal file
11
Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
export ARCHS = armv7 arm64 arm64e
|
||||
|
||||
include ~/theos/makefiles/common.mk
|
||||
|
||||
TWEAK_NAME = AutoReplay
|
||||
AutoReplay_FILES = Tweak.xm
|
||||
|
||||
include $(THEOS_MAKE_PATH)/tweak.mk
|
||||
|
||||
after-install::
|
||||
install.exec "killall -9 SpringBoard"
|
77
Tweak.xm
Normal file
77
Tweak.xm
Normal file
@ -0,0 +1,77 @@
|
||||
typedef struct {
|
||||
long long value;
|
||||
int timescale;
|
||||
unsigned int flags;
|
||||
long long epoch;
|
||||
} TIME;
|
||||
|
||||
@interface PUBrowsingVideoPlayer
|
||||
-(void)videoSessionDidPlayToEnd:(id)arg1; //IOS12
|
||||
-(void)avPlayer:(id)arg1 itemDidPlayToEnd:(id)arg2; //IOS13
|
||||
-(void)seekToTime:(TIME)arg1 toleranceBefore:(TIME)arg2 toleranceAfter:(TIME)arg3 completionHandler:(id)arg4;
|
||||
-(void)seekToTime:(TIME)arg1 completionHandler:(id)arg2;
|
||||
-(TIME)currentTime;
|
||||
-(void)_updateVideoSessionDesiredPlayState;
|
||||
-(void)rewindExistingPlayer;
|
||||
@property(nonatomic) long long desiredPlayState;
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
%group IOS12
|
||||
%hook PUBrowsingVideoPlayer
|
||||
|
||||
- (void)avPlayer:(id)arg1 itemDidPlayToEnd:(id)arg2 {
|
||||
// %orig (arg1, arg2);
|
||||
NSLog(@"AutoReplay - Ended 12");
|
||||
|
||||
TIME t = [self currentTime];
|
||||
t.value = (long long) 0;
|
||||
t.timescale = 100;
|
||||
t.flags = (unsigned int) 1;
|
||||
|
||||
[self seekToTime:t toleranceBefore:t toleranceAfter:t completionHandler:NULL];
|
||||
}
|
||||
|
||||
%end
|
||||
%end //end group IOS12
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
%group IOS13
|
||||
%hook PUBrowsingVideoPlayer
|
||||
|
||||
static bool isFirstTryAfterEnding = false;
|
||||
|
||||
- (void)videoSessionDidPlayToEnd:(id)arg1 {
|
||||
isFirstTryAfterEnding = true;
|
||||
[self rewindExistingPlayer];
|
||||
}
|
||||
|
||||
- (void)_updateVideoSessionDesiredPlayState {
|
||||
if (self.desiredPlayState == 0 && isFirstTryAfterEnding) {
|
||||
isFirstTryAfterEnding = false;
|
||||
MSHookIvar<long long>(self, "_desiredPlayState") = 1;
|
||||
}
|
||||
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
%end //end group IOS13
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
%ctor {
|
||||
float version = [[[UIDevice currentDevice] systemVersion] floatValue];
|
||||
if (version <= 12) {
|
||||
%init(IOS12);
|
||||
} else {
|
||||
%init(IOS13);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user