Ok so I just recently (within the last couple of months) started playing around with JB tweak dev and am slowly putting the pieces together from opensource that I'm finding on git. However, I have hit somewhat of a coders wall. What I am trying to do is create a tweak that when I go to launch an app from the SB, before it launches the apps alpha float value animates to 0.0 with duration of 1 second. The problem I'm having is I cannot for the life of me(and I have scoured the internet, and I'm sure it's right in front of me I just am not seeing it for some reason) find any documentation on how to get methods or properties from another SB header implanted into a %hook of another header.
I need to get -(id)_iconImageView out of SBIconView.h and utilize it in a %hook into -(void)launchFromLocation:(int)location from SBApplicationIcon.h
I had initially got this to partially work just within the SBIconView.h by using touchesEnded but by the time the animation had finished doing its job, it would throw the icons into jitter mode and so I could 0.0 out all of my apps alpha values but not launch any of them... So I must find a way to utilize -(id)_iconImageView in SBApplicationIcon.h to get my desired result.
Any and all help or input is greatly appreciated!!! Thank you for your time.
This is my current code
enter code here
#import <AudioToolBox/AudioToolBox.h>
#define kBundlePath @"/Library/MobileSubstrate/DynmaicLibraries/com.cramage.LaunchNotifier"
@interface SBApplicationIcon
- (void)launchFromLocation:(int)arg;
@end
@interface SBIconView : UIView
-(id)_iconImageView;
-(float)iconImageAlpha;
+ (id)_jitterTransformAnimation;
+ (id)_jitterPositionAnimation;
+ (int)_defaultIconFormat;
@end
%hook SBApplicationIcon
-(void)launchFromLocation:(int)location
{
SBIconView *sbic=[objc_getClass("SBIconView") _iconImageView];
//NSString *message = [NSString stringWithFormat:@"%1.1f", [sbic iconImageAlpha]];
//UIAlertView *alert2 = [[UIAlertView alloc]initWithTitle:@"Touch" message:message delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
//[alert2 show];
//[alert2 release];
//[NSThread sleepForTimeInterval:4.0];
//%orig(location);
NSURL *fileURL = [NSURL URLWithString:@"/System/Library/Audio/UISounds/play.caf"]; // see list below
SystemSoundID soundID;
AudioServicesCreateSystemSoundID((__bridge CFURLRef)fileURL,&soundID);
AudioServicesPlaySystemSound(soundID);
//_iconImageView2.alpha = 1.0;
UIView* iconImageView1 = [sbic _iconImageView];
[UIView animateWithDuration:1.0 animations:^{
iconImageView1.alpha = 0.0;
}
completion:^(BOOL finished){
%orig(location);
}];
}
%end