大侠阿木博客
大侠阿木博客

三星SM-N900下拉状态栏添加农历日期显示教程

systemui.apk\smali\com\android\systemui\statusbar\policy\DateView.smali

搜索函数

.method protected updateClock()V

 

原内容:

.method protected updateClock()V
.locals 2

iget-object v0, p0, Lcom/android/systemui/statusbar/policy/DateView;->mDateFormat:Ljava/lang/String;

new-instance v1, Ljava/util/Date;

invoke-direct {v1}, Ljava/util/Date;-><init>()V

invoke-static {v0, v1}, Landroid/text/format/DateFormat;->format(Ljava/lang/CharSequence;Ljava/util/Date;)Ljava/lang/CharSequence;

move-result-object v0

invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/policy/DateView;->setText(Ljava/lang/CharSequence;)V

const/4 v0, 0x0

const/4 v1, 0x0

invoke-virtual {p0, v0, v1}, Lcom/android/systemui/statusbar/policy/DateView;->setTypeface(Landroid/graphics/Typeface;I)V

return-void
.end method
改为:

.method protected updateClock()V

.locals 6

.end local v1

new-instance v2, Ljava/util/Date;

invoke-direct {v2}, Ljava/util/Date;-><init>()V

iget-object v4, p0, Lcom/android/systemui/statusbar/policy/DateView;->mDateFormat:Ljava/lang/String;

invoke-static {v4, v2}, Landroid/text/format/DateFormat;->format(Ljava/lang/CharSequence;Ljava/util/Date;)Ljava/lang/CharSequence;

move-result-object v4

invoke-virtual {v4}, Ljava/lang/Object;->toString()Ljava/lang/String;

move-result-object v0

new-instance v1, Lcom/android/internal/policy/impl/Lunar;

invoke-direct {v1, v2}, Lcom/android/internal/policy/impl/Lunar;-><init>(Ljava/util/Date;)V

new-instance v4, Ljava/lang/StringBuilder;

invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v4

const-string v5, "\n\u519c\u5386: "

invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v4

invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

move-result-object v4

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

move-result-object v0

.end local v1

invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/policy/DateView;->setText(Ljava/lang/CharSequence;)V

return-void
.end method

然后我们在\smali\com\android\internal\policy\impl\

把Lunar.smail扔进去

代码下载地址:

 http://pan.baidu.com/share/link?shareid=2304349888&uk=1478247800

 

这部也可以把Lunar扔进android.policy.jar

里的\com\android\internal\policy\impl位置

没有标签
首页      Android      Android 教程      三星SM-N900下拉状态栏添加农历日期显示教程

大侠阿木博客

三星SM-N900下拉状态栏添加农历日期显示教程
systemui.apk\smali\com\android\systemui\statusbar\policy\DateView.smali 搜索函数 .method protected updateClock()V   原内容: .method protected updateClock()V .locals 2 i…
扫描二维码继续阅读
2014-05-04