├── Filter.plist
├── LICENSE
├── Listener.xm
├── Makefile
├── README.md
├── Reachability.h
├── Reachability.m
├── control
└── unsplashwallpaper
├── Makefile
├── Preferences
├── PSListController.h
├── PSSpecifier.h
└── PSViewController.h
├── Resources
├── Info.plist
├── UnsplashWallpaper.plist
├── UnsplashWallpaper.png
└── UnsplashWallpaper@2x.png
├── UnsplashWallpaperListController.h
├── UnsplashWallpaperListController.m
└── entry.plist
/Filter.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Filter
6 |
7 | Bundles
8 |
9 | com.apple.springboard
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Zane Helton
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Listener.xm:
--------------------------------------------------------------------------------
1 | #include
2 | #import
3 | #import "Reachability.h"
4 | #import
5 |
6 | #define CHANGEWALLPAPER_ID @"com.zanehelton.unsplashwallpaper.changewallpaper"
7 | #define SAVEWALLPAPER_ID @"com.zanehelton.unsplashwallpaper.savewallpaper"
8 |
9 | @interface UnsplashWallpaperListener : NSObject {
10 | BOOL _isVisible;
11 | NSString *_bundleID;
12 | }
13 |
14 | + (id)sharedInstance;
15 |
16 | - (BOOL)present;
17 | - (BOOL)dismiss;
18 | @end
19 |
20 | // this is an enum specified by Apple, I'm going to use it to make my life a little easier
21 | // I could just use 0, 1, and 2, but it's not obvious what those mean.
22 | typedef NS_ENUM(NSUInteger, PLWallpaperMode) {
23 | PLWallpaperModeBoth,
24 | PLWallpaperModeHomeScreen,
25 | PLWallpaperModeLockScreen
26 | };
27 |
28 | // making sure the tweak knows about these classes
29 | @interface PLStaticWallpaperImageViewController
30 | @property BOOL saveWallpaperData;
31 | - (void)_savePhoto;
32 | - (instancetype)initWithUIImage:(UIImage *)image;
33 | + (id)alloc;
34 | @end
35 |
36 | extern "C" CFArrayRef CPBitmapCreateImagesFromData(CFDataRef cpbitmap, void*, int, void*);
37 |
38 | /*
39 | Heavily documented for education purposes
40 | */
41 |
42 | static LAActivator *sharedActivatorIfExists(void) {
43 | static LAActivator *_LASharedActivator = nil;
44 | static dispatch_once_t token = 0;
45 | dispatch_once(&token, ^{
46 | void *la = dlopen("/usr/lib/libactivator.dylib", RTLD_LAZY);
47 | if ((char *)la) {
48 | _LASharedActivator = (LAActivator *)[objc_getClass("LAActivator") sharedInstance];
49 | }
50 | });
51 | return _LASharedActivator;
52 | }
53 |
54 | @implementation UnsplashWallpaperListener
55 |
56 | + (id)sharedInstance {
57 | static id sharedInstance = nil;
58 | static dispatch_once_t token = 0;
59 | dispatch_once(&token, ^{
60 | sharedInstance = [self new];
61 | });
62 | return sharedInstance;
63 | }
64 |
65 | + (void)load {
66 | [self sharedInstance];
67 | }
68 |
69 | - (id)init {
70 | if ((self = [super init])) {
71 | // Register our listener
72 | LAActivator *_LASharedActivator = sharedActivatorIfExists();
73 | if (_LASharedActivator) {
74 | if (_LASharedActivator.isRunningInsideSpringBoard) {
75 | [_LASharedActivator registerListener:self forName:CHANGEWALLPAPER_ID];
76 | [_LASharedActivator registerListener:self forName:SAVEWALLPAPER_ID];
77 | }
78 | }
79 | }
80 | return self;
81 | }
82 |
83 | - (void)dealloc {
84 | LAActivator *_LASharedActivator = sharedActivatorIfExists();
85 | if (_LASharedActivator) {
86 | if (_LASharedActivator.runningInsideSpringBoard) {
87 | [_LASharedActivator unregisterListenerWithName:CHANGEWALLPAPER_ID];
88 | [_LASharedActivator unregisterListenerWithName:SAVEWALLPAPER_ID];
89 | }
90 | }
91 | }
92 |
93 | #pragma mark - Listener custom methods
94 |
95 | - (BOOL)presentOrDismiss {
96 | if (_isVisible) {
97 | return [self dismiss];
98 | } else {
99 | return [self present];
100 | }
101 | }
102 |
103 | - (BOOL)present {
104 | // Do UI stuff before this comment
105 | _isVisible = YES;
106 | return NO;
107 | }
108 |
109 | - (BOOL)dismiss {
110 | // Do UI stuff before this comment
111 | _isVisible = NO;
112 | return NO;
113 | }
114 |
115 | #pragma mark - LAListener protocol methods
116 |
117 | - (void)activator:(LAActivator *)activator didChangeToEventMode:(NSString *)eventMode {
118 | [self dismiss];
119 | }
120 |
121 | #pragma mark - Incoming events
122 |
123 | // Normal assigned events
124 | - (void)activator:(LAActivator *)activator receiveEvent:(LAEvent *)event forListenerName:(NSString *)listenerName {
125 | if ([listenerName isEqualToString:CHANGEWALLPAPER_ID]) {
126 | // checks for internet connection with Apple's reachability. Otherwise the tweak will boot into safe mode
127 | Reachability *networkReachability = [Reachability reachabilityForInternetConnection];
128 | NetworkStatus networkStatus = [networkReachability currentReachabilityStatus];
129 | if (networkStatus == NotReachable) {
130 | // user is not connected to the internet, make them aware of it
131 | [[[UIAlertView alloc] initWithTitle:@"Whoops!" message:@"Please ensure you're connected to the Internet to use UnsplashWallpaper." delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil] show];
132 | [event setHandled:YES];
133 | return;
134 | }
135 |
136 | // craft a url build on the unsplash 'api' that requests an image the same size as the users device
137 | // doing this for 2 reasons. 1: it makes download times faster 2: the image is cropped for us
138 | NSURL *pageURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://source.unsplash.com/random/%ix%i",
139 | (int)([[UIScreen mainScreen] bounds].size.width * [[UIScreen mainScreen] scale]),
140 | (int)([[UIScreen mainScreen] bounds].size.height * [[UIScreen mainScreen] scale])]];
141 | // sent a request to the url asking for the image data
142 | [NSURLConnection sendAsynchronousRequest:[NSURLRequest requestWithURL:pageURL] queue:[[NSOperationQueue alloc] init] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
143 | // if there seems to be any kind of hiccup in the request, just alert the user
144 | if (error) {
145 | [[[UIAlertView alloc] initWithTitle:@"Whoops!" message:@"Unsplash may be temporarily down. Please try again a few minutes." delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil] show];
146 | return;
147 | }
148 |
149 | // create a UIImage based off of the data
150 | UIImage *image = [UIImage imageWithData:data];
151 | // create a PLStaticWallpaperImageViewController which will be used to set the wallpaper
152 | PLStaticWallpaperImageViewController *wallpaperViewController = [[PLStaticWallpaperImageViewController alloc] initWithUIImage:image];
153 | wallpaperViewController.saveWallpaperData = YES;
154 | // check if the user wants to set the wallpaper for their home screen, lock screen, or both
155 | NSDictionary *bundleDefaults = [[NSUserDefaults standardUserDefaults] persistentDomainForName:@"com.zanehelton.unsplashwallpaper"];
156 | NSString *saveMode = [bundleDefaults valueForKey:@"wallmode"];
157 | if ([saveMode isEqualToString:@"both"]) {
158 | MSHookIvar(wallpaperViewController, "_wallpaperMode") = PLWallpaperModeBoth;
159 | } else if ([saveMode isEqualToString:@"home"]) {
160 | MSHookIvar(wallpaperViewController, "_wallpaperMode") = PLWallpaperModeHomeScreen;
161 | } else if ([saveMode isEqualToString:@"lock"]) {
162 | MSHookIvar(wallpaperViewController, "_wallpaperMode") = PLWallpaperModeLockScreen;
163 | }
164 | // sets the wallpaper
165 | [wallpaperViewController _savePhoto];
166 |
167 | // checks if the user wants to save it their photos
168 | if ([[bundleDefaults valueForKey:@"savetophotos"] boolValue]) {
169 | // if they do, save it
170 | UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
171 | }
172 | }];
173 | } else if ([listenerName isEqualToString:SAVEWALLPAPER_ID]) {
174 | UIAlertView *askWhichWallpaper = [[UIAlertView alloc] initWithTitle:@"Select Wallpaper" message:@"Which wallpaper do you want to save?" delegate:self cancelButtonTitle:@"Nevermind" otherButtonTitles:@"Lockscreen", @"Homescreen", @"Both", nil];
175 | [askWhichWallpaper show];
176 | }
177 |
178 | if ([self presentOrDismiss]) {
179 | [event setHandled:YES];
180 | }
181 | }
182 |
183 | - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
184 | if (buttonIndex == 1) {
185 | // save the lockscreen wallpaper
186 | NSData *homeWallpaperData = [NSData dataWithContentsOfFile:@"/var/mobile/Library/SpringBoard/LockBackground.cpbitmap"];
187 | // do a bunch of low level stuff that I don't even want to talk about
188 | CFDataRef homeWallpaperDataRef = (__bridge CFDataRef)homeWallpaperData;
189 | NSArray *imageArray = (__bridge NSArray *)CPBitmapCreateImagesFromData(homeWallpaperDataRef, NULL, 1, NULL);
190 | UIImage *homeWallpaper = [UIImage imageWithCGImage:(CGImageRef)imageArray[0]];
191 | UIImageWriteToSavedPhotosAlbum(homeWallpaper, nil, nil, nil);
192 | //CFRelease(homeWallpaperDataRef);
193 | } else if (buttonIndex == 2) {
194 | // save the homescreen wallpaper
195 | NSData *homeWallpaperData = [NSData dataWithContentsOfFile:@"/var/mobile/Library/SpringBoard/HomeBackground.cpbitmap"];
196 | if (!homeWallpaperData) {
197 | // the homescreen uses the lockscreen wallpaper if they're the same, this essentially checks if they're the same, and then uses the lockscreen
198 | // wallpaper if they are
199 | homeWallpaperData = [NSData dataWithContentsOfFile:@"/var/mobile/Library/SpringBoard/LockBackground.cpbitmap"];
200 | }
201 | // do a bunch of low level stuff that I don't even want to talk about
202 | CFDataRef homeWallpaperDataRef = (__bridge CFDataRef)homeWallpaperData;
203 | NSArray *imageArray = (__bridge NSArray *)CPBitmapCreateImagesFromData(homeWallpaperDataRef, NULL, 1, NULL);
204 | UIImage *homeWallpaper = [UIImage imageWithCGImage:(CGImageRef)imageArray[0]];
205 | UIImageWriteToSavedPhotosAlbum(homeWallpaper, nil, nil, nil);
206 | } else if (buttonIndex == 3) {
207 | // save the homescreen wallpaper
208 | BOOL sameWallpaper = NO;
209 | NSData *homeWallpaperData = [NSData dataWithContentsOfFile:@"/var/mobile/Library/SpringBoard/HomeBackground.cpbitmap"];
210 | if (!homeWallpaperData) {
211 | // the homescreen uses the lockscreen wallpaper if they're the same, this essentially checks if they're the same, and then uses the lockscreen
212 | // wallpaper if they are
213 | sameWallpaper = YES;
214 | homeWallpaperData = [NSData dataWithContentsOfFile:@"/var/mobile/Library/SpringBoard/LockBackground.cpbitmap"];
215 | }
216 | // do a bunch of low level stuff that I don't even want to talk about
217 | CFDataRef homeWallpaperDataRef = (__bridge CFDataRef)homeWallpaperData;
218 | NSArray *imageArray = (__bridge NSArray *)CPBitmapCreateImagesFromData(homeWallpaperDataRef, NULL, 1, NULL);
219 | UIImage *homeWallpaper = [UIImage imageWithCGImage:(CGImageRef)imageArray[0]];
220 | UIImageWriteToSavedPhotosAlbum(homeWallpaper, nil, nil, nil);
221 | if (!sameWallpaper) {
222 | homeWallpaperData = [NSData dataWithContentsOfFile:@"/var/mobile/Library/SpringBoard/LockBackground.cpbitmap"];
223 | CFDataRef homeWallpaperDataRef = (__bridge CFDataRef)homeWallpaperData;
224 | NSArray *imageArray = (__bridge NSArray *)CPBitmapCreateImagesFromData(homeWallpaperDataRef, NULL, 1, NULL);
225 | UIImage *homeWallpaper = [UIImage imageWithCGImage:(CGImageRef)imageArray[0]];
226 | UIImageWriteToSavedPhotosAlbum(homeWallpaper, nil, nil, nil);
227 | return;
228 | }
229 | }
230 | }
231 |
232 | #pragma mark - Metadata (may be cached)
233 |
234 | - (NSString *)activator:(LAActivator *)activator requiresLocalizedTitleForListenerName:(NSString *)listenerName {
235 | if ([listenerName isEqualToString:CHANGEWALLPAPER_ID])
236 | return @"Change Wallpaper";
237 | else
238 | return @"Save Wallpaper";
239 | }
240 |
241 | - (NSString *)activator:(LAActivator *)activator requiresLocalizedDescriptionForListenerName:(NSString *)listenerName {
242 | if ([listenerName isEqualToString:CHANGEWALLPAPER_ID])
243 | return @"Change wallpaper to image from Unsplash";
244 | else
245 | return @"Save current wallpaper to photos";
246 | }
247 |
248 | - (NSString *)activator:(LAActivator *)activator requiresLocalizedGroupForListenerName:(NSString *)listenerName {
249 | return @"Unsplash Wallpaper";
250 | }
251 |
252 | - (NSArray *)activator:(LAActivator *)activator requiresCompatibleEventModesForListenerWithName:(NSString *)listenerName {
253 | return [NSArray arrayWithObjects:@"springboard", @"lockscreen", @"application", nil];
254 | }
255 |
256 | #pragma mark - Icons
257 |
258 | - (NSData *)activator:(LAActivator *)activator requiresSmallIconDataForListenerName:(NSString *)listenerName scale:(CGFloat *)scale {
259 | if (*scale != 1.0f) {
260 | return [NSData dataWithContentsOfFile:@"/Library/PreferenceBundles/UnsplashWallpaper.bundle/UnsplashWallpaper@2x.png"];
261 | } else {
262 | return [NSData dataWithContentsOfFile:@"/Library/PreferenceBundles/UnsplashWallpaper.bundle/UnsplashWallpaper.png"];
263 | }
264 | }
265 |
266 | @end
267 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | include $(THEOS)/makefiles/common.mk
2 |
3 | TWEAK_NAME = UnsplashWallpaper
4 | UnsplashWallpaper_CFLAGS = -fobjc-arc
5 | UnsplashWallpaper_FILES = Listener.xm Reachability.m
6 | UnsplashWallpaper_FRAMEWORKS = Foundation UIKit SystemConfiguration
7 | UnsplashWallpaper_PRIVATE_FRAMEWORKS = PhotoLibrary AppSupport
8 | UnsplashWallpaper_LIBRARIES = activator
9 |
10 | include $(THEOS_MAKE_PATH)/tweak.mk
11 |
12 | internal-stage::
13 | #Filter plist
14 | $(ECHO_NOTHING)if [ -f Filter.plist ]; then mkdir -p $(THEOS_STAGING_DIR)/Library/MobileSubstrate/DynamicLibraries/; cp Filter.plist $(THEOS_STAGING_DIR)/Library/MobileSubstrate/DynamicLibraries/UnsplashWallpaper.plist; fi$(ECHO_END)
15 | #PreferenceLoader plist
16 | $(ECHO_NOTHING)if [ -f Preferences.plist ]; then mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/UnsplashWallpaper; cp Preferences.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/UnsplashWallpaper/; fi$(ECHO_END)
17 |
18 | after-install::
19 | install.exec "killall -9 SpringBoard"
20 |
21 | SUBPROJECTS += unsplashwallpaper
22 | include $(THEOS_MAKE_PATH)/aggregate.mk
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # UnsplashWallpaper
2 | Change your iOS wallpaper at random to photos from Unsplash.com
3 |
4 | The source code contains how to set the lockscreen & homescreen backgrounds, as well as how to retrieve them.
5 |
--------------------------------------------------------------------------------
/Reachability.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (C) 2015 Apple Inc. All Rights Reserved.
3 | See LICENSE.txt for this sample’s licensing information
4 |
5 | Abstract:
6 | Basic demonstration of how to use the SystemConfiguration Reachablity APIs.
7 | */
8 |
9 | #import
10 | #import
11 | #import
12 |
13 |
14 | typedef enum : NSInteger {
15 | NotReachable = 0,
16 | ReachableViaWiFi,
17 | ReachableViaWWAN
18 | } NetworkStatus;
19 |
20 |
21 | extern NSString *kReachabilityChangedNotification;
22 |
23 |
24 | @interface Reachability : NSObject
25 |
26 | /*!
27 | * Use to check the reachability of a given host name.
28 | */
29 | + (instancetype)reachabilityWithHostName:(NSString *)hostName;
30 |
31 | /*!
32 | * Use to check the reachability of a given IP address.
33 | */
34 | + (instancetype)reachabilityWithAddress:(const struct sockaddr_in *)hostAddress;
35 |
36 | /*!
37 | * Checks whether the default route is available. Should be used by applications that do not connect to a particular host.
38 | */
39 | + (instancetype)reachabilityForInternetConnection;
40 |
41 | /*!
42 | * Checks whether a local WiFi connection is available.
43 | */
44 | + (instancetype)reachabilityForLocalWiFi;
45 |
46 | /*!
47 | * Start listening for reachability notifications on the current run loop.
48 | */
49 | - (BOOL)startNotifier;
50 | - (void)stopNotifier;
51 |
52 | - (NetworkStatus)currentReachabilityStatus;
53 |
54 | /*!
55 | * WWAN may be available, but not active until a connection has been established. WiFi may require a connection for VPN on Demand.
56 | */
57 | - (BOOL)connectionRequired;
58 |
59 | @end
60 |
61 |
62 |
--------------------------------------------------------------------------------
/Reachability.m:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (C) 2015 Apple Inc. All Rights Reserved.
3 | See LICENSE.txt for this sample’s licensing information
4 |
5 | Abstract:
6 | Basic demonstration of how to use the SystemConfiguration Reachablity APIs.
7 | */
8 |
9 | #import
10 | #import
11 | #import
12 | #import
13 |
14 | #import
15 |
16 | #import "Reachability.h"
17 |
18 |
19 | NSString *kReachabilityChangedNotification = @"kNetworkReachabilityChangedNotification";
20 |
21 |
22 | #pragma mark - Supporting functions
23 |
24 | #define kShouldPrintReachabilityFlags 1
25 |
26 | static void PrintReachabilityFlags(SCNetworkReachabilityFlags flags, const char* comment)
27 | {
28 | #if kShouldPrintReachabilityFlags
29 |
30 | NSLog(@"Reachability Flag Status: %c%c %c%c%c%c%c%c%c %s\n",
31 | (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-',
32 | (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-',
33 |
34 | (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-',
35 | (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-',
36 | (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-',
37 | (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-',
38 | (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-',
39 | (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-',
40 | (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-',
41 | comment
42 | );
43 | #endif
44 | }
45 |
46 |
47 | static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info)
48 | {
49 | #pragma unused (target, flags)
50 | NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback");
51 | NSCAssert([(__bridge NSObject*) info isKindOfClass: [Reachability class]], @"info was wrong class in ReachabilityCallback");
52 |
53 | Reachability* noteObject = (__bridge Reachability *)info;
54 | // Post a notification to notify the client that the network reachability changed.
55 | [[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification object: noteObject];
56 | }
57 |
58 |
59 | #pragma mark - Reachability implementation
60 |
61 | @implementation Reachability
62 | {
63 | BOOL _alwaysReturnLocalWiFiStatus; //default is NO
64 | SCNetworkReachabilityRef _reachabilityRef;
65 | }
66 |
67 | + (instancetype)reachabilityWithHostName:(NSString *)hostName
68 | {
69 | Reachability* returnValue = NULL;
70 | SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]);
71 | if (reachability != NULL)
72 | {
73 | returnValue= [[self alloc] init];
74 | if (returnValue != NULL)
75 | {
76 | returnValue->_reachabilityRef = reachability;
77 | returnValue->_alwaysReturnLocalWiFiStatus = NO;
78 | }
79 | else {
80 | CFRelease(reachability);
81 | }
82 | }
83 | return returnValue;
84 | }
85 |
86 |
87 | + (instancetype)reachabilityWithAddress:(const struct sockaddr_in *)hostAddress
88 | {
89 | SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr *)hostAddress);
90 |
91 | Reachability* returnValue = NULL;
92 |
93 | if (reachability != NULL)
94 | {
95 | returnValue = [[self alloc] init];
96 | if (returnValue != NULL)
97 | {
98 | returnValue->_reachabilityRef = reachability;
99 | returnValue->_alwaysReturnLocalWiFiStatus = NO;
100 | }
101 | else {
102 | CFRelease(reachability);
103 | }
104 | }
105 | return returnValue;
106 | }
107 |
108 |
109 |
110 | + (instancetype)reachabilityForInternetConnection
111 | {
112 | struct sockaddr_in zeroAddress;
113 | bzero(&zeroAddress, sizeof(zeroAddress));
114 | zeroAddress.sin_len = sizeof(zeroAddress);
115 | zeroAddress.sin_family = AF_INET;
116 |
117 | return [self reachabilityWithAddress:&zeroAddress];
118 | }
119 |
120 |
121 | + (instancetype)reachabilityForLocalWiFi
122 | {
123 | struct sockaddr_in localWifiAddress;
124 | bzero(&localWifiAddress, sizeof(localWifiAddress));
125 | localWifiAddress.sin_len = sizeof(localWifiAddress);
126 | localWifiAddress.sin_family = AF_INET;
127 |
128 | // IN_LINKLOCALNETNUM is defined in as 169.254.0.0.
129 | localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM);
130 |
131 | Reachability* returnValue = [self reachabilityWithAddress: &localWifiAddress];
132 | if (returnValue != NULL)
133 | {
134 | returnValue->_alwaysReturnLocalWiFiStatus = YES;
135 | }
136 |
137 | return returnValue;
138 | }
139 |
140 |
141 | #pragma mark - Start and stop notifier
142 |
143 | - (BOOL)startNotifier
144 | {
145 | BOOL returnValue = NO;
146 | SCNetworkReachabilityContext context = {0, (__bridge void *)(self), NULL, NULL, NULL};
147 |
148 | if (SCNetworkReachabilitySetCallback(_reachabilityRef, ReachabilityCallback, &context))
149 | {
150 | if (SCNetworkReachabilityScheduleWithRunLoop(_reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode))
151 | {
152 | returnValue = YES;
153 | }
154 | }
155 |
156 | return returnValue;
157 | }
158 |
159 |
160 | - (void)stopNotifier
161 | {
162 | if (_reachabilityRef != NULL)
163 | {
164 | SCNetworkReachabilityUnscheduleFromRunLoop(_reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
165 | }
166 | }
167 |
168 |
169 | - (void)dealloc
170 | {
171 | [self stopNotifier];
172 | if (_reachabilityRef != NULL)
173 | {
174 | CFRelease(_reachabilityRef);
175 | }
176 | }
177 |
178 |
179 | #pragma mark - Network Flag Handling
180 |
181 | - (NetworkStatus)localWiFiStatusForFlags:(SCNetworkReachabilityFlags)flags
182 | {
183 | PrintReachabilityFlags(flags, "localWiFiStatusForFlags");
184 | NetworkStatus returnValue = NotReachable;
185 |
186 | if ((flags & kSCNetworkReachabilityFlagsReachable) && (flags & kSCNetworkReachabilityFlagsIsDirect))
187 | {
188 | returnValue = ReachableViaWiFi;
189 | }
190 |
191 | return returnValue;
192 | }
193 |
194 |
195 | - (NetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags
196 | {
197 | PrintReachabilityFlags(flags, "networkStatusForFlags");
198 | if ((flags & kSCNetworkReachabilityFlagsReachable) == 0)
199 | {
200 | // The target host is not reachable.
201 | return NotReachable;
202 | }
203 |
204 | NetworkStatus returnValue = NotReachable;
205 |
206 | if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0)
207 | {
208 | /*
209 | If the target host is reachable and no connection is required then we'll assume (for now) that you're on Wi-Fi...
210 | */
211 | returnValue = ReachableViaWiFi;
212 | }
213 |
214 | if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) ||
215 | (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0))
216 | {
217 | /*
218 | ... and the connection is on-demand (or on-traffic) if the calling application is using the CFSocketStream or higher APIs...
219 | */
220 |
221 | if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0)
222 | {
223 | /*
224 | ... and no [user] intervention is needed...
225 | */
226 | returnValue = ReachableViaWiFi;
227 | }
228 | }
229 |
230 | if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN)
231 | {
232 | /*
233 | ... but WWAN connections are OK if the calling application is using the CFNetwork APIs.
234 | */
235 | returnValue = ReachableViaWWAN;
236 | }
237 |
238 | return returnValue;
239 | }
240 |
241 |
242 | - (BOOL)connectionRequired
243 | {
244 | NSAssert(_reachabilityRef != NULL, @"connectionRequired called with NULL reachabilityRef");
245 | SCNetworkReachabilityFlags flags;
246 |
247 | if (SCNetworkReachabilityGetFlags(_reachabilityRef, &flags))
248 | {
249 | return (flags & kSCNetworkReachabilityFlagsConnectionRequired);
250 | }
251 |
252 | return NO;
253 | }
254 |
255 |
256 | - (NetworkStatus)currentReachabilityStatus
257 | {
258 | NSAssert(_reachabilityRef != NULL, @"currentNetworkStatus called with NULL SCNetworkReachabilityRef");
259 | NetworkStatus returnValue = NotReachable;
260 | SCNetworkReachabilityFlags flags;
261 |
262 | if (SCNetworkReachabilityGetFlags(_reachabilityRef, &flags))
263 | {
264 | if (_alwaysReturnLocalWiFiStatus)
265 | {
266 | returnValue = [self localWiFiStatusForFlags:flags];
267 | }
268 | else
269 | {
270 | returnValue = [self networkStatusForFlags:flags];
271 | }
272 | }
273 |
274 | return returnValue;
275 | }
276 |
277 |
278 | @end
279 |
--------------------------------------------------------------------------------
/control:
--------------------------------------------------------------------------------
1 | Package: com.zanehelton.unsplashwallpaper
2 | Name: UnsplashWallpaper
3 | Description: Set your wallpaper to a random photo from Unsplash.com to fit your iOS device with an Activator action.
4 | Version: 1.1.0
5 | Priority: optional
6 | Section: Addons (Activator)
7 | Architecture: iphoneos-arm
8 | Depends: mobilesubstrate, libactivator
9 | Maintainer: Zane Helton
10 | Author: Zane Helton
11 |
--------------------------------------------------------------------------------
/unsplashwallpaper/Makefile:
--------------------------------------------------------------------------------
1 | ARCHS = armv7 armv7s arm64
2 |
3 | TARGET = iphone:clang:latest:9.0.2
4 |
5 | THEOS_BUILD_DIR = Packages
6 |
7 | include theos/makefiles/common.mk
8 |
9 | BUNDLE_NAME = UnsplashWallpaper
10 | UnsplashWallpaper_CFLAGS = -fobjc-arc
11 | UnsplashWallpaper_FILES = UnsplashWallpaperListController.m
12 | UnsplashWallpaper_INSTALL_PATH = /Library/PreferenceBundles
13 | UnsplashWallpaper_FRAMEWORKS = Foundation UIKit
14 | UnsplashWallpaper_PRIVATE_FRAMEWORKS = Preferences
15 |
16 | include $(THEOS_MAKE_PATH)/bundle.mk
17 |
18 | internal-stage::
19 | $(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences$(ECHO_END)
20 | $(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/UnsplashWallpaper.plist$(ECHO_END)
21 |
--------------------------------------------------------------------------------
/unsplashwallpaper/Preferences/PSListController.h:
--------------------------------------------------------------------------------
1 | /* Generated by RuntimeBrowser
2 | Image: /System/Library/PrivateFrameworks/Preferences.framework/Preferences
3 | */
4 |
5 | #import "PSViewController.h"
6 |
7 | #import
8 | #import
9 |
10 | @class NSArray, NSMutableArray, NSMutableDictionary, NSString, UIActionSheet, UIAlertView, UIKeyboard, UIPopoverController, UITableView, UIView;
11 |
12 | @interface PSListController : PSViewController {
13 |
14 | /*
15 | struct CGPoint {
16 | float x;
17 | float y;
18 | UIActionSheet *_actionSheet;
19 | UIAlertView *_alertView;
20 | NSMutableArray *_bundleControllers;
21 | BOOL _bundlesLoaded;
22 | BOOL _cachesCells;
23 | NSMutableDictionary *_cells;
24 | UIView *_containerView;
25 | } _contentOffsetWithKeyboard;
26 | */
27 |
28 | BOOL _edgeToEdgeCells;
29 | BOOL _forceSynchronousIconLoadForCreatedCells;
30 | NSMutableArray *_groups;
31 | BOOL _hasAppeared;
32 | //UIKeyboard *_keyboard;
33 | BOOL _keyboardWasVisible;
34 | NSString *_offsetItemName;
35 | BOOL _popupIsDismissing;
36 | BOOL _popupIsModal;
37 | UIPopoverController *_popupStylePopoverController;
38 | BOOL _popupStylePopoverShouldRePresent;
39 | NSMutableArray *_prequeuedReusablePSTableCells;
40 | BOOL _reusesCells;
41 | BOOL _showingSetupController;
42 | NSString *_specifierID;
43 | NSArray *_specifiers;
44 | NSMutableDictionary *_specifiersByID;
45 | BOOL _swapAlertButtons;
46 | UITableView *_table;
47 | float _verticalContentOffset;
48 | }
49 |
50 | @property BOOL edgeToEdgeCells;
51 | @property BOOL forceSynchronousIconLoadForCreatedCells;
52 |
53 | + (BOOL)displaysButtonBar;
54 |
55 | - (void)_addIdentifierForSpecifier:(id)arg1;
56 | - (id)_createGroupIndices:(id)arg1;
57 | - (id)_customViewForSpecifier:(id)arg1 class:(Class)arg2 isHeader:(BOOL)arg3;
58 | - (BOOL)_getGroup:(int*)arg1 row:(int*)arg2 ofSpecifierAtIndex:(int)arg3 groups:(id)arg4;
59 | - (float)_getKeyboardIntersectionHeight;
60 | - (void)_handleActionSheet:(id)arg1 clickedButtonAtIndex:(int)arg2;
61 | - (void)_insertContiguousSpecifiers:(id)arg1 atIndex:(int)arg2 animated:(BOOL)arg3;
62 | - (void)_keyboardDidHide:(id)arg1;
63 | - (void)_keyboardWillHide:(id)arg1;
64 | - (void)_keyboardWillShow:(id)arg1;
65 | - (void)_loadBundleControllers;
66 | - (int)_nextGroupInSpecifiersAfterIndex:(int)arg1 inArray:(id)arg2;
67 | - (void)_removeContiguousSpecifiers:(id)arg1 animated:(BOOL)arg2;
68 | - (void)_removeIdentifierForSpecifier:(id)arg1;
69 | - (void)_returnKeyPressed:(id)arg1;
70 | - (void)_scrollToSpecifierNamed:(id)arg1;
71 | - (void)_setContentInset:(float)arg1;
72 | - (void)_setNotShowingSetupController;
73 | - (float)_tableView:(id)arg1 heightForCustomInSection:(int)arg2 isHeader:(BOOL)arg3;
74 | - (id)_tableView:(id)arg1 viewForCustomInSection:(int)arg2 isHeader:(BOOL)arg3;
75 | - (void)_unloadBundleControllers;
76 | - (void)actionSheet:(id)arg1 clickedButtonAtIndex:(NSInteger)arg2;
77 | - (void)actionSheet:(id)arg1 didDismissWithButtonIndex:(NSInteger)arg2;
78 | - (void)addSpecifier:(id)arg1 animated:(BOOL)arg2;
79 | - (void)addSpecifier:(id)arg1;
80 | - (void)addSpecifiersFromArray:(id)arg1 animated:(BOOL)arg2;
81 | - (void)addSpecifiersFromArray:(id)arg1;
82 | - (void)alertView:(id)arg1 clickedButtonAtIndex:(NSInteger)arg2;
83 | - (void)beginUpdates;
84 | - (id)bundle;
85 | - (id)cachedCellForSpecifier:(id)arg1;
86 | - (id)cachedCellForSpecifierID:(id)arg1;
87 | - (void)clearCache;
88 | - (void)confirmationViewAcceptedForSpecifier:(id)arg1;
89 | - (void)confirmationViewCancelledForSpecifier:(id)arg1;
90 | - (BOOL)containsSpecifier:(id)arg1;
91 | - (id)controllerForRowAtIndexPath:(id)arg1;
92 | - (id)controllerForSpecifier:(id)arg1;
93 | - (void)createGroupIndices;
94 | - (void)createPrequeuedPSTableCells:(unsigned int)arg1;
95 | - (void)dealloc;
96 | - (id)description;
97 | - (void)didRotateFromInterfaceOrientation:(int)arg1;
98 | - (void)dismissConfirmationViewForSpecifier:(id)arg1 animated:(BOOL)arg2;
99 | - (void)dismissPopover;
100 | - (void)dismissPopoverAnimated:(BOOL)arg1;
101 | - (BOOL)edgeToEdgeCells;
102 | - (void)endUpdates;
103 | - (id)findFirstVisibleResponder;
104 | - (BOOL)forceSynchronousIconLoadForCreatedCells;
105 | - (void)formSheetViewWillDisappear;
106 | - (BOOL)getGroup:(int*)arg1 row:(int*)arg2 ofSpecifier:(id)arg3;
107 | - (BOOL)getGroup:(int*)arg1 row:(int*)arg2 ofSpecifierAtIndex:(int)arg3;
108 | - (BOOL)getGroup:(int*)arg1 row:(int*)arg2 ofSpecifierID:(id)arg3;
109 | - (void)handleURL:(id)arg1;
110 | - (int)indexForIndexPath:(id)arg1;
111 | - (int)indexForRow:(int)arg1 inGroup:(int)arg2;
112 | - (int)indexOfGroup:(int)arg1;
113 | - (int)indexOfSpecifier:(id)arg1;
114 | - (int)indexOfSpecifierID:(id)arg1;
115 | - (id)indexPathForIndex:(int)arg1;
116 | - (id)indexPathForSpecifier:(id)arg1;
117 | - (id)init;
118 | - (id)initForContentSize:(CGSize)arg1;
119 | - (void)insertContiguousSpecifiers:(id)arg1 afterSpecifier:(id)arg2 animated:(BOOL)arg3;
120 | - (void)insertContiguousSpecifiers:(id)arg1 afterSpecifier:(id)arg2;
121 | - (void)insertContiguousSpecifiers:(id)arg1 afterSpecifierID:(id)arg2 animated:(BOOL)arg3;
122 | - (void)insertContiguousSpecifiers:(id)arg1 afterSpecifierID:(id)arg2;
123 | - (void)insertContiguousSpecifiers:(id)arg1 atEndOfGroup:(int)arg2 animated:(BOOL)arg3;
124 | - (void)insertContiguousSpecifiers:(id)arg1 atEndOfGroup:(int)arg2;
125 | - (void)insertContiguousSpecifiers:(id)arg1 atIndex:(int)arg2 animated:(BOOL)arg3;
126 | - (void)insertContiguousSpecifiers:(id)arg1 atIndex:(int)arg2;
127 | - (void)insertSpecifier:(id)arg1 afterSpecifier:(id)arg2 animated:(BOOL)arg3;
128 | - (void)insertSpecifier:(id)arg1 afterSpecifier:(id)arg2;
129 | - (void)insertSpecifier:(id)arg1 afterSpecifierID:(id)arg2 animated:(BOOL)arg3;
130 | - (void)insertSpecifier:(id)arg1 afterSpecifierID:(id)arg2;
131 | - (void)insertSpecifier:(id)arg1 atEndOfGroup:(int)arg2 animated:(BOOL)arg3;
132 | - (void)insertSpecifier:(id)arg1 atEndOfGroup:(int)arg2;
133 | - (void)insertSpecifier:(id)arg1 atIndex:(int)arg2 animated:(BOOL)arg3;
134 | - (void)insertSpecifier:(id)arg1 atIndex:(int)arg2;
135 | - (void)lazyLoadBundle:(id)arg1;
136 | - (id)loadSpecifiersFromPlistName:(id)arg1 target:(id)arg2;
137 | - (void)loadView;
138 | - (void)loseFocus;
139 | - (void)migrateSpecifierMetadataFrom:(id)arg1 to:(id)arg2;
140 | - (int)numberOfGroups;
141 | - (BOOL)performActionForSpecifier:(id)arg1;
142 | - (BOOL)performButtonActionForSpecifier:(id)arg1;
143 | - (BOOL)performConfirmationActionForSpecifier:(id)arg1;
144 | - (BOOL)performConfirmationCancelActionForSpecifier:(id)arg1;
145 | - (BOOL)performLoadActionForSpecifier:(id)arg1;
146 | - (void)popoverController:(id)arg1 animationCompleted:(int)arg2;
147 | - (BOOL)popoverControllerShouldDismissPopover:(id)arg1;
148 | - (id)popupStylePopoverController;
149 | - (void)popupViewWillDisappear;
150 | - (void)prepareSpecifiersMetadata;
151 | - (void)pushController:(id)arg1 animate:(BOOL)arg2;
152 | - (void)pushController:(id)arg1;
153 | - (void)reload;
154 | - (void)reloadIconForSpecifierForBundle:(id)arg1;
155 | - (void)reloadSpecifier:(id)arg1 animated:(BOOL)arg2;
156 | - (void)reloadSpecifier:(id)arg1;
157 | - (void)reloadSpecifierAtIndex:(int)arg1 animated:(BOOL)arg2;
158 | - (void)reloadSpecifierAtIndex:(int)arg1;
159 | - (void)reloadSpecifierID:(id)arg1 animated:(BOOL)arg2;
160 | - (void)reloadSpecifierID:(id)arg1;
161 | - (void)reloadSpecifiers;
162 | - (void)removeContiguousSpecifiers:(id)arg1 animated:(BOOL)arg2;
163 | - (void)removeContiguousSpecifiers:(id)arg1;
164 | - (void)removeLastSpecifier;
165 | - (void)removeLastSpecifierAnimated:(BOOL)arg1;
166 | - (void)removeSpecifier:(id)arg1 animated:(BOOL)arg2;
167 | - (void)removeSpecifier:(id)arg1;
168 | - (void)removeSpecifierAtIndex:(int)arg1 animated:(BOOL)arg2;
169 | - (void)removeSpecifierAtIndex:(int)arg1;
170 | - (void)removeSpecifierID:(id)arg1 animated:(BOOL)arg2;
171 | - (void)removeSpecifierID:(id)arg1;
172 | - (void)replaceContiguousSpecifiers:(id)arg1 withSpecifiers:(id)arg2 animated:(BOOL)arg3;
173 | - (void)replaceContiguousSpecifiers:(id)arg1 withSpecifiers:(id)arg2;
174 | - (void)returnPressedAtEnd;
175 | - (int)rowsForGroup:(int)arg1;
176 | - (void)selectRowForSpecifier:(id)arg1;
177 | - (void)setCachesCells:(BOOL)arg1;
178 | - (void)setDesiredVerticalContentOffset:(float)arg1;
179 | - (void)setDesiredVerticalContentOffsetItemNamed:(id)arg1;
180 | - (void)setEdgeToEdgeCells:(BOOL)arg1;
181 | - (void)setForceSynchronousIconLoadForCreatedCells:(BOOL)arg1;
182 | - (void)setReusesCells:(BOOL)arg1;
183 | - (void)setSpecifier:(id)arg1;
184 | - (void)setSpecifierID:(id)arg1;
185 | - (void)setSpecifiers:(id)arg1;
186 | - (void)setTitle:(id)arg1;
187 | - (BOOL)shouldReloadSpecifiersOnResume;
188 | - (BOOL)shouldSelectResponderOnAppearance;
189 | - (void)showConfirmationViewForSpecifier:(id)arg1 useAlert:(BOOL)arg2 swapAlertButtons:(BOOL)arg3;
190 | - (void)showConfirmationViewForSpecifier:(id)arg1;
191 | - (void)showPINSheet:(id)arg1;
192 | - (id)specifier;
193 | - (id)specifierAtIndex:(int)arg1;
194 | - (id)specifierForID:(id)arg1;
195 | - (id)specifierID;
196 | - (id)specifiers;
197 | - (id)specifiersInGroup:(int)arg1;
198 | - (id)table;
199 | - (Class)tableViewClass;
200 | - (void)updateSpecifiers:(id)arg1 withSpecifiers:(id)arg2;
201 | - (void)updateSpecifiersInRange:(NSRange)arg1 withSpecifiers:(id)arg2;
202 | - (float)verticalContentOffset;
203 | - (void)viewDidAppear:(BOOL)arg1;
204 | - (void)viewDidLayoutSubviews;
205 | - (void)viewDidLoad;
206 | - (void)viewDidUnload;
207 | - (void)viewWillAppear:(BOOL)arg1;
208 | - (void)viewWillDisappear:(BOOL)arg1;
209 | - (void)willAnimateRotationToInterfaceOrientation:(int)arg1 duration:(double)arg2;
210 |
211 | @end
--------------------------------------------------------------------------------
/unsplashwallpaper/Preferences/PSSpecifier.h:
--------------------------------------------------------------------------------
1 | /* Generated by RuntimeBrowser
2 | Image: /System/Library/PrivateFrameworks/Preferences.framework/Preferences
3 | */
4 |
5 | #import
6 | #import
7 | #import
8 |
9 | //@class CNFRegAlias, IMAccount, NSArray, NSDictionary, NSMutableDictionary, NSString;
10 |
11 | typedef enum PSTableCellType {
12 | PSGroupCell,
13 | PSLinkCell,
14 | PSLinkListCell,
15 | PSListItemCell,
16 | PSTitleValueCell,
17 | PSSliderCell,
18 | PSSwitchCell,
19 | PSStaticTextCell,
20 | PSEditTextCell,
21 | PSSegmentCell,
22 | PSGiantIconCell,
23 | PSGiantCell,
24 | PSSecureEditTextCell,
25 | PSButtonCell,
26 | PSEditTextViewCell
27 | } PSSpecifierType;
28 |
29 |
30 | @interface PSSpecifier : NSObject {
31 | SEL _buttonAction;
32 | SEL _confirmationAction;
33 | SEL _confirmationCancelAction;
34 | SEL _controllerLoadAction;
35 | NSString *_name;
36 | NSMutableDictionary *_properties;
37 | NSDictionary *_shortTitleDict;
38 | BOOL _showContentString;
39 | NSDictionary *_titleDict;
40 | id _userInfo;
41 | NSArray *_values;
42 | SEL action;
43 | int autoCapsType;
44 | int autoCorrectionType;
45 | SEL cancel;
46 | int cellType;
47 | Class detailControllerClass;
48 | Class editPaneClass;
49 | SEL getter;
50 | int keyboardType;
51 | SEL setter;
52 | id target;
53 | unsigned int textFieldType;
54 | }
55 |
56 | //@property (retain) IMAccount * CNFRegAccount;
57 | //@property (retain) CNFRegAlias * CNFRegAlias;
58 | //@property (retain) CNFRegAlias * CNFRegCallerIdAlias;
59 | @property (assign) SEL buttonAction;
60 | @property (assign) int cellType;
61 | @property (assign) SEL confirmationAction;
62 | @property (assign) SEL confirmationCancelAction;
63 | @property (assign) SEL controllerLoadAction;
64 | @property (assign) Class detailControllerClass;
65 | @property (assign) Class editPaneClass;
66 | @property (retain) NSString * identifier;
67 | @property (retain) NSString * name;
68 | @property (retain) NSDictionary * shortTitleDictionary;
69 | @property (assign) BOOL showContentString;
70 | @property (assign) id target;
71 | @property (retain) NSDictionary * titleDictionary;
72 | @property (retain) id userInfo;
73 | @property (retain) NSArray * values;
74 |
75 | + (id)_dataclassToBundleId;
76 | + (id)acui_linkListCellSpecifierForDataclass:(id)arg1 target:(id)arg2 set:(SEL)arg3 get:(SEL)arg4 detail:(Class)arg5;
77 | + (id)acui_specifierForAppWithBundleID:(id)arg1 target:(id)arg2 set:(SEL)arg3 get:(SEL)arg4;
78 | + (id)acui_specifierForDataclass:(id)arg1 target:(id)arg2 set:(SEL)arg3 get:(SEL)arg4;
79 | + (int)autoCapsTypeForString:(id)arg1;
80 | + (int)autoCorrectionTypeForNumber:(id)arg1;
81 | + (id)buttonSpecifierWithTitle:(id)arg1 target:(id)arg2 action:(SEL)arg3 confirmationInfo:(id)arg4;
82 | + (id)deleteButtonSpecifierWithName:(id)arg1 target:(id)arg2 action:(SEL)arg3;
83 | + (id)emptyGroupSpecifier;
84 | + (id)groupSpecifierWithFooterLinkButton:(id)arg1;
85 | + (id)groupSpecifierWithFooterText:(id)arg1 linkButton:(id)arg2;
86 | + (id)groupSpecifierWithFooterText:(id)arg1 linkButtons:(id)arg2;
87 | + (id)groupSpecifierWithHeader:(id)arg1 footer:(id)arg2 linkButtons:(id)arg3;
88 | + (id)groupSpecifierWithHeader:(id)arg1 footer:(id)arg2;
89 | + (id)groupSpecifierWithName:(id)arg1;
90 | + (int)keyboardTypeForString:(id)arg1;
91 | + (id)preferenceSpecifierNamed:(id)arg1 target:(id)arg2 set:(SEL)arg3 get:(SEL)arg4 detail:(Class)arg5 cell:(int)arg6 edit:(Class)arg7;
92 | + (id)switchSpecifierWithTitle:(id)arg1 target:(id)arg2 setter:(SEL)arg3 getter:(SEL)arg4 key:(id)arg5;
93 |
94 | - (id)CNFRegAccount;
95 | - (id)CNFRegAlias;
96 | - (id)CNFRegCallerIdAlias;
97 | - (id)acui_appBundleID;
98 | - (id)acui_dataclass;
99 | - (SEL)buttonAction;
100 | - (int)cellType;
101 | - (SEL)confirmationAction;
102 | - (SEL)confirmationCancelAction;
103 | - (SEL)controllerLoadAction;
104 | - (void)dealloc;
105 | - (id)description;
106 | - (Class)detailControllerClass;
107 | - (Class)editPaneClass;
108 | - (id)identifier;
109 | - (id)init;
110 | - (void)loadValuesAndTitlesFromDataSource;
111 | - (id)name;
112 | - (id)properties;
113 | - (id)propertyForKey:(id)arg1;
114 | - (void)removePropertyForKey:(id)arg1;
115 | - (void)setButtonAction:(SEL)arg1;
116 | - (void)setCNFRegAccount:(id)arg1;
117 | - (void)setCNFRegAlias:(id)arg1;
118 | - (void)setCNFRegCallerIdAlias:(id)arg1;
119 | - (void)setCellType:(int)arg1;
120 | - (void)setConfirmationAction:(SEL)arg1;
121 | - (void)setConfirmationCancelAction:(SEL)arg1;
122 | - (void)setControllerLoadAction:(SEL)arg1;
123 | - (void)setDetailControllerClass:(Class)arg1;
124 | - (void)setEditPaneClass:(Class)arg1;
125 | - (void)setKeyboardType:(int)arg1 autoCaps:(int)arg2 autoCorrection:(int)arg3;
126 | - (void)setProperties:(id)arg1;
127 | - (void)setProperty:(id)arg1 forKey:(id)arg2;
128 | - (void)setShowContentString:(BOOL)arg1;
129 | - (void)setTarget:(id)arg1;
130 | - (void)setUserInfo:(id)arg1;
131 | - (void)setValues:(id)arg1 titles:(id)arg2 shortTitles:(id)arg3 usingLocalizedTitleSorting:(BOOL)arg4;
132 | - (void)setValues:(id)arg1 titles:(id)arg2 shortTitles:(id)arg3;
133 | - (void)setValues:(id)arg1 titles:(id)arg2;
134 | - (void)setupIconImageWithBundle:(id)arg1;
135 | - (void)setupIconImageWithPath:(id)arg1;
136 | - (id)shortTitleDictionary;
137 | - (BOOL)showContentString;
138 | - (id)target;
139 | - (int)titleCompare:(id)arg1;
140 | - (id)titleDictionary;
141 | - (id)userInfo;
142 | - (id)values;
143 |
144 | @end
--------------------------------------------------------------------------------
/unsplashwallpaper/Preferences/PSViewController.h:
--------------------------------------------------------------------------------
1 | /* Generated by RuntimeBrowser
2 | Image: /System/Library/PrivateFrameworks/Preferences.framework/Preferences
3 | */
4 |
5 | #import
6 | #import
7 |
8 | //@class PSRootController, PSSpecifier, UIViewController;
9 |
10 | @interface PSViewController : UIViewController /**/ {
11 | /*UIViewController *_parentController;
12 | PSRootController *_rootController;
13 | PSSpecifier *_specifier;*/
14 | }
15 |
16 | - (BOOL)canBeShownFromSuspendedState;
17 | - (void)dealloc;
18 | - (void)didLock;
19 | - (void)didUnlock;
20 | - (void)didWake;
21 | - (void)formSheetViewDidDisappear;
22 | - (void)formSheetViewWillDisappear;
23 | - (void)handleURL:(id)arg1;
24 | - (id)parentController;
25 | - (void)popupViewDidDisappear;
26 | - (void)popupViewWillDisappear;
27 | - (void)pushController:(id)arg1;
28 | - (id)readPreferenceValue:(id)arg1;
29 | - (id)rootController;
30 | - (void)setParentController:(id)arg1;
31 | - (void)setPreferenceValue:(id)arg1 specifier:(id)arg2;
32 | - (void)setRootController:(id)arg1;
33 | - (void)setSpecifier:(id)arg1;
34 | - (id)specifier;
35 | - (void)statusBarWillAnimateByHeight:(float)arg1;
36 | - (void)suspend;
37 | - (void)willBecomeActive;
38 | - (void)willResignActive;
39 | - (void)willUnlock;
40 |
41 | @end
--------------------------------------------------------------------------------
/unsplashwallpaper/Resources/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | UnsplashWallpaper
9 | CFBundleIdentifier
10 | com.zanehelton.unsplashwallpaper
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1.0
21 | DTPlatformName
22 | iphoneos
23 | MinimumOSVersion
24 | 9.0.2
25 | NSPrincipalClass
26 | UnsplashWallpaperListController
27 |
28 |
29 |
--------------------------------------------------------------------------------
/unsplashwallpaper/Resources/UnsplashWallpaper.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | items
6 |
7 |
8 | cell
9 | PSGroupCell
10 | label
11 | Settings
12 |
13 |
14 | cell
15 | PSSwitchCell
16 | default
17 |
18 | defaults
19 | com.zanehelton.unsplashwallpaper
20 | key
21 | savetophotos
22 | label
23 | Save to Photos
24 |
25 |
26 | cell
27 | PSSegmentCell
28 | default
29 | both
30 | defaults
31 | com.zanehelton.unsplashwallpaper
32 | validValues
33 |
34 | both
35 | home
36 | lock
37 |
38 | validTitles
39 |
40 | Both
41 | Home
42 | Lock
43 |
44 | shortTitles
45 |
46 | Both
47 | Home
48 | Lock
49 |
50 | key
51 | wallmode
52 |
53 |
54 | cell
55 | PSGroupCell
56 | label
57 | Social
58 |
59 |
60 | cell
61 | PSButtonCell
62 | label
63 | Follow @ZaneHelton
64 | action
65 | openTwitter
66 |
67 |
68 | cell
69 | PSButtonCell
70 | label
71 | Open on GitHub
72 | action
73 | openGithub
74 |
75 |
76 | cell
77 | PSGroupCell
78 | footerText
79 | © 2015 Zane Helton
80 |
81 |
82 | title
83 | UnsplashWallpaper
84 |
85 |
86 |
--------------------------------------------------------------------------------
/unsplashwallpaper/Resources/UnsplashWallpaper.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZaneH/unsplashwallpaper/8140e7c27afca671abf40acab5b7887f5374757a/unsplashwallpaper/Resources/UnsplashWallpaper.png
--------------------------------------------------------------------------------
/unsplashwallpaper/Resources/UnsplashWallpaper@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ZaneH/unsplashwallpaper/8140e7c27afca671abf40acab5b7887f5374757a/unsplashwallpaper/Resources/UnsplashWallpaper@2x.png
--------------------------------------------------------------------------------
/unsplashwallpaper/UnsplashWallpaperListController.h:
--------------------------------------------------------------------------------
1 | //
2 | // UnsplashWallpaperListController.h
3 | // UnsplashWallpaper
4 | //
5 | // Created by Zane Helton on 14.11.2015.
6 | // Copyright (c) 2015 Zane Helton. All rights reserved.
7 | //
8 |
9 | #import "Preferences/PSListController.h"
10 |
11 | @interface UnsplashWallpaperListController : PSListController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/unsplashwallpaper/UnsplashWallpaperListController.m:
--------------------------------------------------------------------------------
1 | //
2 | // UnsplashWallpaperListController.m
3 | // UnsplashWallpaper
4 | //
5 | // Created by Zane Helton on 14.11.2015.
6 | // Copyright (c) 2015 Zane Helton. All rights reserved.
7 | //
8 |
9 | #import "UnsplashWallpaperListController.h"
10 |
11 | @implementation UnsplashWallpaperListController
12 |
13 | - (id)specifiers {
14 | if (_specifiers == nil) {
15 | _specifiers = [self loadSpecifiersFromPlistName:@"UnsplashWallpaper" target:self];
16 | }
17 | return _specifiers;
18 | }
19 |
20 | - (void)openGithub {
21 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.github.com/ZaneH/unsplashwallpaper"]];
22 | }
23 |
24 | - (void)openTwitter {
25 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.twitter.com/ZaneHelton"]];
26 | }
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/unsplashwallpaper/entry.plist:
--------------------------------------------------------------------------------
1 | {
2 | entry = {
3 | bundle = UnsplashWallpaper;
4 | cell = PSLinkCell;
5 | detail = UnsplashWallpaperListController;
6 | icon = UnsplashWallpaper.png;
7 | isController = 1;
8 | label = UnsplashWallpaper;
9 | };
10 | }
11 |
--------------------------------------------------------------------------------