forked from distok/cutthecord
		
	compact, smalltime: Introduce patches
This commit is contained in:
		
							parent
							
								
									220d5ded1b
								
							
						
					
					
						commit
						7d47f603a0
					
				
					 4 changed files with 288 additions and 0 deletions
				
			
		
							
								
								
									
										190
									
								
								patches/smalltime/835.patch
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										190
									
								
								patches/smalltime/835.patch
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,190 @@
 | 
			
		|||
diff -crB -x dist -x build com.discord-835-base/smali_classes2/com/miguelgaeta/simple_time/SimpleTime.smali com.discord-835/smali_classes2/com/miguelgaeta/simple_time/SimpleTime.smali
 | 
			
		||||
*** com.discord-835-base/smali_classes2/com/miguelgaeta/simple_time/SimpleTime.smali    2019-01-25 10:57:34.672582939 +0300
 | 
			
		||||
--- com.discord-835/smali_classes2/com/miguelgaeta/simple_time/SimpleTime.smali 2019-01-28 15:23:40.845156072 +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
 | 
			
		||||
							
								
								
									
										7
									
								
								patches/smalltime/README.md
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								patches/smalltime/README.md
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
## DisTok CutTheCord: Small Time Patch
 | 
			
		||||
 | 
			
		||||
This patch replaces the long time string with just a simple time string. This is useful when combined with `compact` patch.
 | 
			
		||||
 | 
			
		||||
#### Available and tested on:
 | 
			
		||||
- 8.3.5g
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue