370 lines
7 KiB
Smali
370 lines
7 KiB
Smali
.class public final Lcom/discord/utilities/device/DeviceUtils;
|
|
.super Ljava/lang/Object;
|
|
.source "DeviceUtils.kt"
|
|
|
|
|
|
# static fields
|
|
.field public static final INSTANCE:Lcom/discord/utilities/device/DeviceUtils;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Lcom/discord/utilities/device/DeviceUtils;
|
|
|
|
invoke-direct {v0}, Lcom/discord/utilities/device/DeviceUtils;-><init>()V
|
|
|
|
sput-object v0, Lcom/discord/utilities/device/DeviceUtils;->INSTANCE:Lcom/discord/utilities/device/DeviceUtils;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static synthetic isDevice$default(Lcom/discord/utilities/device/DeviceUtils;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;ILjava/lang/Object;)Z
|
|
.locals 1
|
|
|
|
and-int/lit8 p5, p4, 0x1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p5, :cond_0
|
|
|
|
move-object p1, v0
|
|
|
|
:cond_0
|
|
and-int/lit8 p5, p4, 0x2
|
|
|
|
if-eqz p5, :cond_1
|
|
|
|
move-object p2, v0
|
|
|
|
:cond_1
|
|
and-int/lit8 p4, p4, 0x4
|
|
|
|
if-eqz p4, :cond_2
|
|
|
|
move-object p3, v0
|
|
|
|
:cond_2
|
|
invoke-virtual {p0, p1, p2, p3}, Lcom/discord/utilities/device/DeviceUtils;->isDevice(Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;)Z
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static synthetic isDevice$default(Lcom/discord/utilities/device/DeviceUtils;Ljava/util/Set;Ljava/util/Set;Ljava/util/Set;ILjava/lang/Object;)Z
|
|
.locals 1
|
|
|
|
and-int/lit8 p5, p4, 0x1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p5, :cond_0
|
|
|
|
move-object p1, v0
|
|
|
|
:cond_0
|
|
and-int/lit8 p5, p4, 0x2
|
|
|
|
if-eqz p5, :cond_1
|
|
|
|
move-object p2, v0
|
|
|
|
:cond_1
|
|
and-int/lit8 p4, p4, 0x4
|
|
|
|
if-eqz p4, :cond_2
|
|
|
|
move-object p3, v0
|
|
|
|
:cond_2
|
|
invoke-virtual {p0, p1, p2, p3}, Lcom/discord/utilities/device/DeviceUtils;->isDevice(Ljava/util/Set;Ljava/util/Set;Ljava/util/Set;)Z
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final canDrawOverlays(Landroid/content/Context;)Z
|
|
.locals 2
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v1, 0x16
|
|
|
|
if-le v0, v1, :cond_1
|
|
|
|
invoke-static {p1}, Landroid/provider/Settings;->canDrawOverlays(Landroid/content/Context;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const/4 p1, 0x1
|
|
|
|
:goto_1
|
|
return p1
|
|
|
|
:cond_2
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final isDevice(Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;)Z
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-static {p1}, Le/k/a/c/e/p/e;->setOf(Ljava/lang/Object;)Ljava/util/Set;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move-object p1, v0
|
|
|
|
:goto_0
|
|
if-eqz p2, :cond_1
|
|
|
|
invoke-virtual {p2}, Ljava/lang/Number;->intValue()I
|
|
|
|
move-result p2
|
|
|
|
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-static {p2}, Le/k/a/c/e/p/e;->setOf(Ljava/lang/Object;)Ljava/util/Set;
|
|
|
|
move-result-object p2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
move-object p2, v0
|
|
|
|
:goto_1
|
|
if-eqz p3, :cond_2
|
|
|
|
invoke-static {p3}, Le/k/a/c/e/p/e;->setOf(Ljava/lang/Object;)Ljava/util/Set;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_2
|
|
invoke-virtual {p0, p1, p2, v0}, Lcom/discord/utilities/device/DeviceUtils;->isDevice(Ljava/util/Set;Ljava/util/Set;Ljava/util/Set;)Z
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public final isDevice(Ljava/util/Set;Ljava/util/Set;Ljava/util/Set;)Z
|
|
.locals 5
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/Set<",
|
|
"Ljava/lang/String;",
|
|
">;",
|
|
"Ljava/util/Set<",
|
|
"Ljava/lang/Integer;",
|
|
">;",
|
|
"Ljava/util/Set<",
|
|
"Ljava/lang/String;",
|
|
">;)Z"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
invoke-interface {p1}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_2
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/lang/String;
|
|
|
|
sget-object v3, Landroid/os/Build;->MANUFACTURER:Ljava/lang/String;
|
|
|
|
const-string v4, "Build.MANUFACTURER"
|
|
|
|
invoke-static {v3, v4}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v3, v2, v1}, Ly/a0/u;->contains(Ljava/lang/CharSequence;Ljava/lang/CharSequence;Z)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
:cond_3
|
|
const/4 p1, 0x1
|
|
|
|
:goto_0
|
|
if-eqz p2, :cond_8
|
|
|
|
invoke-interface {p2}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_5
|
|
|
|
:cond_4
|
|
const/4 p2, 0x0
|
|
|
|
goto :goto_2
|
|
|
|
:cond_5
|
|
invoke-interface {p2}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p2
|
|
|
|
:cond_6
|
|
invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_4
|
|
|
|
invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/lang/Number;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/Number;->intValue()I
|
|
|
|
move-result v2
|
|
|
|
sget v3, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
if-ne v3, v2, :cond_7
|
|
|
|
const/4 v2, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_7
|
|
const/4 v2, 0x0
|
|
|
|
:goto_1
|
|
if-eqz v2, :cond_6
|
|
|
|
:cond_8
|
|
const/4 p2, 0x1
|
|
|
|
:goto_2
|
|
if-eqz p3, :cond_c
|
|
|
|
invoke-interface {p3}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_a
|
|
|
|
:cond_9
|
|
const/4 p3, 0x0
|
|
|
|
goto :goto_3
|
|
|
|
:cond_a
|
|
invoke-interface {p3}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p3
|
|
|
|
:cond_b
|
|
invoke-interface {p3}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_9
|
|
|
|
invoke-interface {p3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/lang/String;
|
|
|
|
sget-object v3, Landroid/os/Build;->MODEL:Ljava/lang/String;
|
|
|
|
const-string v4, "Build.MODEL"
|
|
|
|
invoke-static {v3, v4}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v3, v2, v1}, Ly/a0/u;->contains(Ljava/lang/CharSequence;Ljava/lang/CharSequence;Z)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_b
|
|
|
|
:cond_c
|
|
const/4 p3, 0x1
|
|
|
|
:goto_3
|
|
if-eqz p1, :cond_d
|
|
|
|
if-eqz p2, :cond_d
|
|
|
|
if-eqz p3, :cond_d
|
|
|
|
const/4 v0, 0x1
|
|
|
|
:cond_d
|
|
return v0
|
|
.end method
|