0

I want to hide the blurred shadow of a SBBulletinBlurredShadowLabel (Private Framework) by hooking it with theos.

SBBulletinBlurredShadowLabel.h:

#import "UILabel.h"

@interface SBBulletinBlurredShadowLabel : UILabel
{
}

- (struct CGSize)sizeThatFits:(struct CGSize)arg1;
- (void)drawTextInRect:(struct CGRect)arg1;

@end

and here it is used

SBBulletinHeaderView.h:

#import "SBBulletinLinenSegmentView.h"

@class NSString, SBBulletinBlurredShadowLabel, SBBulletinClearButton, UIView;

@interface SBBulletinHeaderView : SBBulletinLinenSegmentView
{
    UIView *_translucentOverlay;
    UIView *_iconView;
    SBBulletinBlurredShadowLabel *_sectionLabel;
    SBBulletinClearButton *_clearButton;
    id <SBBulletinHeaderViewDelegate> _delegate;
    NSString *_sectionID;
}

+ (float)headerHeight;
- (id)initWithFrame:(struct CGRect)arg1 linenView:(id)arg2;
@property(retain, nonatomic) NSString *sectionID; // @synthesize sectionID=_sectionID;
- (void)dealloc;
- (void)setShowsClearButton:(BOOL)arg1 animated:(BOOL)arg2;
- (void)layoutSubviews;
- (void)willMoveToWindow:(id)arg1;
- (id)_sectionNameForSectionID:(id)arg1;
- (id)_newIconViewForSectionID:(id)arg1;
@property(readonly, nonatomic) SBBulletinClearButton *clearButton; // @synthesize clearButton=_clearButton;
@property(nonatomic) id <SBBulletinHeaderViewDelegate> delegate; // @synthesize delegate=_delegate;

@end

What does NOT work:

%hook SBBulletinBlurredShadowLabel 
- (void)drawTextInRect:(struct CGRect)arg1 {
//skips it. The label disappears
}
%end

%hook SBBulletinHeaderView
- (void)layoutSubviews {
// does not work since SBBulletinBlurredShadowLabel doesn't use the standard UILabel shadow
self._sectionLabel.shadowColor = [UIColor clearColor];
}
%end

My thought:

%hook SBBulletinBlurredShadowLabel
- (void)drawTextInRect:(struct CGRect)arg1 {
[super drawTextInRect:arg1];
}
%end

But I don't know how to call super when hooking using theos.

Any suggestions how to hide the shadow or how to call super?

1 Answers1

0

In Theos, %orig; is the equivalent of super with the original arguments;

You can also %orig(arg1, arg2, etc); to pass custom args to super.

lunixbochs
  • 21,757
  • 2
  • 39
  • 47