├── .gitignore ├── Evyrest.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── swiftpm │ │ │ └── Package.resolved │ └── xcuserdata │ │ ├── lemin.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ ├── llsc12.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── sourcelocation.xcuserdatad │ │ └── UserInterfaceState.xcuserstate ├── xcshareddata │ └── xcschemes │ │ └── Evyrest.xcscheme └── xcuserdata │ ├── exerhythm.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ └── xcschememanagement.plist │ ├── llsc12.xcuserdatad │ └── xcschemes │ │ └── xcschememanagement.plist │ ├── miso.xcuserdatad │ └── xcschemes │ │ └── xcschememanagement.plist │ └── sourcelocation.xcuserdatad │ └── xcdebugger │ └── Breakpoints_v2.xcbkptlist ├── Evyrest ├── API │ ├── ImageSourcing.swift │ ├── SourcedRepoFetcher.swift │ └── WallpapersCraftWrapper.swift ├── AppDelegate.swift ├── Assets.xcassets │ ├── .DS_Store │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ ├── Artboard.png │ │ └── Contents.json │ ├── Background.imageset │ │ ├── Background.png │ │ └── Contents.json │ ├── Background2.imageset │ │ ├── Bitmap.png │ │ └── Contents.json │ ├── BackgroundColor.colorset │ │ └── Contents.json │ ├── Contents.json │ ├── Evyrest.imageset │ │ ├── Contents.json │ │ └── logo.png │ ├── Local.imageset │ │ ├── Contents.json │ │ └── local.png │ ├── Microsoft.imageset │ │ ├── Contents.json │ │ └── microsoft.png │ ├── Pexels.imageset │ │ ├── Contents.json │ │ └── pexels.png │ ├── Unsplash.imageset │ │ ├── Contents.json │ │ └── unsplash.png │ ├── discord.imageset │ │ ├── Contents.json │ │ └── discord-mark-white.png │ ├── evyrest_image.imageset │ │ ├── Contents.json │ │ └── Path.png │ └── github.imageset │ │ ├── Contents.json │ │ └── GitHub-Mark-64px.png ├── Controllers │ ├── ApplicationMonitor.swift │ ├── LocationManager.swift │ └── WallpaperController.swift ├── Evyrest-Bridging-Header.h ├── EvyrestApp.swift ├── Extensions │ ├── Alert++.swift │ ├── Color++.swift │ ├── String++.swift │ └── TextField++.swift ├── Info.plist ├── Private APIs │ └── WallpaperSetter.swift ├── RemLog │ ├── RemoteLog.h │ └── RemoteLog.swift ├── Utilities │ ├── Keychain │ │ ├── KeychainItemAccessibility.swift │ │ ├── KeychainWrapper.swift │ │ └── SwiftUIPropertyWrapper.swift │ ├── NetworkStatus.swift │ └── Storage │ │ └── StorageManager.swift └── Views │ ├── AboutView.swift │ ├── ContentView.swift │ ├── LoginView.swift │ ├── OptionsView.swift │ └── UtilityViews │ ├── MaterialView.swift │ └── ParallaxEffect.swift ├── LICENSE ├── README.md ├── entitlements.plist └── ipabuild.sh /.gitignore: -------------------------------------------------------------------------------- 1 | build/ -------------------------------------------------------------------------------- /Evyrest.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 56; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2122AF4D295B2E8E00BF7B0D /* LocationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2122AF4C295B2E8E00BF7B0D /* LocationManager.swift */; }; 11 | 2122AF52295B349400BF7B0D /* Alert++.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2122AF51295B349400BF7B0D /* Alert++.swift */; }; 12 | 216B5CBB2964C8020059D378 /* TextField++.swift in Sources */ = {isa = PBXBuildFile; fileRef = 216B5CBA2964C8020059D378 /* TextField++.swift */; }; 13 | 21763939295DB97D0081518F /* ApplicationMonitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21763938295DB97D0081518F /* ApplicationMonitor.swift */; }; 14 | 2176393C295DBB900081518F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2176393B295DBB900081518F /* AppDelegate.swift */; }; 15 | 2176393E295DD4580081518F /* WallpaperController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2176393D295DD4580081518F /* WallpaperController.swift */; }; 16 | 21D1A1A3295C55A600AC45BB /* Dynamic in Frameworks */ = {isa = PBXBuildFile; productRef = 21D1A1A2295C55A600AC45BB /* Dynamic */; }; 17 | 21D702CD295F14AE007AD19D /* OptionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D702CC295F14AE007AD19D /* OptionsView.swift */; }; 18 | 21E6D48C295BA395009FF3C8 /* WallpaperSetter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E6D48B295BA395009FF3C8 /* WallpaperSetter.swift */; }; 19 | 42FBACE129364BAB00B5B58A /* EvyrestApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42FBACE029364BAB00B5B58A /* EvyrestApp.swift */; }; 20 | 42FBACE329364BAB00B5B58A /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42FBACE229364BAB00B5B58A /* ContentView.swift */; }; 21 | 42FBACE529364BAF00B5B58A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 42FBACE429364BAF00B5B58A /* Assets.xcassets */; }; 22 | 6F721C82296478E1001CFE46 /* WallpapersCraftWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F721C81296478E1001CFE46 /* WallpapersCraftWrapper.swift */; }; 23 | AA5A56762937D96F0037B6AA /* KeychainWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA5A56742937D96F0037B6AA /* KeychainWrapper.swift */; }; 24 | AA5A56772937D96F0037B6AA /* KeychainItemAccessibility.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA5A56752937D96F0037B6AA /* KeychainItemAccessibility.swift */; }; 25 | AA5A56792937DA9E0037B6AA /* SwiftUIPropertyWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA5A56782937DA9E0037B6AA /* SwiftUIPropertyWrapper.swift */; }; 26 | AA5A567C2937E2030037B6AA /* StorageManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA5A567B2937E2030037B6AA /* StorageManager.swift */; }; 27 | AA5A567F2937E7750037B6AA /* Color++.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA5A567E2937E7750037B6AA /* Color++.swift */; }; 28 | AADAAF56295F268C0011A423 /* AboutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AADAAF55295F268C0011A423 /* AboutView.swift */; }; 29 | CE1A4F4A2942970B006C1B19 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE1A4F492942970B006C1B19 /* CoreFoundation.framework */; }; 30 | CE1A4F4C29429717006C1B19 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE1A4F4B29429717006C1B19 /* IOKit.framework */; }; 31 | CE1A4F502942B73E006C1B19 /* entitlements.plist in Resources */ = {isa = PBXBuildFile; fileRef = CE1A4F4F2942B73E006C1B19 /* entitlements.plist */; }; 32 | CE2066FA2937B92B008FC95B /* LoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE2066F92937B92B008FC95B /* LoginView.swift */; }; 33 | CE62634F294A409A00F7B237 /* String++.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE62634E294A409A00F7B237 /* String++.swift */; }; 34 | CE626353294A46E700F7B237 /* MaterialView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE626352294A46E700F7B237 /* MaterialView.swift */; }; 35 | CE9BB50B29611C6F0056A85E /* NetworkStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE9BB50A29611C6F0056A85E /* NetworkStatus.swift */; }; 36 | CEA54ACD2937EC44000920C6 /* SourcedRepoFetcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA54ACB2937EC44000920C6 /* SourcedRepoFetcher.swift */; }; 37 | CEA54ACE2937EC44000920C6 /* ImageSourcing.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA54ACC2937EC44000920C6 /* ImageSourcing.swift */; }; 38 | CEBA3F1A293A891D00CE4BB3 /* ParallaxEffect.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEBA3F19293A891C00CE4BB3 /* ParallaxEffect.swift */; }; 39 | CEF9199529401C45007EF5F9 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEF9199429401C45007EF5F9 /* CoreServices.framework */; }; 40 | CEF919A629401D91007EF5F9 /* RemoteLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEF919A529401D91007EF5F9 /* RemoteLog.swift */; }; 41 | /* End PBXBuildFile section */ 42 | 43 | /* Begin PBXCopyFilesBuildPhase section */ 44 | CEF9198329401888007EF5F9 /* Embed Foundation Extensions */ = { 45 | isa = PBXCopyFilesBuildPhase; 46 | buildActionMask = 2147483647; 47 | dstPath = ""; 48 | dstSubfolderSpec = 13; 49 | files = ( 50 | ); 51 | name = "Embed Foundation Extensions"; 52 | runOnlyForDeploymentPostprocessing = 0; 53 | }; 54 | /* End PBXCopyFilesBuildPhase section */ 55 | 56 | /* Begin PBXFileReference section */ 57 | 2122AF4C295B2E8E00BF7B0D /* LocationManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocationManager.swift; sourceTree = ""; }; 58 | 2122AF51295B349400BF7B0D /* Alert++.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Alert++.swift"; sourceTree = ""; }; 59 | 216B5CBA2964C8020059D378 /* TextField++.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TextField++.swift"; sourceTree = ""; }; 60 | 21763938295DB97D0081518F /* ApplicationMonitor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplicationMonitor.swift; sourceTree = ""; }; 61 | 2176393B295DBB900081518F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 62 | 2176393D295DD4580081518F /* WallpaperController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WallpaperController.swift; sourceTree = ""; }; 63 | 21D702CC295F14AE007AD19D /* OptionsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OptionsView.swift; sourceTree = ""; }; 64 | 21E6D48B295BA395009FF3C8 /* WallpaperSetter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WallpaperSetter.swift; sourceTree = ""; }; 65 | 42FBACDD29364BAB00B5B58A /* Evyrest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Evyrest.app; sourceTree = BUILT_PRODUCTS_DIR; }; 66 | 42FBACE029364BAB00B5B58A /* EvyrestApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EvyrestApp.swift; sourceTree = ""; }; 67 | 42FBACE229364BAB00B5B58A /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 68 | 42FBACE429364BAF00B5B58A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 69 | 6F721C81296478E1001CFE46 /* WallpapersCraftWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WallpapersCraftWrapper.swift; sourceTree = ""; }; 70 | AA5A56742937D96F0037B6AA /* KeychainWrapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeychainWrapper.swift; sourceTree = ""; }; 71 | AA5A56752937D96F0037B6AA /* KeychainItemAccessibility.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeychainItemAccessibility.swift; sourceTree = ""; }; 72 | AA5A56782937DA9E0037B6AA /* SwiftUIPropertyWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIPropertyWrapper.swift; sourceTree = ""; }; 73 | AA5A567B2937E2030037B6AA /* StorageManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StorageManager.swift; sourceTree = ""; }; 74 | AA5A567E2937E7750037B6AA /* Color++.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Color++.swift"; sourceTree = ""; }; 75 | AADAAF55295F268C0011A423 /* AboutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutView.swift; sourceTree = ""; }; 76 | CE1A4F47294293C2006C1B19 /* libxpc_datastores.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libxpc_datastores.tbd; path = usr/lib/libxpc_datastores.tbd; sourceTree = SDKROOT; }; 77 | CE1A4F492942970B006C1B19 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; 78 | CE1A4F4B29429717006C1B19 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; 79 | CE1A4F4D2942972C006C1B19 /* libSystem.B.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libSystem.B.tbd; path = usr/lib/libSystem.B.tbd; sourceTree = SDKROOT; }; 80 | CE1A4F4F2942B73E006C1B19 /* entitlements.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = entitlements.plist; sourceTree = SOURCE_ROOT; }; 81 | CE2066F92937B92B008FC95B /* LoginView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginView.swift; sourceTree = ""; }; 82 | CE4F34EA29428C84006F1B36 /* libSystem.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libSystem.tbd; path = usr/lib/libSystem.tbd; sourceTree = SDKROOT; }; 83 | CE62634E294A409A00F7B237 /* String++.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String++.swift"; sourceTree = ""; }; 84 | CE626352294A46E700F7B237 /* MaterialView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialView.swift; sourceTree = ""; }; 85 | CE9BB50A29611C6F0056A85E /* NetworkStatus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkStatus.swift; sourceTree = ""; }; 86 | CEA54ACB2937EC44000920C6 /* SourcedRepoFetcher.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SourcedRepoFetcher.swift; sourceTree = ""; }; 87 | CEA54ACC2937EC44000920C6 /* ImageSourcing.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageSourcing.swift; sourceTree = ""; }; 88 | CEBA3F19293A891C00CE4BB3 /* ParallaxEffect.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParallaxEffect.swift; sourceTree = ""; }; 89 | CEF9197129401886007EF5F9 /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; }; 90 | CEF9197329401886007EF5F9 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; }; 91 | CEF9198729401920007EF5F9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; 92 | CEF9199329401C15007EF5F9 /* Evyrest-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Evyrest-Bridging-Header.h"; sourceTree = ""; }; 93 | CEF9199429401C45007EF5F9 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; }; 94 | CEF919A329401D7D007EF5F9 /* RemoteLog.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RemoteLog.h; sourceTree = ""; }; 95 | CEF919A529401D91007EF5F9 /* RemoteLog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoteLog.swift; sourceTree = ""; }; 96 | CEF919A829401E10007EF5F9 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/CoreServices.framework; sourceTree = DEVELOPER_DIR; }; 97 | /* End PBXFileReference section */ 98 | 99 | /* Begin PBXFrameworksBuildPhase section */ 100 | 42FBACDA29364BAB00B5B58A /* Frameworks */ = { 101 | isa = PBXFrameworksBuildPhase; 102 | buildActionMask = 2147483647; 103 | files = ( 104 | 21D1A1A3295C55A600AC45BB /* Dynamic in Frameworks */, 105 | CE1A4F4C29429717006C1B19 /* IOKit.framework in Frameworks */, 106 | CE1A4F4A2942970B006C1B19 /* CoreFoundation.framework in Frameworks */, 107 | CEF9199529401C45007EF5F9 /* CoreServices.framework in Frameworks */, 108 | ); 109 | runOnlyForDeploymentPostprocessing = 0; 110 | }; 111 | /* End PBXFrameworksBuildPhase section */ 112 | 113 | /* Begin PBXGroup section */ 114 | 21D702CA295F12AB007AD19D /* UtilityViews */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | CE626352294A46E700F7B237 /* MaterialView.swift */, 118 | CEBA3F19293A891C00CE4BB3 /* ParallaxEffect.swift */, 119 | ); 120 | path = UtilityViews; 121 | sourceTree = ""; 122 | }; 123 | 21D702CB295F12DF007AD19D /* Controllers */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | 2176393D295DD4580081518F /* WallpaperController.swift */, 127 | 2122AF4C295B2E8E00BF7B0D /* LocationManager.swift */, 128 | 21763938295DB97D0081518F /* ApplicationMonitor.swift */, 129 | ); 130 | path = Controllers; 131 | sourceTree = ""; 132 | }; 133 | 21E6D48A295BA382009FF3C8 /* Private APIs */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 21E6D48B295BA395009FF3C8 /* WallpaperSetter.swift */, 137 | ); 138 | path = "Private APIs"; 139 | sourceTree = ""; 140 | }; 141 | 42FBACD429364BAB00B5B58A = { 142 | isa = PBXGroup; 143 | children = ( 144 | CE1A4F4F2942B73E006C1B19 /* entitlements.plist */, 145 | 42FBACDF29364BAB00B5B58A /* Evyrest */, 146 | CEF9197029401886007EF5F9 /* Frameworks */, 147 | 42FBACDE29364BAB00B5B58A /* Products */, 148 | ); 149 | sourceTree = ""; 150 | }; 151 | 42FBACDE29364BAB00B5B58A /* Products */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | 42FBACDD29364BAB00B5B58A /* Evyrest.app */, 155 | ); 156 | name = Products; 157 | sourceTree = ""; 158 | }; 159 | 42FBACDF29364BAB00B5B58A /* Evyrest */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | CEF9198729401920007EF5F9 /* Info.plist */, 163 | 2176393B295DBB900081518F /* AppDelegate.swift */, 164 | 42FBACE029364BAB00B5B58A /* EvyrestApp.swift */, 165 | CEA54ACA2937EC44000920C6 /* API */, 166 | 21D702CB295F12DF007AD19D /* Controllers */, 167 | AA5A567D2937E7640037B6AA /* Extensions */, 168 | 21E6D48A295BA382009FF3C8 /* Private APIs */, 169 | CE3C44B8294FA4B800E28A2D /* RemLog */, 170 | AA5A56722937D94B0037B6AA /* Utilities */, 171 | AA5A56712937D7EF0037B6AA /* Views */, 172 | 42FBACE429364BAF00B5B58A /* Assets.xcassets */, 173 | CEF9199329401C15007EF5F9 /* Evyrest-Bridging-Header.h */, 174 | ); 175 | path = Evyrest; 176 | sourceTree = ""; 177 | }; 178 | AA5A56712937D7EF0037B6AA /* Views */ = { 179 | isa = PBXGroup; 180 | children = ( 181 | 21D702CA295F12AB007AD19D /* UtilityViews */, 182 | 42FBACE229364BAB00B5B58A /* ContentView.swift */, 183 | CE2066F92937B92B008FC95B /* LoginView.swift */, 184 | 21D702CC295F14AE007AD19D /* OptionsView.swift */, 185 | AADAAF55295F268C0011A423 /* AboutView.swift */, 186 | ); 187 | path = Views; 188 | sourceTree = ""; 189 | }; 190 | AA5A56722937D94B0037B6AA /* Utilities */ = { 191 | isa = PBXGroup; 192 | children = ( 193 | AA5A567A2937E1EA0037B6AA /* Storage */, 194 | AA5A56732937D96F0037B6AA /* Keychain */, 195 | CE9BB50A29611C6F0056A85E /* NetworkStatus.swift */, 196 | ); 197 | path = Utilities; 198 | sourceTree = ""; 199 | }; 200 | AA5A56732937D96F0037B6AA /* Keychain */ = { 201 | isa = PBXGroup; 202 | children = ( 203 | AA5A56742937D96F0037B6AA /* KeychainWrapper.swift */, 204 | AA5A56752937D96F0037B6AA /* KeychainItemAccessibility.swift */, 205 | AA5A56782937DA9E0037B6AA /* SwiftUIPropertyWrapper.swift */, 206 | ); 207 | path = Keychain; 208 | sourceTree = ""; 209 | }; 210 | AA5A567A2937E1EA0037B6AA /* Storage */ = { 211 | isa = PBXGroup; 212 | children = ( 213 | AA5A567B2937E2030037B6AA /* StorageManager.swift */, 214 | ); 215 | path = Storage; 216 | sourceTree = ""; 217 | }; 218 | AA5A567D2937E7640037B6AA /* Extensions */ = { 219 | isa = PBXGroup; 220 | children = ( 221 | 2122AF51295B349400BF7B0D /* Alert++.swift */, 222 | AA5A567E2937E7750037B6AA /* Color++.swift */, 223 | CE62634E294A409A00F7B237 /* String++.swift */, 224 | 216B5CBA2964C8020059D378 /* TextField++.swift */, 225 | ); 226 | path = Extensions; 227 | sourceTree = ""; 228 | }; 229 | CE3C44B8294FA4B800E28A2D /* RemLog */ = { 230 | isa = PBXGroup; 231 | children = ( 232 | CEF919A329401D7D007EF5F9 /* RemoteLog.h */, 233 | CEF919A529401D91007EF5F9 /* RemoteLog.swift */, 234 | ); 235 | path = RemLog; 236 | sourceTree = ""; 237 | }; 238 | CEA54ACA2937EC44000920C6 /* API */ = { 239 | isa = PBXGroup; 240 | children = ( 241 | CEA54ACB2937EC44000920C6 /* SourcedRepoFetcher.swift */, 242 | CEA54ACC2937EC44000920C6 /* ImageSourcing.swift */, 243 | 6F721C81296478E1001CFE46 /* WallpapersCraftWrapper.swift */, 244 | ); 245 | path = API; 246 | sourceTree = ""; 247 | }; 248 | CEF9197029401886007EF5F9 /* Frameworks */ = { 249 | isa = PBXGroup; 250 | children = ( 251 | CE1A4F4D2942972C006C1B19 /* libSystem.B.tbd */, 252 | CE1A4F4B29429717006C1B19 /* IOKit.framework */, 253 | CE1A4F492942970B006C1B19 /* CoreFoundation.framework */, 254 | CE1A4F47294293C2006C1B19 /* libxpc_datastores.tbd */, 255 | CE4F34EA29428C84006F1B36 /* libSystem.tbd */, 256 | CEF9199429401C45007EF5F9 /* CoreServices.framework */, 257 | CEF919A829401E10007EF5F9 /* CoreServices.framework */, 258 | CEF9197129401886007EF5F9 /* WidgetKit.framework */, 259 | CEF9197329401886007EF5F9 /* SwiftUI.framework */, 260 | ); 261 | name = Frameworks; 262 | sourceTree = ""; 263 | }; 264 | /* End PBXGroup section */ 265 | 266 | /* Begin PBXNativeTarget section */ 267 | 42FBACDC29364BAB00B5B58A /* Evyrest */ = { 268 | isa = PBXNativeTarget; 269 | buildConfigurationList = 42FBACEB29364BAF00B5B58A /* Build configuration list for PBXNativeTarget "Evyrest" */; 270 | buildPhases = ( 271 | 42FBACD929364BAB00B5B58A /* Sources */, 272 | 42FBACDA29364BAB00B5B58A /* Frameworks */, 273 | 42FBACDB29364BAB00B5B58A /* Resources */, 274 | CEF9198329401888007EF5F9 /* Embed Foundation Extensions */, 275 | ); 276 | buildRules = ( 277 | ); 278 | dependencies = ( 279 | ); 280 | name = Evyrest; 281 | packageProductDependencies = ( 282 | 21D1A1A2295C55A600AC45BB /* Dynamic */, 283 | ); 284 | productName = Evyrest; 285 | productReference = 42FBACDD29364BAB00B5B58A /* Evyrest.app */; 286 | productType = "com.apple.product-type.application"; 287 | }; 288 | /* End PBXNativeTarget section */ 289 | 290 | /* Begin PBXProject section */ 291 | 42FBACD529364BAB00B5B58A /* Project object */ = { 292 | isa = PBXProject; 293 | attributes = { 294 | BuildIndependentTargetsInParallel = 1; 295 | LastSwiftUpdateCheck = 1410; 296 | LastUpgradeCheck = 1410; 297 | TargetAttributes = { 298 | 42FBACDC29364BAB00B5B58A = { 299 | CreatedOnToolsVersion = 14.1; 300 | }; 301 | }; 302 | }; 303 | buildConfigurationList = 42FBACD829364BAB00B5B58A /* Build configuration list for PBXProject "Evyrest" */; 304 | compatibilityVersion = "Xcode 14.0"; 305 | developmentRegion = en; 306 | hasScannedForEncodings = 0; 307 | knownRegions = ( 308 | en, 309 | Base, 310 | ); 311 | mainGroup = 42FBACD429364BAB00B5B58A; 312 | packageReferences = ( 313 | 21D1A1A1295C55A600AC45BB /* XCRemoteSwiftPackageReference "Dynamic" */, 314 | ); 315 | productRefGroup = 42FBACDE29364BAB00B5B58A /* Products */; 316 | projectDirPath = ""; 317 | projectRoot = ""; 318 | targets = ( 319 | 42FBACDC29364BAB00B5B58A /* Evyrest */, 320 | ); 321 | }; 322 | /* End PBXProject section */ 323 | 324 | /* Begin PBXResourcesBuildPhase section */ 325 | 42FBACDB29364BAB00B5B58A /* Resources */ = { 326 | isa = PBXResourcesBuildPhase; 327 | buildActionMask = 2147483647; 328 | files = ( 329 | CE1A4F502942B73E006C1B19 /* entitlements.plist in Resources */, 330 | 42FBACE529364BAF00B5B58A /* Assets.xcassets in Resources */, 331 | ); 332 | runOnlyForDeploymentPostprocessing = 0; 333 | }; 334 | /* End PBXResourcesBuildPhase section */ 335 | 336 | /* Begin PBXSourcesBuildPhase section */ 337 | 42FBACD929364BAB00B5B58A /* Sources */ = { 338 | isa = PBXSourcesBuildPhase; 339 | buildActionMask = 2147483647; 340 | files = ( 341 | 2176393C295DBB900081518F /* AppDelegate.swift in Sources */, 342 | AA5A56792937DA9E0037B6AA /* SwiftUIPropertyWrapper.swift in Sources */, 343 | CEA54ACD2937EC44000920C6 /* SourcedRepoFetcher.swift in Sources */, 344 | 42FBACE329364BAB00B5B58A /* ContentView.swift in Sources */, 345 | CE2066FA2937B92B008FC95B /* LoginView.swift in Sources */, 346 | 42FBACE129364BAB00B5B58A /* EvyrestApp.swift in Sources */, 347 | AA5A56762937D96F0037B6AA /* KeychainWrapper.swift in Sources */, 348 | 2176393E295DD4580081518F /* WallpaperController.swift in Sources */, 349 | CEBA3F1A293A891D00CE4BB3 /* ParallaxEffect.swift in Sources */, 350 | AA5A567F2937E7750037B6AA /* Color++.swift in Sources */, 351 | 21E6D48C295BA395009FF3C8 /* WallpaperSetter.swift in Sources */, 352 | 2122AF52295B349400BF7B0D /* Alert++.swift in Sources */, 353 | AA5A56772937D96F0037B6AA /* KeychainItemAccessibility.swift in Sources */, 354 | CEA54ACE2937EC44000920C6 /* ImageSourcing.swift in Sources */, 355 | AADAAF56295F268C0011A423 /* AboutView.swift in Sources */, 356 | CE62634F294A409A00F7B237 /* String++.swift in Sources */, 357 | 21763939295DB97D0081518F /* ApplicationMonitor.swift in Sources */, 358 | CEF919A629401D91007EF5F9 /* RemoteLog.swift in Sources */, 359 | 216B5CBB2964C8020059D378 /* TextField++.swift in Sources */, 360 | AA5A567C2937E2030037B6AA /* StorageManager.swift in Sources */, 361 | 6F721C82296478E1001CFE46 /* WallpapersCraftWrapper.swift in Sources */, 362 | CE626353294A46E700F7B237 /* MaterialView.swift in Sources */, 363 | CE9BB50B29611C6F0056A85E /* NetworkStatus.swift in Sources */, 364 | 2122AF4D295B2E8E00BF7B0D /* LocationManager.swift in Sources */, 365 | 21D702CD295F14AE007AD19D /* OptionsView.swift in Sources */, 366 | ); 367 | runOnlyForDeploymentPostprocessing = 0; 368 | }; 369 | /* End PBXSourcesBuildPhase section */ 370 | 371 | /* Begin XCBuildConfiguration section */ 372 | 42FBACE929364BAF00B5B58A /* Debug */ = { 373 | isa = XCBuildConfiguration; 374 | buildSettings = { 375 | ALWAYS_SEARCH_USER_PATHS = NO; 376 | CLANG_ANALYZER_NONNULL = YES; 377 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 378 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 379 | CLANG_ENABLE_MODULES = YES; 380 | CLANG_ENABLE_OBJC_ARC = YES; 381 | CLANG_ENABLE_OBJC_WEAK = YES; 382 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 383 | CLANG_WARN_BOOL_CONVERSION = YES; 384 | CLANG_WARN_COMMA = YES; 385 | CLANG_WARN_CONSTANT_CONVERSION = YES; 386 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 387 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 388 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 389 | CLANG_WARN_EMPTY_BODY = YES; 390 | CLANG_WARN_ENUM_CONVERSION = YES; 391 | CLANG_WARN_INFINITE_RECURSION = YES; 392 | CLANG_WARN_INT_CONVERSION = YES; 393 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 394 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 395 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 396 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 397 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 398 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 399 | CLANG_WARN_STRICT_PROTOTYPES = YES; 400 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 401 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 402 | CLANG_WARN_UNREACHABLE_CODE = YES; 403 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 404 | COPY_PHASE_STRIP = NO; 405 | DEBUG_INFORMATION_FORMAT = dwarf; 406 | ENABLE_STRICT_OBJC_MSGSEND = YES; 407 | ENABLE_TESTABILITY = YES; 408 | GCC_C_LANGUAGE_STANDARD = gnu11; 409 | GCC_DYNAMIC_NO_PIC = NO; 410 | GCC_NO_COMMON_BLOCKS = YES; 411 | GCC_OPTIMIZATION_LEVEL = 0; 412 | GCC_PREPROCESSOR_DEFINITIONS = ( 413 | "DEBUG=1", 414 | "$(inherited)", 415 | ); 416 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 417 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 418 | GCC_WARN_UNDECLARED_SELECTOR = YES; 419 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 420 | GCC_WARN_UNUSED_FUNCTION = YES; 421 | GCC_WARN_UNUSED_VARIABLE = YES; 422 | IPHONEOS_DEPLOYMENT_TARGET = 15.0; 423 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 424 | MTL_FAST_MATH = YES; 425 | ONLY_ACTIVE_ARCH = YES; 426 | SDKROOT = iphoneos; 427 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 428 | SWIFT_OBJC_BRIDGING_HEADER = "Evyrest/Evyrest-Bridging-Header.h"; 429 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 430 | }; 431 | name = Debug; 432 | }; 433 | 42FBACEA29364BAF00B5B58A /* Release */ = { 434 | isa = XCBuildConfiguration; 435 | buildSettings = { 436 | ALWAYS_SEARCH_USER_PATHS = NO; 437 | CLANG_ANALYZER_NONNULL = YES; 438 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 439 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 440 | CLANG_ENABLE_MODULES = YES; 441 | CLANG_ENABLE_OBJC_ARC = YES; 442 | CLANG_ENABLE_OBJC_WEAK = YES; 443 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 444 | CLANG_WARN_BOOL_CONVERSION = YES; 445 | CLANG_WARN_COMMA = YES; 446 | CLANG_WARN_CONSTANT_CONVERSION = YES; 447 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 448 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 449 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 450 | CLANG_WARN_EMPTY_BODY = YES; 451 | CLANG_WARN_ENUM_CONVERSION = YES; 452 | CLANG_WARN_INFINITE_RECURSION = YES; 453 | CLANG_WARN_INT_CONVERSION = YES; 454 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 455 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 456 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 457 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 458 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 459 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 460 | CLANG_WARN_STRICT_PROTOTYPES = YES; 461 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 462 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 463 | CLANG_WARN_UNREACHABLE_CODE = YES; 464 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 465 | COPY_PHASE_STRIP = NO; 466 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 467 | ENABLE_NS_ASSERTIONS = NO; 468 | ENABLE_STRICT_OBJC_MSGSEND = YES; 469 | GCC_C_LANGUAGE_STANDARD = gnu11; 470 | GCC_NO_COMMON_BLOCKS = YES; 471 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 472 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 473 | GCC_WARN_UNDECLARED_SELECTOR = YES; 474 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 475 | GCC_WARN_UNUSED_FUNCTION = YES; 476 | GCC_WARN_UNUSED_VARIABLE = YES; 477 | IPHONEOS_DEPLOYMENT_TARGET = 15.0; 478 | MTL_ENABLE_DEBUG_INFO = NO; 479 | MTL_FAST_MATH = YES; 480 | SDKROOT = iphoneos; 481 | SWIFT_COMPILATION_MODE = wholemodule; 482 | SWIFT_OBJC_BRIDGING_HEADER = "Evyrest/Evyrest-Bridging-Header.h"; 483 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 484 | VALIDATE_PRODUCT = YES; 485 | }; 486 | name = Release; 487 | }; 488 | 42FBACEC29364BAF00B5B58A /* Debug */ = { 489 | isa = XCBuildConfiguration; 490 | buildSettings = { 491 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 492 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 493 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 494 | CODE_SIGN_STYLE = Automatic; 495 | CURRENT_PROJECT_VERSION = 1; 496 | DEVELOPMENT_ASSET_PATHS = ""; 497 | DEVELOPMENT_TEAM = 92S6JX27W2; 498 | ENABLE_PREVIEWS = YES; 499 | GENERATE_INFOPLIST_FILE = YES; 500 | INFOPLIST_FILE = Evyrest/Info.plist; 501 | INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; 502 | INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "Evyrest runs in background to refresh wallpapers. Usually iOS kills such apps after a period of time. But Evyrest tricks iOS by requesting location data thus allowiing much longer sessions. Data is never stored anywhere, only fetched."; 503 | INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "Evyrest runs in background to refresh wallpapers. Usually iOS kills such apps after a period of time. But Evyrest tricks iOS by requesting location data thus allowiing much longer sessions. Data is never stored anywhere, only fetched."; 504 | INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "Needed to save the image to camera roll obviously"; 505 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 506 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 507 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 508 | INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent; 509 | INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait"; 510 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; 511 | LD_RUNPATH_SEARCH_PATHS = ( 512 | "$(inherited)", 513 | "@executable_path/Frameworks", 514 | ); 515 | MARKETING_VERSION = 1.0; 516 | PRODUCT_BUNDLE_IDENTIFIER = net.sourceloc.evyrest; 517 | PRODUCT_NAME = "$(TARGET_NAME)"; 518 | SWIFT_EMIT_LOC_STRINGS = YES; 519 | SWIFT_VERSION = 5.0; 520 | TARGETED_DEVICE_FAMILY = "1,2"; 521 | }; 522 | name = Debug; 523 | }; 524 | 42FBACED29364BAF00B5B58A /* Release */ = { 525 | isa = XCBuildConfiguration; 526 | buildSettings = { 527 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 528 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 529 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 530 | CODE_SIGN_STYLE = Automatic; 531 | CURRENT_PROJECT_VERSION = 1; 532 | DEVELOPMENT_ASSET_PATHS = ""; 533 | DEVELOPMENT_TEAM = 92S6JX27W2; 534 | ENABLE_PREVIEWS = YES; 535 | GENERATE_INFOPLIST_FILE = YES; 536 | INFOPLIST_FILE = Evyrest/Info.plist; 537 | INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; 538 | INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "Evyrest runs in background to refresh wallpapers. Usually iOS kills such apps after a period of time. But Evyrest tricks iOS by requesting location data thus allowiing much longer sessions. Data is never stored anywhere, only fetched."; 539 | INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "Evyrest runs in background to refresh wallpapers. Usually iOS kills such apps after a period of time. But Evyrest tricks iOS by requesting location data thus allowiing much longer sessions. Data is never stored anywhere, only fetched."; 540 | INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "Needed to save the image to camera roll obviously"; 541 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 542 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 543 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 544 | INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent; 545 | INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait"; 546 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; 547 | LD_RUNPATH_SEARCH_PATHS = ( 548 | "$(inherited)", 549 | "@executable_path/Frameworks", 550 | ); 551 | MARKETING_VERSION = 1.0; 552 | PRODUCT_BUNDLE_IDENTIFIER = net.sourceloc.evyrest; 553 | PRODUCT_NAME = "$(TARGET_NAME)"; 554 | SWIFT_EMIT_LOC_STRINGS = YES; 555 | SWIFT_VERSION = 5.0; 556 | TARGETED_DEVICE_FAMILY = "1,2"; 557 | }; 558 | name = Release; 559 | }; 560 | /* End XCBuildConfiguration section */ 561 | 562 | /* Begin XCConfigurationList section */ 563 | 42FBACD829364BAB00B5B58A /* Build configuration list for PBXProject "Evyrest" */ = { 564 | isa = XCConfigurationList; 565 | buildConfigurations = ( 566 | 42FBACE929364BAF00B5B58A /* Debug */, 567 | 42FBACEA29364BAF00B5B58A /* Release */, 568 | ); 569 | defaultConfigurationIsVisible = 0; 570 | defaultConfigurationName = Release; 571 | }; 572 | 42FBACEB29364BAF00B5B58A /* Build configuration list for PBXNativeTarget "Evyrest" */ = { 573 | isa = XCConfigurationList; 574 | buildConfigurations = ( 575 | 42FBACEC29364BAF00B5B58A /* Debug */, 576 | 42FBACED29364BAF00B5B58A /* Release */, 577 | ); 578 | defaultConfigurationIsVisible = 0; 579 | defaultConfigurationName = Release; 580 | }; 581 | /* End XCConfigurationList section */ 582 | 583 | /* Begin XCRemoteSwiftPackageReference section */ 584 | 21D1A1A1295C55A600AC45BB /* XCRemoteSwiftPackageReference "Dynamic" */ = { 585 | isa = XCRemoteSwiftPackageReference; 586 | repositoryURL = "https://github.com/mhdhejazi/Dynamic"; 587 | requirement = { 588 | kind = upToNextMajorVersion; 589 | minimumVersion = 1.0.0; 590 | }; 591 | }; 592 | /* End XCRemoteSwiftPackageReference section */ 593 | 594 | /* Begin XCSwiftPackageProductDependency section */ 595 | 21D1A1A2295C55A600AC45BB /* Dynamic */ = { 596 | isa = XCSwiftPackageProductDependency; 597 | package = 21D1A1A1295C55A600AC45BB /* XCRemoteSwiftPackageReference "Dynamic" */; 598 | productName = Dynamic; 599 | }; 600 | /* End XCSwiftPackageProductDependency section */ 601 | }; 602 | rootObject = 42FBACD529364BAB00B5B58A /* Project object */; 603 | } 604 | -------------------------------------------------------------------------------- /Evyrest.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Evyrest.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Evyrest.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "pins" : [ 3 | { 4 | "identity" : "dynamic", 5 | "kind" : "remoteSourceControl", 6 | "location" : "https://github.com/mhdhejazi/Dynamic", 7 | "state" : { 8 | "revision" : "ab9a2570862d54aed2663691bb767f881226a12f", 9 | "version" : "1.2.0" 10 | } 11 | } 12 | ], 13 | "version" : 2 14 | } 15 | -------------------------------------------------------------------------------- /Evyrest.xcodeproj/project.xcworkspace/xcuserdata/lemin.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourcelocation/Evyrest/c09e2298b295585b2a69f8e329aca9b3f9473512/Evyrest.xcodeproj/project.xcworkspace/xcuserdata/lemin.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Evyrest.xcodeproj/project.xcworkspace/xcuserdata/llsc12.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourcelocation/Evyrest/c09e2298b295585b2a69f8e329aca9b3f9473512/Evyrest.xcodeproj/project.xcworkspace/xcuserdata/llsc12.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Evyrest.xcodeproj/project.xcworkspace/xcuserdata/sourcelocation.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourcelocation/Evyrest/c09e2298b295585b2a69f8e329aca9b3f9473512/Evyrest.xcodeproj/project.xcworkspace/xcuserdata/sourcelocation.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Evyrest.xcodeproj/xcshareddata/xcschemes/Evyrest.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /Evyrest.xcodeproj/xcuserdata/exerhythm.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /Evyrest.xcodeproj/xcuserdata/exerhythm.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Evyrest.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | evyrestrefresher.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 1 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 42FBACDC29364BAB00B5B58A 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Evyrest.xcodeproj/xcuserdata/llsc12.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Evyrest.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 42FBACDC29364BAB00B5B58A 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Evyrest.xcodeproj/xcuserdata/miso.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Evyrest.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Evyrest.xcodeproj/xcuserdata/sourcelocation.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /Evyrest/API/ImageSourcing.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageSourcing.swift 3 | // Evyrest 4 | // 5 | // Created by exerhythm on 29.11.2022. 6 | // 7 | 8 | import UIKit 9 | 10 | class ImageSourcing: ObservableObject { 11 | 12 | static let shared = ImageSourcing() 13 | 14 | enum APISource: String, CaseIterable, Codable { 15 | case unsplash = "Unsplash" 16 | case pexels = "Pexels" 17 | case microsoft = "Microsoft" 18 | case local = "Local" 19 | } 20 | 21 | static func getImage(from apiSource: APISource, searchTerm: String?) async throws -> (String, UIImage) { 22 | var url: String! 23 | 24 | if apiSource != .local { 25 | switch apiSource { 26 | case .pexels: 27 | url = "" 28 | case .unsplash: 29 | url = "https://source.unsplash.com/random/\(Int(await UIScreen.main.nativeBounds.width))x\(Int(await UIScreen.main.nativeBounds.height))" + (searchTerm != nil ? "?\(searchTerm!)" : "") 30 | case .microsoft: 31 | // Microsoft gives data about image in JSON, we have to fetch the metadata first and then load the image using extracted url 32 | let jsonURL = "http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US" 33 | 34 | let request = URLRequest(url: .init(string: jsonURL)!) 35 | let (data, response) = try await URLSession.shared.data(for: request) 36 | guard (response as? HTTPURLResponse)?.statusCode == 200 else { throw "Non 200 code from \(apiSource) 1. Error code 4-\((response as? HTTPURLResponse)?.statusCode ?? 0)" } 37 | guard let json = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] else { throw "response is not json" } 38 | guard let url1 = (json["images"] as? [[String: Any]])?[0]["url"] as? String else { throw "no url in images response from microsoft" } 39 | url = "https://bing.com" + url1 40 | case .local: break 41 | 42 | } 43 | 44 | // load image using url we got 45 | guard let urlForRequrest = URL(string: url) else { throw "Invalid URL / not yet implemented" } 46 | let request = URLRequest(url: urlForRequrest) 47 | let (data, response) = try await URLSession.shared.data(for: request) 48 | guard (response as? HTTPURLResponse)?.statusCode == 200 else { throw "Non 200 code from \(apiSource). Error code 4-\((response as? HTTPURLResponse)?.statusCode ?? 0)" } 49 | guard let image = UIImage(data: data) else { throw "Response wasn't an image." } 50 | 51 | var id: String? 52 | switch apiSource { 53 | case .unsplash: 54 | id = response.url!.lastPathComponent + ".png" 55 | case .pexels: break 56 | case .microsoft: 57 | id = URLComponents(string: response.url!.absoluteString)! 58 | .queryItems!.first(where: { $0.name == "id" })?.value! 59 | case .local: 60 | break 61 | } 62 | guard let id = id else { throw "Couldn't extract id from response from \(apiSource.rawValue). URL=\(response.url!.absoluteString)"} 63 | return (id,image) 64 | } else { 65 | // TODO: Local 66 | return ("person", UIImage(systemName: "person")!) 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Evyrest/API/SourcedRepoFetcher.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SourcedRepoAPI.swift 3 | // Evyrest 4 | // 5 | // Created by exerhythm on 30.11.2022. 6 | // 7 | 8 | import SwiftUI 9 | 10 | /// Sourced Repo fetcher 11 | class SourcedRepoFetcher: ObservableObject { 12 | 13 | // let serverURL = URL(string: "http://home.sourceloc.net:8080/") 14 | let serverURL = "http://home.sourceloc.net:8080/v1/" 15 | var session = URLSession.shared 16 | 17 | @AppStorage("userToken") var userToken: String? 18 | 19 | /// Logs into Sourced and, if successful, returns a token 20 | func login(username: String, password: String) async throws { 21 | var request = URLRequest(url: .init(string: serverURL + "account/login")!) 22 | request.httpMethod = "POST" 23 | let authBase64 = "\(username):\(password)".data(using: .utf8)!.base64EncodedString() 24 | request.addValue("Basic \(authBase64)", forHTTPHeaderField: "Authorization") 25 | 26 | let (data, response) = try await session.data(for: request) as! (Data, HTTPURLResponse) 27 | guard response.statusCode == 200 else { throw "Invalid email / password" } 28 | let json = try JSONSerialization.jsonObject(with: data, options: .fragmentsAllowed) as! [String: Any] 29 | guard let token = (json["token"] as? [String: Any])?["value"] as? String else { throw "Couldn't parse token. Error code 2" } 30 | userToken = token 31 | } 32 | 33 | /// Logs into Sourced and, if successful, returns a token 34 | func linkDevice() async throws { 35 | guard let userToken = userToken else { throw "Not logged in. \(userToken ?? "Unknown User Token")" } 36 | var request = URLRequest(url: .init(string: serverURL + "account/linkDevice?id=\(udid())")!) 37 | request.httpMethod = "POST" 38 | request.addValue("Bearer \(userToken)", forHTTPHeaderField: "Authorization") 39 | 40 | let (_, response) = try await session.data(for: request) as! (Data, HTTPURLResponse) 41 | print(response.statusCode) 42 | switch response.statusCode { 43 | case 406: 44 | throw "You've reached maximum amount of linked devices to your account. Please remove some at repo.sourceloc.net/account/devices" 45 | case 208, 200: break 46 | default: 47 | throw "Something went wrong while linking the device. Error code 1-\(response.statusCode)" 48 | } 49 | } 50 | 51 | private func udid() -> String { 52 | let aaDeviceInfo: AnyClass? = NSClassFromString("A" + "A" + "D" + "e" + "v" + "i" + "c" + "e" + "I" + "n" + "f" + "o") 53 | return aaDeviceInfo?.value(forKey: "u"+"d"+"i"+"d") as! String 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /Evyrest/API/WallpapersCraftWrapper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WallpapersCraftWrapper.swift 3 | // Evyrest 4 | // 5 | // Created by lemin on 1/3/23. 6 | // 7 | 8 | import Foundation 9 | 10 | class WallpapersCraftWrapper { 11 | func sendRequest() { 12 | /* Configure session, choose between: 13 | * defaultSessionConfiguration 14 | * ephemeralSessionConfiguration 15 | * backgroundSessionConfigurationWithIdentifier: 16 | And set session-wide properties, such as: HTTPAdditionalHeaders, 17 | HTTPCookieAcceptPolicy, requestCachePolicy or timeoutIntervalForRequest. 18 | */ 19 | let sessionConfig = URLSessionConfiguration.default 20 | 21 | /* Create session, and optionally set a URLSessionDelegate. */ 22 | let session = URLSession(configuration: sessionConfig, delegate: nil, delegateQueue: nil) 23 | 24 | /* Create the Request: 25 | Request (3) (GET https://api-uc.wallpaperscraft.com/images) 26 | */ 27 | 28 | guard var URL = URL(string: "https://api-uc.wallpaperscraft.com/images") else {return} 29 | let URLParams = [ 30 | "cost_variant": "ios_cost_2", 31 | "lang": "en", 32 | "limit": "60", 33 | "offset": "0", 34 | "query": "mountain", 35 | "screen[width]": "938", 36 | "screen[height]": "1668", 37 | "sort": "rating", 38 | "types[]": "free,private", 39 | ] 40 | URL = URL.appendingQueryParameters(URLParams) 41 | var request = URLRequest(url: URL) 42 | request.httpMethod = "GET" 43 | 44 | /* Start a new Task */ 45 | let task = session.dataTask(with: request, completionHandler: { (data: Data?, response: URLResponse?, error: Error?) -> Void in 46 | if (error == nil) { 47 | // Success 48 | let statusCode = (response as! HTTPURLResponse).statusCode 49 | print("URL Session Task Succeeded: HTTP \(statusCode)") 50 | } 51 | else { 52 | // Failure 53 | print("URL Session Task Failed: %@", error!.localizedDescription); 54 | } 55 | }) 56 | task.resume() 57 | session.finishTasksAndInvalidate() 58 | } 59 | } 60 | 61 | 62 | protocol URLQueryParameterStringConvertible { 63 | var queryParameters: String {get} 64 | } 65 | 66 | extension Dictionary : URLQueryParameterStringConvertible { 67 | /** 68 | This computed property returns a query parameters string from the given NSDictionary. For 69 | example, if the input is @{@"day":@"Tuesday", @"month":@"January"}, the output 70 | string will be @"day=Tuesday&month=January". 71 | @return The computed parameters string. 72 | */ 73 | var queryParameters: String { 74 | var parts: [String] = [] 75 | for (key, value) in self { 76 | let part = String(format: "%@=%@", 77 | String(describing: key).addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!, 78 | String(describing: value).addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!) 79 | parts.append(part as String) 80 | } 81 | return parts.joined(separator: "&") 82 | } 83 | 84 | } 85 | 86 | extension URL { 87 | /** 88 | Creates a new URL by adding the given query parameters. 89 | @param parametersDictionary The query parameter dictionary to add. 90 | @return A new URL. 91 | */ 92 | func appendingQueryParameters(_ parametersDictionary : Dictionary) -> URL { 93 | let URLString : String = String(format: "%@?%@", self.absoluteString, parametersDictionary.queryParameters) 94 | return URL(string: URLString)! 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Evyrest/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Evyrest 4 | // 5 | // Created by sourcelocation on 29/12/2022. 6 | // 7 | 8 | import UIKit 9 | 10 | extension UNNotificationCategory 11 | { 12 | static let clipboardReaderIdentifier = "WallpaperChanger" 13 | } 14 | 15 | 16 | class AppDelegate: UIResponder, UIApplicationDelegate { 17 | 18 | var window: UIWindow? 19 | 20 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 21 | ApplicationMonitor.shared.start() 22 | 23 | self.registerForNotifications() 24 | 25 | return true 26 | } 27 | 28 | } 29 | 30 | extension AppDelegate: UNUserNotificationCenterDelegate { 31 | private func registerForNotifications() { 32 | let category = UNNotificationCategory(identifier: UNNotificationCategory.clipboardReaderIdentifier, actions: [], intentIdentifiers: []) 33 | UNUserNotificationCenter.current().setNotificationCategories([category]) 34 | 35 | UNUserNotificationCenter.current().delegate = self 36 | UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { (success, error) in } 37 | } 38 | 39 | func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { 40 | completionHandler(.banner) 41 | } 42 | 43 | func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { 44 | guard response.notification.request.content.categoryIdentifier == UNNotificationCategory.clipboardReaderIdentifier else { return } 45 | guard response.actionIdentifier == UNNotificationDefaultActionIdentifier else { return } 46 | print(response) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourcelocation/Evyrest/c09e2298b295585b2a69f8e329aca9b3f9473512/Evyrest/Assets.xcassets/.DS_Store -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "display-p3", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.623", 9 | "green" : "0.500", 10 | "red" : "0.000" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "light" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "display-p3", 24 | "components" : { 25 | "alpha" : "1.000", 26 | "blue" : "0.624", 27 | "green" : "0.498", 28 | "red" : "0.000" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | }, 33 | { 34 | "appearances" : [ 35 | { 36 | "appearance" : "luminosity", 37 | "value" : "dark" 38 | } 39 | ], 40 | "color" : { 41 | "color-space" : "display-p3", 42 | "components" : { 43 | "alpha" : "1.000", 44 | "blue" : "0.623", 45 | "green" : "0.500", 46 | "red" : "0.000" 47 | } 48 | }, 49 | "idiom" : "universal" 50 | } 51 | ], 52 | "info" : { 53 | "author" : "xcode", 54 | "version" : 1 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/AppIcon.appiconset/Artboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourcelocation/Evyrest/c09e2298b295585b2a69f8e329aca9b3f9473512/Evyrest/Assets.xcassets/AppIcon.appiconset/Artboard.png -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Artboard.png", 5 | "idiom" : "universal", 6 | "platform" : "ios", 7 | "size" : "1024x1024" 8 | } 9 | ], 10 | "info" : { 11 | "author" : "xcode", 12 | "version" : 1 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/Background.imageset/Background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourcelocation/Evyrest/c09e2298b295585b2a69f8e329aca9b3f9473512/Evyrest/Assets.xcassets/Background.imageset/Background.png -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/Background.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Background.png", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/Background2.imageset/Bitmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourcelocation/Evyrest/c09e2298b295585b2a69f8e329aca9b3f9473512/Evyrest/Assets.xcassets/Background2.imageset/Bitmap.png -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/Background2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Bitmap.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/BackgroundColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0x3A", 9 | "green" : "0x21", 10 | "red" : "0x00" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/Evyrest.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "logo.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/Evyrest.imageset/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourcelocation/Evyrest/c09e2298b295585b2a69f8e329aca9b3f9473512/Evyrest/Assets.xcassets/Evyrest.imageset/logo.png -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/Local.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "local.png", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/Local.imageset/local.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourcelocation/Evyrest/c09e2298b295585b2a69f8e329aca9b3f9473512/Evyrest/Assets.xcassets/Local.imageset/local.png -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/Microsoft.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "microsoft.png", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/Microsoft.imageset/microsoft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourcelocation/Evyrest/c09e2298b295585b2a69f8e329aca9b3f9473512/Evyrest/Assets.xcassets/Microsoft.imageset/microsoft.png -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/Pexels.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "pexels.png", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/Pexels.imageset/pexels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourcelocation/Evyrest/c09e2298b295585b2a69f8e329aca9b3f9473512/Evyrest/Assets.xcassets/Pexels.imageset/pexels.png -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/Unsplash.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "unsplash.png", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/Unsplash.imageset/unsplash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourcelocation/Evyrest/c09e2298b295585b2a69f8e329aca9b3f9473512/Evyrest/Assets.xcassets/Unsplash.imageset/unsplash.png -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/discord.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "discord-mark-white.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | }, 21 | "properties" : { 22 | "template-rendering-intent" : "template" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/discord.imageset/discord-mark-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourcelocation/Evyrest/c09e2298b295585b2a69f8e329aca9b3f9473512/Evyrest/Assets.xcassets/discord.imageset/discord-mark-white.png -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/evyrest_image.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Path.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | }, 21 | "properties" : { 22 | "template-rendering-intent" : "template" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/evyrest_image.imageset/Path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourcelocation/Evyrest/c09e2298b295585b2a69f8e329aca9b3f9473512/Evyrest/Assets.xcassets/evyrest_image.imageset/Path.png -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/github.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "filename" : "GitHub-Mark-64px.png", 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | }, 21 | "properties" : { 22 | "template-rendering-intent" : "template" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Evyrest/Assets.xcassets/github.imageset/GitHub-Mark-64px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sourcelocation/Evyrest/c09e2298b295585b2a69f8e329aca9b3f9473512/Evyrest/Assets.xcassets/github.imageset/GitHub-Mark-64px.png -------------------------------------------------------------------------------- /Evyrest/Controllers/ApplicationMonitor.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ApplicationMonitor.swift 3 | // Clip 4 | // 5 | // Created by Riley Testut on 6/27/19. 6 | // Copyright © 2019 Riley Testut. All rights reserved. 7 | // 8 | import UIKit 9 | import AVFoundation 10 | import UserNotifications 11 | import Combine 12 | 13 | private enum UserNotification: String 14 | { 15 | case appStoppedRunning = "com.rileytestut.Clip.AppStoppedRunning" 16 | } 17 | 18 | private extension CFNotificationName 19 | { 20 | static let altstoreRequestAppState: CFNotificationName = CFNotificationName("com.altstore.RequestAppState.com.rileytestut.Clip" as CFString) 21 | static let altstoreAppIsRunning: CFNotificationName = CFNotificationName("com.altstore.AppState.Running.com.rileytestut.Clip" as CFString) 22 | } 23 | 24 | private let ReceivedApplicationState: @convention(c) (CFNotificationCenter?, UnsafeMutableRawPointer?, CFNotificationName?, UnsafeRawPointer?, CFDictionary?) -> Void = 25 | { (center, observer, name, object, userInfo) in 26 | ApplicationMonitor.shared.receivedApplicationStateRequest() 27 | } 28 | 29 | class ApplicationMonitor 30 | { 31 | static let shared = ApplicationMonitor() 32 | 33 | let locationManager = LocationManager() 34 | 35 | private(set) var isMonitoring = false 36 | 37 | private var backgroundTaskID: UIBackgroundTaskIdentifier? 38 | } 39 | 40 | extension ApplicationMonitor 41 | { 42 | func start() 43 | { 44 | guard !self.isMonitoring else { return } 45 | self.isMonitoring = true 46 | 47 | self.cancelApplicationQuitNotification() // Cancel any notifications from a previous launch. 48 | self.scheduleApplicationQuitNotification() 49 | 50 | self.locationManager.start() 51 | self.registerForNotifications() 52 | } 53 | } 54 | 55 | private extension ApplicationMonitor 56 | { 57 | func registerForNotifications() 58 | { 59 | let center = CFNotificationCenterGetDarwinNotifyCenter() 60 | CFNotificationCenterAddObserver(center, nil, ReceivedApplicationState, CFNotificationName.altstoreRequestAppState.rawValue, nil, .deliverImmediately) 61 | } 62 | 63 | func scheduleApplicationQuitNotification() 64 | { 65 | let delay = 5 as TimeInterval 66 | 67 | let content = UNMutableNotificationContent() 68 | content.title = NSLocalizedString("App Stopped Running", comment: "") 69 | content.body = NSLocalizedString("Tap this notification to resume wallpaper changes.", comment: "") 70 | 71 | let trigger = UNTimeIntervalNotificationTrigger(timeInterval: delay + 1, repeats: false) 72 | 73 | let request = UNNotificationRequest(identifier: UserNotification.appStoppedRunning.rawValue, content: content, trigger: trigger) 74 | UNUserNotificationCenter.current().add(request) 75 | 76 | DispatchQueue.global().asyncAfter(deadline: .now() + delay) { 77 | // If app is still running at this point, we schedule another notification with same identifier. 78 | // This prevents the currently scheduled notification from displaying, and starts another countdown timer. 79 | self.scheduleApplicationQuitNotification() 80 | } 81 | } 82 | 83 | func cancelApplicationQuitNotification() 84 | { 85 | UNUserNotificationCenter.current().removePendingNotificationRequests(withIdentifiers: [UserNotification.appStoppedRunning.rawValue]) 86 | } 87 | 88 | func sendNotification(title: String, message: String) 89 | { 90 | let content = UNMutableNotificationContent() 91 | content.title = title 92 | content.body = message 93 | 94 | let request = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: nil) 95 | UNUserNotificationCenter.current().add(request) 96 | } 97 | } 98 | 99 | private extension ApplicationMonitor 100 | { 101 | func receivedApplicationStateRequest() 102 | { 103 | guard UIApplication.shared.applicationState != .background else { return } 104 | 105 | let center = CFNotificationCenterGetDarwinNotifyCenter() 106 | CFNotificationCenterPostNotification(center!, CFNotificationName(CFNotificationName.altstoreAppIsRunning.rawValue), nil, nil, true) 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /Evyrest/Controllers/LocationManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LocationManager.swift 3 | // Clip 4 | // 5 | // Created by Riley Testut on 11/6/20. 6 | // Copyright © 2020 Riley Testut. All rights reserved. 7 | // 8 | 9 | // taken from https://github.com/rileytestut/Clip. many thanks 10 | 11 | import CoreLocation 12 | import Combine 13 | import UIKit 14 | 15 | extension LocationManager 16 | { 17 | typealias Status = Result 18 | 19 | enum Error: LocalizedError, RecoverableError 20 | { 21 | case requiresAlwaysAuthorization 22 | 23 | var failureReason: String? { 24 | switch self 25 | { 26 | case .requiresAlwaysAuthorization: return NSLocalizedString("Evyrest requires “Always” location permission.", comment: "") 27 | } 28 | } 29 | 30 | var recoverySuggestion: String? { 31 | switch self 32 | { 33 | case .requiresAlwaysAuthorization: return NSLocalizedString("Please grant Clip “Always” location permission in Settings so it can run in the background indefinitely.", comment: "") 34 | } 35 | } 36 | 37 | var recoveryOptions: [String] { 38 | switch self 39 | { 40 | case .requiresAlwaysAuthorization: return [NSLocalizedString("Open Settings", comment: "")] 41 | } 42 | } 43 | 44 | func attemptRecovery(optionIndex recoveryOptionIndex: Int) -> Bool 45 | { 46 | return false 47 | } 48 | 49 | func attemptRecovery(optionIndex recoveryOptionIndex: Int, resultHandler handler: @escaping (Bool) -> Void) 50 | { 51 | switch self 52 | { 53 | case .requiresAlwaysAuthorization: 54 | let openURL = URL(string: UIApplication.openSettingsURLString)! 55 | UIApplication.shared.open(openURL, options: [:], completionHandler: handler) 56 | } 57 | } 58 | } 59 | } 60 | 61 | class LocationManager: NSObject, ObservableObject 62 | { 63 | var status: Status? = nil 64 | 65 | private let locationManager: CLLocationManager 66 | 67 | override init() 68 | { 69 | self.locationManager = CLLocationManager() 70 | self.locationManager.distanceFilter = CLLocationDistanceMax 71 | self.locationManager.pausesLocationUpdatesAutomatically = false 72 | self.locationManager.allowsBackgroundLocationUpdates = true 73 | 74 | if #available(iOS 14.0, *) 75 | { 76 | self.locationManager.desiredAccuracy = kCLLocationAccuracyReduced 77 | } 78 | else 79 | { 80 | self.locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers 81 | } 82 | 83 | super.init() 84 | 85 | self.locationManager.delegate = self 86 | } 87 | 88 | func start() 89 | { 90 | switch self.status 91 | { 92 | case .success: return 93 | case .failure, nil: break 94 | } 95 | 96 | if locationManager.authorizationStatus == .notDetermined || locationManager.authorizationStatus == .authorizedWhenInUse 97 | { 98 | self.locationManager.requestAlwaysAuthorization() 99 | return 100 | } 101 | 102 | self.locationManager.startUpdatingLocation() 103 | } 104 | 105 | func stop() 106 | { 107 | self.locationManager.stopUpdatingLocation() 108 | self.status = nil 109 | } 110 | } 111 | 112 | 113 | extension LocationManager: CLLocationManagerDelegate 114 | { 115 | func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) 116 | { 117 | switch status 118 | { 119 | case .notDetermined: break 120 | case .restricted, .denied, .authorizedWhenInUse: self.status = .failure(Error.requiresAlwaysAuthorization) 121 | case .authorizedAlways: self.start() 122 | @unknown default: break 123 | } 124 | } 125 | 126 | func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) 127 | { 128 | self.status = .success(()) 129 | } 130 | 131 | func locationManager(_ manager: CLLocationManager, didFailWithError error: Swift.Error) 132 | { 133 | if let error = error as? CLError 134 | { 135 | guard error.code != .denied else { 136 | self.status = .failure(Error.requiresAlwaysAuthorization) 137 | return 138 | } 139 | } 140 | 141 | self.status = .failure(error) 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /Evyrest/Controllers/WallpaperController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WallpaperController.swift 3 | // Evyrest 4 | // 5 | // Created by sourcelocation on 29/12/2022. 6 | // 7 | 8 | import Foundation 9 | import SwiftUI 10 | import notify 11 | import SystemConfiguration 12 | 13 | 14 | class WallpaperController: ObservableObject { 15 | 16 | static let shared = WallpaperController() 17 | 18 | let cacheDir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0].appendingPathComponent("Caches") 19 | 20 | @Published var enabled = false 21 | @Published var apiSource: ImageSourcing.APISource = .unsplash 22 | @Published var savedWallpapers: [URL] = [] 23 | 24 | @AppStorage("searchTerm") var searchTerm: String = "Mountain" 25 | @AppStorage("cacheLimit") var cacheLimit: Double = 50 26 | @AppStorage("downloadOnCellular") var downloadOnCellular = true 27 | @AppStorage("changeHomeScreen") var changeHomeScreen = true 28 | @AppStorage("changeLockScreen") var changeLockScreen = true 29 | 30 | var deviceLocked: Bool? 31 | 32 | func setup() { 33 | NetworkStatus.shared.start() 34 | registerForNotifications() 35 | 36 | updateSavedWallpapers() 37 | } 38 | 39 | func stop() { 40 | // lol 41 | } 42 | 43 | func clearCache() throws { 44 | try FileManager.default.removeItem(at: cacheDir) 45 | updateSavedWallpapers() 46 | } 47 | 48 | private func updateSavedWallpapers() { 49 | // recents in settings 50 | DispatchQueue.main.async { 51 | self.savedWallpapers = (try? FileManager.default.contentsOfDirectory(at: self.cacheDir.appendingPathComponent(self.apiSource.rawValue), includingPropertiesForKeys: nil) 52 | .filter { $0.lastPathComponent != ".DS_Store" /* 💀 */ }.sorted(by: { 53 | if let date1 = try? $0.resourceValues(forKeys: [.addedToDirectoryDateKey]).addedToDirectoryDate, 54 | let date2 = try? $1.resourceValues(forKeys: [.addedToDirectoryDateKey]).addedToDirectoryDate { 55 | return date1 > date2 56 | } 57 | return false 58 | })) ?? [] 59 | } 60 | } 61 | 62 | private func fetchImageFromCurrentSourceAndCache() async throws -> UIImage { 63 | 64 | if let (fileName, image) = try? await ImageSourcing.getImage(from: apiSource, searchTerm: searchTerm), 65 | (NetworkStatus.shared.connType != .cellular || downloadOnCellular) { 66 | // there is connection, new random image obtained 67 | let sourceCacheDir = cacheDir.appendingPathComponent(apiSource.rawValue) 68 | print(sourceCacheDir) 69 | 70 | // cache 71 | try? FileManager.default.createDirectory(at: sourceCacheDir, withIntermediateDirectories: true) 72 | try? image.pngData()?.write(to: sourceCacheDir.appendingPathComponent(fileName)) 73 | try cleanCacheIfNeeded() 74 | 75 | updateSavedWallpapers() 76 | 77 | return image 78 | } else { 79 | // no internet, use one that's cached 80 | 81 | let sourceCacheDir = cacheDir.appendingPathComponent(apiSource.rawValue) 82 | 83 | guard let contents = try? FileManager.default.contentsOfDirectory(at: sourceCacheDir, includingPropertiesForKeys: nil), 84 | let randElement = contents.randomElement() else { 85 | throw "Couldn't fetch wallpapers from \(apiSource.rawValue) and no images were cached previously" 86 | } 87 | 88 | let randomImage = UIImage(contentsOfFile: randElement.path) 89 | return randomImage! 90 | } 91 | } 92 | 93 | private func cleanCacheIfNeeded() throws { 94 | let allSources = ImageSourcing.APISource.allCases 95 | for source in allSources { 96 | let sourceCacheDir = cacheDir.appendingPathComponent(source.rawValue) 97 | 98 | if source != apiSource { 99 | // clean other api sources because we no longer need them. can be done better tho 100 | try? FileManager.default.removeItem(at: sourceCacheDir) 101 | } else { 102 | // check if size of active cache folder exceeds the limit 103 | let contents = (try? FileManager.default.contentsOfDirectory(at: sourceCacheDir, 104 | includingPropertiesForKeys: nil)) ?? [] 105 | let cacheLimit = Int(UserDefaults.standard.double(forKey: "cacheLimit")) 106 | 107 | if contents.count > cacheLimit { 108 | // Remove oldest files 109 | let orderedURLs = contents.sorted(by: { 110 | if let date1 = try? $0.resourceValues(forKeys: [.addedToDirectoryDateKey]).addedToDirectoryDate, 111 | let date2 = try? $1.resourceValues(forKeys: [.addedToDirectoryDateKey]).addedToDirectoryDate { 112 | return date1 < date2 113 | } 114 | return false 115 | }) 116 | print(orderedURLs) 117 | let filesToBeDeleted = orderedURLs[0...(contents.count - cacheLimit) - 1] 118 | 119 | for fileToBeDeleted in filesToBeDeleted { 120 | try FileManager.default.removeItem(at: fileToBeDeleted) 121 | } 122 | } 123 | } 124 | } 125 | } 126 | 127 | func registerForNotifications() { 128 | var notify_token: Int32 = 0 129 | notify_register_dispatch("com.apple.springboard.lockstate", ¬ify_token, DispatchQueue.main, { token in 130 | var state: Int64 = 0 131 | notify_get_state(token, &state) 132 | 133 | self.deviceLocked = state == 1 134 | print(state) 135 | 136 | if self.deviceLocked!, self.enabled { 137 | WallpaperController.shared.updateWallpaper() 138 | } 139 | }) 140 | } 141 | 142 | func updateWallpaper() { 143 | Task { 144 | do { 145 | let image = try await fetchImageFromCurrentSourceAndCache() 146 | WallpaperSetter.shared.setWallpaper(image: image, 147 | homescreen: changeHomeScreen, 148 | lockscreen: changeLockScreen) 149 | } catch { 150 | await UIApplication.shared.alert(body: error.localizedDescription) 151 | } 152 | } 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /Evyrest/Evyrest-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Evyrest-Bridging-Header.h 3 | // Evyrest 4 | // 5 | // Created by exerhythm on 07.12.2022. 6 | // 7 | 8 | #import "RemoteLog.h" 9 | -------------------------------------------------------------------------------- /Evyrest/EvyrestApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EvyrestApp.swift 3 | // Evyrest 4 | // 5 | // Created by Toby Fox on 29/11/2022. 6 | // 7 | 8 | import SwiftUI 9 | import CoreLocation 10 | 11 | @main 12 | struct EvyrestApp: App { 13 | 14 | @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate 15 | @StateObject var sourceRepoFetcher = SourcedRepoFetcher() 16 | 17 | let locationManager = LocationManager() 18 | 19 | @Environment(\.scenePhase) private var phase 20 | 21 | var body: some Scene { 22 | WindowGroup { 23 | ContentView() 24 | .preferredColorScheme(.dark) 25 | .environmentObject(sourceRepoFetcher) 26 | .onAppear { 27 | UserDefaults.standard.register( 28 | defaults: [ 29 | "searchTerm": "Mountain", 30 | "cacheLimit": 50.0, 31 | "downloadOnCellular": false, 32 | "changeHomeScreen": true, 33 | "changeLockScreen": true 34 | ] 35 | ) 36 | ApplicationMonitor.shared.start() 37 | } 38 | } 39 | } 40 | 41 | private func setupColorScheme() { 42 | // We do this via the window so we can access UIKit components too. 43 | let window = UIApplication.shared.windows.first 44 | window?.overrideUserInterfaceStyle = .dark 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Evyrest/Extensions/Alert++.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Alert++.swift 3 | // Evyrest 4 | // 5 | // Created by exerhythm on 14.12.2022. 6 | // 7 | 8 | // MARK: cause *THEY SUCK* in SwiftUI :trollface: 9 | 10 | import UIKit 11 | 12 | var currentUIAlertController: UIAlertController? 13 | 14 | extension UIApplication { 15 | func dismissAlert(animated: Bool) { 16 | DispatchQueue.main.async { 17 | currentUIAlertController?.dismiss(animated: animated) 18 | } 19 | } 20 | func alert(title: String = "Error", body: String, animated: Bool = true, withButton: Bool = true) { 21 | DispatchQueue.main.async { 22 | currentUIAlertController = UIAlertController(title: title, message: body, preferredStyle: .alert) 23 | if withButton { currentUIAlertController?.addAction(.init(title: "OK", style: .cancel)) } 24 | self.present(alert: currentUIAlertController!) 25 | } 26 | } 27 | func confirmAlert(title: String = "Error", body: String, onOK: @escaping () -> (), noCancel: Bool = false) { 28 | DispatchQueue.main.async { 29 | currentUIAlertController = UIAlertController(title: title, message: body, preferredStyle: .alert) 30 | if !noCancel { 31 | currentUIAlertController?.addAction(.init(title: "No", style: .cancel)) 32 | } 33 | currentUIAlertController?.addAction(.init(title: "Yes", style: noCancel ? .cancel : .default, handler: { _ in 34 | onOK() 35 | })) 36 | self.present(alert: currentUIAlertController!) 37 | } 38 | } 39 | func change(title: String = "Error", body: String) { 40 | DispatchQueue.main.async { 41 | currentUIAlertController?.title = title 42 | currentUIAlertController?.message = body 43 | } 44 | } 45 | 46 | func present(alert: UIAlertController) { 47 | alert.view.tintColor = .label 48 | if var topController = self.windows[0].rootViewController { 49 | while let presentedViewController = topController.presentedViewController { 50 | topController = presentedViewController 51 | } 52 | 53 | topController.present(alert, animated: true) 54 | // topController should now be your topmost view controller 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Evyrest/Extensions/Color++.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Color++.swift 3 | // Evyrest 4 | // 5 | // Created by Lakhan Lothiyi on 30/11/2022. 6 | // 7 | 8 | import Foundation 9 | import SwiftUI 10 | 11 | extension Color { 12 | init(hex: String) { 13 | let hex = hex.trimmingCharacters(in: CharacterSet.alphanumerics.inverted) 14 | var int: UInt64 = 0 15 | Scanner(string: hex).scanHexInt64(&int) 16 | let a, r, g, b: UInt64 17 | switch hex.count { 18 | case 3: // RGB (12-bit) 19 | (a, r, g, b) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17) 20 | case 6: // RGB (24-bit) 21 | (a, r, g, b) = (255, int >> 16, int >> 8 & 0xFF, int & 0xFF) 22 | case 8: // ARGB (32-bit) 23 | (a, r, g, b) = (int >> 24, int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF) 24 | default: 25 | (a, r, g, b) = (1, 1, 1, 0) 26 | } 27 | 28 | self.init( 29 | .sRGB, 30 | red: Double(r) / 255, 31 | green: Double(g) / 255, 32 | blue: Double(b) / 255, 33 | opacity: Double(a) / 255 34 | ) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Evyrest/Extensions/String++.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String.swift 3 | // Evyrest 4 | // 5 | // Created by exerhythm on 14.12.2022. 6 | // 7 | 8 | import Foundation 9 | 10 | extension String: LocalizedError { 11 | public var errorDescription: String? { return self } 12 | } 13 | -------------------------------------------------------------------------------- /Evyrest/Extensions/TextField++.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TextField++.swift 3 | // Evyrest 4 | // 5 | // Created by sourcelocation on 03/01/2023. 6 | // 7 | 8 | import SwiftUI 9 | import Combine 10 | 11 | class TextFieldAlertViewController: UIViewController { 12 | 13 | /// Presents a UIAlertController (alert style) with a UITextField and a `Done` button 14 | /// - Parameters: 15 | /// - title: to be used as title of the UIAlertController 16 | /// - message: to be used as optional message of the UIAlertController 17 | /// - text: binding for the text typed into the UITextField 18 | /// - isPresented: binding to be set to false when the alert is dismissed (`Done` button tapped) 19 | init(title: String, message: String?, text: Binding, isPresented: Binding?) { 20 | self.alertTitle = title 21 | self.message = message 22 | self._text = text 23 | self.isPresented = isPresented 24 | super.init(nibName: nil, bundle: nil) 25 | } 26 | 27 | required init?(coder: NSCoder) { 28 | fatalError("init(coder:) has not been implemented") 29 | } 30 | 31 | // MARK: - Dependencies 32 | private let alertTitle: String 33 | private let message: String? 34 | @Binding private var text: String? 35 | private var isPresented: Binding? 36 | 37 | // MARK: - Private Properties 38 | private var subscription: AnyCancellable? 39 | 40 | // MARK: - Lifecycle 41 | override func viewDidAppear(_ animated: Bool) { 42 | super.viewDidAppear(animated) 43 | presentAlertController() 44 | } 45 | 46 | private func presentAlertController() { 47 | guard subscription == nil else { return } // present only once 48 | 49 | let vc = UIAlertController(title: alertTitle, message: message, preferredStyle: .alert) 50 | 51 | // add a textField and create a subscription to update the `text` binding 52 | vc.addTextField { [weak self] textField in 53 | guard let self = self else { return } 54 | self.subscription = NotificationCenter.default 55 | .publisher(for: UITextField.textDidChangeNotification, object: textField) 56 | .map { ($0.object as? UITextField)?.text } 57 | .assign(to: \.text, on: self) 58 | } 59 | 60 | // create a `Done` action that updates the `isPresented` binding when tapped 61 | // this is just for Demo only but we should really inject 62 | // an array of buttons (with their title, style and tap handler) 63 | let action = UIAlertAction(title: "Done", style: .default) { [weak self] _ in 64 | self?.isPresented?.wrappedValue = false 65 | } 66 | vc.addAction(action) 67 | present(vc, animated: true, completion: nil) 68 | } 69 | } 70 | 71 | struct TextFieldAlert { 72 | 73 | // MARK: Properties 74 | let title: String 75 | let message: String? 76 | @Binding var text: String? 77 | var isPresented: Binding? = nil 78 | 79 | // MARK: Modifiers 80 | func dismissable(_ isPresented: Binding) -> TextFieldAlert { 81 | TextFieldAlert(title: title, message: message, text: $text, isPresented: isPresented) 82 | } 83 | } 84 | 85 | extension TextFieldAlert: UIViewControllerRepresentable { 86 | 87 | typealias UIViewControllerType = TextFieldAlertViewController 88 | 89 | func makeUIViewController(context: UIViewControllerRepresentableContext) -> UIViewControllerType { 90 | TextFieldAlertViewController(title: title, message: message, text: $text, isPresented: isPresented) 91 | } 92 | 93 | func updateUIViewController(_ uiViewController: UIViewControllerType, 94 | context: UIViewControllerRepresentableContext) { 95 | // no update needed 96 | } 97 | } 98 | 99 | 100 | struct TextFieldWrapper: View { 101 | 102 | @Binding var isPresented: Bool 103 | let presentingView: PresentingView 104 | let content: () -> TextFieldAlert 105 | 106 | var body: some View { 107 | ZStack { 108 | if (isPresented) { content().dismissable($isPresented) } 109 | presentingView 110 | } 111 | } 112 | } 113 | 114 | extension View { 115 | func textFieldAlert(isPresented: Binding, 116 | content: @escaping () -> TextFieldAlert) -> some View { 117 | TextFieldWrapper(isPresented: isPresented, 118 | presentingView: self, 119 | content: content) 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /Evyrest/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSAppTransportSecurity 6 | 7 | NSAllowsArbitraryLoads 8 | 9 | 10 | NSUserActivityTypes 11 | 12 | ConfigurationIntent 13 | 14 | UIBackgroundModes 15 | 16 | audio 17 | fetch 18 | location 19 | processing 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Evyrest/Private APIs/WallpaperSetter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WallpaperSetter.swift 3 | // Evyrest 4 | // 5 | // Created by sourcelocation on 27/12/2022. 6 | // 7 | 8 | // with the help of https://github.com/MichaelMKenny/ios-13-light-dark-wallpaper-app 9 | 10 | import UIKit 11 | import Dynamic 12 | 13 | func frameworkPath(framework: String) -> String { 14 | var path: String! 15 | #if targetEnvironment(simulator) 16 | path = "/Applications/Xcode-14.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/" 17 | #else 18 | path = "/System/Library/PrivateFrameworks/" 19 | #endif 20 | return path + framework 21 | } 22 | 23 | func loadPrivateFramework(_ name: String) { 24 | Bundle(path: frameworkPath(framework: name))!.load() 25 | } 26 | 27 | 28 | class WallpaperSetter { 29 | static var shared = WallpaperSetter() 30 | 31 | typealias SBSUIWallpaperSetImagesFunction = (@convention(c) (_: NSDictionary, _: NSDictionary, _: Int, _: Int) -> Int) 32 | /// 1. dict of images for light and dark, 33 | /// 2. dict of options for light and dark, 34 | /// 3. location (1=lock, 2=home, 3=both), 35 | /// 4. who knows what the last option is 36 | 37 | 38 | func setWallpaper(image: UIImage, homescreen: Bool, lockscreen: Bool) { 39 | loadPrivateFramework("SpringBoardFoundation.framework"); 40 | 41 | let optionsLight = Dynamic.SBFWallpaperOptions() 42 | optionsLight.setWallpaperMode(1) 43 | optionsLight.setName("1234.Wallpaper Light") 44 | optionsLight.setParallaxFactor(1) 45 | 46 | let optionsDark = Dynamic.SBFWallpaperOptions() 47 | optionsDark.setWallpaperMode(1) 48 | optionsDark.setName("1234.Wallpaper Dark") 49 | optionsDark.setParallaxFactor(1) 50 | 51 | let sbui = dlopen(frameworkPath(framework: "SpringBoardUIServices.framework") + "/SpringBoardUIServices", RTLD_LAZY) 52 | defer { 53 | dlclose(sbui) 54 | } 55 | 56 | let symbolPointer = dlsym(sbui, "SBSUIWallpaperSetImages")! 57 | let SBSUIWallpaperSetImages = unsafeBitCast( 58 | symbolPointer, 59 | to: SBSUIWallpaperSetImagesFunction.self 60 | ) 61 | let result = SBSUIWallpaperSetImages( 62 | NSDictionary(dictionary: ["light": image, "dark": image]), 63 | NSDictionary(dictionary: ["light": optionsLight.asAnyObject!, "dark": optionsDark.asAnyObject!]), 64 | homescreen ? (lockscreen ? 3 : 2) : (lockscreen ? 1 : 0), 65 | UIUserInterfaceStyle.dark.rawValue 66 | ) 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Evyrest/RemLog/RemoteLog.h: -------------------------------------------------------------------------------- 1 | #ifndef _REMOTE_LOG_H_ 2 | #define _REMOTE_LOG_H_ 3 | 4 | #import 5 | #import 6 | #import 7 | #import 8 | #import 9 | 10 | // change this to match your destination (server) IP address 11 | #define RLOG_IP_ADDRESS "192.168.0.24" 12 | #define RLOG_PORT 11909 13 | 14 | __attribute__((unused)) static void RLogv(NSString* format, va_list args) 15 | { 16 | #if DEBUG 17 | NSString* str = [[NSString alloc] initWithFormat:format arguments:args]; 18 | 19 | int sd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); 20 | if (sd <= 0) 21 | { 22 | NSLog(@"[RemoteLog] Error: Could not open socket"); 23 | return; 24 | } 25 | 26 | int broadcastEnable = 1; 27 | int ret = setsockopt(sd, SOL_SOCKET, SO_BROADCAST, &broadcastEnable, sizeof(broadcastEnable)); 28 | if (ret) 29 | { 30 | NSLog(@"[RemoteLog] Error: Could not open set socket to broadcast mode"); 31 | close(sd); 32 | return; 33 | } 34 | 35 | struct sockaddr_in broadcastAddr; 36 | memset(&broadcastAddr, 0, sizeof broadcastAddr); 37 | broadcastAddr.sin_family = AF_INET; 38 | inet_pton(AF_INET, RLOG_IP_ADDRESS, &broadcastAddr.sin_addr); 39 | broadcastAddr.sin_port = htons(RLOG_PORT); 40 | 41 | char* request = (char*)[str UTF8String]; 42 | ret = sendto(sd, request, strlen(request), 0, (struct sockaddr*)&broadcastAddr, sizeof broadcastAddr); 43 | if (ret < 0) 44 | { 45 | NSLog(@"[RemoteLog] Error: Could not send broadcast"); 46 | close(sd); 47 | return; 48 | } 49 | close(sd); 50 | #endif 51 | } 52 | 53 | __attribute__((unused)) static void RLog(NSString* format, ...) 54 | { 55 | #if DEBUG 56 | va_list args; 57 | va_start(args, format); 58 | RLogv(format, args); 59 | va_end(args); 60 | #endif 61 | } 62 | #endif 63 | -------------------------------------------------------------------------------- /Evyrest/RemLog/RemoteLog.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RemoteLog.swift 3 | // Evyrest 4 | // 5 | // Created by exerhythm on 07.12.2022. 6 | // 7 | 8 | import Foundation 9 | 10 | 11 | func remLog(_ objs: Any...) { 12 | for obj in objs { 13 | let args: [CVarArg] = [ String(describing: obj) ] 14 | withVaList(args) { RLogv("%@", $0) } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Evyrest/Utilities/Keychain/KeychainItemAccessibility.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KeychainOptions.swift 3 | // SwiftKeychainWrapper 4 | // 5 | // Created by James Blair on 4/24/16. 6 | // Copyright © 2016 Jason Rendel. All rights reserved. 7 | // 8 | // The MIT License (MIT) 9 | // 10 | // Permission is hereby granted, free of charge, to any person obtaining a copy 11 | // of this software and associated documentation files (the "Software"), to deal 12 | // in the Software without restriction, including without limitation the rights 13 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | // copies of the Software, and to permit persons to whom the Software is 15 | // furnished to do so, subject to the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be included in all 18 | // copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | // SOFTWARE. 27 | 28 | import Foundation 29 | 30 | protocol KeychainAttrRepresentable { 31 | var keychainAttrValue: CFString { get } 32 | } 33 | 34 | // MARK: - KeychainItemAccessibility 35 | public enum KeychainItemAccessibility { 36 | /** 37 | The data in the keychain item cannot be accessed after a restart until the device has been unlocked once by the user. 38 | 39 | After the first unlock, the data remains accessible until the next restart. This is recommended for items that need to be accessed by background applications. Items with this attribute migrate to a new device when using encrypted backups. 40 | */ 41 | @available(iOS 4, *) 42 | case afterFirstUnlock 43 | 44 | /** 45 | The data in the keychain item cannot be accessed after a restart until the device has been unlocked once by the user. 46 | 47 | After the first unlock, the data remains accessible until the next restart. This is recommended for items that need to be accessed by background applications. Items with this attribute do not migrate to a new device. Thus, after restoring from a backup of a different device, these items will not be present. 48 | */ 49 | @available(iOS 4, *) 50 | case afterFirstUnlockThisDeviceOnly 51 | 52 | /** 53 | The data in the keychain item can always be accessed regardless of whether the device is locked. 54 | 55 | This is not recommended for application use. Items with this attribute migrate to a new device when using encrypted backups. 56 | */ 57 | @available(iOS 4, *) 58 | case always 59 | 60 | /** 61 | The data in the keychain can only be accessed when the device is unlocked. Only available if a passcode is set on the device. 62 | 63 | This is recommended for items that only need to be accessible while the application is in the foreground. Items with this attribute never migrate to a new device. After a backup is restored to a new device, these items are missing. No items can be stored in this class on devices without a passcode. Disabling the device passcode causes all items in this class to be deleted. 64 | */ 65 | @available(iOS 8, *) 66 | case whenPasscodeSetThisDeviceOnly 67 | 68 | /** 69 | The data in the keychain item can always be accessed regardless of whether the device is locked. 70 | 71 | This is not recommended for application use. Items with this attribute do not migrate to a new device. Thus, after restoring from a backup of a different device, these items will not be present. 72 | */ 73 | @available(iOS 4, *) 74 | case alwaysThisDeviceOnly 75 | 76 | /** 77 | The data in the keychain item can be accessed only while the device is unlocked by the user. 78 | 79 | This is recommended for items that need to be accessible only while the application is in the foreground. Items with this attribute migrate to a new device when using encrypted backups. 80 | 81 | This is the default value for keychain items added without explicitly setting an accessibility constant. 82 | */ 83 | @available(iOS 4, *) 84 | case whenUnlocked 85 | 86 | /** 87 | The data in the keychain item can be accessed only while the device is unlocked by the user. 88 | 89 | This is recommended for items that need to be accessible only while the application is in the foreground. Items with this attribute do not migrate to a new device. Thus, after restoring from a backup of a different device, these items will not be present. 90 | */ 91 | @available(iOS 4, *) 92 | case whenUnlockedThisDeviceOnly 93 | 94 | static func accessibilityForAttributeValue(_ keychainAttrValue: CFString) -> KeychainItemAccessibility? { 95 | for (key, value) in keychainItemAccessibilityLookup { 96 | if value == keychainAttrValue { 97 | return key 98 | } 99 | } 100 | 101 | return nil 102 | } 103 | } 104 | 105 | private let keychainItemAccessibilityLookup: [KeychainItemAccessibility:CFString] = { 106 | var lookup: [KeychainItemAccessibility:CFString] = [ 107 | .afterFirstUnlock: kSecAttrAccessibleAfterFirstUnlock, 108 | .afterFirstUnlockThisDeviceOnly: kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly, 109 | // .always: kSecAttrAccessibleAlways, 110 | .whenPasscodeSetThisDeviceOnly: kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly, 111 | // .alwaysThisDeviceOnly : kSecAttrAccessibleAlwaysThisDeviceOnly, 112 | .whenUnlocked: kSecAttrAccessibleWhenUnlocked, 113 | .whenUnlockedThisDeviceOnly: kSecAttrAccessibleWhenUnlockedThisDeviceOnly 114 | ] 115 | 116 | return lookup 117 | }() 118 | 119 | extension KeychainItemAccessibility : KeychainAttrRepresentable { 120 | internal var keychainAttrValue: CFString { 121 | return keychainItemAccessibilityLookup[self]! 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /Evyrest/Utilities/Keychain/KeychainWrapper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KeychainWrapper.swift 3 | // KeychainWrapper 4 | // 5 | // Created by Jason Rendel on 9/23/14. 6 | // Copyright (c) 2014 Jason Rendel. All rights reserved. 7 | // 8 | // The MIT License (MIT) 9 | // 10 | // Permission is hereby granted, free of charge, to any person obtaining a copy 11 | // of this software and associated documentation files (the "Software"), to deal 12 | // in the Software without restriction, including without limitation the rights 13 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | // copies of the Software, and to permit persons to whom the Software is 15 | // furnished to do so, subject to the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be included in all 18 | // copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | // SOFTWARE. 27 | 28 | import Foundation 29 | 30 | 31 | private let SecMatchLimit: String! = kSecMatchLimit as String 32 | private let SecReturnData: String! = kSecReturnData as String 33 | private let SecReturnPersistentRef: String! = kSecReturnPersistentRef as String 34 | private let SecValueData: String! = kSecValueData as String 35 | private let SecAttrAccessible: String! = kSecAttrAccessible as String 36 | private let SecClass: String! = kSecClass as String 37 | private let SecAttrService: String! = kSecAttrService as String 38 | private let SecAttrGeneric: String! = kSecAttrGeneric as String 39 | private let SecAttrAccount: String! = kSecAttrAccount as String 40 | private let SecAttrAccessGroup: String! = kSecAttrAccessGroup as String 41 | private let SecReturnAttributes: String = kSecReturnAttributes as String 42 | 43 | /// KeychainWrapper is a class to help make Keychain access in Swift more straightforward. It is designed to make accessing the Keychain services more like using NSUserDefaults, which is much more familiar to people. 44 | open class KeychainWrapper { 45 | 46 | @available(*, deprecated, message: "KeychainWrapper.defaultKeychainWrapper is deprecated, use KeychainWrapper.standard instead") 47 | public static let defaultKeychainWrapper = KeychainWrapper.standard 48 | 49 | /// Default keychain wrapper access 50 | public static let standard = KeychainWrapper() 51 | 52 | /// ServiceName is used for the kSecAttrService property to uniquely identify this keychain accessor. If no service name is specified, KeychainWrapper will default to using the bundleIdentifier. 53 | private (set) public var serviceName: String 54 | 55 | /// AccessGroup is used for the kSecAttrAccessGroup property to identify which Keychain Access Group this entry belongs to. This allows you to use the KeychainWrapper with shared keychain access between different applications. 56 | private (set) public var accessGroup: String? 57 | 58 | private static let defaultServiceName: String = { 59 | return Bundle.main.bundleIdentifier ?? "SwiftKeychainWrapper" 60 | }() 61 | 62 | private convenience init() { 63 | self.init(serviceName: KeychainWrapper.defaultServiceName) 64 | } 65 | 66 | /// Create a custom instance of KeychainWrapper with a custom Service Name and optional custom access group. 67 | /// 68 | /// - parameter serviceName: The ServiceName for this instance. Used to uniquely identify all keys stored using this keychain wrapper instance. 69 | /// - parameter accessGroup: Optional unique AccessGroup for this instance. Use a matching AccessGroup between applications to allow shared keychain access. 70 | public init(serviceName: String, accessGroup: String? = nil) { 71 | self.serviceName = serviceName 72 | self.accessGroup = accessGroup 73 | } 74 | 75 | // MARK:- Public Methods 76 | 77 | /// Checks if keychain data exists for a specified key. 78 | /// 79 | /// - parameter forKey: The key to check for. 80 | /// - parameter withAccessibility: Optional accessibility to use when retrieving the keychain item. 81 | /// - returns: True if a value exists for the key. False otherwise. 82 | open func hasValue(forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> Bool { 83 | if let _ = data(forKey: key, withAccessibility: accessibility) { 84 | return true 85 | } else { 86 | return false 87 | } 88 | } 89 | 90 | open func accessibilityOfKey(_ key: String) -> KeychainItemAccessibility? { 91 | var keychainQueryDictionary = setupKeychainQueryDictionary(forKey: key) 92 | 93 | // Remove accessibility attribute 94 | keychainQueryDictionary.removeValue(forKey: SecAttrAccessible) 95 | 96 | // Limit search results to one 97 | keychainQueryDictionary[SecMatchLimit] = kSecMatchLimitOne 98 | 99 | // Specify we want SecAttrAccessible returned 100 | keychainQueryDictionary[SecReturnAttributes] = kCFBooleanTrue 101 | 102 | // Search 103 | var result: AnyObject? 104 | let status = SecItemCopyMatching(keychainQueryDictionary as CFDictionary, &result) 105 | 106 | guard status == noErr, let resultsDictionary = result as? [String:AnyObject], let accessibilityAttrValue = resultsDictionary[SecAttrAccessible] as? String else { 107 | return nil 108 | } 109 | 110 | return KeychainItemAccessibility.accessibilityForAttributeValue(accessibilityAttrValue as CFString) 111 | } 112 | 113 | /// Get the keys of all keychain entries matching the current ServiceName and AccessGroup if one is set. 114 | open func allKeys() -> Set { 115 | var keychainQueryDictionary: [String:Any] = [ 116 | SecClass: kSecClassGenericPassword, 117 | SecAttrService: serviceName, 118 | SecReturnAttributes: kCFBooleanTrue!, 119 | SecMatchLimit: kSecMatchLimitAll, 120 | ] 121 | 122 | if let accessGroup = self.accessGroup { 123 | keychainQueryDictionary[SecAttrAccessGroup] = accessGroup 124 | } 125 | 126 | var result: AnyObject? 127 | let status = SecItemCopyMatching(keychainQueryDictionary as CFDictionary, &result) 128 | 129 | guard status == errSecSuccess else { return [] } 130 | 131 | var keys = Set() 132 | if let results = result as? [[AnyHashable: Any]] { 133 | for attributes in results { 134 | if let accountData = attributes[SecAttrAccount] as? Data, 135 | let account = String(data: accountData, encoding: String.Encoding.utf8) { 136 | keys.insert(account) 137 | } 138 | } 139 | } 140 | return keys 141 | } 142 | 143 | // MARK: Public Getters 144 | 145 | open func integer(forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> Int? { 146 | guard let numberValue = object(forKey: key, withAccessibility: accessibility) as? NSNumber else { 147 | return nil 148 | } 149 | 150 | return numberValue.intValue 151 | } 152 | 153 | open func float(forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> Float? { 154 | guard let numberValue = object(forKey: key, withAccessibility: accessibility) as? NSNumber else { 155 | return nil 156 | } 157 | 158 | return numberValue.floatValue 159 | } 160 | 161 | open func double(forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> Double? { 162 | guard let numberValue = object(forKey: key, withAccessibility: accessibility) as? NSNumber else { 163 | return nil 164 | } 165 | 166 | return numberValue.doubleValue 167 | } 168 | 169 | open func bool(forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> Bool? { 170 | guard let numberValue = object(forKey: key, withAccessibility: accessibility) as? NSNumber else { 171 | return nil 172 | } 173 | 174 | return numberValue.boolValue 175 | } 176 | 177 | /// Returns a string value for a specified key. 178 | /// 179 | /// - parameter forKey: The key to lookup data for. 180 | /// - parameter withAccessibility: Optional accessibility to use when retrieving the keychain item. 181 | /// - returns: The String associated with the key if it exists. If no data exists, or the data found cannot be encoded as a string, returns nil. 182 | open func string(forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> String? { 183 | guard let keychainData = data(forKey: key, withAccessibility: accessibility) else { 184 | return nil 185 | } 186 | 187 | return String(data: keychainData, encoding: String.Encoding.utf8) as String? 188 | } 189 | 190 | /// Returns an object that conforms to NSCoding for a specified key. 191 | /// 192 | /// - parameter forKey: The key to lookup data for. 193 | /// - parameter withAccessibility: Optional accessibility to use when retrieving the keychain item. 194 | /// - returns: The decoded object associated with the key if it exists. If no data exists, or the data found cannot be decoded, returns nil. 195 | open func object(forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> NSCoding? { 196 | guard let keychainData = data(forKey: key, withAccessibility: accessibility) else { 197 | return nil 198 | } 199 | 200 | return try! NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(keychainData) as? NSCoding 201 | } 202 | 203 | 204 | /// Returns a Data object for a specified key. 205 | /// 206 | /// - parameter forKey: The key to lookup data for. 207 | /// - parameter withAccessibility: Optional accessibility to use when retrieving the keychain item. 208 | /// - returns: The Data object associated with the key if it exists. If no data exists, returns nil. 209 | open func data(forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> Data? { 210 | var keychainQueryDictionary = setupKeychainQueryDictionary(forKey: key, withAccessibility: accessibility) 211 | 212 | // Limit search results to one 213 | keychainQueryDictionary[SecMatchLimit] = kSecMatchLimitOne 214 | 215 | // Specify we want Data/CFData returned 216 | keychainQueryDictionary[SecReturnData] = kCFBooleanTrue 217 | 218 | // Search 219 | var result: AnyObject? 220 | let status = SecItemCopyMatching(keychainQueryDictionary as CFDictionary, &result) 221 | 222 | return status == noErr ? result as? Data : nil 223 | } 224 | 225 | 226 | /// Returns a persistent data reference object for a specified key. 227 | /// 228 | /// - parameter forKey: The key to lookup data for. 229 | /// - parameter withAccessibility: Optional accessibility to use when retrieving the keychain item. 230 | /// - returns: The persistent data reference object associated with the key if it exists. If no data exists, returns nil. 231 | open func dataRef(forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> Data? { 232 | var keychainQueryDictionary = setupKeychainQueryDictionary(forKey: key, withAccessibility: accessibility) 233 | 234 | // Limit search results to one 235 | keychainQueryDictionary[SecMatchLimit] = kSecMatchLimitOne 236 | 237 | // Specify we want persistent Data/CFData reference returned 238 | keychainQueryDictionary[SecReturnPersistentRef] = kCFBooleanTrue 239 | 240 | // Search 241 | var result: AnyObject? 242 | let status = SecItemCopyMatching(keychainQueryDictionary as CFDictionary, &result) 243 | 244 | return status == noErr ? result as? Data : nil 245 | } 246 | 247 | // MARK: Public Setters 248 | 249 | @discardableResult open func set(_ value: Int, forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> Bool { 250 | return set(NSNumber(value: value), forKey: key, withAccessibility: accessibility) 251 | } 252 | 253 | @discardableResult open func set(_ value: Float, forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> Bool { 254 | return set(NSNumber(value: value), forKey: key, withAccessibility: accessibility) 255 | } 256 | 257 | @discardableResult open func set(_ value: Double, forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> Bool { 258 | return set(NSNumber(value: value), forKey: key, withAccessibility: accessibility) 259 | } 260 | 261 | @discardableResult open func set(_ value: Bool, forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> Bool { 262 | return set(NSNumber(value: value), forKey: key, withAccessibility: accessibility) 263 | } 264 | 265 | /// Save a String value to the keychain associated with a specified key. If a String value already exists for the given key, the string will be overwritten with the new value. 266 | /// 267 | /// - parameter value: The String value to save. 268 | /// - parameter forKey: The key to save the String under. 269 | /// - parameter withAccessibility: Optional accessibility to use when setting the keychain item. 270 | /// - returns: True if the save was successful, false otherwise. 271 | @discardableResult open func set(_ value: String, forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> Bool { 272 | if let data = value.data(using: .utf8) { 273 | return set(data, forKey: key, withAccessibility: accessibility) 274 | } else { 275 | return false 276 | } 277 | } 278 | 279 | /// Save an NSCoding compliant object to the keychain associated with a specified key. If an object already exists for the given key, the object will be overwritten with the new value. 280 | /// 281 | /// - parameter value: The NSCoding compliant object to save. 282 | /// - parameter forKey: The key to save the object under. 283 | /// - parameter withAccessibility: Optional accessibility to use when setting the keychain item. 284 | /// - returns: True if the save was successful, false otherwise. 285 | @discardableResult open func set(_ value: NSCoding, forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> Bool { 286 | let data = try! NSKeyedArchiver.archivedData(withRootObject: value, requiringSecureCoding: false) 287 | 288 | return set(data, forKey: key, withAccessibility: accessibility) 289 | } 290 | 291 | /// Save a Data object to the keychain associated with a specified key. If data already exists for the given key, the data will be overwritten with the new value. 292 | /// 293 | /// - parameter value: The Data object to save. 294 | /// - parameter forKey: The key to save the object under. 295 | /// - parameter withAccessibility: Optional accessibility to use when setting the keychain item. 296 | /// - returns: True if the save was successful, false otherwise. 297 | @discardableResult open func set(_ value: Data, forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> Bool { 298 | var keychainQueryDictionary: [String:Any] = setupKeychainQueryDictionary(forKey: key, withAccessibility: accessibility) 299 | 300 | keychainQueryDictionary[SecValueData] = value 301 | 302 | if let accessibility = accessibility { 303 | keychainQueryDictionary[SecAttrAccessible] = accessibility.keychainAttrValue 304 | } else { 305 | // Assign default protection - Protect the keychain entry so it's only valid when the device is unlocked 306 | keychainQueryDictionary[SecAttrAccessible] = KeychainItemAccessibility.whenUnlocked.keychainAttrValue 307 | } 308 | 309 | let status: OSStatus = SecItemAdd(keychainQueryDictionary as CFDictionary, nil) 310 | 311 | if status == errSecSuccess { 312 | return true 313 | } else if status == errSecDuplicateItem { 314 | return update(value, forKey: key, withAccessibility: accessibility) 315 | } else { 316 | return false 317 | } 318 | } 319 | 320 | @available(*, deprecated, message: "remove is deprecated, use removeObject instead") 321 | @discardableResult open func remove(key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> Bool { 322 | return removeObject(forKey: key, withAccessibility: accessibility) 323 | } 324 | 325 | /// Remove an object associated with a specified key. If re-using a key but with a different accessibility, first remove the previous key value using removeObjectForKey(:withAccessibility) using the same accessibilty it was saved with. 326 | /// 327 | /// - parameter forKey: The key value to remove data for. 328 | /// - parameter withAccessibility: Optional accessibility level to use when looking up the keychain item. 329 | /// - returns: True if successful, false otherwise. 330 | @discardableResult open func removeObject(forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> Bool { 331 | let keychainQueryDictionary: [String:Any] = setupKeychainQueryDictionary(forKey: key, withAccessibility: accessibility) 332 | 333 | // Delete 334 | let status: OSStatus = SecItemDelete(keychainQueryDictionary as CFDictionary) 335 | 336 | if status == errSecSuccess { 337 | return true 338 | } else { 339 | return false 340 | } 341 | } 342 | 343 | /// Remove all keychain data added through KeychainWrapper. This will only delete items matching the currnt ServiceName and AccessGroup if one is set. 344 | open func removeAllKeys() -> Bool { 345 | // Setup dictionary to access keychain and specify we are using a generic password (rather than a certificate, internet password, etc) 346 | var keychainQueryDictionary: [String:Any] = [SecClass:kSecClassGenericPassword] 347 | 348 | // Uniquely identify this keychain accessor 349 | keychainQueryDictionary[SecAttrService] = serviceName 350 | 351 | // Set the keychain access group if defined 352 | if let accessGroup = self.accessGroup { 353 | keychainQueryDictionary[SecAttrAccessGroup] = accessGroup 354 | } 355 | 356 | let status: OSStatus = SecItemDelete(keychainQueryDictionary as CFDictionary) 357 | 358 | if status == errSecSuccess { 359 | return true 360 | } else { 361 | return false 362 | } 363 | } 364 | 365 | /// Remove all keychain data, including data not added through keychain wrapper. 366 | /// 367 | /// - Warning: This may remove custom keychain entries you did not add via SwiftKeychainWrapper. 368 | /// 369 | open class func wipeKeychain() { 370 | deleteKeychainSecClass(kSecClassGenericPassword) // Generic password items 371 | deleteKeychainSecClass(kSecClassInternetPassword) // Internet password items 372 | deleteKeychainSecClass(kSecClassCertificate) // Certificate items 373 | deleteKeychainSecClass(kSecClassKey) // Cryptographic key items 374 | deleteKeychainSecClass(kSecClassIdentity) // Identity items 375 | } 376 | 377 | // MARK:- Private Methods 378 | 379 | /// Remove all items for a given Keychain Item Class 380 | /// 381 | /// 382 | @discardableResult private class func deleteKeychainSecClass(_ secClass: AnyObject) -> Bool { 383 | let query = [SecClass: secClass] 384 | let status: OSStatus = SecItemDelete(query as CFDictionary) 385 | 386 | if status == errSecSuccess { 387 | return true 388 | } else { 389 | return false 390 | } 391 | } 392 | 393 | /// Update existing data associated with a specified key name. The existing data will be overwritten by the new data. 394 | private func update(_ value: Data, forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> Bool { 395 | var keychainQueryDictionary: [String:Any] = setupKeychainQueryDictionary(forKey: key, withAccessibility: accessibility) 396 | let updateDictionary = [SecValueData:value] 397 | 398 | // on update, only set accessibility if passed in 399 | if let accessibility = accessibility { 400 | keychainQueryDictionary[SecAttrAccessible] = accessibility.keychainAttrValue 401 | } 402 | 403 | // Update 404 | let status: OSStatus = SecItemUpdate(keychainQueryDictionary as CFDictionary, updateDictionary as CFDictionary) 405 | 406 | if status == errSecSuccess { 407 | return true 408 | } else { 409 | return false 410 | } 411 | } 412 | 413 | /// Setup the keychain query dictionary used to access the keychain on iOS for a specified key name. Takes into account the Service Name and Access Group if one is set. 414 | /// 415 | /// - parameter forKey: The key this query is for 416 | /// - parameter withAccessibility: Optional accessibility to use when setting the keychain item. If none is provided, will default to .WhenUnlocked 417 | /// - returns: A dictionary with all the needed properties setup to access the keychain on iOS 418 | private func setupKeychainQueryDictionary(forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -> [String:Any] { 419 | // Setup default access as generic password (rather than a certificate, internet password, etc) 420 | var keychainQueryDictionary: [String:Any] = [SecClass:kSecClassGenericPassword] 421 | 422 | // Uniquely identify this keychain accessor 423 | keychainQueryDictionary[SecAttrService] = serviceName 424 | 425 | // Only set accessibiilty if its passed in, we don't want to default it here in case the user didn't want it set 426 | if let accessibility = accessibility { 427 | keychainQueryDictionary[SecAttrAccessible] = accessibility.keychainAttrValue 428 | } 429 | 430 | // Set the keychain access group if defined 431 | if let accessGroup = self.accessGroup { 432 | keychainQueryDictionary[SecAttrAccessGroup] = accessGroup 433 | } 434 | 435 | // Uniquely identify the account who will be accessing the keychain 436 | let encodedIdentifier: Data? = key.data(using: String.Encoding.utf8) 437 | 438 | keychainQueryDictionary[SecAttrGeneric] = encodedIdentifier 439 | 440 | keychainQueryDictionary[SecAttrAccount] = encodedIdentifier 441 | 442 | return keychainQueryDictionary 443 | } 444 | } 445 | -------------------------------------------------------------------------------- /Evyrest/Utilities/Keychain/SwiftUIPropertyWrapper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftUIPropertyWrapper.swift 3 | // Evyrest 4 | // 5 | // Created by Lakhan Lothiyi on 30/11/2022. 6 | // 7 | 8 | import Foundation 9 | import SwiftUI 10 | 11 | @propertyWrapper 12 | struct KeychainStorage: DynamicProperty { 13 | private let key: String 14 | 15 | var wrappedValue: String? { 16 | get { 17 | getValue() 18 | } 19 | 20 | nonmutating set { 21 | setValue(newValue) 22 | } 23 | } 24 | 25 | func getValue() -> String? { 26 | KeychainWrapper.standard.string(forKey: key) 27 | } 28 | 29 | func setValue(_ val: String?) { 30 | if let val = val { 31 | KeychainWrapper.standard.set(val, forKey: key) 32 | } else { 33 | KeychainWrapper.standard.removeObject(forKey: key) 34 | } 35 | } 36 | 37 | init(_ key: String) { 38 | self.key = key 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Evyrest/Utilities/NetworkStatus.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NetworkStatus.swift 3 | // Evyrest 4 | // 5 | // Created by exerhythm on 01.01.2023. 6 | // 7 | 8 | // totally not yoinked from https://en.proft.me/2020/04/27/detect-network-status-swift/ 9 | #warning("credits") 10 | 11 | import Foundation 12 | import Network 13 | 14 | public enum ConnectionType { 15 | case wifi 16 | case ethernet 17 | case cellular 18 | case unknown 19 | } 20 | 21 | class NetworkStatus { 22 | static public let shared = NetworkStatus() 23 | private var monitor: NWPathMonitor 24 | private var queue = DispatchQueue.global() 25 | var isOn: Bool = true 26 | var connType: ConnectionType = .wifi 27 | 28 | private init() { 29 | self.monitor = NWPathMonitor() 30 | self.queue = DispatchQueue.global(qos: .background) 31 | self.monitor.start(queue: queue) 32 | } 33 | 34 | func start() { 35 | self.monitor.pathUpdateHandler = { path in 36 | self.isOn = path.status == .satisfied 37 | self.connType = self.checkConnectionTypeForPath(path) 38 | } 39 | } 40 | 41 | func stop() { 42 | self.monitor.cancel() 43 | } 44 | 45 | func checkConnectionTypeForPath(_ path: NWPath) -> ConnectionType { 46 | if path.usesInterfaceType(.wifi) { 47 | return .wifi 48 | } else if path.usesInterfaceType(.wiredEthernet) { 49 | return .ethernet 50 | } else if path.usesInterfaceType(.cellular) { 51 | return .cellular 52 | } 53 | 54 | return .unknown 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Evyrest/Utilities/Storage/StorageManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StorageManager.swift 3 | // Carpet stuff innit bruv 4 | // 5 | // Created by Lakhan Lothiyi on 21/11/2022. 6 | // 7 | // This is a general utility storage system shared between multiple projects. 8 | // 9 | 10 | import Foundation 11 | 12 | class StorageManager: ObservableObject { 13 | 14 | static let shared = StorageManager() 15 | 16 | internal var fileLocation: URL = { 17 | let docs = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first! 18 | let storageObjectLocation = docs.appendingPathComponent("storage").appendingPathExtension("object") // add storage.object file 19 | return storageObjectLocation 20 | }() 21 | 22 | internal let encoder = JSONEncoder() 23 | internal let decoder = JSONDecoder() 24 | 25 | var s: StorageObject { 26 | didSet { 27 | self.objectWillChange.send() 28 | StorageManager.saveLoadedObjectToLocalStorage(self) 29 | } 30 | } 31 | 32 | internal static let blankTemplate = StorageObject(imageSource: .pexels) 33 | 34 | init() { 35 | 36 | // create file if it doesnt exist 37 | if !FileManager.default.fileExists(atPath: fileLocation.path) { 38 | let starterObj = StorageManager.blankTemplate 39 | let json = try? encoder.encode(starterObj) 40 | try? json?.write(to: fileLocation, options: .atomic) 41 | 42 | // else if it does exist, make sure it successfully gets loaded and decodes, else write a blank template. 43 | } else if let data = try? Data(contentsOf: fileLocation), 44 | let _ = try? decoder.decode(StorageObject.self, from: data) {} else { 45 | let starterObj = StorageManager.blankTemplate 46 | let json = try? encoder.encode(starterObj) 47 | try? json?.write(to: fileLocation, options: .atomic) 48 | } 49 | 50 | self.s = StorageManager.getObjectFromLocalStorage(decoder, fileLocation, encoder: encoder) 51 | 52 | self.objectWillChange.send() 53 | } 54 | 55 | static private func reloadObjectFromLocalStorage(_ self: StorageManager) { 56 | self.objectWillChange.send() 57 | self.s = StorageManager.getObjectFromLocalStorage(self.decoder, self.fileLocation, encoder: self.encoder) 58 | } 59 | 60 | static private func saveLoadedObjectToLocalStorage(_ self: StorageManager) { 61 | print("saving object") 62 | do { 63 | let json = try self.encoder.encode(self.s) 64 | try json.write(to: self.fileLocation, options: .atomic) 65 | } catch { 66 | fatalError(error.localizedDescription) 67 | } 68 | } 69 | 70 | static private func getObjectFromLocalStorage(_ decoder: JSONDecoder, _ fileLocation: URL, encoder: JSONEncoder) -> StorageObject { 71 | print("loading object") 72 | do { 73 | var file: Data 74 | if FileManager.default.fileExists(atPath: fileLocation.path) { 75 | file = try Data(contentsOf: fileLocation) 76 | } else { 77 | let starterObj = StorageManager.blankTemplate 78 | let json = try encoder.encode(starterObj) 79 | file = json 80 | } 81 | 82 | let object = try decoder.decode(StorageObject.self, from: file) 83 | 84 | return object 85 | } catch { 86 | fatalError(error.localizedDescription) 87 | } 88 | } 89 | } 90 | 91 | struct StorageObject: Codable { 92 | var imageSource: ImageSourcing.APISource 93 | } 94 | -------------------------------------------------------------------------------- /Evyrest/Views/AboutView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AboutView.swift 3 | // Evyrest 4 | // 5 | // Created by Lakhan Lothiyi on 30/12/2022. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct AboutView: View { 11 | @Environment(\.openURL) var openURL 12 | 13 | var body: some View { 14 | VStack(spacing: 32) { 15 | Text("Credits") 16 | .font(.headline) 17 | // .padding(12) 18 | VStack(spacing: 4) { 19 | Text("Made by sourcelocation") 20 | Text("with help from llsc12") 21 | .font(.footnote) 22 | .opacity(0.6) 23 | } 24 | Text("MIT - Skittyblock/WallpaperSetter\nPublic Domain - rileytestut/Clip") 25 | .font(.footnote) 26 | .opacity(0.6) 27 | VStack { 28 | Button(action: { 29 | openURL(URL(string: "https://discord.gg/HTseVFhEbK")!) 30 | }) { 31 | HStack { 32 | Spacer() 33 | Image("discord") 34 | Text("Discord") 35 | Spacer() 36 | } 37 | .padding(8) 38 | .background(MaterialView(.light)) 39 | .cornerRadius(8) 40 | .padding(.horizontal, 16) 41 | } 42 | Button(action: { 43 | openURL(URL(string: "https://twitter.com/sourceloc")!) 44 | }) { 45 | HStack { 46 | Spacer() 47 | Image("github") 48 | Text("Github") 49 | Spacer() 50 | } 51 | .padding(8) 52 | .background(MaterialView(.light)) 53 | .cornerRadius(8) 54 | .padding(.horizontal, 16) 55 | } 56 | } 57 | Spacer() 58 | Text("You are awesome for using this app! :)") 59 | .font(.footnote) 60 | .opacity(0.6) 61 | } 62 | .foregroundColor(.white) 63 | .multilineTextAlignment(.center) 64 | .frame(height: 400) 65 | } 66 | } 67 | 68 | 69 | struct AboutView_Previews: PreviewProvider { 70 | static var previews: some View { 71 | ContentView(aboutPresented: true) 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Evyrest/Views/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // Evyrest 4 | // 5 | // Created by Toby Fox on 29/11/2022. 6 | // 7 | 8 | import SwiftUI 9 | import CoreMotion 10 | 11 | 12 | 13 | struct ContentView: View { 14 | 15 | @ObservedObject var wallpaperController = WallpaperController.shared 16 | 17 | @AppStorage("userToken") var userToken: String? 18 | @State var loginPresented = false 19 | 20 | @State var optionsPresented = false 21 | @State var aboutPresented = false 22 | 23 | 24 | var body: some View { 25 | GeometryReader { geometry in 26 | ZStack { 27 | Color("BackgroundColor") 28 | .ignoresSafeArea() 29 | Image("Background") 30 | .resizable() 31 | .aspectRatio(contentMode: .fill) 32 | .edgesIgnoringSafeArea(.all) 33 | .blur(radius: 3) 34 | .frame(width: geometry.size.width, height: geometry.size.height) 35 | 36 | .opacity(wallpaperController.enabled ? 0 : 1) 37 | .scaleEffect(wallpaperController.enabled ? 1.3 : 1.15) 38 | .scaleEffect(optionsPresented || aboutPresented ? 1.075 : 1.15) 39 | .animation(.spring().speed(0.5), value: wallpaperController.enabled) 40 | .animation(.spring(), value: aboutPresented) 41 | .animation(.spring(), value: optionsPresented) 42 | VStack { 43 | Spacer() 44 | header 45 | if !wallpaperController.enabled { 46 | Spacer() 47 | } 48 | sourceLocation 49 | if !wallpaperController.enabled { 50 | Spacer() 51 | Spacer() 52 | } 53 | button 54 | footer 55 | if wallpaperController.enabled { 56 | Spacer() 57 | } 58 | } 59 | .frame(maxWidth: .infinity, maxHeight: .infinity) 60 | .sheet(isPresented: $loginPresented, content: {LoginView()}) 61 | .onAppear { 62 | wallpaperController.setup() 63 | //#if targetEnvironment(simulator) || DEBUG 64 | //#else 65 | // loginPresented = userToken == nil 66 | //#endif 67 | } 68 | .blur(radius: optionsPresented || aboutPresented ? 2 : 0) 69 | .scaleEffect(optionsPresented || aboutPresented ? 0.85 : 1) 70 | .animation(.spring(), value: optionsPresented) 71 | .animation(.spring(), value: aboutPresented) 72 | 73 | Color.black 74 | .ignoresSafeArea() 75 | .opacity(optionsPresented || aboutPresented ? 0.5 : 0) 76 | .animation(.spring(), value: optionsPresented) 77 | .animation(.spring(), value: aboutPresented) 78 | .onTapGesture { 79 | if optionsPresented { 80 | optionsPresented = false 81 | } 82 | if aboutPresented { 83 | aboutPresented = false 84 | } 85 | } 86 | // MARK: - Options & About 87 | ZStack { 88 | AboutView() 89 | .opacity(aboutPresented ? 1 : 0) 90 | OptionsView() 91 | .opacity(optionsPresented ? 1 : 0) 92 | } 93 | .frame(maxWidth: 300) 94 | .background(MaterialView(.light) 95 | .opacity(0.8) 96 | .cornerRadius(20)) 97 | .scaleEffect(optionsPresented || aboutPresented ? 1 : 0.9) 98 | .opacity(optionsPresented || aboutPresented ? 1 : 0) 99 | .animation(.spring().speed(1.5), value: optionsPresented) 100 | .animation(.spring().speed(1.5), value: aboutPresented) 101 | } 102 | } 103 | } 104 | 105 | @ViewBuilder 106 | var header: some View { 107 | Image("Evyrest") 108 | .resizable() 109 | .aspectRatio(contentMode: .fit) 110 | .padding() 111 | .frame(maxWidth: 175) 112 | .scaleEffect(wallpaperController.enabled ? 1.15 : 1) 113 | .animation(.spring().speed(1), value: wallpaperController.enabled) 114 | } 115 | 116 | @ViewBuilder 117 | var sourceLocation: some View { 118 | VStack { 119 | ForEach(ImageSourcing.APISource.allCases, id: \.rawValue) { sourceType in 120 | VStack { 121 | Button { 122 | UIImpactFeedbackGenerator(style: .light).impactOccurred() 123 | wallpaperController.apiSource = sourceType 124 | } label: { 125 | HStack { 126 | Image(sourceType.rawValue) 127 | .resizable() 128 | .aspectRatio(contentMode: .fit) 129 | .padding(.trailing, 20.0) 130 | .frame(height: 32) 131 | Text(sourceType.rawValue) 132 | .foregroundColor(Color.white) 133 | .padding(.trailing, 20.0) 134 | Spacer() 135 | Image(systemName: wallpaperController.apiSource == sourceType ? "checkmark.circle.fill" : "circle") 136 | .resizable() 137 | .aspectRatio(contentMode: .fit) 138 | // .foregroundColor(.accentColor) 139 | .frame(height: 22) 140 | .symbolRenderingMode(.palette) 141 | .foregroundStyle(Color.white, Color.accentColor) 142 | .opacity(wallpaperController.apiSource == sourceType ? 1 : 0.25) 143 | .preferredColorScheme(.light) 144 | } 145 | .padding(.vertical, 6) 146 | .frame(maxWidth: .infinity) 147 | .padding(.horizontal) 148 | .animation(.spring().speed(2), value: wallpaperController.apiSource) 149 | .background(Color(red: 1, green: 1, blue: 1, opacity: 0.00001)) 150 | } 151 | .buttonStyle(.plain) 152 | .disabled(sourceType != .unsplash) 153 | 154 | if ImageSourcing.APISource.allCases.last! != sourceType { 155 | Divider() 156 | .background(.white) 157 | .opacity(0.5) 158 | } 159 | } 160 | } 161 | } 162 | .padding() 163 | .background(MaterialView(.systemUltraThinMaterialLight).opacity(0.5)) 164 | .cornerRadius(20) 165 | .frame(maxWidth: 300, maxHeight: wallpaperController.enabled ? 0 : nil) 166 | .opacity(wallpaperController.enabled ? 0 : 1) 167 | .animation(.spring().speed(2), value: wallpaperController.enabled) 168 | } 169 | 170 | @ViewBuilder 171 | var button: some View { 172 | HStack(spacing:0) { 173 | 174 | // MARK: - Bottom row buttons 175 | 176 | Button(action: { 177 | UIImpactFeedbackGenerator(style: .medium).impactOccurred() 178 | // UIApplication.shared.alert(title: "Credits", body: "Made by sourcelocation (with a bit of help from llsc12).\n\nMIT - Skittyblock/WallpaperSetter\nPublic Domain - rileytestut/Clip \n\nIdea - FreshWall by SparkDev") 179 | aboutPresented.toggle() 180 | }) { 181 | Image(systemName: "info.circle") 182 | .foregroundColor(.white) 183 | .padding() 184 | .font(.system(size: 16, weight: .bold)) 185 | } 186 | .background(MaterialView(.systemUltraThinMaterialLight).opacity(0.5)) 187 | .cornerRadius(32) 188 | .opacity(wallpaperController.enabled ? 0 : 1) 189 | .animation(.spring(), value: wallpaperController.enabled) 190 | .padding(.trailing, 12) 191 | .frame(maxWidth: wallpaperController.enabled ? 0 : nil) 192 | 193 | 194 | Button(action: { 195 | UIImpactFeedbackGenerator(style: .medium).impactOccurred() 196 | wallpaperController.enabled.toggle() 197 | }) { 198 | Image(systemName: wallpaperController.enabled ? "xmark" : "checkmark") 199 | .foregroundColor(.white) 200 | .padding() 201 | .frame(maxWidth: 300) 202 | .font(.system(size: 16, weight: .bold)) 203 | } 204 | .background(MaterialView(.systemUltraThinMaterialLight).opacity(0.5)) 205 | .cornerRadius(32) 206 | .animation(.spring(), value: wallpaperController.enabled) 207 | 208 | Button(action: { 209 | UIImpactFeedbackGenerator(style: .medium).impactOccurred() 210 | optionsPresented.toggle() 211 | }) { 212 | Image(systemName: "switch.2") 213 | .foregroundColor(.white) 214 | .padding() 215 | .font(.system(size: 16, weight: .black)) 216 | } 217 | .background(MaterialView(.systemUltraThinMaterialLight).opacity(0.5)) 218 | .cornerRadius(32) 219 | .opacity(wallpaperController.enabled ? 0 : 1) 220 | .animation(.spring(), value: wallpaperController.enabled) 221 | .padding(.leading, 12) 222 | .frame(maxWidth: wallpaperController.enabled ? 0 : nil) 223 | } 224 | .frame(maxWidth: 300) 225 | } 226 | 227 | @ViewBuilder 228 | var footer: some View { 229 | VStack(spacing: 0) { 230 | Text(wallpaperController.enabled ? "Enabled and currently running." : "© 2022 sourcelocation with ♡") 231 | 232 | .foregroundColor(.white) 233 | .font(.footnote) 234 | .padding(.top, 8) 235 | .padding(.bottom, wallpaperController.enabled ? 4 : 10) 236 | .animation(.spring().speed(1), value: wallpaperController.enabled) 237 | .multilineTextAlignment(.center) 238 | 239 | Text("Try locking your device.") 240 | .foregroundColor(.init(hex: "#AAA")) 241 | .font(.footnote) 242 | .frame(maxHeight: wallpaperController.enabled ? nil : 0) 243 | .opacity(wallpaperController.enabled ? 1 : 0) 244 | .animation(.spring().speed(1), value: wallpaperController.enabled) 245 | } 246 | } 247 | } 248 | 249 | struct ContentView_Previews: PreviewProvider { 250 | static var previews: some View { 251 | ContentView() 252 | } 253 | } 254 | -------------------------------------------------------------------------------- /Evyrest/Views/LoginView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LoginView.swift 3 | // Evyrest 4 | // 5 | // Created by exerhythm on 30.11.2022. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct LoginView: View { 11 | 12 | @Environment(\.dismiss) var dismiss 13 | 14 | @State var username = "" 15 | @State var password = "" 16 | 17 | @EnvironmentObject var sourceRepoFetcher: SourcedRepoFetcher 18 | 19 | var body: some View { 20 | VStack { 21 | Image("evyrest_image") 22 | .resizable() 23 | .aspectRatio(contentMode: .fit) 24 | .foregroundColor(.accentColor) 25 | .frame(width: 80) 26 | .padding(.top, 32) 27 | Text("Welcome to\nEvyrest") 28 | .font(.system(size: 32, weight: .bold)) 29 | .multilineTextAlignment(.center) 30 | HStack { 31 | Image(systemName: "lanyardcard") 32 | .resizable() 33 | .aspectRatio(contentMode: .fit) 34 | .foregroundColor(.accentColor) 35 | .frame(height: 24) 36 | Text("Please log in into your Sourced Repo account to continue") 37 | .padding(10) 38 | } 39 | TextField("Email", text: $username) 40 | .textFieldStyle(.roundedBorder) 41 | .padding(4) 42 | .textInputAutocapitalization(.never) 43 | SecureField("Password", text: $password) 44 | .textFieldStyle(.roundedBorder) 45 | .padding(.horizontal, 4) 46 | 47 | Spacer() 48 | Button("Forgot password?") { 49 | 50 | } 51 | .padding(4) 52 | Button(action: { 53 | Task { 54 | do { 55 | try await sourceRepoFetcher.login(username: username, password: password) 56 | try await sourceRepoFetcher.linkDevice() 57 | dismiss() 58 | } catch { 59 | DispatchQueue.main.async { 60 | UIApplication.shared.alert(body: "\(error.localizedDescription)") 61 | } 62 | } 63 | } 64 | }) { 65 | Text("Log in") 66 | .padding(12) 67 | .frame(maxWidth: .infinity) 68 | .background(Color.accentColor) 69 | .foregroundColor(.white) 70 | .cornerRadius(12) 71 | } 72 | } 73 | .padding() 74 | .frame(maxWidth: 325, maxHeight: .infinity) 75 | .interactiveDismissDisabled() 76 | } 77 | } 78 | 79 | struct LoginView_Previews: PreviewProvider { 80 | static var previews: some View { 81 | LoginView() 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /Evyrest/Views/OptionsView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OptionsView.swift 3 | // Evyrest 4 | // 5 | // Created by sourcelocation on 30/12/2022. 6 | // 7 | 8 | import SwiftUI 9 | import Photos 10 | 11 | struct OptionsView: View { 12 | @ObservedObject var wallpaperController = WallpaperController.shared 13 | 14 | @State private var presentAlert = false 15 | 16 | struct RecentWallpaperView: View { 17 | @State var action: () -> () 18 | @State var url: URL 19 | 20 | var body: some View { 21 | Button(action: action) { 22 | AsyncImage(url: url) { image in 23 | image 24 | .resizable() 25 | .scaledToFill() 26 | .frame(width: 70, height: 140) 27 | .clipped() 28 | .overlay(alignment: .bottom) { 29 | Image(systemName: "arrow.down") 30 | .padding(4) 31 | .frame(maxWidth: .infinity) 32 | .background { 33 | MaterialView(.dark) 34 | .frame(height: 32) 35 | .opacity(0.5) 36 | } 37 | } 38 | .cornerRadius(8) 39 | 40 | } placeholder: { 41 | Color.gray 42 | .frame(width: 70) 43 | } 44 | } 45 | } 46 | } 47 | 48 | var body: some View { 49 | VStack(spacing: 20) { 50 | Button(action: { 51 | presentAlert = true 52 | }) { 53 | ZStack { 54 | Image("Background2") 55 | .resizable() 56 | .scaledToFill() 57 | .frame(height: 80) 58 | .clipped() 59 | Color(hex: "00213A") 60 | .opacity(0.3) 61 | .clipped() 62 | VStack { 63 | Text("Current theme") 64 | .font(.footnote) 65 | .foregroundColor(.white) 66 | Text(wallpaperController.searchTerm) 67 | .font(.headline) 68 | } 69 | } 70 | .overlay(alignment: .trailing) { 71 | Image(systemName: "chevron.right") 72 | .padding(8) 73 | } 74 | .cornerRadius(8) 75 | .frame(height: 80) 76 | } 77 | .padding(.horizontal) 78 | .padding(.top) 79 | 80 | VStack(spacing: 8) { 81 | HStack { 82 | Text("Recents") 83 | .font(.headline) 84 | Spacer() 85 | Button(action: { 86 | try? wallpaperController.clearCache() 87 | }) { 88 | Image(systemName: "xmark.bin.fill") 89 | .padding(.vertical, 8) 90 | .padding(.horizontal, 8) 91 | .background(MaterialView(.light)) 92 | .cornerRadius(8) 93 | } 94 | } 95 | .padding(.horizontal) 96 | if wallpaperController.savedWallpapers.isEmpty { 97 | ZStack { 98 | MaterialView(.light) 99 | .frame(height: 48) 100 | .cornerRadius(12) 101 | .padding() 102 | Text("Recent wallpapers will appear here.") 103 | .font(.footnote) 104 | .padding() 105 | .multilineTextAlignment(.center) 106 | } 107 | } else { 108 | ScrollView(.horizontal, showsIndicators: false) { 109 | LazyHStack { 110 | ForEach(Array(wallpaperController.savedWallpapers.enumerated()), id: \.1) { (n, wallpaper) in 111 | let isFirst = n == 0 // make sure these are valid or the styling wont work 112 | let isLast = n == wallpaperController.savedWallpapers.count - 1 113 | 114 | let egg: () -> Void = { 115 | PHPhotoLibrary.shared().performChanges({ 116 | PHAssetChangeRequest.creationRequestForAsset(from: UIImage(contentsOfFile: wallpaper.path)!) 117 | }) 118 | } 119 | 120 | RecentWallpaperView(action: egg, url: wallpaper) 121 | .padding(.leading, isFirst ? 16 : 0) 122 | .padding(.trailing, isLast ? 16 : 0) 123 | } 124 | } 125 | } 126 | .frame(height: 140) 127 | } 128 | } 129 | 130 | VStack { 131 | HStack { 132 | Text("Cache limit") 133 | .font(.headline) 134 | Spacer() 135 | Text(wallpaperController.cacheLimit != 150 ? "\(Int(wallpaperController.cacheLimit))" : "∞") 136 | Image(systemName: "photo.on.rectangle.angled") 137 | } 138 | .padding(.horizontal) 139 | 140 | Slider(value: $wallpaperController.cacheLimit, in: 0...150) 141 | .tint(.init("BackgroundColor")) 142 | .padding(.horizontal) 143 | } 144 | 145 | VStack { 146 | Toggle(isOn: $wallpaperController.changeLockScreen) { 147 | Text("Lock screen") 148 | // .font(.headline) 149 | } 150 | Toggle(isOn: $wallpaperController.changeHomeScreen) { 151 | Text("Home screen") 152 | // .font(.headline) 153 | } 154 | Toggle(isOn: $wallpaperController.downloadOnCellular) { 155 | Text("Download on Cellular") 156 | // .font(.headline) 157 | } 158 | } 159 | .padding(.horizontal) 160 | .tint(.init("BackgroundColor")) 161 | .padding(.bottom) 162 | } 163 | .foregroundColor(.white) 164 | .textFieldAlert(isPresented: $presentAlert) { () -> TextFieldAlert in 165 | TextFieldAlert(title: "Set theme", message: "Enter any search query to be used for fetching from Unsplash. Keep them simple and using one word", text: Binding($wallpaperController.searchTerm)) 166 | } 167 | } 168 | } 169 | 170 | struct OptionsView_Previews: PreviewProvider { 171 | static var previews: some View { 172 | ContentView(optionsPresented: true) 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /Evyrest/Views/UtilityViews/MaterialView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MaterialView.swift 3 | // DebToIPA 4 | // 5 | // Created by exerhythm on 18.10.2022. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct MaterialView: UIViewRepresentable { 11 | let material: UIBlurEffect.Style 12 | 13 | init(_ material: UIBlurEffect.Style) { 14 | self.material = material 15 | } 16 | 17 | func makeUIView(context: Context) -> UIVisualEffectView { 18 | UIVisualEffectView(effect: UIBlurEffect(style: material)) 19 | } 20 | 21 | func updateUIView(_ uiView: UIVisualEffectView, context: Context) { 22 | uiView.effect = UIBlurEffect(style: material) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Evyrest/Views/UtilityViews/ParallaxEffect.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MotionManager.swift 3 | // Evyrest 4 | // 5 | // Created by exerhythm on 02.12.2022. 6 | // 7 | 8 | import Foundation 9 | import SwiftUI 10 | import CoreMotion 11 | 12 | class MotionManager: ObservableObject { 13 | 14 | @Published var pitch: Double = 0.0 15 | @Published var roll: Double = 0.0 16 | 17 | static let shared = MotionManager() 18 | 19 | private var manager: CMMotionManager 20 | 21 | init() { 22 | self.manager = CMMotionManager() 23 | self.manager.deviceMotionUpdateInterval = 1/60 24 | self.manager.startDeviceMotionUpdates(to: .main) { (motionData, error) in 25 | guard error == nil else { 26 | print(error!) 27 | return 28 | } 29 | 30 | if let motionData = motionData { 31 | self.pitch = motionData.attitude.pitch 32 | self.roll = motionData.attitude.roll 33 | } 34 | } 35 | } 36 | 37 | deinit { 38 | self.manager.stopDeviceMotionUpdates() 39 | self.roll = 0 40 | self.pitch = 0 41 | } 42 | } 43 | 44 | struct ParallaxMotionModifier: ViewModifier { 45 | 46 | @ObservedObject var manager = MotionManager.shared 47 | var magnitude: Double 48 | 49 | func body(content: Content) -> some View { 50 | let scale = (magnitude / 2) + 1 51 | let mag = magnitude * 15 52 | content 53 | .scaleEffect(scale, anchor: .center) 54 | .offset(x: CGFloat((manager.roll * mag)), y: CGFloat((manager.pitch * mag))) 55 | .animation(.spring(), value: manager.roll) 56 | .animation(.spring(), value: manager.pitch) 57 | } 58 | } 59 | 60 | extension View { 61 | func parallaxed(magnitude: Double) -> some View { 62 | modifier(ParallaxMotionModifier(magnitude: magnitude)) 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Evyrest 2 | 3 | ![Artboard](https://user-images.githubusercontent.com/52459150/210447490-02d73567-41dd-437e-ad7f-a5a17934f55b.png) 4 | -------------------------------------------------------------------------------- /entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.springboard.wallpaper-access 6 | 7 | platform-application 8 | 9 | com.apple.private.security.container-manager 10 | 11 | com.apple.private.security.no-container 12 | 13 | com.apple.private.security.no-sandbox 14 | 15 | com.apple.private.security.container-required 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /ipabuild.sh: -------------------------------------------------------------------------------- 1 | WORKING_LOCATION="$(pwd)" 2 | APPLICATION_NAME=Evyrest 3 | HELPER_EXEC_NAME=evyrestrefresher 4 | CONFIGURATION=Debug 5 | 6 | # If the folder 'build' does not exist, create it 7 | if [ ! -d "build" ]; then 8 | mkdir build 9 | fi 10 | 11 | cd build 12 | 13 | # remove already built tipa if present 14 | if [ -e "$APPLICATION_NAME.tipa" ]; then 15 | rm $APPLICATION_NAME.tipa 16 | fi 17 | 18 | 19 | DD_BUILD_PATH="$WORKING_LOCATION/build/DerivedData/Build/Products/$CONFIGURATION-iphoneos" 20 | TARGET_APP="build/$APPLICATION_NAME.app" 21 | 22 | # Build APPLICATION_NAME 23 | xcodebuild -project "$WORKING_LOCATION/$APPLICATION_NAME.xcodeproj" \ 24 | -scheme $APPLICATION_NAME \ 25 | -configuration $CONFIGURATION \ 26 | -derivedDataPath "$WORKING_LOCATION/build/DerivedData" \ 27 | -destination 'generic/platform=iOS' \ 28 | ONLY_ACTIVE_ARCH="NO" \ 29 | CODE_SIGNING_ALLOWED="NO" 30 | 31 | cp -r "$DD_BUILD_PATH/$APPLICATION_NAME.app" "$WORKING_LOCATION/$TARGET_APP" 32 | 33 | # Build HELPER_EXEC_NAME 34 | xcodebuild -project "$WORKING_LOCATION/$APPLICATION_NAME.xcodeproj" \ 35 | -scheme $HELPER_EXEC_NAME \ 36 | -configuration $CONFIGURATION \ 37 | -derivedDataPath "$WORKING_LOCATION/build/DerivedData" \ 38 | -destination 'generic/platform=iOS' \ 39 | ONLY_ACTIVE_ARCH="NO" \ 40 | CODE_SIGNING_ALLOWED="NO" 41 | 42 | cp -r "$DD_BUILD_PATH/$HELPER_EXEC_NAME" "$WORKING_LOCATION/$TARGET_APP/$HELPER_EXEC_NAME" 43 | 44 | 45 | # Remove signature 46 | codesign --remove "$TARGET_APP" 47 | if [ -e "$TARGET_APP/_CodeSignature" ]; then 48 | rm -rf "$TARGET_APP/_CodeSignature" 49 | fi 50 | if [ -e "$TARGET_APP/embedded.mobileprovision" ]; then 51 | rm -rf "$TARGET_APP/embedded.mobileprovision" 52 | fi 53 | 54 | 55 | # Add entitlements 56 | echo "Adding entitlements to $APPLICATION_NAME" 57 | ldid -S"$WORKING_LOCATION/entitlements.plist" "$WORKING_LOCATION/$TARGET_APP/$APPLICATION_NAME" 58 | echo "Adding entitlements $HELPER_EXEC_NAME" 59 | ldid -S"$WORKING_LOCATION/entitlements.plist" "$WORKING_LOCATION/$TARGET_APP/$HELPER_EXEC_NAME" 60 | 61 | 62 | # Package .ipa 63 | rm -rf Payload 64 | mkdir Payload 65 | cp -r $APPLICATION_NAME.app Payload/$APPLICATION_NAME.app 66 | 67 | # Zip the Payload and rename 68 | zip -vr $APPLICATION_NAME.tipa Payload 69 | 70 | # Cleanup 71 | rm -rf $APPLICATION_NAME.app 72 | rm -rf $HELPER_EXEC_NAME 73 | rm -rf Payload --------------------------------------------------------------------------------