package com.tbmob; import android.content.Context; import android.content.SharedPreferences; public class SPUtils { public static boolean getTbInitState(Context context) { if (context == null) { return false; } return context.getSharedPreferences("tb_sp", 0).getBoolean("initState", false); } public static void setTbInitState(Context context, boolean z) { if (context != null) { SharedPreferences.Editor edit = context.getSharedPreferences("tb_sp", 0).edit(); edit.putBoolean("initState", z); edit.apply(); } } public static String getGdtPackageName(Context context) { if (context == null) { return ""; } return context.getSharedPreferences("tb_sp", 0).getString("GdtPackageName", ""); } public static void setGdtPackageName(Context context, String str) { if (context != null) { SharedPreferences.Editor edit = context.getSharedPreferences("tb_sp", 0).edit(); edit.putString("GdtPackageName", str); edit.commit(); } } }