package setting; import android.content.Context; import android.content.SharedPreferences; import c.e.b.a; import com.player.activity.MyApplication; public class MySettings { public static MySettings mySettings; public final String CATEGORY_INDEX = "CATEGORY_INDEX"; public final String CHANNEL_INDEX = "CHANNEL_INDEX"; public SharedPreferences.Editor ed; public SharedPreferences sp; static { System.loadLibrary("player"); } public MySettings(Context context) { SharedPreferences sharedPreferences = context.getSharedPreferences("XLIVE", 0); this.sp = sharedPreferences; this.ed = sharedPreferences.edit(); mySettings = this; } public static MySettings get() { if (mySettings == null) { mySettings = new MySettings(MyApplication.f1989b); } return mySettings; } public String a() { return this.sp.getString("EPG_URL", "http://diyp.112114.xyz"); } public native String b(); public native String c(); public void clearAppointment() { this.ed.putLong("APPOINTMENTTS", 0); this.ed.commit(); } public void clearSettings() { this.ed.clear(); this.ed.commit(); } public void d(String str) { this.ed.putString("EPG_URL", str); this.ed.commit(); } public native String d1(); public native String d1k(); public native String d2(); public native String d2k(); public long getAppointTs() { return this.sp.getLong("APPOINTMENTTS", 0); } public int getAppointment(int i) { SharedPreferences sharedPreferences = this.sp; return sharedPreferences.getInt("APPOINTMENT" + i, 0); } public int getCategoryIndex() { return this.sp.getInt("CATEGORY_INDEX", 1); } public int getChannelIndex() { return this.sp.getInt("CHANNEL_INDEX", 0); } public int getChannelListStyle() { return this.sp.getInt("列表风格", 0); } public String getChannelUrl() { return this.sp.getString("CHANNEL_URL", "请输入节目地址"); } public String getExitPng() { return this.sp.getString("ExitSplashPng", "请输入退出图片地址"); } public int getMediaCodec() { return this.sp.getInt("解码方式", 1); } public String getProvince() { return this.sp.getString("省份选择", "河南"); } public int getScreenScale() { return this.sp.getInt("画面比例", 0); } public long getSeekPos(String str) { SharedPreferences sharedPreferences = this.sp; return sharedPreferences.getLong("SEEK_POST_" + str, 0); } public String getSplashPng() { return this.sp.getString("SplashPng", "请输入启动背景地址"); } public int getTimeOut() { return this.sp.getInt("超时换源", 1); } public int getUrlIndex(a aVar) { SharedPreferences sharedPreferences = this.sp; StringBuilder a = c.b.a.a.a.a("线路选择"); a.append(aVar.f1788d); a.append(aVar.f1786b); return sharedPreferences.getInt(a.toString(), 0); } public String getUserAgent() { return this.sp.getString("UserAgent", ""); } public boolean isCategoryHide(String str) { SharedPreferences sharedPreferences = this.sp; return sharedPreferences.getBoolean("HIDE_" + str, false); } public boolean isChannelFavored(a aVar) { SharedPreferences sharedPreferences = this.sp; StringBuilder a = c.b.a.a.a.a("FAVOR"); a.append(aVar.f1788d); a.append("/"); a.append(aVar.f1786b); return sharedPreferences.getBoolean(a.toString(), false); } public boolean isChannelNumHide() { return this.sp.getBoolean("HIDE_CHANNEL_NUM", false); } public boolean isEpg() { return this.sp.getBoolean("is_Epg", true); } public boolean isEyeProtectMode() { return this.sp.getBoolean("护眼模式", false); } public boolean isQuickExitStyle() { return this.sp.getBoolean("快速退出", false); } public boolean isRememberPlay() { return this.sp.getBoolean("REMBER_PLAY", false); } public boolean isRememberURLIndex() { return this.sp.getBoolean("记忆多源", true); } public boolean isReverseSwitchStyle() { return this.sp.getBoolean("换台反转", false); } public boolean isShiJiListStyle() { return this.sp.getBoolean("传统列表", false); } public boolean isShowEpgList() { return this.sp.getBoolean("EPG功能", true); } public boolean isShowNetSpeed() { return this.sp.getBoolean("显示网速", false); } public boolean isShowSeekBack() { return this.sp.getBoolean("开启时移", true); } public boolean isShowTime() { return this.sp.getBoolean("显示时间", false); } public boolean isShowback() { return this.sp.getBoolean("回看列表", true); } public void isShowbackStyle() { this.ed.putBoolean("回看列表", !isShowback()); this.ed.commit(); } public boolean isStartAtPowerOn() { return this.sp.getBoolean("开机自启", false); } public boolean isSwitchChannelInAll() { return this.sp.getBoolean("跨选分类", false); } public boolean isUseP2P() { return this.sp.getBoolean("玩转原力", false); } public boolean isUseWebDiy() { return this.sp.getBoolean("开启传源", false); } public void saveAppointmentChannel(int i, int i2, int i3, int i4, long j) { this.ed.putInt("APPOINTMENT1", i); this.ed.putInt("APPOINTMENT2", i2); this.ed.putInt("APPOINTMENT3", i3); this.ed.putInt("APPOINTMENT4", i4); this.ed.putLong("APPOINTMENTTS", j); this.ed.commit(); } public void saveCategoryIndex(int i) { this.ed.putInt("CATEGORY_INDEX", i); this.ed.commit(); } public void saveChannelIndex(int i) { this.ed.putInt("CHANNEL_INDEX", i); this.ed.commit(); } public void saveChannelListStyle(int i) { this.ed.putInt("列表风格", i); this.ed.commit(); } public void saveChannelUrl(String str) { this.ed.putString("CHANNEL_URL", str); this.ed.commit(); } public void saveExitSplashPng(String str) { this.ed.putString("ExitSplashPng", str); this.ed.commit(); } public void saveMediaCodec(int i) { this.ed.putInt("解码方式", i); this.ed.commit(); } public void saveProvince(String str) { this.ed.putString("省份选择", str); this.ed.commit(); } public void saveScreenScale(int i) { this.ed.putInt("画面比例", i); this.ed.commit(); } public void saveSeekPos(String str, long j) { SharedPreferences.Editor editor = this.ed; editor.putLong("SEEK_POST_" + str, j); this.ed.commit(); } public void saveSplashPng(String str) { this.ed.putString("SplashPng", str); this.ed.commit(); } public void saveTimeOut(int i) { this.ed.putInt("超时换源", i); this.ed.commit(); } public void saveUrlIndex(a aVar, int i) { SharedPreferences.Editor editor = this.ed; StringBuilder a = c.b.a.a.a.a("线路选择"); a.append(aVar.f1788d); a.append(aVar.f1786b); editor.putInt(a.toString(), i); this.ed.commit(); } public void saveUserAgent(String str) { this.ed.putString("UserAgent", str); this.ed.commit(); } public void setFavoredChannel(a aVar) { SharedPreferences.Editor editor = this.ed; StringBuilder a = c.b.a.a.a.a("FAVOR"); a.append(aVar.f1788d); a.append("/"); a.append(aVar.f1786b); editor.putBoolean(a.toString(), !isChannelFavored(aVar)); this.ed.commit(); } public void setFavoredChannel(a aVar, boolean z) { SharedPreferences.Editor editor = this.ed; StringBuilder a = c.b.a.a.a.a("FAVOR"); a.append(aVar.f1788d); a.append("/"); a.append(aVar.f1786b); editor.putBoolean(a.toString(), z); this.ed.commit(); } public void toggleExitStyle() { this.ed.putBoolean("快速退出", !isQuickExitStyle()); this.ed.commit(); } public void toggleEyeProtectMode() { this.ed.putBoolean("护眼模式", !isEyeProtectMode()); this.ed.commit(); } public void toggleHideCategory(String str) { this.ed.putBoolean(c.b.a.a.a.a("HIDE_", str), !isCategoryHide(str)); this.ed.commit(); } public void toggleHideChannelNum() { this.ed.putBoolean("HIDE_CHANNEL_NUM", !isChannelNumHide()); this.ed.commit(); } public void toggleHideisEpg() { this.ed.putBoolean("is_Epg", !isEpg()); this.ed.commit(); } public void toggleRememberPlay() { this.ed.putBoolean("REMBER_PLAY", !isRememberPlay()); this.ed.commit(); } public void toggleRememberURLIndex() { this.ed.putBoolean("记忆多源", !isRememberURLIndex()); this.ed.commit(); } public void toggleShiJiListStyle() { this.ed.putBoolean("传统列表", !isShiJiListStyle()); this.ed.commit(); } public void toggleShowEpgList() { this.ed.putBoolean("EPG功能", !isShowEpgList()); this.ed.commit(); } public void toggleShowNetSpeed() { this.ed.putBoolean("显示网速", !isShowNetSpeed()); this.ed.commit(); } public void toggleShowSeekBack() { this.ed.putBoolean("开启时移", !isShowSeekBack()); this.ed.commit(); } public void toggleShowTime() { this.ed.putBoolean("显示时间", !isShowTime()); this.ed.commit(); } public void toggleStartAtPowerOn() { this.ed.putBoolean("开机自启", !isStartAtPowerOn()); this.ed.commit(); } public void toggleSwitchChannelInAll() { this.ed.putBoolean("跨选分类", !isSwitchChannelInAll()); this.ed.commit(); } public void toggleSwitchStyle() { this.ed.putBoolean("换台反转", !isReverseSwitchStyle()); this.ed.commit(); } public void toggleUseP2p() { this.ed.putBoolean("玩转原力", !isUseP2P()); this.ed.commit(); } public void toggleUseWebDiy() { this.ed.putBoolean("开启传源", !isUseWebDiy()); this.ed.commit(); } }