-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tweak.xm
70 lines (56 loc) · 1.48 KB
/
Tweak.xm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#import <SpringBoard/SpringBoard.h>
#import <AVFoundation/AVFoundation.h>
#import <UIKit/UIKit.h>
%hook AVAudioSession
-(id) init
{
NSString* bundleId = [[NSBundle mainBundle] bundleIdentifier];
NSLog(@"IRGENDWAS: constructor by bundleid: %@", bundleId);
self = %orig;
if(self)
{
NSError* myerr = nil;
// this.setMode(mode, error);
[self setMode:AVAudioSessionModeSpokenAudio error:&myerr];
}
return self;
}
-(BOOL)setMode:(id)arg1 error:(id*)arg2
{
// if app is blacklisted
NSString* bundleId = [[NSBundle mainBundle] bundleIdentifier];
NSLog(@"IRGENDWAS: setMode: %@ by bundleid: %@", arg1, bundleId);
// else
// %orig(arg1,arg2);
return %orig(AVAudioSessionModeSpokenAudio,arg2);
}
%end
%hook UIApplicationDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSLog(@"IRGENDWAS: didfinishlaunching: %@", application);
return %orig;
}
%end
%hook SpringBoard
-(void) thisMethodDoesNotExistInHeaders:(id)arg {
%orig(arg);
}
%end
%hook SBApplication
- (void)didLaunch:(id)arg1 {
NSLog(@"IRGENDWAS: didLaunch: %@", arg1);
%orig;
}
-(void) applicationDidFinishLaunching:(id)arg {
%orig(arg);
UIAlertView *lookWhatWorks = [[UIAlertView alloc] initWithTitle:@"simject Example Tweak"
message:@"It works! (ノ´ヮ´)ノ*:・゚✧"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[lookWhatWorks show];
}
%end
%ctor {
NSLog(@"IRGENDWAS %@",@"TWEAK loaded.");
}