28 lines
1.0 KiB
Java
28 lines
1.0 KiB
Java
|
package com.google.firebase.crashlytics.internal.settings;
|
||
|
|
||
|
import com.google.firebase.crashlytics.internal.common.CurrentTimeProvider;
|
||
|
import com.google.firebase.crashlytics.internal.settings.model.SettingsData;
|
||
|
import org.json.JSONException;
|
||
|
import org.json.JSONObject;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public class SettingsJsonParser {
|
||
|
private final CurrentTimeProvider currentTimeProvider;
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public SettingsJsonParser(CurrentTimeProvider currentTimeProvider) {
|
||
|
this.currentTimeProvider = currentTimeProvider;
|
||
|
}
|
||
|
|
||
|
public SettingsData parseSettingsJson(JSONObject jSONObject) throws JSONException {
|
||
|
return getJsonTransformForVersion(jSONObject.getInt("settings_version")).buildFromJson(this.currentTimeProvider, jSONObject);
|
||
|
}
|
||
|
|
||
|
private static SettingsJsonTransform getJsonTransformForVersion(int i) {
|
||
|
if (i == 3) {
|
||
|
return new SettingsV3JsonTransform();
|
||
|
}
|
||
|
return new DefaultSettingsJsonTransform();
|
||
|
}
|
||
|
}
|