Android電話

[電話] android.policy.jarの書き換え

Amazonのアソシエイトとして、8796.jp管理日誌は適格販売により収入を得ています。
スポンサーリンク

frameworkフォルダの中身をいじるのはいつもドキドキする!

image image

こんな感じで統一感が出ました。なかなか良い感じ。

だがしかし!英語にするとウィジェットが折り返した!!!むむむ。これはいかん… 曜日まで含めて国際化されたのって他にあったかなぁ。

image image

まあ、今日のところはいいやw

smali弄りにもちょっと慣れてきましたが、まだまだ謎が多い。

追記。わかった。FORMAT_ABBREV_MONTHとか使えばいいんだ?0x16指定を0x18016に変更して再チャレンジ

[patch]
Index: LockScreenSEMC.smali
===================================================================
— LockScreenSEMC.smali (リビジョン 2)
+++ LockScreenSEMC.smali (作業コピー)
@@ -310,58 +310,6 @@
return-void
.end method

-.method private getSystemDateFormat()Ljava/lang/String;
– .locals 5

– .prologue
– .line 528
– invoke-virtual {p0}, Lcom/android/internal/policy/impl/LockScreenSEMC;->getContext()Landroid/content/Context;

– move-result-object v2

– invoke-static {v2}, Landroid/text/format/DateFormat;->getDateFormat(Landroid/content/Context;)Ljava/text/DateFormat;

– move-result-object v0

– check-cast v0, Ljava/text/SimpleDateFormat;

– .line 530
– .local v0, dateFormat:Ljava/text/SimpleDateFormat;
– invoke-virtual {v0}, Ljava/text/SimpleDateFormat;->toPattern()Ljava/lang/String;

– move-result-object v1

– .line 535
– .local v1, format:Ljava/lang/String;
– new-instance v2, Ljava/lang/StringBuilder;

– invoke-direct {v2}, Ljava/lang/StringBuilder;->()V

– const-string v3, “EEE, ”

– invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

– move-result-object v2

– const-string v3, “M{1,3}”

– const-string v4, “MMM”

– invoke-virtual {v1, v3, v4}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

– move-result-object v3

– invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

– move-result-object v2

– invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

– move-result-object v2

– return-object v2
-.end method

.method private musicButtonPressedTimer()V
.locals 0

@@ -371,7 +319,7 @@
.end method

.method private refreshTimeAndDateDisplay()V
– .locals 8
+ .locals 9

.prologue
.line 248
@@ -442,12 +390,20 @@
.line 270
iget-object v5, p0, Lcom/android/internal/policy/impl/LockScreenSEMC;->mDate:Landroid/widget/TextView;

– invoke-direct {p0}, Lcom/android/internal/policy/impl/LockScreenSEMC;->getSystemDateFormat()Ljava/lang/String;
+ invoke-virtual {v4}, Ljava/util/Calendar;->getTimeInMillis()J

– move-result-object v6
+ move-result-wide v6

– invoke-static {v6, v3}, Landroid/text/format/DateFormat;->format(Ljava/lang/CharSequence;Ljava/util/Date;)Ljava/lang/CharSequence;
+ .end local v0 #dateString:Ljava/lang/String;

+ const/16 v0, 0x16
+
+ invoke-virtual {p0}, Lcom/android/internal/policy/impl/LockScreenSEMC;->getContext()Landroid/content/Context;
+
+ move-result-object v8
+
+ invoke-static {v8, v6, v7, v0}, Landroid/text/format/DateUtils;->formatDateTime(Landroid/content/Context;JI)Ljava/lang/String;
+
move-result-object v6

invoke-virtual {v5, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
@@ -456,7 +412,6 @@
return-void

.line 258
– .end local v0 #dateString:Ljava/lang/String;
:cond_0
new-instance v1, Ljava/text/SimpleDateFormat;

[/patch]

タイトルとURLをコピーしました