substrate extension to make the app switcher cards square like the non-x iPhones
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
824B

  1. // Define the path to our preference plist
  2. #define PLIST_PATH @"/var/mobile/Library/Preferences/com.yaypixxo.squareswitcherxprefs.plist"
  3. // Create a method we'll use to get the bool value of the enable switch
  4. inline bool GetPrefBool(NSString *key) {
  5. return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];
  6. }
  7. // What to modify
  8. @interface SBAppSwitcherPageView : UIView
  9. @property (assign,nonatomic) double cornerRadius;
  10. -(void)_updateCornerRadius;
  11. @end
  12. // Hook into header
  13. %hook SBAppSwitcherPageView
  14. -(void)_updateCornerRadius {
  15. // Check if enable switch is on (using the method we created earlier)
  16. if (GetPrefBool(@"enabled")) {
  17. // Change corner radius
  18. %orig;
  19. self.cornerRadius = 5;
  20. }
  21. // If the enable switch is off, don't modify
  22. else {
  23. %orig;
  24. }
  25. }
  26. // And cleanup
  27. %end