0

I'm currently learning how to hook with Mobile Substrate (runtime or whatever) and I'm a little confused. I'm trying to make a funny tweak that changes my Natwest balance to a string. I'm using something called "theos".

This is the code I have so far that doesn't work:

%hook AccountSummaryBaseView
- (id)accountBalanceLabel {
  NSString *temp = [NSString stringWithFormat:@"£999,999.99"];
  return temp;
  %orig;
}
%end

Could someone point me in the right direction? This would help me to understand how I can use this with other classes and methods.

I have these methods inside of the AccountSummaryBaseView class:

(void)setAccountSummary:(id)
(id)accountSummary
(id)paymentBeneficiary
(void)setPaymentBeneficiary
(id)accountTypeLabel
(id)accountNumberAndSortCodeLabel
(id)aliasLabel
(void)updateBalance
(id)accountLogoImageView
(id)accountBalanceLabel
(id)payeeAccountNumber
(id)fundsAvailableLabel
(void)setAccountLogoImageView:(id)
(void)setAccountTypeLabel:(id)
(void)setAliasLabel:(id)
(void)setAccountNumberAndSortCodeLabel:(id)
(void)setAccountBalanceLabel:(id)
(void)setFundsAvailableLabel:(id)
(void)setPayeeAccountNumber:(id)
(id)initWithFrame:(CGRect)
(void)dealloc
(void)setEnabled:(BOOL)
(BOOL)enabled
(int)accountType:(id)
halfer
  • 19,824
  • 17
  • 99
  • 186
Declan Land
  • 639
  • 2
  • 11
  • 27

1 Answers1

0

Try this:

%hook AccountSummaryBaseView

-(void)setAccountBalanceLabel:(id)arg {

   NSString *temp = [NSString stringWithFormat:@"£999,999.99"];
   %orig(temp);

}

%end

Good Luck ;)

  • Ahh! Calling %orig is just like calling 'self' then?:) I didn't manage to make it work dude haha, for some reason it just won't change on the screen - do you think the arg needs to be returned as a float or an nsnumber or something? :) cheers man! – Declan Land Sep 02 '14 at 20:53
  • %orig; calls the original method. AccountBalanceLabel is a property and setAccountBalanceLabel is the setter of it. So when calling %orig(temp) you are setting just the argument of the method. – user3628430 Sep 03 '14 at 01:20