Jump to content

2 posts in this topic

Recommended Posts

Posted

Have you ever tried to compile a tweak with a class such as:

KIK.Settings

or

Runkeeper.RKAccount

And receive an error such as "cannot use dot operator on a type"? Well, here's how you can fix it.

 

In your tweak.xm, it should look something like this:

%hook Account // This is the name you'd like to give the class. This could be 'Settings', 'Coins', 'Premium', whatever you like. I'll use "Account" for the sake of this tutorial.
-(bool)isPremium {
return TRUE;
}
%end

%ctor {
    %init(Account = objc_getClass("Runkeeper.RKAccount")); // The "Account" should be the name you called your class above. The "Runkeeper.RKAccount" should be the actual class name itself. So the class name for example could be "Runkeeper.RKAccount" or whatever class you are trying to hack.
}

Now when you go ahead and compile, you shouldn't receive any errors concerning the class you've added!

 

Credits:

@AnotherLurker (All credits go this guy)

@Joka (Writing out this tutorial)

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