Skip to content
Guest Big Announcement

What am I doing wrong?

Featured Replies

App: Betternet VPN

//Begin BetternetUser
%hook BetternetUser
-(void) setIsPremium:(bool) {
  %orig(TRUE);
}
-(bool) isPremium {
  return TRUE;
}
-(bool) allowedPremium {
  return TRUE;
}
%end
//Begin CRFLabelUpdater
%hook CRFLabelUpdater
+(void) setPremiumStage:(int) {
  %orig(1);
}
%end
Attempted making an MSHook - tested in flex (working) I have no idea why this isn't working and honestly just need some help.

Updated by Mocha

Solved by mitosis

*10 hour bump.

The code with the void methods aren't right :p You're supposed to set the argument to true then call %orig() with it.

 

Like so:

 

%hook BetterNetuser

- (void)setIsPremium:(BOOL)arg1 {
arg1 = true;
%orig(arg1);
}

and

 

%hook CRFLabelUpdater
+ (void)setPremiumStage:(int)arg1 {
arg1 = 1;
%orig(arg1);
}

arg1 could be any name it doesn't matter.

  • Author

The code with the void methods aren't right :p You're supposed to set the argument to true then call %orig() with it.

 

Like so:

 

%hook BetterNetuser

- (void)setIsPremium:(BOOL)arg1 {
arg1 = true;
%orig(arg1);
}
and

 

%hook CRFLabelUpdater
+ (void)setPremiumStage:(int)arg1 {
arg1 = 1;
%orig(arg1);
}
arg1 could be any name it doesn't matter.

 

//Begin BetternetUser
%hook BetternetUser
- (void)setIsPremium:(BOOL)arg1 {
arg1 = true;
%orig(arg1);
}
- (bool)isPremium {
return true;
}
- (bool)allowedPremium {
return true;
}
%end
//Begin CRFLabelUpdater
%hook CRFLabelUpdater
+ (void)setPremiumStage:(int)arg1 {
arg1 = 1;
%orig(arg1);
}
%end
Still can't get it to work D:

Updated by Mocha

  • Solution
//Begin BetternetUser
%hook BetternetUser
- (void)setIsPremium:(BOOL)arg1 {
arg1 = true;
%orig(arg1);
}
- (bool)isPremium {
return true;
}
- (bool)allowedPremium {
return true;
}
%end
//Begin CRFLabelUpdater
%hook CRFLabelUpdater
+ (void)setPremiumStage:(int)arg1 {
arg1 = 1;
%orig(arg1);
}
%end
Still can't get it to work D:

 

//Begin BetternetUser
%hook BetternetUser
- (void)setIsPremium:(BOOL)arg1 {
arg1 = true;
%orig(arg1);
}
- (bool)isPremium {
return true;
}
- (bool)allowedPremium {
return true;
}
%end
//Begin CRFLabelUpdater
%hook CRFLabelUpdater
+ (void)setPremiumStage:(int)arg2 {
arg2 = 1;
%orig(arg2);
}
%end

I am not sure about this, but try it out

Updated by mitosis

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.