package f7; import android.content.Context; import android.content.SharedPreferences; import com.google.android.gms.ads.RequestConfiguration; /* loaded from: classes2.dex */ public abstract class l { public static boolean a(Context context, String str) { if (context != null) { try { if (context.getPackageName() != null) { return context.getSharedPreferences(context.getPackageName(), 0).getBoolean(str, false); } } catch (Exception unused) { } } return false; } public static float b(Context context) { if (context != null) { try { if (context.getPackageName() != null) { return context.getSharedPreferences(context.getPackageName(), 0).getFloat("Key.ENDING_POPPUP_DIM_ALPHA", -1.0f); } } catch (Exception unused) { } } return -1.0f; } public static int c(Context context, String str) { if (context != null) { try { if (context.getPackageName() != null) { return context.getSharedPreferences(context.getPackageName(), 0).getInt(str, 0); } } catch (Exception unused) { } } return 0; } public static long d(Context context, String str) { if (context != null) { try { if (context.getPackageName() != null) { return context.getSharedPreferences(context.getPackageName(), 0).getLong(str, 0L); } } catch (Exception unused) { } } return 0L; } public static String e(Context context, String str) { if (context != null) { try { if (context.getPackageName() != null) { return context.getSharedPreferences(context.getPackageName(), 0).getString(str, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); } } catch (Exception unused) { } } return RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; } public static void f(Context context, String str, boolean z10) { if (context == null || context.getPackageName() == null) { return; } SharedPreferences.Editor edit = context.getSharedPreferences(context.getPackageName(), 0).edit(); edit.putBoolean(str, z10); edit.commit(); } public static void g(Context context, String str, int i10) { if (context == null || context.getPackageName() == null) { return; } SharedPreferences.Editor edit = context.getSharedPreferences(context.getPackageName(), 0).edit(); edit.putInt(str, i10); edit.commit(); } public static void h(Context context, String str, long j10) { if (context != null) { try { if (context.getPackageName() == null) { return; } SharedPreferences.Editor edit = context.getSharedPreferences(context.getPackageName(), 0).edit(); edit.putLong(str, j10); edit.commit(); } catch (Exception unused) { } } } public static void i(Context context, String str, String str2) { if (context != null) { try { if (context.getPackageName() == null) { return; } SharedPreferences.Editor edit = context.getSharedPreferences(context.getPackageName(), 0).edit(); edit.putString(str, str2); edit.commit(); } catch (Exception unused) { } } } }