0

So, what's the question: I'm trying to change "slide to unlock" text color on lockscreen. I'm using Theos to hook SBAwayLockBar class and -(void)_setLabel:(id)label method. Here's my Tweak.xm:

#import <SpringBoard/SpringBoard.h>

%hook SBAwayLockBar
-(void)_setLabel:(id)label {

label = @"text";

%orig;
}
%end

And this is all what I can do with "slide to unlock" text. I have tried to change (id)label to (UILabel *)label, but my iPhone went to Safe mode after respring. So, which other method I need to call, or which type must the "slide to unlock" label be to I have ability to change its color?

Thanks!

UPDATE:

I wrote this code

#import <SpringBoard/SpringBoard.h>

static NSString *cont;

%hook SBAwayLockBar

-(void)_setLabel:(id)label {

cont = label;

NSString *giantSpace = @" ";

for(int i = 0; i <= [cont length] * 2; i++) {

    giantSpace = [NSString stringWithFormat:@"%@ ", giantSpace];

}

label = giantSpace;

%orig;

}

%end


%hook TPLockTextView

-(void)drawRect:(CGRect)rect {

NSString *string = cont;

[[UIColor whiteColor] set]; 
[string drawInRect:rect withFont:[UIFont systemFontOfSize:19]];

%orig;

}

%end

, but it draws a new label with the same text as in original label and colorises the new label instead of original. What am I supposed to do/add/edit now? Thanks!

4

0 回答 0