added date formatter + deleted some unused code

This commit is contained in:
gdlbo
2022-06-24 23:14:51 +03:00
parent 257b2e33f2
commit d364b2c87a
4 changed files with 94 additions and 48 deletions
@@ -1,6 +1,5 @@
package ru.vtosters.lite.utils;
import static android.os.Build.VERSION;
import static java.lang.Long.MAX_VALUE;
import static ru.vtosters.lite.f0x1d.VTVerifications.hasPrometheus;
import static ru.vtosters.lite.f0x1d.VTVerifications.isVerified;
@@ -225,10 +224,6 @@ public class Preferences{
return getBoolValue("returnnorifs", false);
}
public static boolean CommentsSort(){
return getBoolValue("commentssorting", false);
}
public static boolean gcmfix(){
return getBoolValue("gcmfix", true) && isValidSignature();
}
@@ -253,14 +248,6 @@ public class Preferences{
return getBoolValue("isMusicRestricted", true);
}
public static boolean msgflat(){
return getBoolValue("msgflat", false);
}
public static boolean msgtails(){
return getBoolValue("msgtails", true);
}
public static boolean navbar(){
return getBoolValue("navbar", true);
}
@@ -325,14 +312,6 @@ public class Preferences{
return getBoolValue("systememoji", false);
}
public static boolean unlockstats(){
return getBoolValue("unlockstats", false);
}
public static boolean usevkui(){
return getBoolValue("usevkui", true);
}
public static boolean vksans(){
return getBoolValue("vksans", false);
}
@@ -341,27 +320,11 @@ public class Preferences{
return getBoolValue("voice", true);
}
public static boolean newvideo(){
return false;
}
public static int getMsgCount(int orig){
String customvalue = getPrefsValue("msgcount");
return customvalue.isEmpty() ? orig : Integer.parseInt(customvalue);
}
public static String MediacontentFix(){
return VERSION.SDK_INT >= 29 ? "date_modified DESC" : "datetaken DESC";
} // Fix photo picker for sdk 29+
public static String MediacontentFix2(){
return VERSION.SDK_INT >= 29 ? "date_modified" : "datetaken";
} // Fix photo picker for sdk 29+
public static String MediacontentFix3(){
return VERSION.SDK_INT >= 29 ? ", date_modified=" : ", dateTaken=";
} // Fix photo picker for sdk 29+
public static boolean color_grishka(){
return getBoolValue("color_grishka", true);
}
@@ -374,18 +337,10 @@ public class Preferences{
return getBoolValue("vkme_notifs", false);
}
public static boolean roundedmsgs(){
return getBoolValue("roundedmsgs", false);
}
public static boolean checkupdates(){
return getBoolValue("checkupdates", true) && isValidSignature();
}
public static boolean disableanimstickers(){
return getBoolValue("disableanimstickers", true);
}
public static boolean isValidSignature(){
try {
return validateAppSignature();
@@ -432,7 +432,21 @@
.method public static a(IZZ)Ljava/lang/String;
.locals 20
.line 11
move/from16 v0, p1
if-nez v0, :cond_228
move/from16 v0, p0
invoke-static {v0}, Lcom/vtosters/lite/VKApplication;->getFullTime(I)Ljava/lang/String;
move-result-object v0
if-eqz v0, :cond_228
return-object v0
:cond_228
sget-object v0, Lcom/vk/core/util/AppContextHolder;->a:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
@@ -1436,7 +1450,15 @@
.method public static b(ILandroid/content/res/Resources;)Ljava/lang/String;
.locals 4
.line 18
invoke-static {p0}, Lcom/vtosters/lite/VKApplication;->getFullTime(I)Ljava/lang/String;
move-result-object v0
if-eqz v0, :cond_228
return-object v0
:cond_228
invoke-static {}, Lcom/vk/core/util/TimeUtils;->b()I
move-result v0
@@ -1548,7 +1570,21 @@
.method public static b(IZZ)Ljava/lang/String;
.locals 15
.line 2
move/from16 v0, p2
if-nez v0, :cond_d
move/from16 v0, p0
invoke-static {v0}, Lcom/vtosters/lite/VKApplication;->getFullTime(I)Ljava/lang/String;
move-result-object v0
if-eqz v0, :cond_d
return-object v0
:cond_d
sget-object v0, Lcom/vk/core/util/AppContextHolder;->a:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
@@ -45,6 +45,10 @@
invoke-direct {p1, v0}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V
invoke-static {}, Lru/vtosters/lite/utils/Preferences;->setDateFormat()Ljava/text/SimpleDateFormat;
move-result-object p1
iput-object p1, p0, Lcom/vk/im/ui/components/attaches_history/attaches/adapter/delegates/DocAttachViewTypeDelegate;->b:Ljava/text/SimpleDateFormat;
return-void
@@ -14,6 +14,7 @@
# static fields
.field private static a:Z
.field private static final formatoftime:Ljava/text/SimpleDateFormat;
# direct methods
.method static constructor <clinit>()V
@@ -3013,9 +3014,59 @@
.line 48
sput-boolean v7, Lcom/vtosters/lite/VKApplication;->a:Z
new-instance v0, Ljava/text/SimpleDateFormat;
invoke-static {}, Lru/vtosters/lite/utils/Preferences;->getDateFormat()Ljava/lang/String;
move-result-object v3
invoke-direct {v0, v3}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V
sput-object v0, Lcom/vtosters/lite/VKApplication;->formatoftime:Ljava/text/SimpleDateFormat;
return-void
.end method
.method public static getFullTime(I)Ljava/lang/String;
.registers 6
.param p0, "s" # I
.line 17
invoke-static {}, Lru/vtosters/lite/utils/Preferences;->fulltime()Z
move-result v0
if-eqz v0, :cond_17
.line 18
new-instance v0, Ljava/util/Date;
int-to-long v1, p0
const-wide/16 v3, 0x3e8
mul-long v1, v1, v3
invoke-direct {v0, v1, v2}, Ljava/util/Date;-><init>(J)V
.line 19
.local v0, "d":Ljava/util/Date;
sget-object v1, Lcom/vtosters/lite/VKApplication;->formatoftime:Ljava/text/SimpleDateFormat;
invoke-virtual {v1, v0}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v1
return-object v1
.line 21
.end local v0 # "d":Ljava/util/Date;
:cond_17
const/4 v0, 0x0
return-object v0
.end method
.method public onLowMemory()V
.locals 2