360 lines
7.7 KiB
Smali
360 lines
7.7 KiB
Smali
.class public Lc/c;
|
|
.super Ljava/lang/Object;
|
|
.source "AdvertisingIdUtils.java"
|
|
|
|
|
|
# annotations
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
value = {
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP:Landroidx/annotation/RestrictTo$Scope;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final a:Ljava/lang/String; = "androidx.ads.identifier.provider.GET_AD_ID"
|
|
|
|
.field public static final b:Ljava/lang/String; = "androidx.ads.identifier.provider.HIGH_PRIORITY"
|
|
.annotation build Landroidx/annotation/VisibleForTesting;
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static a(Landroid/content/pm/PackageManager;)Ljava/util/List;
|
|
.locals 2
|
|
.param p0 # Landroid/content/pm/PackageManager;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroid/content/pm/PackageManager;",
|
|
")",
|
|
"Ljava/util/List<",
|
|
"Landroid/content/pm/ServiceInfo;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
new-instance v0, Landroid/content/Intent;
|
|
|
|
const-string v1, "androidx.ads.identifier.provider.GET_AD_ID"
|
|
|
|
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
|
|
|
|
const/high16 v1, 0x100000
|
|
|
|
.line 2
|
|
invoke-virtual {p0, v0, v1}, Landroid/content/pm/PackageManager;->queryIntentServices(Landroid/content/Intent;I)Ljava/util/List;
|
|
|
|
move-result-object p0
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
.line 3
|
|
invoke-interface {p0}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 4
|
|
:cond_0
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
.line 5
|
|
invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Landroid/content/pm/ResolveInfo;
|
|
|
|
.line 6
|
|
iget-object v1, v1, Landroid/content/pm/ResolveInfo;->serviceInfo:Landroid/content/pm/ServiceInfo;
|
|
|
|
.line 7
|
|
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
return-object v0
|
|
|
|
.line 8
|
|
:cond_2
|
|
:goto_1
|
|
invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static b(Landroid/content/pm/PackageInfo;Landroid/content/pm/PackageInfo;)Z
|
|
.locals 7
|
|
|
|
.line 1
|
|
invoke-static {p0}, Lc/c;->c(Landroid/content/pm/PackageInfo;)Z
|
|
|
|
move-result v0
|
|
|
|
.line 2
|
|
invoke-static {p1}, Lc/c;->c(Landroid/content/pm/PackageInfo;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
return v0
|
|
|
|
.line 3
|
|
:cond_0
|
|
iget-wide v0, p0, Landroid/content/pm/PackageInfo;->firstInstallTime:J
|
|
|
|
iget-wide v2, p1, Landroid/content/pm/PackageInfo;->firstInstallTime:J
|
|
|
|
cmp-long v4, v0, v2
|
|
|
|
const/4 v5, 0x1
|
|
|
|
const/4 v6, 0x0
|
|
|
|
if-eqz v4, :cond_2
|
|
|
|
cmp-long p0, v0, v2
|
|
|
|
if-gez p0, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
move v5, v6
|
|
|
|
:goto_0
|
|
return v5
|
|
|
|
.line 4
|
|
:cond_2
|
|
iget-object p0, p0, Landroid/content/pm/PackageInfo;->packageName:Ljava/lang/String;
|
|
|
|
iget-object p1, p1, Landroid/content/pm/PackageInfo;->packageName:Ljava/lang/String;
|
|
|
|
invoke-virtual {p0, p1}, Ljava/lang/String;->compareTo(Ljava/lang/String;)I
|
|
|
|
move-result p0
|
|
|
|
if-gez p0, :cond_3
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
move v5, v6
|
|
|
|
:goto_1
|
|
return v5
|
|
.end method
|
|
|
|
.method public static c(Landroid/content/pm/PackageInfo;)Z
|
|
.locals 5
|
|
|
|
.line 1
|
|
iget-object p0, p0, Landroid/content/pm/PackageInfo;->requestedPermissions:[Ljava/lang/String;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
return v0
|
|
|
|
.line 2
|
|
:cond_0
|
|
array-length v1, p0
|
|
|
|
move v2, v0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_2
|
|
|
|
aget-object v3, p0, v2
|
|
|
|
const-string v4, "androidx.ads.identifier.provider.HIGH_PRIORITY"
|
|
|
|
.line 3
|
|
invoke-virtual {v4, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_1
|
|
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
|
|
:cond_1
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
return v0
|
|
.end method
|
|
|
|
.method public static d(Ljava/lang/String;Landroid/content/pm/PackageManager;)Z
|
|
.locals 1
|
|
.param p0 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # Landroid/content/pm/PackageManager;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
invoke-virtual {p1, p0, v0}, Landroid/content/pm/PackageManager;->getApplicationInfo(Ljava/lang/String;I)Landroid/content/pm/ApplicationInfo;
|
|
|
|
move-result-object p0
|
|
|
|
.line 2
|
|
iget p0, p0, Landroid/content/pm/ApplicationInfo;->flags:I
|
|
:try_end_0
|
|
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
const/4 p1, 0x1
|
|
|
|
and-int/2addr p0, p1
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
move v0, p1
|
|
|
|
:catch_0
|
|
:cond_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public static e(Ljava/util/List;Landroid/content/pm/PackageManager;)Landroid/content/pm/ServiceInfo;
|
|
.locals 5
|
|
.param p0 # Ljava/util/List;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # Landroid/content/pm/PackageManager;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"Landroid/content/pm/ServiceInfo;",
|
|
">;",
|
|
"Landroid/content/pm/PackageManager;",
|
|
")",
|
|
"Landroid/content/pm/ServiceInfo;"
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-interface {p0}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-object v1
|
|
|
|
.line 2
|
|
:cond_0
|
|
invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
move-object v0, v1
|
|
|
|
:catch_0
|
|
:cond_1
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_3
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Landroid/content/pm/ServiceInfo;
|
|
|
|
.line 3
|
|
:try_start_0
|
|
iget-object v3, v2, Landroid/content/pm/ServiceInfo;->packageName:Ljava/lang/String;
|
|
|
|
const/16 v4, 0x1000
|
|
|
|
.line 4
|
|
invoke-virtual {p1, v3, v4}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
|
|
|
|
move-result-object v3
|
|
:try_end_0
|
|
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
.line 5
|
|
invoke-static {v3, v0}, Lc/c;->b(Landroid/content/pm/PackageInfo;Landroid/content/pm/PackageInfo;)Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_1
|
|
|
|
:cond_2
|
|
move-object v1, v2
|
|
|
|
move-object v0, v3
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
return-object v1
|
|
.end method
|