2022-09-23 11:55:44 +08:00
|
|
|
|
package cn.trans88.taxiappkotlin;
|
|
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
import android.util.Log;
|
|
|
|
|
|
2023-08-09 14:01:24 +08:00
|
|
|
|
import com.google.gson.Gson;
|
|
|
|
|
|
|
|
|
|
import cn.trans88.taxiappkotlin.logic.model.BackgroundType;
|
2023-09-01 16:13:32 +08:00
|
|
|
|
import cn.trans88.taxiappkotlin.util.DateUtil;
|
2022-09-23 11:55:44 +08:00
|
|
|
|
import cn.trans88.taxiappkotlin.util.YoungUtil;
|
|
|
|
|
|
|
|
|
|
public class Configurations {
|
|
|
|
|
private Context context;
|
|
|
|
|
|
|
|
|
|
private static Configurations cfg;
|
|
|
|
|
private Configurations(Context c){
|
|
|
|
|
context = c;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Configurations config(Context c){
|
|
|
|
|
if(cfg == null)
|
|
|
|
|
cfg = new Configurations(c);
|
|
|
|
|
return cfg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//将老的cn.trans88.taxiappkotlin.logic.Settings
|
|
|
|
|
public void init(){
|
2023-05-04 11:08:30 +08:00
|
|
|
|
|
2022-09-23 11:55:44 +08:00
|
|
|
|
boolean init = context.getSharedPreferences("config", Context.MODE_PRIVATE).getBoolean("init", false);
|
|
|
|
|
if(init) return;
|
|
|
|
|
|
|
|
|
|
boolean firstReg = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getBoolean("isFirstRegister", true);
|
|
|
|
|
if(firstReg){
|
|
|
|
|
YoungUtil.YoungLog("first register");
|
|
|
|
|
YoungUtil.YoungLog("cannot read file :cn.trans88.taxiappkotlin.logic.Settings");
|
|
|
|
|
registerTokenSave("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50X2lkIjoiNWY4OTNiODE1NzIzMDk0YWQzZmM5MTI0IiwiZ3JvdXBfaWQiOiI1Zjg5M2I4MTU3MjMwOTRhZDNmYzkxMjYiLCJ1c2VyX2lkIjoiNWY4OTNiODE1NzIzMDk0YWQzZmM5MTI1In0.o2M6CE2yFi7dvjILb485sQF436eMDdKwzTryK4rw3W0");
|
|
|
|
|
appTokenSave("");
|
|
|
|
|
companySave(TaxiApp.Companion.getSANLE());
|
|
|
|
|
syncSave(true);
|
|
|
|
|
logServiceUrlSave("http://taxihub.cn:2348/");
|
|
|
|
|
connServiceUrlSave("");
|
|
|
|
|
screenSizeXSave(160);
|
|
|
|
|
screenSizeYSave(64);
|
|
|
|
|
taxiInfoSave("");
|
|
|
|
|
cardIdSave( "");
|
|
|
|
|
taxiServiceUrlSave( "");
|
|
|
|
|
downloadUrlSave( "");
|
|
|
|
|
accountIdSave( "");
|
|
|
|
|
taxiBaseUrlSave("http://taxihub.cn:2346/");
|
|
|
|
|
isDeleteOldAdvitiseSave( false);
|
|
|
|
|
isFirstRegisterSave(true);
|
|
|
|
|
enableWriteLogSave( false);
|
|
|
|
|
advertiseOrderSave( "");
|
2023-04-14 10:43:59 +08:00
|
|
|
|
loggerSwitchSave(false);
|
|
|
|
|
gpsSwitchSave(false);
|
2022-09-23 11:55:44 +08:00
|
|
|
|
upload_debug_file_urlSave("http://taxihub.cn:2345/postDebugFile");
|
2023-09-01 16:13:32 +08:00
|
|
|
|
|
|
|
|
|
//edit by ljh @2023/8/14
|
|
|
|
|
TaxiApp taxiApp = (TaxiApp) TaxiApp.Companion.instance();
|
|
|
|
|
taxiApp.getDaoAds().clear();
|
|
|
|
|
taxiApp.getRegionsList().clear();
|
|
|
|
|
|
|
|
|
|
//edit by ljh @2023/8/22
|
|
|
|
|
// taxiApp.saveLog("第一次注册清空了播放列表数据,first register clear play order.");
|
2022-09-23 11:55:44 +08:00
|
|
|
|
}else{
|
|
|
|
|
YoungUtil.YoungLog("copy configurations");
|
|
|
|
|
YoungUtil.YoungLog("read file :cn.trans88.taxiappkotlin.logic.Settings OK");
|
|
|
|
|
String registerToken = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getString("registerToken", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50X2lkIjoiNWY4OTNiODE1NzIzMDk0YWQzZmM5MTI0IiwiZ3JvdXBfaWQiOiI1Zjg5M2I4MTU3MjMwOTRhZDNmYzkxMjYiLCJ1c2VyX2lkIjoiNWY4OTNiODE1NzIzMDk0YWQzZmM5MTI1In0.o2M6CE2yFi7dvjILb485sQF436eMDdKwzTryK4rw3W0");
|
|
|
|
|
String appToken = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getString("appToken", "");
|
|
|
|
|
String company = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getString("company", TaxiApp.Companion.getSANLE());
|
|
|
|
|
boolean sync = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getBoolean("sync", true);
|
|
|
|
|
String logServiceUrl = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getString("logServiceUrl", "http://taxihub.cn:2348/");
|
|
|
|
|
String connServiceUrl = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getString("connServiceUrl", "");
|
|
|
|
|
int x = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getInt("screenSizeX", 160);
|
|
|
|
|
int y = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getInt("screenSizeY", 64);
|
|
|
|
|
String taxiInfo = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getString("taxiInfo", "");
|
|
|
|
|
String cardId = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getString("cardId", "");
|
|
|
|
|
String taxiServiceUrl = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getString("taxiServiceUrl", "");
|
|
|
|
|
String downloadUrl = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getString("downloadUrl", "");
|
|
|
|
|
String accountId = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getString("accountId", "");
|
|
|
|
|
String taxiBaseUrl = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getString("taxiBaseUrl", "http://taxihub.cn:2346/");
|
|
|
|
|
boolean isDeleteOldAdvitise = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getBoolean("isDeleteOldAdvitise", false);
|
|
|
|
|
boolean isFirstRegister = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getBoolean("isFirstRegister", true);
|
|
|
|
|
boolean enableWriteLog = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getBoolean("enableWriteLog", false);
|
|
|
|
|
boolean loggerSwitch = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getBoolean("loggerSwitch", true);
|
|
|
|
|
boolean gpsSwitch = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getBoolean("gpsSwitch", true);
|
|
|
|
|
String upload_debug_file_url = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getString("upload_debug_file_url", "http://taxihub.cn:2345/postDebugFile");
|
|
|
|
|
String advertiseOrder = context.getSharedPreferences("cn.trans88.taxiappkotlin.logic.Settings", Context.MODE_PRIVATE).getString("advertiseOrder", "");
|
|
|
|
|
|
|
|
|
|
/*YoungUtil.YoungLog("yzd", registerToken);
|
|
|
|
|
YoungUtil.YoungLog("yzd", appToken);
|
|
|
|
|
YoungUtil.YoungLog("yzd", company);
|
|
|
|
|
YoungUtil.YoungLog("yzd", "" +sync);
|
|
|
|
|
YoungUtil.YoungLog("yzd", logServiceUrl);
|
|
|
|
|
YoungUtil.YoungLog("yzd", connServiceUrl);
|
|
|
|
|
YoungUtil.YoungLog("yzd", "" +x);
|
|
|
|
|
YoungUtil.YoungLog("yzd", "" + y);
|
|
|
|
|
YoungUtil.YoungLog("yzd", taxiInfo);
|
|
|
|
|
YoungUtil.YoungLog("yzd", cardId);
|
|
|
|
|
YoungUtil.YoungLog("yzd", taxiServiceUrl);
|
|
|
|
|
YoungUtil.YoungLog("yzd", downloadUrl);
|
|
|
|
|
YoungUtil.YoungLog("yzd", accountId);
|
|
|
|
|
YoungUtil.YoungLog("yzd", taxiBaseUrl);
|
|
|
|
|
YoungUtil.YoungLog("yzd", "" + isDeleteOldAdvitise);
|
|
|
|
|
YoungUtil.YoungLog("yzd", "" + isFirstRegister);
|
|
|
|
|
YoungUtil.YoungLog("yzd", "" + enableWriteLog);
|
|
|
|
|
YoungUtil.YoungLog("yzd", advertiseOrder);
|
|
|
|
|
YoungUtil.YoungLog("yzd", "" + loggerSwitch);
|
|
|
|
|
YoungUtil.YoungLog("yzd", "" + gpsSwitch);
|
|
|
|
|
YoungUtil.YoungLog("yzd", "" + upload_debug_file_url);
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
registerTokenSave(registerToken);
|
|
|
|
|
appTokenSave(appToken);
|
|
|
|
|
companySave(company);
|
|
|
|
|
syncSave(sync);
|
|
|
|
|
logServiceUrlSave(logServiceUrl);
|
|
|
|
|
connServiceUrlSave(connServiceUrl);
|
|
|
|
|
screenSizeXSave(x);
|
|
|
|
|
screenSizeYSave(y);
|
|
|
|
|
taxiInfoSave(taxiInfo);
|
|
|
|
|
cardIdSave(cardId);
|
|
|
|
|
taxiServiceUrlSave(taxiServiceUrl);
|
|
|
|
|
downloadUrlSave(downloadUrl);
|
|
|
|
|
accountIdSave(accountId);
|
|
|
|
|
taxiBaseUrlSave(taxiBaseUrl);
|
|
|
|
|
isDeleteOldAdvitiseSave(isDeleteOldAdvitise);
|
|
|
|
|
isFirstRegisterSave(isFirstRegister);
|
|
|
|
|
enableWriteLogSave(enableWriteLog);
|
|
|
|
|
advertiseOrderSave(advertiseOrder);
|
|
|
|
|
loggerSwitchSave(loggerSwitch);
|
|
|
|
|
gpsSwitchSave(gpsSwitch);
|
|
|
|
|
upload_debug_file_urlSave(upload_debug_file_url);
|
|
|
|
|
}
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putBoolean("init", true).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String registerToken(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("registerToken", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50X2lkIjoiNWY4OTNiODE1NzIzMDk0YWQzZmM5MTI0IiwiZ3JvdXBfaWQiOiI1Zjg5M2I4MTU3MjMwOTRhZDNmYzkxMjYiLCJ1c2VyX2lkIjoiNWY4OTNiODE1NzIzMDk0YWQzZmM5MTI1In0.o2M6CE2yFi7dvjILb485sQF436eMDdKwzTryK4rw3W0");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void registerTokenSave(String s){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("registerToken", s).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String appToken(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("appToken", "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void appTokenSave(String s){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("appToken", s).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String company(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("company", TaxiApp.Companion.getSANLE());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void companySave(String s){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("company", s).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean sync(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getBoolean("sync", true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void syncSave(Boolean b){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putBoolean("sync", b).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String logServiceUrl(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("logServiceUrl", "http://taxihub.cn:2348/");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void logServiceUrlSave(String s){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("logServiceUrl", s).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String connServiceUrl(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("connServiceUrl", "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void connServiceUrlSave(String s){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("connServiceUrl", s).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int screenSizeX(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getInt("screenSizeX", 160);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void screenSizeXSave(int x){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putInt("screenSizeX", x).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int screenSizeY(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getInt("screenSizeY", 64);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void screenSizeYSave(int y){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putInt("screenSizeY", y).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String taxiInfo(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("taxiInfo", "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void taxiInfoSave(String s){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("taxiInfo", s).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String cardId(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("cardId", "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void cardIdSave(String s){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("cardId", s).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String taxiServiceUrl(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("taxiServiceUrl", "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void taxiServiceUrlSave(String s){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("taxiServiceUrl", s).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String downloadUrl(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("downloadUrl", "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void downloadUrlSave(String s){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("downloadUrl", s).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String accountId(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("accountId", "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void accountIdSave(String s){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("accountId", s).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String taxiBaseUrl(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("taxiBaseUrl", "http://taxihub.cn:2346/");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void taxiBaseUrlSave(String s){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("taxiBaseUrl", s).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isDeleteOldAdvitise(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getBoolean("isDeleteOldAdvitise", false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void isDeleteOldAdvitiseSave(boolean b){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putBoolean("isDeleteOldAdvitise", b).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isFirstRegister(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getBoolean("isFirstRegister", true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void isFirstRegisterSave(boolean b){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putBoolean("isFirstRegister", b).apply();
|
|
|
|
|
}
|
|
|
|
|
public boolean enableWriteLog(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getBoolean("enableWriteLog", false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void enableWriteLogSave(boolean b){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putBoolean("enableWriteLog", b).apply();
|
|
|
|
|
}
|
|
|
|
|
public boolean loggerSwitch(){
|
2023-06-29 16:46:18 +08:00
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getBoolean("loggerSwitch", true);
|
2022-09-23 11:55:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void loggerSwitchSave(boolean b){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putBoolean("loggerSwitch", b).apply();
|
|
|
|
|
}
|
|
|
|
|
public boolean gpsSwitch(){
|
2023-06-29 16:46:18 +08:00
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getBoolean("gpsSwitch", true);
|
2022-09-23 11:55:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void gpsSwitchSave(boolean b){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putBoolean("gpsSwitch", b).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String advertiseOrder(){
|
2023-09-01 16:13:32 +08:00
|
|
|
|
String adOrder = context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("advertiseOrder", "");
|
|
|
|
|
return adOrder != null ? adOrder : "";
|
2022-09-23 11:55:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void advertiseOrderSave(String s){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("advertiseOrder", s).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String upload_debug_file_url(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("upload_debug_file_url", "http://lichenplatform:2345/postDebugFile");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void upload_debug_file_urlSave(String s){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("upload_debug_file_url", s).apply();
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-11 16:48:52 +08:00
|
|
|
|
/**
|
|
|
|
|
* 当前TaxiApp播放的是否是定时广告
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public Boolean isTimedAdvertise(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getBoolean("isTimedAdvertise", false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 当前TaxiApp播放的是否是定时广告
|
|
|
|
|
* @param s
|
|
|
|
|
*/
|
|
|
|
|
public void isTimedAdvertiseSave(Boolean s){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putBoolean("isTimedAdvertise", s).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String timedAdList(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("timedAdList", "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void timedAdListSave(String s){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("timedAdList", s).apply();
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-29 16:46:18 +08:00
|
|
|
|
public boolean isFirstInstalled(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getBoolean("isFirstInstalled", true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void isFirstInstalledSave(boolean b){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putBoolean("isFirstInstalled", b).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String backgroundType(){
|
2023-08-09 14:01:24 +08:00
|
|
|
|
TaxiApp taxiApp = (TaxiApp) TaxiApp.Companion.instance();
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("backgroundType", taxiApp.getDefaultBackgroundType());
|
2023-06-29 16:46:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void backgroundTypeSave(String s){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("backgroundType", s).apply();
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-09 14:01:24 +08:00
|
|
|
|
public boolean isCustomLogo(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getBoolean("isCustomLogo", false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void isCustomLogoSave(Boolean b){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putBoolean("isCustomLogo", b).apply();
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-17 15:09:43 +08:00
|
|
|
|
/**
|
|
|
|
|
* taxiApp开始运行时间
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public long startRunTime(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getLong("startRunTime",0L);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void startRunTimeSave(Long startTime){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putLong("startRunTime", startTime).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* taxiApp结束运行时间
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public long endRunTime(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getLong("endRunTime",0L);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void endRunTimeSave(Long startTime){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putLong("endRunTime", startTime).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* taxiApp当天总的运行时间
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public long sumRunTime(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getLong("sumRunTime",0L);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void sumRunTimeSave(Long startTime){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putLong("sumRunTime", startTime).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String runtimeJsonString(){
|
|
|
|
|
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("runtimeJsonString", "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void runtimeJsonStringSave(String s){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("runtimeJsonString", s).apply();
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-12 16:29:08 +08:00
|
|
|
|
public String logSummaryJsonString(){
|
|
|
|
|
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("logSummaryJsonString", "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void logSummaryJsonStringSave(String s){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("logSummaryJsonString", s).apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* taxiApp当天第一次运行时间
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public long firstRunTime(){
|
|
|
|
|
long defaultValue = System.currentTimeMillis();
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getLong("firstRunTime",defaultValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void firstRunTimeSave(Long runTime){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putLong("firstRunTime", runTime).apply();
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-13 15:43:00 +08:00
|
|
|
|
/**
|
|
|
|
|
* 日志概要上传的周期,默认一天传一次,单位分钟
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public int logInterval(){
|
|
|
|
|
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getInt("logInterval", 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void logIntervalSave(int x){
|
|
|
|
|
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putInt("screenSizeX", x).apply();
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-23 11:55:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|