Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add logging to debug app layout

  • Loading branch information...
commit 47262fcfda56c78dcfbf2e942229a1c8befe7eae 1 parent ec7d182
@rpetrich authored
Showing with 29 additions and 1 deletion.
  1. +1 −1  Hooks/Belfry.plist
  2. +27 −0 Hooks/Hooks.x
  3. +1 −0  Hooks/Makefile
View
2  Hooks/Belfry.plist
@@ -1 +1 @@
-{ Filter = { Bundles = ( "com.apple.springboard" ); }; }
+{ Filter = { Bundles = ( "com.apple.springboard", "com.apple.stocks", "com.apple.VoiceMemos", "com.apple.mobiletimer", "com.apple.weather" ); }; }
View
27 Hooks/Hooks.x
@@ -1,4 +1,5 @@
#import <SpringBoard/SpringBoard.h>
+#import <UIKit/UIKit2.h>
%config(generator=internal)
@@ -21,3 +22,29 @@
}
%end
+
+%hook UIApplication
+
+- (void)motionEnded:(UIEventSubtype)motion withEvent:(id)event
+{
+ NSLog(@"Layout: %@", [[self keyWindow] recursiveDescription]);
+ %orig;
+}
+
+%end
+
+%hook UIView
+
+- (NSMutableString *)description
+{
+ UIViewController *vc = [UIViewController viewControllerForView:self];
+ if (!vc)
+ return %orig;
+ NSMutableString *result = [[%orig mutableCopy] autorelease];
+ NSInteger position = [result length] - 1;
+ [result insertString:[vc description] atIndex:position];
+ [result insertString:@" viewController = " atIndex:position];
+ return result;
+}
+
+%end
View
1  Hooks/Makefile
@@ -3,6 +3,7 @@ include theos/makefiles/common.mk
TWEAK_NAME = Belfry
Belfry_FILES = Hooks.x
+Belfry_FRAMEWORKS = UIKit
include $(THEOS_MAKE_PATH)/tweak.mk
Please sign in to comment.
Something went wrong with that request. Please try again.