├── .gitignore
├── Amēlija.plist
├── AmēlijaPrefs
├── Resources
│ ├── Assets
│ │ ├── Amēlija.png
│ │ ├── AMBanner.png
│ │ ├── AMHotIcon.png
│ │ ├── April@2x.png
│ │ ├── Amēlija@2x.png
│ │ ├── Amēlija@3x.png
│ │ └── Meredith@2x.png
│ ├── Info.plist
│ ├── AmelijaLinks.plist
│ ├── HS.plist
│ ├── Root.plist
│ ├── LS.plist
│ └── AmelijaContributors.plist
├── Makefile
├── layout
│ └── Library
│ │ └── PreferenceLoader
│ │ └── Preferences
│ │ └── AmēlijaPrefs.plist
├── AMLRootVC.h
└── AMLRootVC.m
├── Makefile
├── control
├── Headers
├── Amēlija.h
├── Common.h
└── Prefs.h
├── .github
└── workflows
│ └── build.yml
├── README.md
├── Amēlija.x
└── LICENSE
/.gitignore:
--------------------------------------------------------------------------------
1 | .cache/
2 | .theos/
3 | packages/
4 | compile_commands.json
5 |
--------------------------------------------------------------------------------
/Amēlija.plist:
--------------------------------------------------------------------------------
1 | { Filter = { Bundles = ( "com.apple.springboard" ); }; }
2 |
--------------------------------------------------------------------------------
/AmēlijaPrefs/Resources/Assets/Amēlija.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Luki120/Amelija/HEAD/AmēlijaPrefs/Resources/Assets/Amēlija.png
--------------------------------------------------------------------------------
/AmēlijaPrefs/Resources/Assets/AMBanner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Luki120/Amelija/HEAD/AmēlijaPrefs/Resources/Assets/AMBanner.png
--------------------------------------------------------------------------------
/AmēlijaPrefs/Resources/Assets/AMHotIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Luki120/Amelija/HEAD/AmēlijaPrefs/Resources/Assets/AMHotIcon.png
--------------------------------------------------------------------------------
/AmēlijaPrefs/Resources/Assets/April@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Luki120/Amelija/HEAD/AmēlijaPrefs/Resources/Assets/April@2x.png
--------------------------------------------------------------------------------
/AmēlijaPrefs/Resources/Assets/Amēlija@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Luki120/Amelija/HEAD/AmēlijaPrefs/Resources/Assets/Amēlija@2x.png
--------------------------------------------------------------------------------
/AmēlijaPrefs/Resources/Assets/Amēlija@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Luki120/Amelija/HEAD/AmēlijaPrefs/Resources/Assets/Amēlija@3x.png
--------------------------------------------------------------------------------
/AmēlijaPrefs/Resources/Assets/Meredith@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Luki120/Amelija/HEAD/AmēlijaPrefs/Resources/Assets/Meredith@2x.png
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | export TARGET := iphone:clang:latest:latest
2 |
3 | INSTALL_TARGET_PROCESSES = SpringBoard
4 |
5 | TWEAK_NAME = Amēlija
6 |
7 | Amēlija_FILES = Amēlija.x
8 | Amēlija_CFLAGS = -fobjc-arc
9 | Amēlija_LIBRARIES = gcuniversal
10 |
11 | SUBPROJECTS = AmēlijaPrefs
12 |
13 | include $(THEOS)/makefiles/common.mk
14 | include $(THEOS_MAKE_PATH)/tweak.mk
15 | include $(THEOS_MAKE_PATH)/aggregate.mk
16 |
--------------------------------------------------------------------------------
/AmēlijaPrefs/Makefile:
--------------------------------------------------------------------------------
1 | BUNDLE_NAME = AmēlijaPrefs
2 |
3 | AmēlijaPrefs_FILES = AMLRootVC.m
4 | AmēlijaPrefs_CFLAGS = -fobjc-arc
5 | AmēlijaPrefs_LIBRARIES = gcuniversal
6 | AmēlijaPrefs_FRAMEWORKS = UIKit
7 | AmēlijaPrefs_PRIVATE_FRAMEWORKS = Preferences OnBoardingKit
8 | AmēlijaPrefs_INSTALL_PATH = /Library/PreferenceBundles
9 |
10 | include $(THEOS)/makefiles/common.mk
11 | include $(THEOS_MAKE_PATH)/bundle.mk
--------------------------------------------------------------------------------
/control:
--------------------------------------------------------------------------------
1 | Package: me.luki.amelija
2 | Name: Amēlija
3 | Version: 2.0
4 | Architecture: iphoneos-arm
5 | Description: Take full control of your wallpapers on the fly
6 | Maintainer: Luki
7 | Author: Luki
8 | Section: Tweaks
9 | Depends: mobilesubstrate, preferenceloader, com.mrgcgamer.libgcuniversal
10 | Icon: https://raw.githubusercontent.com/Luki120/Amelija/main/Am%C4%93lijaPrefs/Resources/Assets/AMHotIcon.png
11 | Depiction: https://luki120.github.io/depictions/web/?p=me.luki.amelija
12 | SileoDepiction: https://luki120.github.io/depictions/native/me.luki.amelija/depiction.json
13 |
--------------------------------------------------------------------------------
/AmēlijaPrefs/layout/Library/PreferenceLoader/Preferences/AmēlijaPrefs.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | entry
6 |
7 | bundle
8 | AmēlijaPrefs
9 | cell
10 | PSLinkCell
11 | detail
12 | AMLRootListController
13 | icon
14 | Assets/Amēlija.png
15 | isController
16 |
17 | label
18 | Amēlija
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Headers/Amēlija.h:
--------------------------------------------------------------------------------
1 | @import UIKit;
2 | @import CydiaSubstrate;
3 | #import "Common.h"
4 | #import "Prefs.h"
5 |
6 |
7 | @interface CSCoverSheetViewController : UIViewController
8 | @property (nonatomic, strong) UIView *blurView;
9 | @property (nonatomic, strong) _UIBackdropView *gaussianBlurView;
10 | - (void)unleashThatLSBlur;
11 | - (void)showBlurIfNotifsPresent;
12 | - (void)fadeInBlur;
13 | - (void)fadeOutBlur;
14 | @end
15 |
16 |
17 | @interface SBHomeScreenViewController : UIViewController
18 | @property (nonatomic, strong) UIView *blurView;
19 | @property (nonatomic, strong) _UIBackdropView *gaussianBlurView;
20 | - (void)unleashThatHSBlur;
21 | @end
22 |
23 |
24 | @interface NCNotificationMasterList : NSObject
25 | @property (assign, nonatomic) NSInteger notificationCount;
26 | - (void)postNotif;
27 | @end
28 |
--------------------------------------------------------------------------------
/AmēlijaPrefs/Resources/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | AmēlijaPrefs
9 | CFBundleIdentifier
10 | me.luki.amēlijaprefs
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1.0
21 | NSPrincipalClass
22 | AMLRootVC
23 |
24 |
--------------------------------------------------------------------------------
/AmēlijaPrefs/AMLRootVC.h:
--------------------------------------------------------------------------------
1 | @import AudioToolbox.AudioServices;
2 | @import ObjectiveC.message;
3 | @import Preferences.PSListController;
4 | @import Preferences.PSSpecifier;
5 | @import Preferences.PSTableCell;
6 | #import
7 | #import "../Headers/Common.h"
8 |
9 |
10 | @interface OBWelcomeController : UIViewController
11 | - (id)initWithTitle:(id)arg1 detailText:(id)arg2 icon:(id)arg3;
12 | - (void)addBulletedListItemWithTitle:(id)arg1 description:(id)arg2 image:(id)arg3;
13 | @end
14 |
15 |
16 | @interface AMLRootVC : PSListController
17 | @end
18 |
19 |
20 | @interface LSRootVC : PSListController
21 | @end
22 |
23 |
24 | @interface HSRootVC : PSListController
25 | @end
26 |
27 |
28 | @interface AmelijaLinksVC : PSListController
29 | @end
30 |
31 |
32 | @interface AmelijaContributorsVC : PSListController
33 | @end
34 |
35 |
36 | @interface PSListController ()
37 | - (BOOL)containsSpecifier:(PSSpecifier *)specifier;
38 | @end
39 |
--------------------------------------------------------------------------------
/Headers/Common.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #define rootlessPathC(cPath) ROOT_PATH(cPath)
4 | #define rootlessPathNS(path) ROOT_PATH_NS(path)
5 |
6 | static NSString *const kPath = rootlessPathNS(@"/var/mobile/Library/Preferences/me.luki.amēlijaprefs.plist");
7 |
8 | static NSNotificationName const AmelijaLSBlurAppliedNotification = @"AmelijaLSBlurAppliedNotification";
9 | static NSNotificationName const AmelijaNotificationArrivedNotification = @"AmelijaNotificationArrivedNotification";
10 | static NSNotificationName const AmelijaHSBlurAppliedNotification = @"AmelijaHSBlurAppliedNotification";
11 |
12 |
13 | @interface _UIBackdropViewSettings : NSObject
14 | + (id)settingsForStyle:(NSInteger)arg1;
15 | @end
16 |
17 |
18 | @interface _UIBackdropView : UIView
19 | - (id)initWithFrame:(CGRect)arg1 autosizesToFitSuperview:(BOOL)arg2 settings:(id)arg3;
20 | @end
21 |
22 |
23 | @interface NSDistributedNotificationCenter : NSNotificationCenter
24 | @end
25 |
--------------------------------------------------------------------------------
/Headers/Prefs.h:
--------------------------------------------------------------------------------
1 | // LS
2 |
3 | static BOOL lsBlur;
4 | static BOOL blurIfNotifs;
5 |
6 | static NSInteger lsBlurType;
7 |
8 | static float lsIntensity;
9 |
10 | static UIBlurEffect *blurEffect;
11 |
12 | // HS
13 |
14 | static BOOL hsBlur;
15 |
16 | static NSInteger hsBlurType;
17 |
18 | static float hsIntensity;
19 |
20 | static void loadPrefs() {
21 |
22 | NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile: kPath];
23 | NSMutableDictionary *prefs = dict ? [dict mutableCopy] : [NSMutableDictionary dictionary];
24 |
25 | lsBlur = prefs[@"lsBlur"] ? [prefs[@"lsBlur"] boolValue] : NO;
26 | blurIfNotifs = prefs[@"blurIfNotifs"] ? [prefs[@"blurIfNotifs"] boolValue] : NO;
27 | lsBlurType = prefs[@"lsBlurType"] ? [prefs[@"lsBlurType"] integerValue] : 0;
28 | lsIntensity = prefs[@"lsIntensity"] ? [prefs[@"lsIntensity"] floatValue] : 0.85f;
29 |
30 | hsBlur = prefs[@"hsBlur"] ? [prefs[@"hsBlur"] boolValue] : NO;
31 | hsBlurType = prefs[@"hsBlurType"] ? [prefs[@"hsBlurType"] integerValue] : 0;
32 | hsIntensity = prefs[@"hsIntensity"] ? [prefs[@"hsIntensity"] floatValue] : 0.85f;
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Makefile CI
2 |
3 | on:
4 | push:
5 | branches: [ "main" ]
6 | pull_request:
7 | branches: [ "main" ]
8 |
9 | jobs:
10 | build:
11 | runs-on: macos-latest
12 | steps:
13 | - uses: actions/checkout@main
14 |
15 | - name: Checkout theos/theos
16 | uses: actions/checkout@main
17 | with:
18 | repository: theos/theos
19 | ref: master
20 | submodules: recursive
21 | path: theos
22 |
23 | - name: Checkout theos/sdks
24 | uses: actions/checkout@main
25 | with:
26 | repository: theos/sdks
27 | ref: master
28 | sparse-checkout: iPhoneOS14.5.sdk
29 | path: theos/sdks
30 |
31 | - name: Checkout LibGcUniversalDocumentation/master
32 | uses: actions/checkout@main
33 | with:
34 | repository: MrGcGamer/LibGcUniversalDocumentation
35 | path: LibGcUniversalDocumentation
36 |
37 | - name: Setup libs & build package
38 | run: |
39 | cd LibGcUniversalDocumentation
40 | THEOS=../theos ./install.sh
41 | cd ..
42 | brew install make ldid
43 | THEOS=theos gmake clean package TARGET="iphone:clang:14.5:14.0" FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless
44 |
45 | - name: Upload a Build Artifact
46 | uses: actions/upload-artifact@v3
47 | with:
48 | path: packages/*.deb
49 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Amēlija
2 |
3 |
4 |
5 | ## Features
6 |
7 | * Custom blurs for your LockScreen.
8 | * Custom blurs for your HomeScreen.
9 |
10 | ## Blur Types
11 |
12 | * Epic.
13 | * Dark.
14 | * Light.
15 | * Adaptive.
16 | * Promiment.
17 | * System thin material.
18 | * System chrome material.
19 | * System ultra thin material.
20 |
21 | ## Socials
22 |
23 | * [Twitter](https://twitter.com/Lukii120)
24 | * [Support on Discord](https://discord.gg/2y5uWhhNJu)
25 |
26 | ## Contributing
27 |
28 | * Contributions are more than welcomed, but should follow this etiquette:
29 |
30 | * If you're a contributor with write access to this repository, you **should NOT** push to main branch, preferably push to a new one and *then* create the PR.
31 | * Keep commit titles short and then explain them in comments or preferably in the commit's description.
32 | * Push small commits (e.g if you changed 2 directories, commit one directory, then commit the other one and only THEN push)
33 |
34 | ## LICENSE
35 |
36 | * [Mozilla Public License 2.0](https://www.mozilla.org/en-US/MPL/2.0/)
37 |
38 | ## Assets LICENSE
39 |
40 | * Under no means shall the visual assets of this repository – i.e., all photo-, picto-, icono-, and videographic material – (if any) be altered and/or redistributed for any independent commercial or non-commercial intent beyond its original function in this project. Permissible usage of such content is restricted solely to its express application in this repository and any forks that retain the material in its original, unaltered form only.
41 |
--------------------------------------------------------------------------------
/AmēlijaPrefs/Resources/AmelijaLinks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | items
6 |
7 |
8 | cell
9 | PSGroupCell
10 | label
11 | Maybe
12 |
13 |
14 | cell
15 | PSButtonCell
16 | cellClass
17 | AmelijaTintCell
18 | action
19 | launchDiscord
20 | label
21 | Chat With Us On Discord
22 |
23 |
24 | cell
25 | PSButtonCell
26 | cellClass
27 | AmelijaTintCell
28 | action
29 | launchPayPal
30 | label
31 | Donate To Luki 🥰
32 |
33 |
34 | cell
35 | PSButtonCell
36 | cellClass
37 | AmelijaTintCell
38 | action
39 | launchGitHub
40 | label
41 | Source Code 🔥
42 |
43 |
44 | cell
45 | PSGroupCell
46 | label
47 | You Might Like
48 |
49 |
50 | cell
51 | PSButtonCell
52 | cellClass
53 | AmelijaTintCell
54 | action
55 | launchApril
56 | label
57 | April
58 | icon
59 | Assets/April@2x.png
60 |
61 |
62 | cell
63 | PSButtonCell
64 | cellClass
65 | AmelijaTintCell
66 | action
67 | launchMeredith
68 | label
69 | Meredith
70 | icon
71 | Assets/Meredith@2x.png
72 |
73 |
74 | title
75 | Amēlija
76 |
77 |
78 |
--------------------------------------------------------------------------------
/AmēlijaPrefs/Resources/HS.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | items
6 |
7 |
8 | cell
9 | PSGroupCell
10 | label
11 | HS
12 |
13 |
14 | cell
15 | PSSwitchCell
16 | default
17 |
18 | defaults
19 | me.luki.amēlijaprefs
20 | key
21 | hsBlur
22 | label
23 | Blur
24 | id
25 | MiscHSBlursSwitch
26 |
27 |
28 | cell
29 | PSGroupCell
30 | id
31 | GroupCell-1
32 |
33 |
34 | cell
35 | PSLinkListCell
36 | detail
37 | PSListItemsController
38 | defaults
39 | me.luki.amēlijaprefs
40 | id
41 | MiscHSBlursList
42 | default
43 | 0
44 | key
45 | hsBlurType
46 | label
47 | Blur Types
48 | validValues
49 |
50 | 0
51 | 1
52 | 2
53 | 3
54 | 4
55 | 5
56 | 6
57 | 7
58 |
59 | validTitles
60 |
61 | Epic
62 | Dark
63 | Light
64 | Adaptive
65 | Promiment
66 | System Thin
67 | System Ultra Thin
68 | System Chrome Material
69 |
70 |
71 |
72 | cell
73 | PSGroupCell
74 | label
75 | This slider controls the intensity (alpha) of the blur
76 | id
77 | GroupCell-2
78 |
79 |
80 | cell
81 | PSSliderCell
82 | default
83 | 0.85
84 | defaults
85 | me.luki.amēlijaprefs
86 | key
87 | hsIntensity
88 | min
89 | 0
90 | max
91 | 1
92 | showValue
93 |
94 | id
95 | BlurSliderCell
96 |
97 |
98 | title
99 | Amēlija
100 |
101 |
102 |
--------------------------------------------------------------------------------
/AmēlijaPrefs/Resources/Root.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | items
6 |
7 |
8 | cellClass
9 | GcDuoTwitterCell
10 | firstLabel
11 | Luki120
12 | firstAccount
13 | Lukii120
14 | firstURL
15 | https://avatars.githubusercontent.com/u/74214115?v=4
16 | secondLabel
17 | Ben
18 | secondAccount
19 | Ben216k
20 | secondURL
21 | https://avatars.githubusercontent.com/u/91443760?v=4
22 |
23 |
24 | cell
25 | PSGroupCell
26 |
27 |
28 | cell
29 | PSLinkCell
30 | detail
31 | LSRootVC
32 | isController
33 |
34 | label
35 | LockScreen
36 |
37 |
38 | cell
39 | PSLinkCell
40 | detail
41 | HSRootVC
42 | isController
43 |
44 | label
45 | HomeScreen
46 |
47 |
48 | cell
49 | PSGroupCell
50 |
51 |
52 | action
53 | shatterThePrefsToPieces
54 | cell
55 | PSButtonCell
56 | cellClass
57 | AmelijaTintCell
58 | label
59 | Reset Preferences
60 |
61 |
62 | cell
63 | PSGroupCell
64 |
65 |
66 | cell
67 | PSLinkCell
68 | cellClass
69 | AmelijaTintCell
70 | detail
71 | AmelijaContributorsVC
72 | isController
73 |
74 | label
75 | Contributors
76 |
77 |
78 | cell
79 | PSGroupCell
80 |
81 |
82 | cell
83 | PSLinkCell
84 | cellClass
85 | AmelijaTintCell
86 | detail
87 | AmelijaLinksVC
88 | isController
89 |
90 | label
91 | Take A Look
92 |
93 |
94 | cell
95 | PSGroupCell
96 | footerAlignment
97 | 1
98 | footerText
99 | Izgatavojis Luki ar 💜
100 | isStaticText
101 |
102 |
103 |
104 | cell
105 | PSGroupCell
106 | footerAlignment
107 | 1
108 | footerText
109 | © 2021-2024 Luki120
110 | isStaticText
111 |
112 |
113 |
114 | title
115 | Amēlija
116 |
117 |
118 |
--------------------------------------------------------------------------------
/AmēlijaPrefs/Resources/LS.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | items
6 |
7 |
8 | cell
9 | PSGroupCell
10 | label
11 | LS
12 |
13 |
14 | cell
15 | PSSwitchCell
16 | default
17 |
18 | defaults
19 | me.luki.amēlijaprefs
20 | key
21 | lsBlur
22 | label
23 | Blur
24 | id
25 | MiscLSBlursSwitch
26 |
27 |
28 | cell
29 | PSGroupCell
30 | id
31 | GroupCell-1
32 |
33 |
34 | cell
35 | PSLinkListCell
36 | detail
37 | PSListItemsController
38 | defaults
39 | me.luki.amēlijaprefs
40 | id
41 | MiscLSBlursList
42 | default
43 | 0
44 | key
45 | lsBlurType
46 | label
47 | Blur Types
48 | validValues
49 |
50 | 0
51 | 1
52 | 2
53 | 3
54 | 4
55 | 5
56 | 6
57 | 7
58 |
59 | validTitles
60 |
61 | Epic
62 | Dark
63 | Light
64 | Adaptive
65 | Promiment
66 | System Thin
67 | System Ultra Thin
68 | System Chrome Material
69 |
70 |
71 |
72 | cell
73 | PSGroupCell
74 | label
75 | This slider controls the intensity (alpha) of the blur
76 | id
77 | GroupCell-2
78 |
79 |
80 | cell
81 | PSSliderCell
82 | default
83 | 0.85
84 | defaults
85 | me.luki.amēlijaprefs
86 | key
87 | lsIntensity
88 | min
89 | 0
90 | max
91 | 1
92 | showValue
93 |
94 | id
95 | BlurSliderCell
96 |
97 |
98 | cell
99 | PSGroupCell
100 | id
101 | GroupCell-3
102 |
103 |
104 | cell
105 | PSSwitchCell
106 | default
107 |
108 | defaults
109 | me.luki.amēlijaprefs
110 | key
111 | blurIfNotifs
112 | label
113 | Blur Only With Notifs
114 | id
115 | BlurOnlyWithNotifsSwitch
116 |
117 |
118 | title
119 | Amēlija
120 |
121 |
122 |
--------------------------------------------------------------------------------
/AmēlijaPrefs/Resources/AmelijaContributors.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | items
6 |
7 |
8 | cell
9 | PSGroupCell
10 | label
11 | Lead Developer
12 |
13 |
14 | cell
15 | PSButtonCell
16 | cellClass
17 | GcTwitterCell
18 | accountLabel
19 | Luki120
20 | account
21 | Lukii120
22 | URL
23 | https://avatars.githubusercontent.com/u/74214115?v=4
24 |
25 |
26 | cell
27 | PSGroupCell
28 | label
29 | Wizard & Axon support help
30 |
31 |
32 | cell
33 | PSButtonCell
34 | cellClass
35 | GcTwitterCell
36 | accountLabel
37 | RuntimeOverflow
38 | account
39 | RuntimeOverflow
40 | URL
41 | https://avatars.githubusercontent.com/u/38386956?v=4
42 |
43 |
44 | cell
45 | PSGroupCell
46 | label
47 | Epic Blur
48 |
49 |
50 | cell
51 | PSButtonCell
52 | cellClass
53 | GcTwitterCell
54 | accountLabel
55 | ETHN
56 | account
57 | EthanWhited
58 | URL
59 | https://avatars.githubusercontent.com/u/41249541?v=4
60 |
61 |
62 | cell
63 | PSGroupCell
64 | label
65 | Help with specifiers
66 |
67 |
68 | cell
69 | PSButtonCell
70 | cellClass
71 | GcTwitterCell
72 | accountLabel
73 | Miguelaka
74 | account
75 | Miguelaka95
76 | URL
77 | https://pbs.twimg.com/profile_images/1352713271435014148/_N-NLFJv_400x400.jpg
78 |
79 |
80 | cell
81 | PSGroupCell
82 | label
83 | Pretty Icon And Banner
84 |
85 |
86 | cell
87 | PSButtonCell
88 | cellClass
89 | GcTwitterCell
90 | accountLabel
91 | Ben
92 | account
93 | Ben216k
94 | URL
95 | https://avatars.githubusercontent.com/u/91443760?v=4
96 |
97 |
98 | cell
99 | PSGroupCell
100 | label
101 | Pretty Twitter Cells
102 |
103 |
104 | cell
105 | PSButtonCell
106 | cellClass
107 | GcTwitterCell
108 | accountLabel
109 | MrGcGamer
110 | account
111 | MrGcGamer
112 | URL
113 | https://avatars.githubusercontent.com/u/32813275?v=4
114 |
115 |
116 | title
117 | Amēlija
118 |
119 |
120 |
--------------------------------------------------------------------------------
/Amēlija.x:
--------------------------------------------------------------------------------
1 | #import "Headers/Amēlija.h"
2 |
3 |
4 | static NSInteger cellCount = 0;
5 | static NSInteger notificationCount = 0;
6 |
7 | #define kEnekoExists [[NSFileManager defaultManager] fileExistsAtPath:rootlessPathNS(@"/Library/MobileSubstrate/DynamicLibraries/Eneko.dylib")]
8 | #define kTakoExists [[NSFileManager defaultManager] fileExistsAtPath:rootlessPathNS(@"/Library/MobileSubstrate/DynamicLibraries/Tako.dylib")]
9 |
10 | // Reusable
11 |
12 | static UIView *blurView(UIViewController *self, CGFloat alpha) {
13 |
14 | UIView *blurView = [[UIVisualEffectView alloc] initWithEffect: blurEffect];
15 | blurView.tag = 1337;
16 | blurView.alpha = alpha;
17 | blurView.frame = self.view.bounds;
18 | blurView.clipsToBounds = YES;
19 | blurView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
20 | [self.view insertSubview:blurView atIndex:0];
21 |
22 | return blurView;
23 |
24 | }
25 |
26 | static _UIBackdropView *gaussianBlurView(UIViewController *self, CGFloat alpha) {
27 |
28 | _UIBackdropViewSettings *settings = [_UIBackdropViewSettings settingsForStyle:2];
29 |
30 | _UIBackdropView *gaussianBlurView = [[_UIBackdropView alloc] initWithFrame:CGRectZero autosizesToFitSuperview:YES settings:settings];
31 | gaussianBlurView.tag = 1337;
32 | gaussianBlurView.alpha = alpha;
33 | [self.view insertSubview:gaussianBlurView atIndex:0];
34 |
35 | return gaussianBlurView;
36 |
37 | }
38 |
39 | static void blurType(NSInteger blurType) {
40 |
41 | switch(blurType) {
42 | case 1: blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]; break;
43 | case 2: blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; break;
44 | case 3: blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleRegular]; break;
45 | case 4: blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleProminent]; break;
46 | case 5: blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleSystemThinMaterial]; break;
47 | case 6: blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleSystemUltraThinMaterial]; break;
48 | case 7: blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleSystemChromeMaterial]; break;
49 | }
50 |
51 | }
52 |
53 | static NSInteger (*origNumberOfItemsInSection)(UIView *, SEL, UICollectionView *, NSInteger);
54 | static NSInteger overrideNumberOfItemsInSection(UIView *self, SEL _cmd, UICollectionView *collectionView, NSInteger section) {
55 |
56 | cellCount = origNumberOfItemsInSection(self, _cmd, collectionView, section);
57 | [NSDistributedNotificationCenter.defaultCenter postNotificationName:AmelijaNotificationArrivedNotification object:nil];
58 | return cellCount;
59 |
60 | }
61 |
62 | static id observer;
63 | static void appDidFinishLaunching() {
64 |
65 | observer = [NSNotificationCenter.defaultCenter addObserverForName:UIApplicationDidFinishLaunchingNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) {
66 |
67 | if(NSClassFromString(@"AXNView"))
68 | MSHookMessageEx(NSClassFromString(@"AXNView"), @selector(collectionView:numberOfItemsInSection:), (IMP) &overrideNumberOfItemsInSection, (IMP *) &origNumberOfItemsInSection);
69 |
70 | else if(NSClassFromString(@"TKOView"))
71 | MSHookMessageEx(NSClassFromString(@"TKOView"), @selector(collectionView:numberOfItemsInSection:), (IMP) &overrideNumberOfItemsInSection, (IMP *) &origNumberOfItemsInSection);
72 |
73 | [NSNotificationCenter.defaultCenter removeObserver: observer];
74 |
75 | }];
76 |
77 | }
78 |
79 |
80 | %hook NCNotificationMasterList
81 |
82 | - (void)removeNotificationRequest:(id)arg1 { // get notification count in a reliable way
83 |
84 | %orig;
85 | [self postNotif];
86 |
87 | }
88 |
89 |
90 | - (void)insertNotificationRequest:(id)arg1 {
91 |
92 | %orig;
93 | [self postNotif];
94 |
95 | }
96 |
97 |
98 | - (void)modifyNotificationRequest:(id)arg1 {
99 |
100 | %orig;
101 | [self postNotif];
102 |
103 | }
104 |
105 | %new
106 |
107 | - (void)postNotif {
108 |
109 | notificationCount = [self notificationCount];
110 | [NSDistributedNotificationCenter.defaultCenter postNotificationName:AmelijaNotificationArrivedNotification object:nil];
111 |
112 | }
113 |
114 | %end
115 |
116 |
117 | %hook CSCoverSheetViewController
118 |
119 | %property (nonatomic, strong) UIView *blurView;
120 | %property (nonatomic, strong) _UIBackdropView *gaussianBlurView;
121 |
122 | %new
123 |
124 | - (void)unleashThatLSBlur { // self explanatory
125 |
126 | loadPrefs();
127 |
128 | [[self.view viewWithTag: 1337] removeFromSuperview];
129 |
130 | if(!lsBlur) return;
131 | if(lsBlurType == 0) {
132 |
133 | self.gaussianBlurView = gaussianBlurView(self, lsIntensity);
134 | if(blurIfNotifs && notificationCount == 0) self.gaussianBlurView.alpha = 0;
135 |
136 | }
137 |
138 | else {
139 |
140 | blurType(lsBlurType);
141 |
142 | self.blurView = blurView(self, lsIntensity);
143 | if(blurIfNotifs && notificationCount == 0) self.blurView.alpha = 0;
144 |
145 | }
146 |
147 | if(self.blurView || self.gaussianBlurView) [self showBlurIfNotifsPresent];
148 |
149 | }
150 |
151 | %new
152 |
153 | - (void)showBlurIfNotifsPresent { // self explanatory
154 |
155 | loadPrefs();
156 |
157 | if(!blurIfNotifs) {
158 |
159 | self.blurView.alpha = lsBlur ? lsIntensity : 1;
160 | self.gaussianBlurView.alpha = lsBlur ? lsIntensity : 1;
161 |
162 | }
163 |
164 | else if(!kTakoExists) {
165 |
166 | if(cellCount == 0 && notificationCount == 0) [self fadeOutBlur];
167 | else [self fadeInBlur];
168 |
169 | }
170 |
171 | else {
172 |
173 | if(cellCount == 0) [self fadeOutBlur];
174 | else [self fadeInBlur];
175 |
176 | }
177 |
178 | }
179 |
180 | %new
181 |
182 | - (void)fadeInBlur {
183 |
184 | [UIView animateWithDuration:0.8 delay:0.0 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{
185 |
186 | self.blurView.alpha = lsBlur ? lsIntensity : 1;
187 | self.gaussianBlurView.alpha = lsBlur ? lsIntensity : 1;
188 |
189 | } completion:nil];
190 |
191 | }
192 |
193 | %new
194 |
195 | - (void)fadeOutBlur {
196 |
197 | [UIView animateWithDuration:1.5 delay:0.0 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{
198 |
199 | self.blurView.alpha = 0;
200 | self.gaussianBlurView.alpha = 0;
201 |
202 | } completion:nil];
203 |
204 | }
205 |
206 |
207 | - (void)viewDidLoad { // create notification observers
208 |
209 | %orig;
210 |
211 | [self unleashThatLSBlur];
212 | [NSDistributedNotificationCenter.defaultCenter addObserver:self selector:@selector(unleashThatLSBlur) name:AmelijaLSBlurAppliedNotification object:nil];
213 | [NSDistributedNotificationCenter.defaultCenter addObserver:self selector:@selector(showBlurIfNotifsPresent) name:AmelijaNotificationArrivedNotification object:nil];
214 |
215 | }
216 |
217 | %end
218 |
219 |
220 | %hook SBHomeScreenViewController
221 |
222 | %property (nonatomic, strong) UIView *blurView;
223 | %property (nonatomic, strong) _UIBackdropView *gaussianBlurView;
224 |
225 | %new
226 |
227 | - (void)unleashThatHSBlur { // self explanatory
228 |
229 | loadPrefs();
230 |
231 | [[self.view viewWithTag: 1337] removeFromSuperview];
232 |
233 | if(!hsBlur) return;
234 | if(hsBlurType == 0) self.gaussianBlurView = gaussianBlurView(self, hsIntensity);
235 |
236 | else {
237 |
238 | blurType(hsBlurType);
239 | self.blurView = blurView(self, hsIntensity);
240 |
241 | }
242 |
243 | if(!kEnekoExists) return;
244 |
245 | CALayer *videoLayer;
246 |
247 | for(CALayer *sublayer in self.view.layer.sublayers)
248 | if([sublayer isKindOfClass: NSClassFromString(@"AVPlayerLayer")]) videoLayer = sublayer;
249 |
250 | [videoLayer removeFromSuperlayer];
251 | [self.view.layer insertSublayer:videoLayer atIndex: 0];
252 |
253 | }
254 |
255 |
256 | - (void)viewDidLoad { // create notification observers
257 |
258 | %orig;
259 |
260 | [self unleashThatHSBlur];
261 | [NSDistributedNotificationCenter.defaultCenter addObserver:self selector:@selector(unleashThatHSBlur) name:AmelijaHSBlurAppliedNotification object:nil];
262 |
263 | }
264 |
265 | %end
266 |
267 |
268 | %ctor {
269 |
270 | loadPrefs();
271 | appDidFinishLaunching();
272 |
273 | }
274 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Mozilla Public License Version 2.0
2 | ==================================
3 |
4 | ### 1. Definitions
5 |
6 | **1.1. “Contributor”**
7 | means each individual or legal entity that creates, contributes to
8 | the creation of, or owns Covered Software.
9 |
10 | **1.2. “Contributor Version”**
11 | means the combination of the Contributions of others (if any) used
12 | by a Contributor and that particular Contributor's Contribution.
13 |
14 | **1.3. “Contribution”**
15 | means Covered Software of a particular Contributor.
16 |
17 | **1.4. “Covered Software”**
18 | means Source Code Form to which the initial Contributor has attached
19 | the notice in Exhibit A, the Executable Form of such Source Code
20 | Form, and Modifications of such Source Code Form, in each case
21 | including portions thereof.
22 |
23 | **1.5. “Incompatible With Secondary Licenses”**
24 | means
25 |
26 | * **(a)** that the initial Contributor has attached the notice described
27 | in Exhibit B to the Covered Software; or
28 | * **(b)** that the Covered Software was made available under the terms of
29 | version 1.1 or earlier of the License, but not also under the
30 | terms of a Secondary License.
31 |
32 | **1.6. “Executable Form”**
33 | means any form of the work other than Source Code Form.
34 |
35 | **1.7. “Larger Work”**
36 | means a work that combines Covered Software with other material, in
37 | a separate file or files, that is not Covered Software.
38 |
39 | **1.8. “License”**
40 | means this document.
41 |
42 | **1.9. “Licensable”**
43 | means having the right to grant, to the maximum extent possible,
44 | whether at the time of the initial grant or subsequently, any and
45 | all of the rights conveyed by this License.
46 |
47 | **1.10. “Modifications”**
48 | means any of the following:
49 |
50 | * **(a)** any file in Source Code Form that results from an addition to,
51 | deletion from, or modification of the contents of Covered
52 | Software; or
53 | * **(b)** any new file in Source Code Form that contains any Covered
54 | Software.
55 |
56 | **1.11. “Patent Claims” of a Contributor**
57 | means any patent claim(s), including without limitation, method,
58 | process, and apparatus claims, in any patent Licensable by such
59 | Contributor that would be infringed, but for the grant of the
60 | License, by the making, using, selling, offering for sale, having
61 | made, import, or transfer of either its Contributions or its
62 | Contributor Version.
63 |
64 | **1.12. “Secondary License”**
65 | means either the GNU General Public License, Version 2.0, the GNU
66 | Lesser General Public License, Version 2.1, the GNU Affero General
67 | Public License, Version 3.0, or any later versions of those
68 | licenses.
69 |
70 | **1.13. “Source Code Form”**
71 | means the form of the work preferred for making modifications.
72 |
73 | **1.14. “You” (or “Your”)**
74 | means an individual or a legal entity exercising rights under this
75 | License. For legal entities, “You” includes any entity that
76 | controls, is controlled by, or is under common control with You. For
77 | purposes of this definition, “control” means **(a)** the power, direct
78 | or indirect, to cause the direction or management of such entity,
79 | whether by contract or otherwise, or **(b)** ownership of more than
80 | fifty percent (50%) of the outstanding shares or beneficial
81 | ownership of such entity.
82 |
83 |
84 | ### 2. License Grants and Conditions
85 |
86 | #### 2.1. Grants
87 |
88 | Each Contributor hereby grants You a world-wide, royalty-free,
89 | non-exclusive license:
90 |
91 | * **(a)** under intellectual property rights (other than patent or trademark)
92 | Licensable by such Contributor to use, reproduce, make available,
93 | modify, display, perform, distribute, and otherwise exploit its
94 | Contributions, either on an unmodified basis, with Modifications, or
95 | as part of a Larger Work; and
96 | * **(b)** under Patent Claims of such Contributor to make, use, sell, offer
97 | for sale, have made, import, and otherwise transfer either its
98 | Contributions or its Contributor Version.
99 |
100 | #### 2.2. Effective Date
101 |
102 | The licenses granted in Section 2.1 with respect to any Contribution
103 | become effective for each Contribution on the date the Contributor first
104 | distributes such Contribution.
105 |
106 | #### 2.3. Limitations on Grant Scope
107 |
108 | The licenses granted in this Section 2 are the only rights granted under
109 | this License. No additional rights or licenses will be implied from the
110 | distribution or licensing of Covered Software under this License.
111 | Notwithstanding Section 2.1(b) above, no patent license is granted by a
112 | Contributor:
113 |
114 | * **(a)** for any code that a Contributor has removed from Covered Software;
115 | or
116 | * **(b)** for infringements caused by: **(i)** Your and any other third party's
117 | modifications of Covered Software, or **(ii)** the combination of its
118 | Contributions with other software (except as part of its Contributor
119 | Version); or
120 | * **(c)** under Patent Claims infringed by Covered Software in the absence of
121 | its Contributions.
122 |
123 | This License does not grant any rights in the trademarks, service marks,
124 | or logos of any Contributor (except as may be necessary to comply with
125 | the notice requirements in Section 3.4).
126 |
127 | #### 2.4. Subsequent Licenses
128 |
129 | No Contributor makes additional grants as a result of Your choice to
130 | distribute the Covered Software under a subsequent version of this
131 | License (see Section 10.2) or under the terms of a Secondary License (if
132 | permitted under the terms of Section 3.3).
133 |
134 | #### 2.5. Representation
135 |
136 | Each Contributor represents that the Contributor believes its
137 | Contributions are its original creation(s) or it has sufficient rights
138 | to grant the rights to its Contributions conveyed by this License.
139 |
140 | #### 2.6. Fair Use
141 |
142 | This License is not intended to limit any rights You have under
143 | applicable copyright doctrines of fair use, fair dealing, or other
144 | equivalents.
145 |
146 | #### 2.7. Conditions
147 |
148 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
149 | in Section 2.1.
150 |
151 |
152 | ### 3. Responsibilities
153 |
154 | #### 3.1. Distribution of Source Form
155 |
156 | All distribution of Covered Software in Source Code Form, including any
157 | Modifications that You create or to which You contribute, must be under
158 | the terms of this License. You must inform recipients that the Source
159 | Code Form of the Covered Software is governed by the terms of this
160 | License, and how they can obtain a copy of this License. You may not
161 | attempt to alter or restrict the recipients' rights in the Source Code
162 | Form.
163 |
164 | #### 3.2. Distribution of Executable Form
165 |
166 | If You distribute Covered Software in Executable Form then:
167 |
168 | * **(a)** such Covered Software must also be made available in Source Code
169 | Form, as described in Section 3.1, and You must inform recipients of
170 | the Executable Form how they can obtain a copy of such Source Code
171 | Form by reasonable means in a timely manner, at a charge no more
172 | than the cost of distribution to the recipient; and
173 |
174 | * **(b)** You may distribute such Executable Form under the terms of this
175 | License, or sublicense it under different terms, provided that the
176 | license for the Executable Form does not attempt to limit or alter
177 | the recipients' rights in the Source Code Form under this License.
178 |
179 | #### 3.3. Distribution of a Larger Work
180 |
181 | You may create and distribute a Larger Work under terms of Your choice,
182 | provided that You also comply with the requirements of this License for
183 | the Covered Software. If the Larger Work is a combination of Covered
184 | Software with a work governed by one or more Secondary Licenses, and the
185 | Covered Software is not Incompatible With Secondary Licenses, this
186 | License permits You to additionally distribute such Covered Software
187 | under the terms of such Secondary License(s), so that the recipient of
188 | the Larger Work may, at their option, further distribute the Covered
189 | Software under the terms of either this License or such Secondary
190 | License(s).
191 |
192 | #### 3.4. Notices
193 |
194 | You may not remove or alter the substance of any license notices
195 | (including copyright notices, patent notices, disclaimers of warranty,
196 | or limitations of liability) contained within the Source Code Form of
197 | the Covered Software, except that You may alter any license notices to
198 | the extent required to remedy known factual inaccuracies.
199 |
200 | #### 3.5. Application of Additional Terms
201 |
202 | You may choose to offer, and to charge a fee for, warranty, support,
203 | indemnity or liability obligations to one or more recipients of Covered
204 | Software. However, You may do so only on Your own behalf, and not on
205 | behalf of any Contributor. You must make it absolutely clear that any
206 | such warranty, support, indemnity, or liability obligation is offered by
207 | You alone, and You hereby agree to indemnify every Contributor for any
208 | liability incurred by such Contributor as a result of warranty, support,
209 | indemnity or liability terms You offer. You may include additional
210 | disclaimers of warranty and limitations of liability specific to any
211 | jurisdiction.
212 |
213 |
214 | ### 4. Inability to Comply Due to Statute or Regulation
215 |
216 | If it is impossible for You to comply with any of the terms of this
217 | License with respect to some or all of the Covered Software due to
218 | statute, judicial order, or regulation then You must: **(a)** comply with
219 | the terms of this License to the maximum extent possible; and **(b)**
220 | describe the limitations and the code they affect. Such description must
221 | be placed in a text file included with all distributions of the Covered
222 | Software under this License. Except to the extent prohibited by statute
223 | or regulation, such description must be sufficiently detailed for a
224 | recipient of ordinary skill to be able to understand it.
225 |
226 |
227 | ### 5. Termination
228 |
229 | **5.1.** The rights granted under this License will terminate automatically
230 | if You fail to comply with any of its terms. However, if You become
231 | compliant, then the rights granted under this License from a particular
232 | Contributor are reinstated **(a)** provisionally, unless and until such
233 | Contributor explicitly and finally terminates Your grants, and **(b)** on an
234 | ongoing basis, if such Contributor fails to notify You of the
235 | non-compliance by some reasonable means prior to 60 days after You have
236 | come back into compliance. Moreover, Your grants from a particular
237 | Contributor are reinstated on an ongoing basis if such Contributor
238 | notifies You of the non-compliance by some reasonable means, this is the
239 | first time You have received notice of non-compliance with this License
240 | from such Contributor, and You become compliant prior to 30 days after
241 | Your receipt of the notice.
242 |
243 | **5.2.** If You initiate litigation against any entity by asserting a patent
244 | infringement claim (excluding declaratory judgment actions,
245 | counter-claims, and cross-claims) alleging that a Contributor Version
246 | directly or indirectly infringes any patent, then the rights granted to
247 | You by any and all Contributors for the Covered Software under Section
248 | 2.1 of this License shall terminate.
249 |
250 | **5.3.** In the event of termination under Sections 5.1 or 5.2 above, all
251 | end user license agreements (excluding distributors and resellers) which
252 | have been validly granted by You or Your distributors under this License
253 | prior to termination shall survive termination.
254 |
255 |
256 | ### 6. Disclaimer of Warranty
257 |
258 | > Covered Software is provided under this License on an “as is”
259 | > basis, without warranty of any kind, either expressed, implied, or
260 | > statutory, including, without limitation, warranties that the
261 | > Covered Software is free of defects, merchantable, fit for a
262 | > particular purpose or non-infringing. The entire risk as to the
263 | > quality and performance of the Covered Software is with You.
264 | > Should any Covered Software prove defective in any respect, You
265 | > (not any Contributor) assume the cost of any necessary servicing,
266 | > repair, or correction. This disclaimer of warranty constitutes an
267 | > essential part of this License. No use of any Covered Software is
268 | > authorized under this License except under this disclaimer.
269 |
270 | ### 7. Limitation of Liability
271 |
272 | > Under no circumstances and under no legal theory, whether tort
273 | > (including negligence), contract, or otherwise, shall any
274 | > Contributor, or anyone who distributes Covered Software as
275 | > permitted above, be liable to You for any direct, indirect,
276 | > special, incidental, or consequential damages of any character
277 | > including, without limitation, damages for lost profits, loss of
278 | > goodwill, work stoppage, computer failure or malfunction, or any
279 | > and all other commercial damages or losses, even if such party
280 | > shall have been informed of the possibility of such damages. This
281 | > limitation of liability shall not apply to liability for death or
282 | > personal injury resulting from such party's negligence to the
283 | > extent applicable law prohibits such limitation. Some
284 | > jurisdictions do not allow the exclusion or limitation of
285 | > incidental or consequential damages, so this exclusion and
286 | > limitation may not apply to You.
287 |
288 |
289 | ### 8. Litigation
290 |
291 | Any litigation relating to this License may be brought only in the
292 | courts of a jurisdiction where the defendant maintains its principal
293 | place of business and such litigation shall be governed by laws of that
294 | jurisdiction, without reference to its conflict-of-law provisions.
295 | Nothing in this Section shall prevent a party's ability to bring
296 | cross-claims or counter-claims.
297 |
298 |
299 | ### 9. Miscellaneous
300 |
301 | This License represents the complete agreement concerning the subject
302 | matter hereof. If any provision of this License is held to be
303 | unenforceable, such provision shall be reformed only to the extent
304 | necessary to make it enforceable. Any law or regulation which provides
305 | that the language of a contract shall be construed against the drafter
306 | shall not be used to construe this License against a Contributor.
307 |
308 |
309 | ### 10. Versions of the License
310 |
311 | #### 10.1. New Versions
312 |
313 | Mozilla Foundation is the license steward. Except as provided in Section
314 | 10.3, no one other than the license steward has the right to modify or
315 | publish new versions of this License. Each version will be given a
316 | distinguishing version number.
317 |
318 | #### 10.2. Effect of New Versions
319 |
320 | You may distribute the Covered Software under the terms of the version
321 | of the License under which You originally received the Covered Software,
322 | or under the terms of any subsequent version published by the license
323 | steward.
324 |
325 | #### 10.3. Modified Versions
326 |
327 | If you create software not governed by this License, and you want to
328 | create a new license for such software, you may create and use a
329 | modified version of this License if you rename the license and remove
330 | any references to the name of the license steward (except to note that
331 | such modified license differs from this License).
332 |
333 | #### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses
334 |
335 | If You choose to distribute Source Code Form that is Incompatible With
336 | Secondary Licenses under the terms of this version of the License, the
337 | notice described in Exhibit B of this License must be attached.
338 |
339 | ## Exhibit A - Source Code Form License Notice
340 |
341 | This Source Code Form is subject to the terms of the Mozilla Public
342 | License, v. 2.0. If a copy of the MPL was not distributed with this
343 | file, You can obtain one at http://mozilla.org/MPL/2.0/.
344 |
345 | If it is not possible or desirable to put the notice in a particular
346 | file, then You may include the notice in a location (such as a LICENSE
347 | file in a relevant directory) where a recipient would be likely to look
348 | for such a notice.
349 |
350 | You may add additional accurate notices of copyright ownership.
351 |
352 | ## Exhibit B - “Incompatible With Secondary Licenses” Notice
353 |
354 | This Source Code Form is "Incompatible With Secondary Licenses", as
355 | defined by the Mozilla Public License, v. 2.0.
356 |
357 |
358 |
--------------------------------------------------------------------------------
/AmēlijaPrefs/AMLRootVC.m:
--------------------------------------------------------------------------------
1 | #import "AMLRootVC.h"
2 |
3 |
4 | #define kAmelijaTintColor [UIColor colorWithRed:0.47 green:0.21 blue:0.24 alpha: 1.0]
5 |
6 | @implementation AMLRootVC {
7 |
8 | UIView *headerView;
9 | UIImageView *iconImageView;
10 | UIImageView *headerImageView;
11 | OBWelcomeController *changelogController;
12 |
13 | }
14 |
15 | // ! Lifecycle
16 |
17 | - (NSArray *)specifiers {
18 |
19 | if(!_specifiers) _specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self];
20 | return _specifiers;
21 |
22 | }
23 |
24 |
25 | - (id)init {
26 |
27 | self = [super init];
28 | if(!self) return nil;
29 |
30 | static dispatch_once_t onceToken = 0;
31 | dispatch_once(&onceToken, ^{ registerAmelijaTintCellClass(); });
32 |
33 | [self setupUI];
34 |
35 | return self;
36 |
37 | }
38 |
39 |
40 | - (void)setupUI {
41 |
42 | NSString *bannerImagePath = rootlessPathNS(@"/Library/PreferenceBundles/AmēlijaPrefs.bundle/Assets/AMBanner.png");
43 |
44 | UIImage *iconImage = [UIImage imageWithContentsOfFile:rootlessPathNS(@"/Library/PreferenceBundles/AmēlijaPrefs.bundle/Assets/Amēlija@2x.png")];
45 | UIImage *bannerImage = [UIImage imageWithContentsOfFile: bannerImagePath];
46 |
47 | if(!headerView) headerView = [[UIView alloc] initWithFrame:CGRectMake(0,0,200,200)];
48 |
49 | if(!headerImageView) {
50 | headerImageView = [UIImageView new];
51 | headerImageView.image = bannerImage;
52 | headerImageView.contentMode = UIViewContentModeScaleAspectFill;
53 | headerImageView.clipsToBounds = YES;
54 | headerImageView.translatesAutoresizingMaskIntoConstraints = NO;
55 | [headerView addSubview: headerImageView];
56 | }
57 |
58 | UIButton *changelogButton = [UIButton new];
59 | changelogButton.tintColor = kAmelijaTintColor;
60 | [changelogButton setImage:[UIImage systemImageNamed:@"atom"] forState: UIControlStateNormal];
61 | [changelogButton addTarget:self action:@selector(showWtfChangedInThisVersion) forControlEvents: UIControlEventTouchUpInside];
62 |
63 | UIBarButtonItem *changelogButtonItem = [[UIBarButtonItem alloc] initWithCustomView: changelogButton];
64 | self.navigationItem.rightBarButtonItem = changelogButtonItem;
65 |
66 | self.navigationItem.titleView = [UIView new];
67 |
68 | if(!iconImageView) {
69 | iconImageView = [UIImageView new];
70 | iconImageView.image = iconImage;
71 | iconImageView.contentMode = UIViewContentModeScaleAspectFit;
72 | iconImageView.translatesAutoresizingMaskIntoConstraints = NO;
73 | [self.navigationItem.titleView addSubview: iconImageView];
74 | }
75 |
76 | [self layoutUI];
77 |
78 | }
79 |
80 |
81 | - (void)layoutUI {
82 |
83 | [iconImageView.topAnchor constraintEqualToAnchor: self.navigationItem.titleView.topAnchor].active = YES;
84 | [iconImageView.bottomAnchor constraintEqualToAnchor: self.navigationItem.titleView.bottomAnchor].active = YES;
85 | [iconImageView.leadingAnchor constraintEqualToAnchor: self.navigationItem.titleView.leadingAnchor].active = YES;
86 | [iconImageView.trailingAnchor constraintEqualToAnchor: self.navigationItem.titleView.trailingAnchor].active = YES;
87 |
88 | [headerImageView.topAnchor constraintEqualToAnchor: headerView.topAnchor].active = YES;
89 | [headerImageView.bottomAnchor constraintEqualToAnchor: headerView.bottomAnchor].active = YES;
90 | [headerImageView.leadingAnchor constraintEqualToAnchor: headerView.leadingAnchor].active = YES;
91 | [headerImageView.trailingAnchor constraintEqualToAnchor: headerView.trailingAnchor].active = YES;
92 |
93 | }
94 |
95 | // ! Selectors
96 |
97 | - (void)showWtfChangedInThisVersion {
98 |
99 | AudioServicesPlaySystemSound(1521);
100 |
101 | NSString *tweakIconImagePath = rootlessPathNS(@"/Library/PreferenceBundles/AmēlijaPrefs.bundle/Assets/AMHotIcon.png");
102 |
103 | UIImage *tweakIconImage = [UIImage imageWithContentsOfFile: tweakIconImagePath];
104 | UIImage *checkmarkImage = [UIImage systemImageNamed:@"checkmark.circle.fill"];
105 |
106 | if(changelogController) { [self presentViewController:changelogController animated:YES completion:nil]; return; }
107 | changelogController = [[OBWelcomeController alloc] initWithTitle:@"Amēlija" detailText:@"2.0" icon:tweakIconImage];
108 | [changelogController addBulletedListItemWithTitle:@"Tweak" description:@"Added rootless support." image:checkmarkImage];
109 | [changelogController addBulletedListItemWithTitle:@"Code" description:@"Refactoring ⇝ everything works the same, but better." image:checkmarkImage];
110 |
111 | _UIBackdropViewSettings *settings = [_UIBackdropViewSettings settingsForStyle:2];
112 |
113 | _UIBackdropView *backdropView = [[_UIBackdropView alloc] initWithFrame:CGRectZero autosizesToFitSuperview:YES settings:settings];
114 | backdropView.clipsToBounds = YES;
115 | [changelogController.viewIfLoaded insertSubview:backdropView atIndex:0];
116 |
117 | changelogController.viewIfLoaded.backgroundColor = UIColor.clearColor;
118 | changelogController.view.tintColor = kAmelijaTintColor;
119 | changelogController.modalInPresentation = NO;
120 | changelogController.modalPresentationStyle = UIModalPresentationPageSheet;
121 | [self presentViewController:changelogController animated:YES completion:nil];
122 |
123 | }
124 |
125 |
126 | - (void)shatterThePrefsToPieces {
127 |
128 | AudioServicesPlaySystemSound(1521);
129 |
130 | UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Amēlija" message:@"Do you want to start fresh?" preferredStyle:UIAlertControllerStyleAlert];
131 | UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:@"Shoot" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
132 |
133 | [[NSFileManager defaultManager] removeItemAtPath:kPath error:nil];
134 | [self crossDissolveBlur];
135 |
136 | }];
137 |
138 | UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Meh" style:UIAlertActionStyleDefault handler:nil];
139 |
140 | [alertController addAction: confirmAction];
141 | [alertController addAction: cancelAction];
142 |
143 | [self presentViewController:alertController animated:YES completion:nil];
144 |
145 | }
146 |
147 |
148 | - (void)crossDissolveBlur {
149 |
150 | _UIBackdropViewSettings *settings = [_UIBackdropViewSettings settingsForStyle:2];
151 |
152 | _UIBackdropView *backdropView = [[_UIBackdropView alloc] initWithFrame:CGRectZero autosizesToFitSuperview:YES settings:settings];
153 | backdropView.alpha = 0;
154 | backdropView.clipsToBounds = YES;
155 | [self.view addSubview: backdropView];
156 |
157 | [UIView animateWithDuration:1 delay:0 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{
158 |
159 | backdropView.alpha = 1;
160 |
161 | } completion:^(BOOL finished) { [self launchRespring]; }];
162 |
163 | }
164 |
165 |
166 | - (void)launchRespring {
167 |
168 | pid_t pid;
169 | const char* args[] = {"killall", "backboardd", NULL, NULL};
170 | posix_spawn(&pid, rootlessPathC("/usr/bin/killall"), NULL, NULL, (char* const*)args, NULL);
171 |
172 | }
173 |
174 | // ! Preferences
175 |
176 | - (id)readPreferenceValue:(PSSpecifier *)specifier {
177 |
178 | NSMutableDictionary *settings = [NSMutableDictionary dictionary];
179 | [settings addEntriesFromDictionary:[NSDictionary dictionaryWithContentsOfFile: kPath]];
180 | return settings[specifier.properties[@"key"]] ?: specifier.properties[@"default"];
181 |
182 | }
183 |
184 |
185 | - (void)setPreferenceValue:(id)value specifier:(PSSpecifier *)specifier {
186 |
187 | NSMutableDictionary *settings = [NSMutableDictionary dictionary];
188 | [settings addEntriesFromDictionary:[NSDictionary dictionaryWithContentsOfFile: kPath]];
189 | [settings setObject:value forKey:specifier.properties[@"key"]];
190 | [settings writeToFile:kPath atomically:YES];
191 |
192 | [super setPreferenceValue:value specifier:specifier];
193 |
194 | }
195 |
196 | // ! UITableViewDataSource
197 |
198 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
199 |
200 | tableView.tableHeaderView = headerView;
201 | return [super tableView:tableView cellForRowAtIndexPath:indexPath];
202 |
203 | }
204 |
205 | // ! Dark juju
206 |
207 | static void amelija_setTitle(PSTableCell *self, SEL _cmd, NSString *title) {
208 |
209 | struct objc_super superSetTitle = {
210 | self,
211 | [self superclass]
212 | };
213 |
214 | id (*superCall)(struct objc_super *, SEL, NSString *) = (void *)objc_msgSendSuper;
215 | superCall(&superSetTitle, _cmd, title);
216 |
217 | self.titleLabel.textColor = kAmelijaTintColor;
218 | self.titleLabel.highlightedTextColor = kAmelijaTintColor;
219 |
220 | }
221 |
222 | static void registerAmelijaTintCellClass() {
223 |
224 | Class AmelijaTintCellClass = objc_allocateClassPair([PSTableCell class], "AmelijaTintCell", 0);
225 | Method method = class_getInstanceMethod([PSTableCell class], @selector(setTitle:));
226 | const char *typeEncoding = method_getTypeEncoding(method);
227 | class_addMethod(AmelijaTintCellClass, @selector(setTitle:), (IMP) amelija_setTitle, typeEncoding);
228 |
229 | objc_registerClassPair(AmelijaTintCellClass);
230 |
231 | }
232 |
233 | @end
234 |
235 |
236 | @implementation LSRootVC {
237 |
238 | NSMutableDictionary *savedSpecifiers;
239 |
240 | }
241 |
242 | - (NSArray *)specifiers {
243 |
244 | if(_specifiers) return nil;
245 | _specifiers = [self loadSpecifiersFromPlistName:@"LS" target:self];
246 |
247 | NSArray *chosenIDs = @[
248 | @"GroupCell-1",
249 | @"MiscLSBlursList",
250 | @"GroupCell-2",
251 | @"BlurSliderCell",
252 | @"GroupCell-3",
253 | @"BlurOnlyWithNotifsSwitch"
254 | ];
255 |
256 | savedSpecifiers = savedSpecifiers ?: [NSMutableDictionary new];
257 |
258 | for(PSSpecifier *specifier in _specifiers)
259 |
260 | if([chosenIDs containsObject:[specifier propertyForKey:@"id"]])
261 |
262 | [savedSpecifiers setObject:specifier forKey:[specifier propertyForKey:@"id"]];
263 |
264 | return _specifiers;
265 |
266 | }
267 |
268 |
269 | - (void)viewDidLoad {
270 |
271 | [super viewDidLoad];
272 | [self reloadSpecifiers];
273 |
274 | [UISlider appearanceWhenContainedInInstancesOfClasses:@[[self class]]].minimumTrackTintColor = kAmelijaTintColor;
275 | [UISwitch appearanceWhenContainedInInstancesOfClasses:@[[self class]]].onTintColor = kAmelijaTintColor;
276 |
277 | }
278 |
279 |
280 | - (void)reloadSpecifiers {
281 |
282 | [super reloadSpecifiers];
283 |
284 | if(![[self readPreferenceValue:[self specifierForID:@"MiscLSBlursSwitch"]] boolValue])
285 |
286 | [self removeContiguousSpecifiers:@[savedSpecifiers[@"GroupCell-1"], savedSpecifiers[@"MiscLSBlursList"], savedSpecifiers[@"GroupCell-2"], savedSpecifiers[@"BlurSliderCell"], savedSpecifiers[@"GroupCell-3"], savedSpecifiers[@"BlurOnlyWithNotifsSwitch"]] animated:NO];
287 |
288 | else if(![self containsSpecifier:savedSpecifiers[@"GroupCell-1"]])
289 |
290 | [self insertContiguousSpecifiers:@[savedSpecifiers[@"GroupCell-1"], savedSpecifiers[@"MiscLSBlursList"], savedSpecifiers[@"GroupCell-2"], savedSpecifiers[@"BlurSliderCell"], savedSpecifiers[@"GroupCell-3"], savedSpecifiers[@"BlurOnlyWithNotifsSwitch"]] afterSpecifierID:@"MiscLSBlursSwitch" animated:NO];
291 |
292 | }
293 |
294 |
295 | - (id)readPreferenceValue:(PSSpecifier *)specifier {
296 |
297 | NSMutableDictionary *settings = [NSMutableDictionary dictionary];
298 | [settings addEntriesFromDictionary:[NSDictionary dictionaryWithContentsOfFile: kPath]];
299 | return settings[specifier.properties[@"key"]] ?: specifier.properties[@"default"];
300 |
301 | }
302 |
303 |
304 | - (void)setPreferenceValue:(id)value specifier:(PSSpecifier *)specifier {
305 |
306 | NSMutableDictionary *settings = [NSMutableDictionary dictionary];
307 | [settings addEntriesFromDictionary:[NSDictionary dictionaryWithContentsOfFile: kPath]];
308 | [settings setObject:value forKey:specifier.properties[@"key"]];
309 | [settings writeToFile:kPath atomically:YES];
310 |
311 | [super setPreferenceValue:value specifier:specifier];
312 |
313 | [NSDistributedNotificationCenter.defaultCenter postNotificationName:AmelijaLSBlurAppliedNotification object:nil];
314 | [NSDistributedNotificationCenter.defaultCenter postNotificationName:AmelijaNotificationArrivedNotification object:nil];
315 |
316 | NSString *key = [specifier propertyForKey:@"key"];
317 |
318 | if([key isEqualToString:@"lsBlur"]) {
319 |
320 | if(![value boolValue])
321 |
322 | [self removeContiguousSpecifiers:@[savedSpecifiers[@"GroupCell-1"], savedSpecifiers[@"MiscLSBlursList"], savedSpecifiers[@"GroupCell-2"], savedSpecifiers[@"BlurSliderCell"], savedSpecifiers[@"GroupCell-3"], savedSpecifiers[@"BlurOnlyWithNotifsSwitch"]] animated:YES];
323 |
324 | else if(![self containsSpecifier:savedSpecifiers[@"GroupCell-1"]])
325 |
326 | [self insertContiguousSpecifiers:@[savedSpecifiers[@"GroupCell-1"], savedSpecifiers[@"MiscLSBlursList"], savedSpecifiers[@"GroupCell-2"], savedSpecifiers[@"BlurSliderCell"], savedSpecifiers[@"GroupCell-3"], savedSpecifiers[@"BlurOnlyWithNotifsSwitch"]] afterSpecifierID:@"MiscLSBlursSwitch" animated:YES];
327 |
328 | }
329 |
330 | }
331 |
332 | @end
333 |
334 |
335 | @implementation HSRootVC {
336 |
337 | NSMutableDictionary *savedSpecifiers;
338 |
339 | }
340 |
341 | - (NSArray *)specifiers {
342 |
343 | if(_specifiers) return nil;
344 | _specifiers = [self loadSpecifiersFromPlistName:@"HS" target:self];
345 |
346 | NSArray *chosenIDs = @[
347 | @"GroupCell-1",
348 | @"MiscHSBlursList",
349 | @"GroupCell-2",
350 | @"BlurSliderCell"
351 | ];
352 |
353 | savedSpecifiers = savedSpecifiers ?: [NSMutableDictionary new];
354 |
355 | for(PSSpecifier *specifier in _specifiers)
356 |
357 | if([chosenIDs containsObject:[specifier propertyForKey:@"id"]])
358 |
359 | [savedSpecifiers setObject:specifier forKey:[specifier propertyForKey:@"id"]];
360 |
361 | return _specifiers;
362 |
363 | }
364 |
365 |
366 | - (void)viewDidLoad {
367 |
368 | [super viewDidLoad];
369 | [self reloadSpecifiers];
370 |
371 | [UISlider appearanceWhenContainedInInstancesOfClasses:@[[self class]]].minimumTrackTintColor = kAmelijaTintColor;
372 | [UISwitch appearanceWhenContainedInInstancesOfClasses:@[[self class]]].onTintColor = kAmelijaTintColor;
373 |
374 | }
375 |
376 |
377 | - (void)reloadSpecifiers { // Dynamic specifiers
378 |
379 | [super reloadSpecifiers];
380 |
381 | if(![[self readPreferenceValue:[self specifierForID:@"MiscHSBlursSwitch"]] boolValue])
382 |
383 | [self removeContiguousSpecifiers:@[savedSpecifiers[@"GroupCell-1"], savedSpecifiers[@"MiscHSBlursList"], savedSpecifiers[@"GroupCell-2"], savedSpecifiers[@"BlurSliderCell"]] animated:NO];
384 |
385 | else if(![self containsSpecifier:savedSpecifiers[@"GroupCell-1"]])
386 |
387 | [self insertContiguousSpecifiers:@[savedSpecifiers[@"GroupCell-1"], savedSpecifiers[@"MiscHSBlursList"], savedSpecifiers[@"GroupCell-2"], savedSpecifiers[@"BlurSliderCell"]] afterSpecifierID:@"MiscHSBlursSwitch" animated:NO];
388 |
389 |
390 | }
391 |
392 |
393 | - (id)readPreferenceValue:(PSSpecifier *)specifier {
394 |
395 | NSMutableDictionary *settings = [NSMutableDictionary dictionary];
396 | [settings addEntriesFromDictionary:[NSDictionary dictionaryWithContentsOfFile:kPath]];
397 | return settings[specifier.properties[@"key"]] ?: specifier.properties[@"default"];
398 |
399 | }
400 |
401 |
402 | - (void)setPreferenceValue:(id)value specifier:(PSSpecifier *)specifier {
403 |
404 | NSMutableDictionary *settings = [NSMutableDictionary dictionary];
405 | [settings addEntriesFromDictionary:[NSDictionary dictionaryWithContentsOfFile:kPath]];
406 | [settings setObject:value forKey:specifier.properties[@"key"]];
407 | [settings writeToFile:kPath atomically:YES];
408 |
409 | [super setPreferenceValue:value specifier:specifier];
410 |
411 | [NSDistributedNotificationCenter.defaultCenter postNotificationName:AmelijaHSBlurAppliedNotification object:nil];
412 |
413 | NSString *key = [specifier propertyForKey:@"key"];
414 |
415 | if([key isEqualToString:@"hsBlur"]) {
416 |
417 | if(![value boolValue])
418 |
419 | [self removeContiguousSpecifiers:@[savedSpecifiers[@"GroupCell-1"], savedSpecifiers[@"MiscHSBlursList"], savedSpecifiers[@"GroupCell-2"], savedSpecifiers[@"BlurSliderCell"]] animated:YES];
420 |
421 | else if(![self containsSpecifier:savedSpecifiers[@"GroupCell-1"]])
422 |
423 | [self insertContiguousSpecifiers:@[savedSpecifiers[@"GroupCell-1"], savedSpecifiers[@"MiscHSBlursList"], savedSpecifiers[@"GroupCell-2"], savedSpecifiers[@"BlurSliderCell"]] afterSpecifierID:@"MiscHSBlursSwitch" animated:YES];
424 |
425 | }
426 |
427 | }
428 |
429 | @end
430 |
431 |
432 | @implementation AmelijaContributorsVC
433 |
434 | - (NSArray *)specifiers {
435 |
436 | if(!_specifiers) _specifiers = [self loadSpecifiersFromPlistName:@"AmelijaContributors" target:self];
437 | return _specifiers;
438 |
439 | }
440 |
441 | @end
442 |
443 |
444 | @implementation AmelijaLinksVC
445 |
446 | - (NSArray *)specifiers {
447 |
448 | if(!_specifiers) _specifiers = [self loadSpecifiersFromPlistName:@"AmelijaLinks" target:self];
449 | return _specifiers;
450 |
451 | }
452 |
453 |
454 | - (void)launchDiscord { [self launchURL: [NSURL URLWithString: @"https://discord.gg/jbE3avwSHs"]]; }
455 | - (void)launchGitHub { [self launchURL: [NSURL URLWithString: @"https://github.com/Luki120/Amelija"]]; }
456 | - (void)launchPayPal { [self launchURL: [NSURL URLWithString: @"https://paypal.me/Luki120"]]; }
457 | - (void)launchApril { [self launchURL: [NSURL URLWithString:@"https://repo.twickd.com/get/com.twickd.luki120.april"]]; }
458 | - (void)launchMeredith { [self launchURL: [NSURL URLWithString: @"https://repo.twickd.com/get/com.twickd.luki120.meredith"]]; }
459 |
460 | - (void)launchURL:(NSURL *)url { [UIApplication.sharedApplication openURL:url options:@{} completionHandler:nil]; }
461 |
462 | @end
463 |
--------------------------------------------------------------------------------