Jump to content

antifile

Newbie
  • Posts

    1
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

antifile's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hey everyone! So I've got this tweak I'm making via Zane Helton's tutorials. I've hooked UIViewController and ive %end'ed it at the end but it still says that I'm missing my %end.. Can someone shine any light onto why this is happening? Here's the code: @interface BCBatteryDeviceController { NSArray *_sortedDevices; } +(id)sharedInstance; @end @interface BCBatteryDevice { long long _percentCharge; NSString *_name; } @end %hook UIViewController - (void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion { //no code would run without orig if ([viewControllerToPresent isKindOfClass[UIAlertController class]]) { UIAlertController *ac = (UIAlertController *)viewControllerToPresent; BCBatteryDeviceController *bcb = [%c(BCBatteryDeviceController) sharedInstance]; NAArrray *devices = MSHookIvar<NSArray *>(bcb, "_sortedDevices"); NSMutableString *newMessage = [NSMutableString new]; for (BCBatteryDevice *device in devices) { NSString *deviceName = MSHookIvar<NSString *>(device, "_name"); long long deviceCharge = MSHookIvar<long long>(device, "_percentCharge"); [newMessage appendString:@"%@ : %lld%%\n", deviceName, deviceCharge]; } [ac setMessage:newMessage]; return %orig(ac, flag, completion); } else { return %orig; } } %end Thanks for any help guys!
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines