好的,所以我最近(在过去的几个月内)开始玩 JB 调整开发,并且正在慢慢地将我在 git 上找到的开源拼凑在一起。但是,我遇到了一些程序员的障碍。我要做的是创建一个调整,当我从 SB 启动应用程序时,在它启动应用程序之前,alpha 浮点值动画为 0.0,持续时间为 1 秒。我遇到的问题是我一生都无法(而且我已经在互联网上搜索过,而且我确定它就在我面前,我只是出于某种原因没有看到它)找到有关如何获取的任何文档另一个 SB 头中的方法或属性被植入到另一个头的 %hook 中。
我需要从 SBIconView.h 中获取 -(id)_iconImageView 并在 SBApplicationIcon.h 的 -(void)launchFromLocation:(int)location 的 %hook 中使用它
我最初是通过使用 touchesEnded 在 SBIconView.h 中部分工作的,但是当动画完成工作时,它会将图标置于抖动模式,因此我可以将所有应用程序的 alpha 值设为 0.0,但是不启动它们中的任何一个......所以我必须找到一种方法来利用 SBApplicationIcon.h 中的 -(id)_iconImageView 来获得我想要的结果。
非常感谢任何和所有帮助或输入!感谢您的时间。
这是我当前的代码
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