-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathTweak.xm
43 lines (33 loc) · 1.76 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
#import <Foundation/Foundation.h>
@interface watched : NSObject
@end
@implementation watched
- (void)addNewItemsToPlistWithPath:(NSString *)plistPath key:(NSString *)key value:(id)value {
NSMutableDictionary *plistDictionary = [NSMutableDictionary dictionaryWithContentsOfFile:plistPath];
if (plistDictionary == nil) {
NSLog(@"Failed to load plist file at path: %@", plistPath);
return;
}
[plistDictionary setObject:value forKey:key];
if (![plistDictionary writeToFile:plistPath atomically:YES]) {
NSLog(@"Failed to write plist file at path: %@", plistPath);
} else {
NSLog(@"Successfully added items to plist file: %@", plistPath);
}
}
@end
%ctor {
//require respring to apply the tweak working.
watched *tweak = [[watched alloc] init];
//first file
NSString *firstPlistPath = @"/var/mobile/Library/Preferences/com.apple.NanoRegistry.plist";
[tweak addNewItemsToPlistWithPath:firstPlistPath key:@"minPairingCompatibilityVersion" value:@(1)];
//if apple update more watchOS, set maxPairingCompatibilityVersion to higher number (example: 9.5.1 around 27 then +2 for each big version, now lastest is 10.3.1 then it's 35~37)
[tweak addNewItemsToPlistWithPath:firstPlistPath key:@"maxPairingCompatibilityVersion" value:@(37)];
[tweak addNewItemsToPlistWithPath:firstPlistPath key:@"IOS_PAIRING_EOL_MIN_PAIRING_COMPATIBILITY_VERSION_CHIPIDS" value:@""];
[tweak addNewItemsToPlistWithPath:firstPlistPath key:@"minPairingCompatibilityVersionWithChipID" value:@(1)];
//second file
NSString *secondPlistPath = @"/var/mobile/Library/Preferences/com.apple.pairedsync.plist";
//maybe the same as the 37
[tweak addNewItemsToPlistWithPath:secondPlistPath key:@"activityTimeout" value:@(35)];
}