Jump to content

18 posts in this topic

Recommended Posts

Posted

i am trying to return a bool value in mobile susbstrate hacking,

 

 

 

 

%hook XYZ

 
- (void)setIsTyping:(BOOL)fp8 ;
 
 
 
So i want to return the bool value as false, what should i do? I would greatly appreciate if you are ready to help!! 
Posted

doesn't work man


i did it already

 

return False

i did that already


Tweak.xm:3:120: error: expected class member or base class name
  ...self, SEL _cmd):(BOOL)  {
                     ^
Tweak.xm:3:120: error: expected '{' or ','
Tweak.xm:3:119: error: only constructors take base initializers
  ...self, SEL _cmd):(BOOL)  {
Posted (edited)

%hook XYZ

 

- (void)setIsTyping:(BOOL)fp8 {

fp8 = FALSE;

}

 

%end

Updated by Chrizk0
Posted (edited)

%hook XYZ

 

- (void)setIsTyping:(BOOL)fp8 {

fp8 = FALSE;

}

 

%end

dayumm man, i was getting confused lmao! don't you think we need to put %orig(fp8) too?

i will try this out hold on

dayumm man, i was getting confused lmao! don't you think we need to put %orig(fp8) too?

i will try this out hold on

- (void)mediaBar:(id)fp8 isTyping:(BOOL)fp12 , so if it's like this

all i need to do is 

{         fp12=false;

 

 

?

Updated by Vegito
Posted

Yes Vegito you were right, if you don't use %orig, the function will not run so keep using { fp12 = false; return %orig(fp8, fp12); }

Posted

Yes Vegito you were right, if you don't use %orig, the function will not run so keep using { fp12 = false; return %orig(fp8, fp12); }

can i do this way? to make it work? 

 

- (void)setIsTyping:(BOOL)fp8 
{
%orig(false);
}
 
or
 
 
- (void)setIsTyping:(BOOL)fp8 
{
%orig(fp8);
fp8=false;
}
 
 
or
 
 
 
- (void)setIsTyping:(BOOL)fp8 
{
 
fp8=false
%orig(fp8);
}
 
 
ARE ALL THESE WAYS CORRECT?

 

OR the one you told me now?

 

Posted

 

can i do this way? to make it work? 

 

- (void)setIsTyping:(BOOL)fp8 
{
%orig(false);
}
 
or
 
 
- (void)setIsTyping:(BOOL)fp8 
{
%orig(fp8);
fp8=false;
}
 
 
or
 
 
 
- (void)setIsTyping:(BOOL)fp8 
{
 
fp8=false
%orig(fp8);
}
 
 
ARE ALL THESE WAYS CORRECT?

 

OR the one you told me now?

 

 

 

I'm not sure but I dont think the first one would work.

I'm not sure but I think the second one should work.

You forgot semicolon in the third one.

Posted (edited)

o

 

I'm not sure but I dont think the first one would work.

I'm not sure but I think the second one should work.

You forgot semicolon in the third one.

oh f .... that semi colon for now xD , well when i compiled it, it showed no errors though all of the 3 ways showed no errors. it's just that now i am lazy to see whether it works in  every single way or not lol

Updated by Vegito

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • 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