cutthecord/old-patches/smalltime/884.patch

192 lines
5.3 KiB
Diff
Raw Normal View History

2019-04-25 11:01:07 +00:00
diff -crB -x dist -x build com.discord-836-testing/smali_classes2/com/miguelgaeta/simple_time/SimpleTime.smali com.discord-836/smali_classes2/com/miguelgaeta/simple_time/SimpleTime.smali
*** com.discord-836-testing/smali_classes2/com/miguelgaeta/simple_time/SimpleTime.smali 2019-01-31 10:40:04.989283867 +0300
--- com.discord-836/smali_classes2/com/miguelgaeta/simple_time/SimpleTime.smali 2019-01-31 10:53:44.476028781 +0300
***************
*** 247,419 ****
.end method
.method public toReadableTimeString(Ljava/lang/Long;)Ljava/lang/String;
! .locals 6
!
! .line 126
! invoke-virtual {p0}, Lcom/miguelgaeta/simple_time/SimpleTime;->currentTimeMillis()J
!
! move-result-wide v0
!
! invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
!
! move-result-object v0
!
! invoke-virtual {p0, v0}, Lcom/miguelgaeta/simple_time/SimpleTime;->toCalendar(Ljava/lang/Long;)Ljava/util/Calendar;
!
! move-result-object v0
!
! const/4 v1, 0x0
!
! const/16 v2, 0xb
!
! .line 128
! invoke-virtual {v0, v2, v1}, Ljava/util/Calendar;->set(II)V
!
! const/16 v2, 0xc
!
! .line 129
! invoke-virtual {v0, v2, v1}, Ljava/util/Calendar;->set(II)V
!
! const/16 v2, 0xd
!
! .line 130
! invoke-virtual {v0, v2, v1}, Ljava/util/Calendar;->set(II)V
!
! const/16 v2, 0xe
!
! .line 131
! invoke-virtual {v0, v2, v1}, Ljava/util/Calendar;->set(II)V
!
! .line 133
! iget-object v1, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->locale:Ljava/util/Locale;
!
! invoke-virtual {v1}, Ljava/util/Locale;->getLanguage()Ljava/lang/String;
!
! move-result-object v1
!
! const-string v2, "en"
!
! invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
!
! move-result v1
!
! if-nez v1, :cond_1
!
! .line 136
! invoke-virtual {p1}, Ljava/lang/Long;->longValue()J
!
! move-result-wide v1
!
! invoke-virtual {v0}, Ljava/util/Calendar;->getTimeInMillis()J
!
! move-result-wide v3
!
! cmp-long v0, v1, v3
!
! if-lez v0, :cond_0
!
! .line 137
iget-object v0, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->formatterTime:Ljava/text/DateFormat;
invoke-virtual {v0, p1}, Ljava/text/DateFormat;->format(Ljava/lang/Object;)Ljava/lang/String;
- move-result-object p1
-
- return-object p1
-
- .line 139
- :cond_0
- iget-object v0, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->formatterDateTime:Ljava/text/DateFormat;
-
- invoke-virtual {v0, p1}, Ljava/text/DateFormat;->format(Ljava/lang/Object;)Ljava/lang/String;
-
- move-result-object p1
-
- return-object p1
-
- .line 143
- :cond_1
- invoke-virtual {p1}, Ljava/lang/Long;->longValue()J
-
- move-result-wide v1
-
- invoke-virtual {v0}, Ljava/util/Calendar;->getTimeInMillis()J
-
- move-result-wide v3
-
- cmp-long v5, v1, v3
-
- if-lez v5, :cond_2
-
- .line 144
- new-instance v0, Ljava/lang/StringBuilder;
-
- const-string v1, "Today at "
-
- invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
-
- iget-object v1, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->formatterTime:Ljava/text/DateFormat;
-
- invoke-virtual {v1, p1}, Ljava/text/DateFormat;->format(Ljava/lang/Object;)Ljava/lang/String;
-
- move-result-object p1
-
- invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
-
- invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
-
- move-result-object p1
-
- return-object p1
-
- :cond_2
- const/4 v1, 0x5
-
- const/4 v2, -0x1
-
- .line 147
- invoke-virtual {v0, v1, v2}, Ljava/util/Calendar;->add(II)V
-
- .line 149
- invoke-virtual {p1}, Ljava/lang/Long;->longValue()J
-
- move-result-wide v1
-
- invoke-virtual {v0}, Ljava/util/Calendar;->getTimeInMillis()J
-
- move-result-wide v3
-
- cmp-long v0, v1, v3
-
- if-lez v0, :cond_3
-
- .line 150
- new-instance v0, Ljava/lang/StringBuilder;
-
- const-string v1, "Yesterday at "
-
- invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
-
- iget-object v1, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->formatterTime:Ljava/text/DateFormat;
-
- invoke-virtual {v1, p1}, Ljava/text/DateFormat;->format(Ljava/lang/Object;)Ljava/lang/String;
-
- move-result-object p1
-
- invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
-
- invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
-
- move-result-object p1
-
- return-object p1
-
- .line 153
- :cond_3
- iget-object v0, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->formatterDateTime:Ljava/text/DateFormat;
-
- invoke-virtual {v0, p1}, Ljava/text/DateFormat;->format(Ljava/lang/Object;)Ljava/lang/String;
-
move-result-object p1
return-object p1
--- 247,257 ----
.end method
.method public toReadableTimeString(Ljava/lang/Long;)Ljava/lang/String;
! .locals 1
iget-object v0, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->formatterTime:Ljava/text/DateFormat;
invoke-virtual {v0, p1}, Ljava/text/DateFormat;->format(Ljava/lang/Object;)Ljava/lang/String;
move-result-object p1
return-object p1