Skip to content
Guest Big Announcement

Question regarding the hooking method

Featured Replies

Solved by AnotherLurker

  • Solution

This is the basic Template:

%hook TargetClass //TargetClass from Flex
- (void)productPurchased:(id)product //Target Method from flex, MAKE SURE to add names after :(id), :(bool), :(int) etc
    name = nil; //Set the argument to nil (null), use the name you provided for the argument
    %orig(); //call %orig;, Note how the method is - (void), if it was something else, use "return %orig();"
}
%end

You result should be: (Please don't look this before attempting to fill out the template above, so you can actual learn)

 

%hook MyLessonsViewController
- (void)productPurchased:(id)product {
   produc = nil;
   %orig();
}
%end

 

 

Updated by JustRick

  • Author

This is the basic Template:

%hook TargetClass //TargetClass from Flex
- (void)productPurchased:(id)product //Target Method from flex, MAKE SURE to add names after :(id), :(bool), :(int) etc
    name = nil; //Set the argument to nil (null), use the name you provided for the argument
    %orig(); //call %orig;, Note how the method is - (void), if it was something else, use "return %orig();"
}
%end

You result should be: (Please don't look this before attempting to fill out the template above, so you can actual learn)

 

 

%hook MyLessonsViewController
- (void)productPurchased:(id)product {
   produc = nil;
   %orig();
}
%end

 

 

 

Thank you for the mini tutorial ! Very clear instructions !!! Have a good day :))

Create an account or sign in to comment

Featured Content

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.