1
0
réplica de https://github.com/lint/TFDidThatSay synced 2025-10-21 16:16:17 +00:00

Add Reddit 2020.29.0 support

Este commit está contenido en:
lint
2020-08-23 14:39:37 -04:00
padre baa6f589f8
commit 7e1db92b2f
Se han modificado 2 ficheros con 10 adiciones y 3 borrados

3
tweak/Reddit.h Archivo normal → Archivo ejecutable
Ver fichero

@ -178,6 +178,9 @@
+ (id)sharedManager; + (id)sharedManager;
@end @end
@interface AppDelegate : UIResponder
@property(strong, nonatomic) AccountManager *accountManager;
@end
/* ---- Reddit v3 ---- */ /* ---- Reddit v3 ---- */

8
tweak/Reddit.xm Archivo normal → Archivo ejecutable
Ver fichero

@ -102,9 +102,11 @@ int secondVersionPart = 0;
id textColor; id textColor;
if (firstVersionPart == 2020) { if (firstVersionPart == 2020) {
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
AppSettings *appSettings = [%c(AppSettings) sharedSettings]; AppSettings *appSettings = [%c(AppSettings) sharedSettings];
AccountManager *accountManager = secondVersionPart >= 29 ? [appDelegate accountManager] : [%c(AccountManager) sharedManager];
themeManager = [[%c(ThemeManager) alloc] initWithAppSettings:appSettings]; themeManager = [[%c(ThemeManager) alloc] initWithAppSettings:appSettings];
isNightMode = [[[%c(AccountManager) sharedManager] defaults] objectForKey:@"kUseNightKey"]; isNightMode = [[accountManager defaults] objectForKey:@"kUseNightKey"];
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"13.0") && [appSettings isAutoDarkModeEnabled]) { if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"13.0") && [appSettings isAutoDarkModeEnabled]) {
@ -258,8 +260,10 @@ int secondVersionPart = 0;
id textColor; id textColor;
if (firstVersionPart == 2020) { if (firstVersionPart == 2020) {
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
AccountManager *accountManager = secondVersionPart >= 29 ? [appDelegate accountManager] : [%c(AccountManager) sharedManager];
themeManager = [[%c(ThemeManager) alloc] initWithAppSettings:[%c(AppSettings) sharedSettings]]; themeManager = [[%c(ThemeManager) alloc] initWithAppSettings:[%c(AppSettings) sharedSettings]];
isNightMode = [[[%c(AccountManager) sharedManager] defaults] objectForKey:@"kUseNightKey"]; isNightMode = [[accountManager defaults] objectForKey:@"kUseNightKey"];
if (isNightMode) { if (isNightMode) {
textColor = [[themeManager darkTheme] bodyTextColor]; textColor = [[themeManager darkTheme] bodyTextColor];