package com.baidu.liantian.x0.f; import android.content.Context; import android.content.SharedPreferences; import android.text.TextUtils; import com.baidu.liantian.x0.a.e; import org.json.JSONObject; /* compiled from: Preferences */ public class a { private SharedPreferences a; private SharedPreferences.Editor b; private Context c; public a(Context context) { try { this.c = context; SharedPreferences sharedPreferences = context.getSharedPreferences("ltgzpfc", 4); this.a = sharedPreferences; this.b = sharedPreferences.edit(); } catch (Throwable th) { e.a(th); } } public void a(String str, String str2) { this.b.putString(str, str2); this.b.commit(); } public String a(String str) { return this.a.getString(str, ""); } public void b(String str, String str2) { this.b.putString(str, str2); this.b.commit(); } public String b(String str) { return this.a.getString(str, ""); } public void a(int i) { this.b.putInt("rst", i); this.b.commit(); } public void a(boolean z) { this.b.putBoolean("hac", z); this.b.commit(); } public void b(boolean z) { this.b.putBoolean("upcu_c", z); this.b.commit(); } public void c(boolean z) { this.b.putBoolean("s_ph_pl", z); this.b.putLong("s_p_p_t", System.currentTimeMillis()); this.b.commit(); } public void c(String str) { this.b.putString("se-s-v", str); this.b.commit(); } public int a() { JSONObject optJSONObject; try { String a2 = a("plc03"); if (!TextUtils.isEmpty(a2) && (optJSONObject = new JSONObject(a2).optJSONObject("5")) != null) { return optJSONObject.optInt("1", 1); } } catch (Throwable th) { e.a(th); } return 1; } public void b(int i) { this.b.putInt("cloud_sw", i); this.b.commit(); } public boolean b() { return this.a.getInt("cloud_sw", 0) == 1; } public void c(int i) { this.b.putInt("wm_d_c_s", i); this.b.commit(); } public void d(int i) { this.b.putInt("wm_in_ma_cco", i); this.b.commit(); } public String c() { return this.a.getString("u_c_s", ""); } }