瀏覽代碼

Add Reddit 2020.29.0 support

master
lint 4 年之前
父節點
當前提交
7e1db92b2f
共有 2 個檔案被更改,包括 10 行新增3 行删除
  1. +4
    -1
      tweak/Reddit.h
  2. +6
    -2
      tweak/Reddit.xm

+ 4
- 1
tweak/Reddit.h 查看文件

@@ -176,8 +176,11 @@
@interface AccountManager
@property(assign, nonatomic) id defaults;
+ (id)sharedManager;
@end
@end
@interface AppDelegate : UIResponder
@property(strong, nonatomic) AccountManager *accountManager;
@end
/* ---- Reddit v3 ---- */

+ 6
- 2
tweak/Reddit.xm 查看文件

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

Loading…
取消
儲存