[EVO 4G Themes and Apps] JsChiSurf:
Remove AM/PM from 12 hour clock

Okay guys, at the prodding of SteelH, who has taken me out of semi-retirement, I took a look at this VERY quickly, as this is not something I use, since I remove the clock all together.

However, since this has already been done by someone else on Samsung phone, probably using a technique different than what I would have pursued (not that there is anything wrong with it), it prevents me from having to figure it out, and rather, just "apply" the principle to our Sense tweaked services.jar instead.

So, if you want to manually modify your services.jar file to remove am/pm from your clock (note, this may break 24 hour display all together, not sure, I didn't bother testing), decompile and open /com/android/server/status/StatusBarPolicy.smali, and wholesale replace the updateClock() method in your existing file with the following tweaked version I've provided:

.method private final updateClock()V
.locals 6

.prologue
.line 940
iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mCalendar:Ljava/util/Calendar;

invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

move-result-wide v1

invoke-virtual {v0, v1, v2}, Ljava/util/Calendar;->setTimeInMillis(J)V

.line 941
iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mClockData:Lcom/android/server/status/IconData;

iget-object v1, p0, Lcom/android/server/status/StatusBarPolicy;->mContext:Landroid/content/Context;

invoke-static {v1}, Landroid/text/format/DateFormat;->getTimeFormat(Landroid/content/Context;)Ljava/text/DateFormat;

move-result-object v1

iget-object v2, p0, Lcom/android/server/status/StatusBarPolicy;->mCalendar:Ljava/util/Calendar;

invoke-virtual {v2}, Ljava/util/Calendar;->getTime()Ljava/util/Date;

move-result-object v2

invoke-virtual {v1, v2}, Ljava/text/DateFormat;->format(Ljava/util/Date;)Ljava/lang/String;

move-result-object v1

const-string v4, " PM"

const-string v5, ""

invoke-virtual {v1, v4, v5}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

move-result-object v1

const-string v4, " AM"

const-string v5, ""

invoke-virtual {v1, v4, v5}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

move-result-object v1

iput-object v1, v0, Lcom/android/server/status/IconData;->text:Ljava/lang/CharSequence;

.line 942
iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mService:Lcom/android/server/status/StatusBarService;

iget-object v1, p0, Lcom/android/server/status/StatusBarPolicy;->mClockIcon:Landroid/os/IBinder;

iget-object v2, p0, Lcom/android/server/status/StatusBarPolicy;->mClockData:Lcom/android/server/status/IconData;

const/4 v3, 0x0

invoke-virtual {v0, v1, v2, v3}, Lcom/android/server/status/StatusBarService;->updateIcon(Landroid/os/IBinder;Lcom/android/server/status/IconData;Lcom/android/server/status/NotificationData;)V

.line 943
return-void

.end method

Reference:

Credit to s0niqu3 for the original mod concpet. I opened it up and pulled what was needed to manually apply the same to our version, which was not a 1-to-1 copy / paste, unfortunately, but rather, took a little massaging due do framework differences.