Weather/smali_classes4/fm/jiecao/jcvideoplayer_lib/JCUtils.smali
2021-05-10 10:13:34 +02:00

291 lines
5.9 KiB
Smali

.class public Lfm/jiecao/jcvideoplayer_lib/JCUtils;
.super Ljava/lang/Object;
.source "JCUtils.java"
# direct methods
.method public constructor <init>()V
.locals 0
.line 17
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static a(Landroid/content/Context;)Landroid/app/Activity;
.locals 2
const/4 v0, 0x0
if-nez p0, :cond_0
return-object v0
.line 65
:cond_0
instance-of v1, p0, Landroid/app/Activity;
if-eqz v1, :cond_1
.line 66
check-cast p0, Landroid/app/Activity;
return-object p0
.line 67
:cond_1
instance-of v1, p0, Landroid/content/ContextWrapper;
if-eqz v1, :cond_2
.line 68
check-cast p0, Landroid/content/ContextWrapper;
invoke-virtual {p0}, Landroid/content/ContextWrapper;->getBaseContext()Landroid/content/Context;
move-result-object p0
invoke-static {p0}, Lfm/jiecao/jcvideoplayer_lib/JCUtils;->a(Landroid/content/Context;)Landroid/app/Activity;
move-result-object p0
return-object p0
:cond_2
return-object v0
.end method
.method public static a(I)Ljava/lang/String;
.locals 8
.line 20
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
.line 21
new-instance v1, Ljava/util/Formatter;
invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;
move-result-object v2
invoke-direct {v1, v0, v2}, Ljava/util/Formatter;-><init>(Ljava/lang/Appendable;Ljava/util/Locale;)V
.line 22
div-int/lit16 p0, p0, 0x3e8
.line 24
rem-int/lit8 v2, p0, 0x3c
.line 25
div-int/lit8 v3, p0, 0x3c
rem-int/lit8 v3, v3, 0x3c
.line 26
div-int/lit16 p0, p0, 0xe10
const/4 v4, 0x0
.line 28
invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->setLength(I)V
const/4 v0, 0x2
const/4 v5, 0x1
if-lez p0, :cond_0
const-string v6, "%d:%02d:%02d"
const/4 v7, 0x3
.line 30
new-array v7, v7, [Ljava/lang/Object;
invoke-static {p0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p0
aput-object p0, v7, v4
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p0
aput-object p0, v7, v5
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p0
aput-object p0, v7, v0
invoke-virtual {v1, v6, v7}, Ljava/util/Formatter;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/util/Formatter;
move-result-object p0
invoke-virtual {p0}, Ljava/util/Formatter;->toString()Ljava/lang/String;
move-result-object p0
return-object p0
:cond_0
const-string p0, "%02d:%02d"
.line 32
new-array v0, v0, [Ljava/lang/Object;
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v3
aput-object v3, v0, v4
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
aput-object v2, v0, v5
invoke-virtual {v1, p0, v0}, Ljava/util/Formatter;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/util/Formatter;
move-result-object p0
invoke-virtual {p0}, Ljava/util/Formatter;->toString()Ljava/lang/String;
move-result-object p0
return-object p0
.end method
.method public static a(Ljava/lang/String;)Ljava/lang/String;
.locals 8
.line 38
invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v0
const/4 v1, 0x0
if-nez v0, :cond_0
invoke-static {p0}, Landroid/text/TextUtils;->isDigitsOnly(Ljava/lang/CharSequence;)Z
move-result v0
if-eqz v0, :cond_0
.line 39
invoke-static {p0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result p0
goto :goto_0
:cond_0
const/4 p0, 0x0
.line 41
:goto_0
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
.line 42
new-instance v2, Ljava/util/Formatter;
invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;
move-result-object v3
invoke-direct {v2, v0, v3}, Ljava/util/Formatter;-><init>(Ljava/lang/Appendable;Ljava/util/Locale;)V
.line 44
rem-int/lit8 v3, p0, 0x3c
.line 45
div-int/lit8 v4, p0, 0x3c
rem-int/lit8 v4, v4, 0x3c
.line 46
div-int/lit16 p0, p0, 0xe10
.line 48
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->setLength(I)V
const/4 v0, 0x2
const/4 v5, 0x1
if-lez p0, :cond_1
const-string v6, "%d:%02d:%02d"
const/4 v7, 0x3
.line 50
new-array v7, v7, [Ljava/lang/Object;
invoke-static {p0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p0
aput-object p0, v7, v1
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p0
aput-object p0, v7, v5
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p0
aput-object p0, v7, v0
invoke-virtual {v2, v6, v7}, Ljava/util/Formatter;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/util/Formatter;
move-result-object p0
invoke-virtual {p0}, Ljava/util/Formatter;->toString()Ljava/lang/String;
move-result-object p0
return-object p0
:cond_1
const-string p0, "%02d:%02d"
.line 52
new-array v0, v0, [Ljava/lang/Object;
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v4
aput-object v4, v0, v1
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
aput-object v1, v0, v5
invoke-virtual {v2, p0, v0}, Ljava/util/Formatter;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/util/Formatter;
move-result-object p0
invoke-virtual {p0}, Ljava/util/Formatter;->toString()Ljava/lang/String;
move-result-object p0
return-object p0
.end method