Dark tabs for Zenith! Mirror of https://github.com/mac-user669/ZenithDark
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

88 linhas
3.3KB

  1. #line 1 "Tweak.xm"
  2. #import "ZenithDark.h"
  3. #include <substrate.h>
  4. #if defined(__clang__)
  5. #if __has_feature(objc_arc)
  6. #define _LOGOS_SELF_TYPE_NORMAL __unsafe_unretained
  7. #define _LOGOS_SELF_TYPE_INIT __attribute__((ns_consumed))
  8. #define _LOGOS_SELF_CONST const
  9. #define _LOGOS_RETURN_RETAINED __attribute__((ns_returns_retained))
  10. #else
  11. #define _LOGOS_SELF_TYPE_NORMAL
  12. #define _LOGOS_SELF_TYPE_INIT
  13. #define _LOGOS_SELF_CONST
  14. #define _LOGOS_RETURN_RETAINED
  15. #endif
  16. #else
  17. #define _LOGOS_SELF_TYPE_NORMAL
  18. #define _LOGOS_SELF_TYPE_INIT
  19. #define _LOGOS_SELF_CONST
  20. #define _LOGOS_RETURN_RETAINED
  21. #endif
  22. @class ZNGrabberAccessoryView;
  23. static void (*_logos_orig$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$)(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST, SEL, UITraitCollection *); static void _logos_method$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST, SEL, UITraitCollection *); static void (*_logos_orig$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$)(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST, SEL, UIColor *); static void _logos_method$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST, SEL, UIColor *);
  24. #line 16 "Tweak.xm"
  25. static void _logos_method$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST __unused self, SEL __unused _cmd, UITraitCollection * previousTraitCollection) {
  26. _logos_orig$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$(self, _cmd, previousTraitCollection);
  27. if (@available(iOS 13, *)) {
  28. if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
  29. [self setBackgroundColor:kDarkModeColor];
  30. }
  31. else {
  32. [self setBackgroundColor:kLightModeColor];
  33. }
  34. }
  35. }
  36. static void _logos_method$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(_LOGOS_SELF_TYPE_NORMAL ZNGrabberAccessoryView* _LOGOS_SELF_CONST __unused self, SEL __unused _cmd, UIColor * backgroundColor) {
  37. if (@available(iOS 13, *)) {
  38. if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
  39. _logos_orig$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(self, _cmd, kDarkModeColor);
  40. }
  41. else {
  42. _logos_orig$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$(self, _cmd, backgroundColor);
  43. }
  44. }
  45. }
  46. static __attribute__((constructor)) void _logosLocalCtor_da6b7450(int __unused argc, char __unused **argv, char __unused **envp) {
  47. dlopen ("/Library/MobileSubstrate/DynamicLibraries/Zenith.dylib", RTLD_NOW);
  48. }
  49. static __attribute__((constructor)) void _logosLocalInit() {
  50. {Class _logos_class$_ungrouped$ZNGrabberAccessoryView = objc_getClass("ZNGrabberAccessoryView"); MSHookMessageEx(_logos_class$_ungrouped$ZNGrabberAccessoryView, @selector(traitCollectionDidChange:), (IMP)&_logos_method$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$, (IMP*)&_logos_orig$_ungrouped$ZNGrabberAccessoryView$traitCollectionDidChange$);MSHookMessageEx(_logos_class$_ungrouped$ZNGrabberAccessoryView, @selector(setBackgroundColor:), (IMP)&_logos_method$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$, (IMP*)&_logos_orig$_ungrouped$ZNGrabberAccessoryView$setBackgroundColor$);} }
  51. #line 59 "Tweak.xm"