Browse Source

Add files via upload

pull/2/head
Gil Shahar 5 years ago
parent
commit
e27f4f12be
No account linked to committer's email address
5 changed files with 62 additions and 0 deletions
  1. +1
    -0
      ExactTimePhone.plist
  2. +12
    -0
      Makefile
  3. +40
    -0
      Tweak.xm
  4. +9
    -0
      control
  5. BIN
      packages/com.gilshahar7.exacttimephone_1.0_iphoneos-arm.deb

+ 1
- 0
ExactTimePhone.plist View File

@@ -0,0 +1 @@
{ Filter = { Bundles = ( "com.apple.mobilephone" ); }; }

+ 12
- 0
Makefile View File

@@ -0,0 +1,12 @@
export ARCHS = armv7 arm64

include $(THEOS)/makefiles/common.mk

TWEAK_NAME = ExactTimePhone
ExactTimePhone_FILES = Tweak.xm
ExactTimePhone_CFLAGS = -fobjc-arc

include $(THEOS_MAKE_PATH)/tweak.mk

after-install::
install.exec "killall -9 MobilePhone"

+ 40
- 0
Tweak.xm View File

@@ -0,0 +1,40 @@
@interface UIDateLabel : UILabel
@property (nonatomic, strong) NSDate *date;
@end

@interface MPRecentsTableViewCell
@property (nonatomic, strong) UIDateLabel *callerDateLabel;
@end

static bool is24h;


%hook MPRecentsTableViewCell
-(void)layoutSubviews{
%orig;
if(![self.callerDateLabel.text containsString:@":"]){
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
if(is24h){
[dateFormatter setDateFormat:@"\nHH:mm"];
}else{
[dateFormatter setDateFormat:@"\nh:mm a"];
}
self.callerDateLabel.textAlignment = 2;
self.callerDateLabel.numberOfLines = 2;
self.callerDateLabel.text = [self.callerDateLabel.text stringByAppendingString:[dateFormatter stringFromDate:self.callerDateLabel.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
- 0
control View File

@@ -0,0 +1,9 @@
Package: com.gilshahar7.exacttimephone
Name: ExactTimePhone
Depends: mobilesubstrate
Version: 1.0
Architecture: iphoneos-arm
Description: Adds an exact time to the calls log in the stock phone app.
Maintainer: gilshahar7
Author: gilshahar7
Section: Tweaks

BIN
packages/com.gilshahar7.exacttimephone_1.0_iphoneos-arm.deb View File


Loading…
Cancel
Save