-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsparkle.m
82 lines (59 loc) · 2.08 KB
/
sparkle.m
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
71
72
73
74
75
76
77
78
79
80
81
82
#define BUILDING_SPARKLE_SOURCES_EXTERNALLY
#import <Foundation/Foundation.h>
#import <Headers/SUUpdater.h>
#import <objc/runtime.h> // Required for class_addMethod()
static SUUpdater *updater = nil;
void sparkle_initialize() {
if (!updater)
updater = [[SUUpdater sharedUpdater] retain];
}
void sparkle_checkForUpdates() { [updater checkForUpdates:updater]; }
void sparkle_checkForUpdatesInBackground() {
[updater checkForUpdatesInBackground];
}
void sparkle_setAutomaticallyChecksForUpdates(int check) {
[updater setAutomaticallyChecksForUpdates:check];
}
int sparkle_automaticallyChecksForUpdates() {
return [updater automaticallyChecksForUpdates];
}
void sparkle_setAutomaticallyDownloadsUpdates(int check) {
[updater setAutomaticallyDownloadsUpdates:check];
}
int sparkle_automaticallyDownloadsUpdates() {
return [updater automaticallyDownloadsUpdates];
}
void sparkle_setUpdateCheckInterval(int interval) {
[updater setUpdateCheckInterval:interval];
}
int sparkle_updateCheckInterval() { return [updater updateCheckInterval]; }
void sparkle_checkForUpdateInformation() {
[updater checkForUpdateInformation];
}
void sparkle_setFeedURL(const char *feedURL) {
[updater setFeedURL:[NSURL URLWithString:@(feedURL)]];
}
const char *sparkle_feedURL() {
return [[[updater feedURL] absoluteString] UTF8String];
}
void sparkle_setUserAgentString(const char *ua) {
[updater setUserAgentString:@(ua)];
}
const char *sparkle_userAgentString() {
return [[updater userAgentString] UTF8String];
}
void sparkle_setSendsSystemProfile(int check) {
[updater setSendsSystemProfile:check];
}
int sparkle_sendsSystemProfile() { return [updater sendsSystemProfile]; }
void sparkle_setDecryptionPassword(const char *pw) {
[updater setDecryptionPassword:@(pw)];
}
const char *sparkle_decryptionPassword() {
return [[updater decryptionPassword] UTF8String];
}
double sparkle_lastUpdateCheckDate() {
return [[updater lastUpdateCheckDate] timeIntervalSince1970];
}
void sparkle_resetUpdateCycle() { [updater resetUpdateCycle]; }
int sparkle_updateInProgress() { return [updater updateInProgress]; }