379 lines
		
	
	
		
			9.1 KiB
		
	
	
	
		
			Smali
		
	
	
	
	
	
			
		
		
	
	
			379 lines
		
	
	
		
			9.1 KiB
		
	
	
	
		
			Smali
		
	
	
	
	
	
| .class Lcom/google/firebase/messaging/Store;
 | |
| .super Ljava/lang/Object;
 | |
| .source "com.google.firebase:firebase-messaging@@23.0.0"
 | |
| 
 | |
| 
 | |
| # annotations
 | |
| .annotation system Ldalvik/annotation/MemberClasses;
 | |
|     value = {
 | |
|         Lcom/google/firebase/messaging/Store$Token;
 | |
|     }
 | |
| .end annotation
 | |
| 
 | |
| 
 | |
| # instance fields
 | |
| .field public final store:Landroid/content/SharedPreferences;
 | |
| 
 | |
| 
 | |
| # direct methods
 | |
| .method public constructor <init>(Landroid/content/Context;)V
 | |
|     .locals 2
 | |
| 
 | |
|     .line 1
 | |
|     invoke-direct {p0}, Ljava/lang/Object;-><init>()V
 | |
| 
 | |
|     const-string v0, "com.google.android.gms.appid"
 | |
| 
 | |
|     const/4 v1, 0x0
 | |
| 
 | |
|     invoke-virtual {p1, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     iput-object v0, p0, Lcom/google/firebase/messaging/Store;->store:Landroid/content/SharedPreferences;
 | |
| 
 | |
|     const-string v0, "com.google.android.gms.appid-no-backup"
 | |
| 
 | |
|     .line 2
 | |
|     invoke-direct {p0, p1, v0}, Lcom/google/firebase/messaging/Store;->checkForRestore(Landroid/content/Context;Ljava/lang/String;)V
 | |
| 
 | |
|     return-void
 | |
| .end method
 | |
| 
 | |
| .method private checkForRestore(Landroid/content/Context;Ljava/lang/String;)V
 | |
|     .locals 2
 | |
| 
 | |
|     const-string p2, "FirebaseMessaging"
 | |
| 
 | |
|     .line 1
 | |
|     invoke-static {p1}, Landroidx/core/content/d;->m(Landroid/content/Context;)Ljava/io/File;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     new-instance v0, Ljava/io/File;
 | |
| 
 | |
|     const-string v1, "com.google.android.gms.appid-no-backup"
 | |
| 
 | |
|     .line 2
 | |
|     invoke-direct {v0, p1, v1}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
 | |
| 
 | |
|     .line 3
 | |
|     invoke-virtual {v0}, Ljava/io/File;->exists()Z
 | |
| 
 | |
|     move-result p1
 | |
| 
 | |
|     if-eqz p1, :cond_0
 | |
| 
 | |
|     return-void
 | |
| 
 | |
|     .line 4
 | |
|     :cond_0
 | |
|     :try_start_0
 | |
|     invoke-virtual {v0}, Ljava/io/File;->createNewFile()Z
 | |
| 
 | |
|     move-result p1
 | |
| 
 | |
|     if-eqz p1, :cond_2
 | |
| 
 | |
|     .line 5
 | |
|     invoke-virtual {p0}, Lcom/google/firebase/messaging/Store;->isEmpty()Z
 | |
| 
 | |
|     move-result p1
 | |
| 
 | |
|     if-nez p1, :cond_2
 | |
| 
 | |
|     const-string p1, "App restored, clearing state"
 | |
| 
 | |
|     .line 6
 | |
|     invoke-static {p2, p1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
 | |
| 
 | |
|     .line 7
 | |
|     invoke-virtual {p0}, Lcom/google/firebase/messaging/Store;->deleteAll()V
 | |
|     :try_end_0
 | |
|     .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
 | |
| 
 | |
|     return-void
 | |
| 
 | |
|     :catch_0
 | |
|     move-exception p1
 | |
| 
 | |
|     const/4 v0, 0x3
 | |
| 
 | |
|     .line 8
 | |
|     invoke-static {p2, v0}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
 | |
| 
 | |
|     move-result v0
 | |
| 
 | |
|     if-eqz v0, :cond_2
 | |
| 
 | |
|     .line 9
 | |
|     invoke-virtual {p1}, Ljava/io/IOException;->getMessage()Ljava/lang/String;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     const-string v0, "Error creating file in no backup dir: "
 | |
| 
 | |
|     invoke-virtual {p1}, Ljava/lang/String;->length()I
 | |
| 
 | |
|     move-result v1
 | |
| 
 | |
|     if-eqz v1, :cond_1
 | |
| 
 | |
|     invoke-virtual {v0, p1}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     goto :goto_0
 | |
| 
 | |
|     :cond_1
 | |
|     new-instance p1, Ljava/lang/String;
 | |
| 
 | |
|     invoke-direct {p1, v0}, Ljava/lang/String;-><init>(Ljava/lang/String;)V
 | |
| 
 | |
|     :goto_0
 | |
|     invoke-static {p2, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
 | |
| 
 | |
|     :cond_2
 | |
|     return-void
 | |
| .end method
 | |
| 
 | |
| .method private createTokenKey(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
 | |
|     .locals 3
 | |
| 
 | |
|     .line 1
 | |
|     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
 | |
| 
 | |
|     invoke-static {p2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
 | |
| 
 | |
|     move-result-object v1
 | |
| 
 | |
|     invoke-virtual {v1}, Ljava/lang/String;->length()I
 | |
| 
 | |
|     move-result v1
 | |
| 
 | |
|     new-instance v2, Ljava/lang/StringBuilder;
 | |
| 
 | |
|     add-int/lit8 v0, v0, 0x5
 | |
| 
 | |
|     add-int/2addr v0, v1
 | |
| 
 | |
|     invoke-direct {v2, v0}, Ljava/lang/StringBuilder;-><init>(I)V
 | |
| 
 | |
|     const-string v0, "|T|"
 | |
| 
 | |
|     const-string v1, "|*"
 | |
| 
 | |
|     invoke-static {v2, p1, v0, p2, v1}, Lr1/k;->a(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     return-object p1
 | |
| .end method
 | |
| 
 | |
| 
 | |
| # virtual methods
 | |
| .method public declared-synchronized deleteAll()V
 | |
|     .locals 1
 | |
| 
 | |
|     monitor-enter p0
 | |
| 
 | |
|     .line 1
 | |
|     :try_start_0
 | |
|     iget-object v0, p0, Lcom/google/firebase/messaging/Store;->store:Landroid/content/SharedPreferences;
 | |
| 
 | |
|     invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->clear()Landroid/content/SharedPreferences$Editor;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z
 | |
|     :try_end_0
 | |
|     .catchall {:try_start_0 .. :try_end_0} :catchall_0
 | |
| 
 | |
|     monitor-exit p0
 | |
| 
 | |
|     return-void
 | |
| 
 | |
|     :catchall_0
 | |
|     move-exception v0
 | |
| 
 | |
|     monitor-exit p0
 | |
| 
 | |
|     throw v0
 | |
| .end method
 | |
| 
 | |
| .method public declared-synchronized deleteToken(Ljava/lang/String;Ljava/lang/String;)V
 | |
|     .locals 0
 | |
| 
 | |
|     monitor-enter p0
 | |
| 
 | |
|     .line 1
 | |
|     :try_start_0
 | |
|     invoke-direct {p0, p1, p2}, Lcom/google/firebase/messaging/Store;->createTokenKey(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     iget-object p2, p0, Lcom/google/firebase/messaging/Store;->store:Landroid/content/SharedPreferences;
 | |
| 
 | |
|     .line 2
 | |
|     invoke-interface {p2}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
 | |
| 
 | |
|     move-result-object p2
 | |
| 
 | |
|     .line 3
 | |
|     invoke-interface {p2, p1}, Landroid/content/SharedPreferences$Editor;->remove(Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;
 | |
| 
 | |
|     .line 4
 | |
|     invoke-interface {p2}, Landroid/content/SharedPreferences$Editor;->commit()Z
 | |
|     :try_end_0
 | |
|     .catchall {:try_start_0 .. :try_end_0} :catchall_0
 | |
| 
 | |
|     monitor-exit p0
 | |
| 
 | |
|     return-void
 | |
| 
 | |
|     :catchall_0
 | |
|     move-exception p1
 | |
| 
 | |
|     monitor-exit p0
 | |
| 
 | |
|     throw p1
 | |
| .end method
 | |
| 
 | |
| .method public declared-synchronized getToken(Ljava/lang/String;Ljava/lang/String;)Lcom/google/firebase/messaging/Store$Token;
 | |
|     .locals 1
 | |
| 
 | |
|     monitor-enter p0
 | |
| 
 | |
|     .line 1
 | |
|     :try_start_0
 | |
|     iget-object v0, p0, Lcom/google/firebase/messaging/Store;->store:Landroid/content/SharedPreferences;
 | |
| 
 | |
|     invoke-direct {p0, p1, p2}, Lcom/google/firebase/messaging/Store;->createTokenKey(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     const/4 p2, 0x0
 | |
| 
 | |
|     invoke-interface {v0, p1, p2}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     invoke-static {p1}, Lcom/google/firebase/messaging/Store$Token;->parse(Ljava/lang/String;)Lcom/google/firebase/messaging/Store$Token;
 | |
| 
 | |
|     move-result-object p1
 | |
|     :try_end_0
 | |
|     .catchall {:try_start_0 .. :try_end_0} :catchall_0
 | |
| 
 | |
|     monitor-exit p0
 | |
| 
 | |
|     return-object p1
 | |
| 
 | |
|     :catchall_0
 | |
|     move-exception p1
 | |
| 
 | |
|     monitor-exit p0
 | |
| 
 | |
|     throw p1
 | |
| .end method
 | |
| 
 | |
| .method public declared-synchronized isEmpty()Z
 | |
|     .locals 1
 | |
| 
 | |
|     monitor-enter p0
 | |
| 
 | |
|     .line 1
 | |
|     :try_start_0
 | |
|     iget-object v0, p0, Lcom/google/firebase/messaging/Store;->store:Landroid/content/SharedPreferences;
 | |
| 
 | |
|     invoke-interface {v0}, Landroid/content/SharedPreferences;->getAll()Ljava/util/Map;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     invoke-interface {v0}, Ljava/util/Map;->isEmpty()Z
 | |
| 
 | |
|     move-result v0
 | |
|     :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
 | |
| 
 | |
| .method public declared-synchronized saveToken(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
 | |
|     .locals 2
 | |
| 
 | |
|     monitor-enter p0
 | |
| 
 | |
|     .line 1
 | |
|     :try_start_0
 | |
|     invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
 | |
| 
 | |
|     move-result-wide v0
 | |
| 
 | |
|     invoke-static {p3, p4, v0, v1}, Lcom/google/firebase/messaging/Store$Token;->encode(Ljava/lang/String;Ljava/lang/String;J)Ljava/lang/String;
 | |
| 
 | |
|     move-result-object p3
 | |
|     :try_end_0
 | |
|     .catchall {:try_start_0 .. :try_end_0} :catchall_0
 | |
| 
 | |
|     if-nez p3, :cond_0
 | |
| 
 | |
|     monitor-exit p0
 | |
| 
 | |
|     return-void
 | |
| 
 | |
|     :cond_0
 | |
|     :try_start_1
 | |
|     iget-object p4, p0, Lcom/google/firebase/messaging/Store;->store:Landroid/content/SharedPreferences;
 | |
| 
 | |
|     .line 2
 | |
|     invoke-interface {p4}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
 | |
| 
 | |
|     move-result-object p4
 | |
| 
 | |
|     .line 3
 | |
|     invoke-direct {p0, p1, p2}, Lcom/google/firebase/messaging/Store;->createTokenKey(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     invoke-interface {p4, p1, p3}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;
 | |
| 
 | |
|     .line 4
 | |
|     invoke-interface {p4}, Landroid/content/SharedPreferences$Editor;->commit()Z
 | |
|     :try_end_1
 | |
|     .catchall {:try_start_1 .. :try_end_1} :catchall_0
 | |
| 
 | |
|     monitor-exit p0
 | |
| 
 | |
|     return-void
 | |
| 
 | |
|     :catchall_0
 | |
|     move-exception p1
 | |
| 
 | |
|     monitor-exit p0
 | |
| 
 | |
|     throw p1
 | |
| .end method
 |