Jump to content

Tweak.xm issue with dot class


Go to solution Solved by cz1993,

9 posts in this topic

Recommended Posts

Posted

In the tweak.xm if have one dot class exemple some.class   can use the

%ctor {
    %init (Some = objc_getClass("some.class"));
}

For resolve this issue

but if we have 2 class with dot how to resolve that.  Theos print already inited.

Posted (edited)

%group A

%hook onesomeclass

- (void)method {

//code here

}

%end

%end

 

%group B

%hook twosomeclass

- (void)method {

//more code here

}

%end

%end

 

 

%ctor {

   %init(A, onesomeclass = objc_getClass("one.someclass"));

 

   %init(B, twosomeclass = objc_getClass("two.someclass"));

}

Updated by mikiyan1978
Posted
2 hours ago, mikiyan1978 said:

%group A

%hook onesomeclass

- (void)method {

//code here

}

%end

%end

 

%group B

%hook twosomeclass

- (void)method {

//more code here

}

%end

%end

 

 

%ctor {

   %init(A, onesomeclass = objc_getClass("one.someclass"));

 

   %init(B, twosomeclass = objc_getClass("two.someclass"));

}

Let me try.. Thx for reply

Posted
2 hours ago, mikiyan1978 said:

%group A

%hook onesomeclass

- (void)method {

//code here

}

%end

%end

 

%group B

%hook twosomeclass

- (void)method {

//more code here

}

%end

%end

 

 

%ctor {

   %init(A, onesomeclass = objc_getClass("one.someclass"));

 

   %init(B, twosomeclass = objc_getClass("two.someclass"));

}

Show this error

Error: non-initialized hook group : _ungrouped

  • Solution
Posted (edited)
18 minutes ago, mikiyan1978 said:

Please show me the code of Tweak.xm.

I solved the issue !  Thx so much!

Updated by cz1993

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