Closed Naville closed 6 years ago
I.E.:
%group com.apple.SpringBoard
%hook AAA
-(void)BlahBlah{
}
%end
%end
%ctor{
%init([NSBundle mainBundle].bundleIdentifier)
}
I think that this is the best practice:
%group SpringBoardHooks
%hook AAA
-(void)BlahBlah{
}
%end
%end
%ctor {
@autoreleasepool {
NSString *bundleID = [[NSBundle mainBundle] bundleIdentifier];
if([bundleID isEqualToString:@"com.apple.SpringBoard"]){
%init(SpringBoardHooks);
}
}
}
Anyway i don't think this is the right place for asking this... First of all you should take a look at http://iphonedevwiki.net/index.php/Logos
Unfortunately, expressions are not supported as group names passed to %init
. This would require construction of the underlying function and variable names at runtime, which includes classes cached by calls to %c()
. To call functions, you would need to use dlsym()
, which is slower than jumping to it by using the address that’s already known at compile time. It could be implemented, but isn’t really worth it.
@MTShare I know that method. I think that is a little bit messy so I was looking for a better solution.
Thanks for the tip anyway
@kirb What about dynamic classes? i.e.
static Meh=NSClassFromString(@"AAA");
%group A
%hook Meh
-(void)AAAA{
}
%end
%group B
%ctor{
if(Meh==nil){
Meh=NSClassFromString(@"BBB");
}
%init (A);
}
This should be easier to implement and worth the effort? Would be useful.
EDIT: I know how to code all these using OC Runtime directly but ,again ,looking for simpler method
That is absolutely supported.
%group Hello
%hook Meh
- (void)test { }
%end
%end
%init(Hello, Meh=NSClassFromString(@"BBB"));
(Sorry I think the issues template doesn't support my issue so I cleared them)
I'm fully aware of the fact that I can %group YOSWAG and %init(YOSWAG);
Can I %group com.apple.springboard and %init([NSBundle mainBundle].bundleIdentifier); ?
Thanks
EDIT:I'm fully aware that this would require a huge refactor.