.class public final Lcom/tapjoy/TJPreferencesMigration; .super Ljava/lang/Object; .source "SourceFile" # instance fields .field public final a:Lcom/tapjoy/TJKeyValueStorage; .field public final b:Landroid/content/SharedPreferences; .field public final c:Ljava/util/Map; .field public final d:Ljava/util/List; # direct methods .method public constructor (Lcom/tapjoy/TJKeyValueStorage;Landroid/content/SharedPreferences;Ljava/util/Map;Ljava/util/List;)V .locals 1 .annotation system Ldalvik/annotation/Signature; value = { "(", "Lcom/tapjoy/TJKeyValueStorage;", "Landroid/content/SharedPreferences;", "Ljava/util/Map<", "Ljava/lang/String;", "Ljava/lang/String;", ">;", "Ljava/util/List<", "Ljava/lang/String;", ">;)V" } .end annotation const-string v0, "tjKeyValueStorage" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V const-string v0, "migratingPreferences" invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V const-string v0, "migratingKeysMapping" invoke-static {p3, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V const-string v0, "listOfDoubles" invoke-static {p4, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 1 invoke-direct {p0}, Ljava/lang/Object;->()V iput-object p1, p0, Lcom/tapjoy/TJPreferencesMigration;->a:Lcom/tapjoy/TJKeyValueStorage; iput-object p2, p0, Lcom/tapjoy/TJPreferencesMigration;->b:Landroid/content/SharedPreferences; iput-object p3, p0, Lcom/tapjoy/TJPreferencesMigration;->c:Ljava/util/Map; iput-object p4, p0, Lcom/tapjoy/TJPreferencesMigration;->d:Ljava/util/List; return-void .end method # virtual methods .method public final a(Ljava/lang/String;Ljava/lang/Object;)V .locals 4 iget-object v0, p0, Lcom/tapjoy/TJPreferencesMigration;->b:Landroid/content/SharedPreferences; .line 1 invoke-interface {v0, p1}, Landroid/content/SharedPreferences;->contains(Ljava/lang/String;)Z move-result v0 if-eqz v0, :cond_8 .line 3 instance-of v0, p2, Ljava/lang/Boolean; const/4 v1, 0x0 if-eqz v0, :cond_0 iget-object p2, p0, Lcom/tapjoy/TJPreferencesMigration;->b:Landroid/content/SharedPreferences; invoke-interface {p2, p1, v1}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z move-result p2 invoke-static {p2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean; move-result-object p2 goto :goto_0 .line 4 :cond_0 instance-of v0, p2, Ljava/lang/Float; if-eqz v0, :cond_1 iget-object p2, p0, Lcom/tapjoy/TJPreferencesMigration;->b:Landroid/content/SharedPreferences; const/4 v0, 0x0 invoke-interface {p2, p1, v0}, Landroid/content/SharedPreferences;->getFloat(Ljava/lang/String;F)F move-result p2 invoke-static {p2}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float; move-result-object p2 goto :goto_0 .line 5 :cond_1 instance-of v0, p2, Ljava/lang/Integer; if-eqz v0, :cond_2 iget-object p2, p0, Lcom/tapjoy/TJPreferencesMigration;->b:Landroid/content/SharedPreferences; invoke-interface {p2, p1, v1}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I move-result p2 invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object p2 goto :goto_0 .line 6 :cond_2 instance-of v0, p2, Ljava/lang/Long; if-eqz v0, :cond_3 iget-object p2, p0, Lcom/tapjoy/TJPreferencesMigration;->b:Landroid/content/SharedPreferences; const-wide/16 v0, 0x0 invoke-interface {p2, p1, v0, v1}, Landroid/content/SharedPreferences;->getLong(Ljava/lang/String;J)J move-result-wide v0 invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object p2 goto :goto_0 .line 7 :cond_3 instance-of p2, p2, Ljava/lang/String; const/4 v0, 0x0 if-eqz p2, :cond_4 iget-object p2, p0, Lcom/tapjoy/TJPreferencesMigration;->b:Landroid/content/SharedPreferences; invoke-interface {p2, p1, v0}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; move-result-object p2 goto :goto_0 :cond_4 move-object p2, v0 :goto_0 iget-object v0, p0, Lcom/tapjoy/TJPreferencesMigration;->c:Ljava/util/Map; .line 10 invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 check-cast v0, Ljava/lang/String; if-nez v0, :cond_5 move-object v0, p1 :cond_5 if-eqz p2, :cond_7 :try_start_0 iget-object v1, p0, Lcom/tapjoy/TJPreferencesMigration;->d:Ljava/util/List; .line 14 invoke-interface {v1, p1}, Ljava/util/List;->contains(Ljava/lang/Object;)Z move-result v1 if-eqz v1, :cond_6 iget-object v1, p0, Lcom/tapjoy/TJPreferencesMigration;->a:Lcom/tapjoy/TJKeyValueStorage; .line 15 invoke-virtual {p2}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p2 invoke-static {p2}, Ljava/lang/Double;->parseDouble(Ljava/lang/String;)D move-result-wide v2 invoke-static {v2, v3}, Ljava/lang/Double;->valueOf(D)Ljava/lang/Double; move-result-object p2 invoke-virtual {v1, v0, p2}, Lcom/tapjoy/TJKeyValueStorage;->setValue(Ljava/lang/String;Ljava/lang/Object;)V goto :goto_1 :cond_6 iget-object v1, p0, Lcom/tapjoy/TJPreferencesMigration;->a:Lcom/tapjoy/TJKeyValueStorage; .line 17 invoke-virtual {v1, v0, p2}, Lcom/tapjoy/TJKeyValueStorage;->setValue(Ljava/lang/String;Ljava/lang/Object;)V :try_end_0 .catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0 goto :goto_1 .line 20 :catch_0 new-instance p2, Ljava/lang/StringBuilder; invoke-direct {p2}, Ljava/lang/StringBuilder;->()V const-string v0, "Failed to migrate key: " invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p2 const-string v0, "TJPreferencesMigration" invoke-static {v0, p2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I :cond_7 :goto_1 iget-object p2, p0, Lcom/tapjoy/TJPreferencesMigration;->b:Landroid/content/SharedPreferences; .line 23 invoke-interface {p2}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor; move-result-object p2 invoke-interface {p2, p1}, Landroid/content/SharedPreferences$Editor;->remove(Ljava/lang/String;)Landroid/content/SharedPreferences$Editor; move-result-object p1 invoke-interface {p1}, Landroid/content/SharedPreferences$Editor;->apply()V :cond_8 return-void .end method .method public final migrateAllKeysIfExists()V .locals 4 iget-object v0, p0, Lcom/tapjoy/TJPreferencesMigration;->b:Landroid/content/SharedPreferences; .line 1 invoke-interface {v0}, Landroid/content/SharedPreferences;->getAll()Ljava/util/Map; move-result-object v0 if-eqz v0, :cond_1 .line 3 invoke-interface {v0}, Ljava/util/Map;->entrySet()Ljava/util/Set; move-result-object v0 invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator; move-result-object v0 :cond_0 :goto_0 invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z move-result v1 if-eqz v1, :cond_1 invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v1 check-cast v1, Ljava/util/Map$Entry; iget-object v2, p0, Lcom/tapjoy/TJPreferencesMigration;->c:Ljava/util/Map; .line 4 invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object; move-result-object v3 invoke-interface {v2, v3}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z move-result v2 if-eqz v2, :cond_0 .line 5 invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object; move-result-object v2 const-string v3, "(...)" invoke-static {v2, v3}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V check-cast v2, Ljava/lang/String; invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object; move-result-object v1 invoke-virtual {p0, v2, v1}, Lcom/tapjoy/TJPreferencesMigration;->a(Ljava/lang/String;Ljava/lang/Object;)V goto :goto_0 :cond_1 return-void .end method