538 lines
12 KiB
Smali
538 lines
12 KiB
Smali
.class public final Lcom/google/firebase/iid/g;
|
|
.super Ljava/lang/Object;
|
|
.source "com.google.firebase:firebase-iid@@19.0.1"
|
|
|
|
|
|
# instance fields
|
|
.field private final aUI:Landroid/content/Context;
|
|
|
|
.field private alh:Ljava/lang/String;
|
|
.annotation build Ljavax/annotation/concurrent/GuardedBy;
|
|
value = "this"
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private alu:Ljava/lang/String;
|
|
.annotation build Ljavax/annotation/concurrent/GuardedBy;
|
|
value = "this"
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private zzd:I
|
|
.annotation build Ljavax/annotation/concurrent/GuardedBy;
|
|
value = "this"
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private zze:I
|
|
.annotation build Ljavax/annotation/concurrent/GuardedBy;
|
|
value = "this"
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput v0, p0, Lcom/google/firebase/iid/g;->zze:I
|
|
|
|
iput-object p1, p0, Lcom/google/firebase/iid/g;->aUI:Landroid/content/Context;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static a(Ljava/security/PublicKey;)Ljava/lang/String;
|
|
.locals 3
|
|
|
|
invoke-interface {p0}, Ljava/security/PublicKey;->getEncoded()[B
|
|
|
|
move-result-object p0
|
|
|
|
:try_start_0
|
|
const-string v0, "SHA1"
|
|
|
|
invoke-static {v0}, Ljava/security/MessageDigest;->getInstance(Ljava/lang/String;)Ljava/security/MessageDigest;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p0}, Ljava/security/MessageDigest;->digest([B)[B
|
|
|
|
move-result-object p0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
aget-byte v1, p0, v0
|
|
|
|
and-int/lit8 v1, v1, 0xf
|
|
|
|
add-int/lit8 v1, v1, 0x70
|
|
|
|
int-to-byte v1, v1
|
|
|
|
aput-byte v1, p0, v0
|
|
|
|
const/16 v1, 0x8
|
|
|
|
const/16 v2, 0xb
|
|
|
|
invoke-static {p0, v0, v1, v2}, Landroid/util/Base64;->encodeToString([BIII)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
:try_end_0
|
|
.catch Ljava/security/NoSuchAlgorithmException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p0
|
|
|
|
:catch_0
|
|
const-string p0, "FirebaseInstanceId"
|
|
|
|
const-string v0, "Unexpected error, device missing required algorithms"
|
|
|
|
invoke-static {p0, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
const/4 p0, 0x0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static c(Lcom/google/firebase/FirebaseApp;)Ljava/lang/String;
|
|
.locals 3
|
|
|
|
invoke-virtual {p0}, Lcom/google/firebase/FirebaseApp;->AE()Lcom/google/firebase/c;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v0, v0, Lcom/google/firebase/c;->aSX:Ljava/lang/String;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
invoke-virtual {p0}, Lcom/google/firebase/FirebaseApp;->AE()Lcom/google/firebase/c;
|
|
|
|
move-result-object p0
|
|
|
|
iget-object p0, p0, Lcom/google/firebase/c;->aSU:Ljava/lang/String;
|
|
|
|
const-string v0, "1:"
|
|
|
|
invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
return-object p0
|
|
|
|
:cond_1
|
|
const-string v0, ":"
|
|
|
|
invoke-virtual {p0, v0}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
array-length v0, p0
|
|
|
|
const/4 v1, 0x2
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-ge v0, v1, :cond_2
|
|
|
|
return-object v2
|
|
|
|
:cond_2
|
|
const/4 v0, 0x1
|
|
|
|
aget-object p0, p0, v0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/String;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
return-object v2
|
|
|
|
:cond_3
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private final ds(Ljava/lang/String;)Landroid/content/pm/PackageInfo;
|
|
.locals 2
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/google/firebase/iid/g;->aUI:Landroid/content/Context;
|
|
|
|
invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {v0, p1, v1}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
|
|
|
|
move-result-object p1
|
|
:try_end_0
|
|
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p1
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v0
|
|
|
|
add-int/lit8 v0, v0, 0x17
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1, v0}, Ljava/lang/StringBuilder;-><init>(I)V
|
|
|
|
const-string v0, "Failed to find package "
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "FirebaseInstanceId"
|
|
|
|
invoke-static {v0, p1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
const/4 p1, 0x0
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private final declared-synchronized zY()V
|
|
.locals 2
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/google/firebase/iid/g;->aUI:Landroid/content/Context;
|
|
|
|
invoke-virtual {v0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p0, v0}, Lcom/google/firebase/iid/g;->ds(Ljava/lang/String;)Landroid/content/pm/PackageInfo;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget v1, v0, Landroid/content/pm/PackageInfo;->versionCode:I
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
iput-object v1, p0, Lcom/google/firebase/iid/g;->alh:Ljava/lang/String;
|
|
|
|
iget-object v0, v0, Landroid/content/pm/PackageInfo;->versionName:Ljava/lang/String;
|
|
|
|
iput-object v0, p0, Lcom/google/firebase/iid/g;->alu:Ljava/lang/String;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:cond_0
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final declared-synchronized Bg()I
|
|
.locals 5
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget v0, p0, Lcom/google/firebase/iid/g;->zze:I
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget v0, p0, Lcom/google/firebase/iid/g;->zze:I
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
:try_start_1
|
|
iget-object v0, p0, Lcom/google/firebase/iid/g;->aUI:Landroid/content/Context;
|
|
|
|
invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "com.google.android.c2dm.permission.SEND"
|
|
|
|
const-string v2, "com.google.android.gms"
|
|
|
|
invoke-virtual {v0, v1, v2}, Landroid/content/pm/PackageManager;->checkPermission(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, -0x1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-ne v1, v2, :cond_1
|
|
|
|
const-string v0, "FirebaseInstanceId"
|
|
|
|
const-string v1, "Google Play services missing or without correct permission."
|
|
|
|
invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return v3
|
|
|
|
:cond_1
|
|
:try_start_2
|
|
invoke-static {}, Lcom/google/android/gms/common/util/l;->isAtLeastO()Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
if-nez v1, :cond_2
|
|
|
|
new-instance v1, Landroid/content/Intent;
|
|
|
|
const-string v4, "com.google.android.c2dm.intent.REGISTER"
|
|
|
|
invoke-direct {v1, v4}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
|
|
|
|
const-string v4, "com.google.android.gms"
|
|
|
|
invoke-virtual {v1, v4}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
invoke-virtual {v0, v1, v3}, Landroid/content/pm/PackageManager;->queryIntentServices(Landroid/content/Intent;I)Ljava/util/List;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-interface {v1}, Ljava/util/List;->size()I
|
|
|
|
move-result v1
|
|
|
|
if-lez v1, :cond_2
|
|
|
|
iput v2, p0, Lcom/google/firebase/iid/g;->zze:I
|
|
|
|
iget v0, p0, Lcom/google/firebase/iid/g;->zze:I
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return v0
|
|
|
|
:cond_2
|
|
:try_start_3
|
|
new-instance v1, Landroid/content/Intent;
|
|
|
|
const-string v4, "com.google.iid.TOKEN_REQUEST"
|
|
|
|
invoke-direct {v1, v4}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
|
|
|
|
const-string v4, "com.google.android.gms"
|
|
|
|
invoke-virtual {v1, v4}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
invoke-virtual {v0, v1, v3}, Landroid/content/pm/PackageManager;->queryBroadcastReceivers(Landroid/content/Intent;I)Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x2
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
if-lez v0, :cond_3
|
|
|
|
iput v1, p0, Lcom/google/firebase/iid/g;->zze:I
|
|
|
|
iget v0, p0, Lcom/google/firebase/iid/g;->zze:I
|
|
:try_end_3
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return v0
|
|
|
|
:cond_3
|
|
:try_start_4
|
|
const-string v0, "FirebaseInstanceId"
|
|
|
|
const-string v3, "Failed to resolve IID implementation package, falling back"
|
|
|
|
invoke-static {v0, v3}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
invoke-static {}, Lcom/google/android/gms/common/util/l;->isAtLeastO()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
iput v1, p0, Lcom/google/firebase/iid/g;->zze:I
|
|
|
|
goto :goto_0
|
|
|
|
:cond_4
|
|
iput v2, p0, Lcom/google/firebase/iid/g;->zze:I
|
|
|
|
:goto_0
|
|
iget v0, p0, Lcom/google/firebase/iid/g;->zze:I
|
|
:try_end_4
|
|
.catchall {:try_start_4 .. :try_end_4} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return v0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final declared-synchronized Bh()Ljava/lang/String;
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/google/firebase/iid/g;->alh:Ljava/lang/String;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
invoke-direct {p0}, Lcom/google/firebase/iid/g;->zY()V
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/google/firebase/iid/g;->alh:Ljava/lang/String;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return-object v0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final declared-synchronized Bi()Ljava/lang/String;
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/google/firebase/iid/g;->alu:Ljava/lang/String;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
invoke-direct {p0}, Lcom/google/firebase/iid/g;->zY()V
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/google/firebase/iid/g;->alu:Ljava/lang/String;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return-object v0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final declared-synchronized Bj()I
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget v0, p0, Lcom/google/firebase/iid/g;->zzd:I
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const-string v0, "com.google.android.gms"
|
|
|
|
invoke-direct {p0, v0}, Lcom/google/firebase/iid/g;->ds(Ljava/lang/String;)Landroid/content/pm/PackageInfo;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget v0, v0, Landroid/content/pm/PackageInfo;->versionCode:I
|
|
|
|
iput v0, p0, Lcom/google/firebase/iid/g;->zzd:I
|
|
|
|
:cond_0
|
|
iget v0, p0, Lcom/google/firebase/iid/g;->zzd:I
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return v0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|