Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace 'Reset' button #17

Merged
merged 1 commit into from
May 18, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions FixCode/FixCode.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
#import "Aspects.h"
#import "FixCode.h"

@interface IDEEnhancedProvisioningSigningIdentity : NSObject
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find runtime headers for the views here. Should I move these somewhere else or are they fine here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine 👍


@property NSUInteger state; // 0: current, 2: online-only

@end

@interface IDESigningIdentityActionCellViewContents : NSObject

@property IDEEnhancedProvisioningSigningIdentity *signingIdentity;

@end

@interface NSObject (Shutup)

-(void)_autoLayoutViewViewFrameDidChange:(id)arg0;
Expand Down Expand Up @@ -163,6 +175,16 @@ - (void)swizzleCodeSigningResolution
if (error) {
NSLog(@"Error: %@", error);
}

[objc_getClass("IDESigningIdentityActionCellView") aspect_hookSelector:@selector(setObjectValue:) withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo> info, IDESigningIdentityActionCellViewContents *cellContents) {
if ([[cellContents signingIdentity] state] == 2) {
[self findAndReplaceFixIssueButtonInView:info.instance];
}
} error:&error];

if (error) {
NSLog(@"Error: %@", error);
}
}

@end