mirror of
https://github.com/gilshahar7/ExactTimeMessages.git
synced 2025-06-27 20:06:45 +00:00
Version 1.0
This commit is contained in:
1
ExactTimeMessages.plist
Normal file
1
ExactTimeMessages.plist
Normal file
@ -0,0 +1 @@
|
||||
{ Filter = { Bundles = ( "com.apple.MobileSMS" ); }; }
|
12
Makefile
Normal file
12
Makefile
Normal file
@ -0,0 +1,12 @@
|
||||
export ARCHS = armv7 arm64
|
||||
|
||||
include $(THEOS)/makefiles/common.mk
|
||||
|
||||
TWEAK_NAME = ExactTimeMessages
|
||||
ExactTimeMessages_FILES = Tweak.xm
|
||||
ExactTimeMessages_CFLAGS = -fobjc-arc
|
||||
|
||||
include $(THEOS_MAKE_PATH)/tweak.mk
|
||||
|
||||
after-install::
|
||||
install.exec "killall -9 MobileSMS"
|
34
Tweak.xm
Normal file
34
Tweak.xm
Normal file
@ -0,0 +1,34 @@
|
||||
@interface UIDateLabel : UILabel
|
||||
@property (nonatomic, strong) NSDate *date;
|
||||
@end
|
||||
static bool is24h;
|
||||
|
||||
|
||||
%hook CKConversationListCell
|
||||
-(void)layoutSubviews{
|
||||
%orig;
|
||||
if(MSHookIvar<UIDateLabel *>(self, "_dateLabel")){
|
||||
UIDateLabel *dateLabel = MSHookIvar<UIDateLabel *>(self, "_dateLabel");
|
||||
if(![dateLabel.text containsString:@":"]){
|
||||
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
|
||||
if(is24h){
|
||||
[dateFormatter setDateFormat:@" • HH:mm"];
|
||||
}else{
|
||||
[dateFormatter setDateFormat:@" • h:mm a"];
|
||||
}
|
||||
dateLabel.text = [dateLabel.text stringByAppendingString:[dateFormatter stringFromDate:dateLabel.date]];
|
||||
}
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
%ctor{
|
||||
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
|
||||
[formatter setLocale:[NSLocale currentLocale]];
|
||||
[formatter setDateStyle:NSDateFormatterNoStyle];
|
||||
[formatter setTimeStyle:NSDateFormatterShortStyle];
|
||||
NSString *dateString = [formatter stringFromDate:[NSDate date]];
|
||||
NSRange amRange = [dateString rangeOfString:[formatter AMSymbol]];
|
||||
NSRange pmRange = [dateString rangeOfString:[formatter PMSymbol]];
|
||||
is24h = (amRange.location == NSNotFound && pmRange.location == NSNotFound);
|
||||
}
|
9
control
Normal file
9
control
Normal file
@ -0,0 +1,9 @@
|
||||
Package: com.gilshahar7.exacttimemessages
|
||||
Name: ExactTimeMessages
|
||||
Depends: mobilesubstrate
|
||||
Version: 1.0
|
||||
Architecture: iphoneos-arm
|
||||
Description: Adds an exact time to the message cells in the stock messages app.
|
||||
Maintainer: gilshahar7
|
||||
Author: gilshahar7
|
||||
Section: Tweaks
|
Reference in New Issue
Block a user