- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
62 lines
2.6 KiB
Java
62 lines
2.6 KiB
Java
package com.tapjoy;
|
|
|
|
import android.content.SharedPreferences;
|
|
import android.util.Log;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public final class TJPreferencesMigration {
|
|
public final TJKeyValueStorage a;
|
|
public final SharedPreferences b;
|
|
public final Map c;
|
|
public final List d;
|
|
|
|
public TJPreferencesMigration(TJKeyValueStorage tjKeyValueStorage, SharedPreferences migratingPreferences, Map<String, String> migratingKeysMapping, List<String> listOfDoubles) {
|
|
Intrinsics.checkNotNullParameter(tjKeyValueStorage, "tjKeyValueStorage");
|
|
Intrinsics.checkNotNullParameter(migratingPreferences, "migratingPreferences");
|
|
Intrinsics.checkNotNullParameter(migratingKeysMapping, "migratingKeysMapping");
|
|
Intrinsics.checkNotNullParameter(listOfDoubles, "listOfDoubles");
|
|
this.a = tjKeyValueStorage;
|
|
this.b = migratingPreferences;
|
|
this.c = migratingKeysMapping;
|
|
this.d = listOfDoubles;
|
|
}
|
|
|
|
public final void a(String str, Object obj) {
|
|
if (this.b.contains(str)) {
|
|
Object valueOf = obj instanceof Boolean ? Boolean.valueOf(this.b.getBoolean(str, false)) : obj instanceof Float ? Float.valueOf(this.b.getFloat(str, 0.0f)) : obj instanceof Integer ? Integer.valueOf(this.b.getInt(str, 0)) : obj instanceof Long ? Long.valueOf(this.b.getLong(str, 0L)) : obj instanceof String ? this.b.getString(str, null) : null;
|
|
String str2 = (String) this.c.get(str);
|
|
if (str2 == null) {
|
|
str2 = str;
|
|
}
|
|
if (valueOf != null) {
|
|
try {
|
|
if (this.d.contains(str)) {
|
|
this.a.setValue(str2, Double.valueOf(Double.parseDouble(valueOf.toString())));
|
|
} else {
|
|
this.a.setValue(str2, valueOf);
|
|
}
|
|
} catch (IllegalArgumentException unused) {
|
|
Log.e("TJPreferencesMigration", "Failed to migrate key: " + str);
|
|
}
|
|
}
|
|
this.b.edit().remove(str).apply();
|
|
}
|
|
}
|
|
|
|
public final void migrateAllKeysIfExists() {
|
|
Map<String, ?> all = this.b.getAll();
|
|
if (all != null) {
|
|
for (Map.Entry<String, ?> entry : all.entrySet()) {
|
|
if (this.c.containsKey(entry.getKey())) {
|
|
String key = entry.getKey();
|
|
Intrinsics.checkNotNullExpressionValue(key, "<get-key>(...)");
|
|
a(key, entry.getValue());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|