version:3.3
fix: update:对接最新接口,分管理员配置和用户配置
This commit is contained in:
@@ -67,8 +67,8 @@ android {
|
|||||||
productFlavors {
|
productFlavors {
|
||||||
beta {
|
beta {
|
||||||
flavorDimensions "default"
|
flavorDimensions "default"
|
||||||
versionCode 22
|
versionCode 24
|
||||||
versionName "3.1"
|
versionName "3.3"
|
||||||
}
|
}
|
||||||
|
|
||||||
official {
|
official {
|
||||||
|
|||||||
27
app/src/main/java/com/uiui/sn/bean/SystemSettingsSet.java
Normal file
27
app/src/main/java/com/uiui/sn/bean/SystemSettingsSet.java
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
package com.uiui.sn.bean;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class SystemSettingsSet implements Serializable {
|
||||||
|
private static final long serialVersionUID = 2102990332552652787L;
|
||||||
|
|
||||||
|
SystemSettings user;
|
||||||
|
SystemSettings admin;
|
||||||
|
|
||||||
|
public SystemSettings getUser() {
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser(SystemSettings user) {
|
||||||
|
this.user = user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SystemSettings getAdmin() {
|
||||||
|
return admin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAdmin(SystemSettings admin) {
|
||||||
|
this.admin = admin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -89,6 +89,11 @@ public class ControlManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setSystemSetting(SystemSettings userSystemSettings, SystemSettings adminSystemSettings) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setSystemSetting(SystemSettings systemSettings) {
|
public void setSystemSetting(SystemSettings systemSettings) {
|
||||||
if (systemSettings == null) {
|
if (systemSettings == null) {
|
||||||
Log.e(TAG, "setSystemSetting: SystemSettings is NULL");
|
Log.e(TAG, "setSystemSetting: SystemSettings is NULL");
|
||||||
@@ -119,8 +124,8 @@ public class ControlManager {
|
|||||||
Log.e("setDisableSetting", "Close all settings: ");
|
Log.e("setDisableSetting", "Close all settings: ");
|
||||||
setUSBstate(1);
|
setUSBstate(1);
|
||||||
setPhoneList(1);
|
setPhoneList(1);
|
||||||
setBluetooth(1);
|
setBluetooth(0);
|
||||||
setHotspot(1);
|
setHotspot(0);
|
||||||
setCamera(1);
|
setCamera(1);
|
||||||
setTF(1);
|
setTF(1);
|
||||||
setIcon(1);
|
setIcon(1);
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import com.uiui.sn.bean.CloudLessonSetting;
|
|||||||
import com.uiui.sn.bean.Label;
|
import com.uiui.sn.bean.Label;
|
||||||
import com.uiui.sn.bean.SnInfo;
|
import com.uiui.sn.bean.SnInfo;
|
||||||
import com.uiui.sn.bean.SystemSettings;
|
import com.uiui.sn.bean.SystemSettings;
|
||||||
|
import com.uiui.sn.bean.SystemSettingsSet;
|
||||||
import com.uiui.sn.bean.UserAvatarInfo;
|
import com.uiui.sn.bean.UserAvatarInfo;
|
||||||
import com.uiui.sn.bean.browser.BrowserApiData;
|
import com.uiui.sn.bean.browser.BrowserApiData;
|
||||||
import com.uiui.sn.bean.browser.BrowserBean;
|
import com.uiui.sn.bean.browser.BrowserBean;
|
||||||
@@ -146,6 +147,9 @@ public class NetInterfaceManager {
|
|||||||
public static final String CUSTOM_REPEAT_REQ_PROTOCOL = "MY_CUSTOM_REPEAT_REQ_PROTOCOL";
|
public static final String CUSTOM_REPEAT_REQ_PROTOCOL = "MY_CUSTOM_REPEAT_REQ_PROTOCOL";
|
||||||
|
|
||||||
private NetInterfaceManager(Context context) {
|
private NetInterfaceManager(Context context) {
|
||||||
|
if (context == null) {
|
||||||
|
throw new RuntimeException("Context is NULL");
|
||||||
|
}
|
||||||
this.mContext = context;
|
this.mContext = context;
|
||||||
this.crv = mContext.getContentResolver();
|
this.crv = mContext.getContentResolver();
|
||||||
this.cacheHelper = new CacheHelper(mContext);
|
this.cacheHelper = new CacheHelper(mContext);
|
||||||
@@ -277,7 +281,7 @@ public class NetInterfaceManager {
|
|||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<BaseResponse<SystemSettings>> getsettingControl() {
|
public Observable<BaseResponse<SystemSettingsSet>> getsettingControl() {
|
||||||
return mRetrofit.create(Setting.class)
|
return mRetrofit.create(Setting.class)
|
||||||
.getSetting(Utils.getSerial())
|
.getSetting(Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
@@ -700,13 +704,13 @@ public class NetInterfaceManager {
|
|||||||
this.add("com.uiui.health");
|
this.add("com.uiui.health");
|
||||||
this.add("com.uiui.city");
|
this.add("com.uiui.city");
|
||||||
//扶小鹰
|
//扶小鹰
|
||||||
this.add("com.fuying.fuxiaoying");
|
this.add(JGYUtils.gkwxhd);
|
||||||
this.add("com.zhiduoke.fxy");
|
this.add(JGYUtils.fuxiaoying);
|
||||||
this.add("com.fuying.english");
|
this.add(JGYUtils.moshujia);
|
||||||
this.add("com.pengren.growthspace");
|
this.add(JGYUtils.english);
|
||||||
this.add("com.moshujiamm.moshujia");
|
this.add(JGYUtils.zhiduoke);
|
||||||
this.add("com.gankao.gkwxhd");
|
this.add(JGYUtils.aobama);
|
||||||
this.add("com.fuying.aobama.pad");
|
this.add(JGYUtils.growthspace);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
public static long getPackageSize(Context context, String filePath) {
|
public static long getPackageSize(Context context, String filePath) {
|
||||||
@@ -969,6 +973,93 @@ public class NetInterfaceManager {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void checkFXYAppUpdate(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
|
ConnectMode connectMode = ConnectMode.SIX_HOUR;
|
||||||
|
if (refresh) {
|
||||||
|
connectMode = ConnectMode.ONE_HOUR;
|
||||||
|
}
|
||||||
|
if (ConnectManager.getInstance().isNeedConnect(JGYUtils.FUXIAOYING_KEY, connectMode)) {
|
||||||
|
checkFXYAppUpdate(lifecycle, callback);
|
||||||
|
} else {
|
||||||
|
String jsonString = cacheHelper.getAsString(JGYUtils.FUXIAOYING_KEY);
|
||||||
|
//为 "" 是已经请求成功的
|
||||||
|
if (jsonString == null) {
|
||||||
|
checkFXYAppUpdate(lifecycle, callback);
|
||||||
|
} else {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Type type = new TypeToken<List<AppInfo>>() {
|
||||||
|
}.getType();
|
||||||
|
List<AppInfo> appInfoList = gson.fromJson(jsonString, type);
|
||||||
|
getAllAppUpdate(appInfoList);
|
||||||
|
callback.onComplete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void checkFXYAppUpdate(BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
|
Observable.zip(
|
||||||
|
getUpdateObservable(JGYUtils.gkwxhd),
|
||||||
|
getUpdateObservable(JGYUtils.fuxiaoying),
|
||||||
|
getUpdateObservable(JGYUtils.moshujia),
|
||||||
|
getUpdateObservable(JGYUtils.english),
|
||||||
|
getUpdateObservable(JGYUtils.zhiduoke),
|
||||||
|
getUpdateObservable(JGYUtils.aobama),
|
||||||
|
getUpdateObservable(JGYUtils.growthspace),
|
||||||
|
(appInfoBaseResponse, appInfoBaseResponse2, appInfoBaseResponse3, appInfoBaseResponse4, appInfoBaseResponse5, appInfoBaseResponse6, appInfoBaseResponse7) -> {
|
||||||
|
List<AppInfo> appInfoList = new ArrayList<>();
|
||||||
|
if (appInfoBaseResponse.code == 200) {
|
||||||
|
appInfoList.add(appInfoBaseResponse.data);
|
||||||
|
}
|
||||||
|
if (appInfoBaseResponse2.code == 200) {
|
||||||
|
appInfoList.add(appInfoBaseResponse2.data);
|
||||||
|
}
|
||||||
|
if (appInfoBaseResponse3.code == 200) {
|
||||||
|
appInfoList.add(appInfoBaseResponse3.data);
|
||||||
|
}
|
||||||
|
if (appInfoBaseResponse4.code == 200) {
|
||||||
|
appInfoList.add(appInfoBaseResponse4.data);
|
||||||
|
}
|
||||||
|
if (appInfoBaseResponse5.code == 200) {
|
||||||
|
appInfoList.add(appInfoBaseResponse5.data);
|
||||||
|
}
|
||||||
|
if (appInfoBaseResponse6.code == 200) {
|
||||||
|
appInfoList.add(appInfoBaseResponse6.data);
|
||||||
|
}
|
||||||
|
if (appInfoBaseResponse7.code == 200) {
|
||||||
|
appInfoList.add(appInfoBaseResponse7.data);
|
||||||
|
}
|
||||||
|
return appInfoList;
|
||||||
|
})
|
||||||
|
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<List<AppInfo>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
Log.e("checkFXYAppUpdate", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull List<AppInfo> appInfos) {
|
||||||
|
Log.e("checkFXYAppUpdate", "onNext: " + appInfos);
|
||||||
|
cacheHelper.put(JGYUtils.FUXIAOYING_KEY, GsonUtils.toJSONString(appInfos));
|
||||||
|
getAllAppUpdate(appInfos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
Log.e("checkFXYAppUpdate", "onError: " + e.getMessage());
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e("checkFXYAppUpdate", "onComplete: ");
|
||||||
|
callback.onComplete();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void getAllAppUpdate(String jsonString) {
|
public void getAllAppUpdate(String jsonString) {
|
||||||
if (TextUtils.isEmpty(jsonString)) {
|
if (TextUtils.isEmpty(jsonString)) {
|
||||||
return;
|
return;
|
||||||
@@ -1864,17 +1955,17 @@ public class NetInterfaceManager {
|
|||||||
|
|
||||||
public void getSystemSettings() {
|
public void getSystemSettings() {
|
||||||
getsettingControl()
|
getsettingControl()
|
||||||
.subscribe(new Observer<BaseResponse<SystemSettings>>() {
|
.subscribe(new Observer<BaseResponse<SystemSettingsSet>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
Log.e("getSystemSettings", "onSubscribe: ");
|
Log.e("getSystemSettings", "onSubscribe: ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(@NonNull BaseResponse<SystemSettings> BaseResponse) {
|
public void onNext(@NonNull BaseResponse<SystemSettingsSet> BaseResponse) {
|
||||||
int code = BaseResponse.code;
|
int code = BaseResponse.code;
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
String data = new Gson().toJson(BaseResponse.data);
|
String data = new Gson().toJson(BaseResponse.data.getAdmin());
|
||||||
Log.e("getSystemSettings", "onNext: " + data);
|
Log.e("getSystemSettings", "onNext: " + data);
|
||||||
ControlManager.getInstance().setSystemSetting(data);
|
ControlManager.getInstance().setSystemSetting(data);
|
||||||
} else {
|
} else {
|
||||||
@@ -1896,58 +1987,58 @@ public class NetInterfaceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void getTimeControl() {
|
public void getTimeControl() {
|
||||||
getTimeControlObservable()
|
// getTimeControlObservable()
|
||||||
.subscribe(new Observer<BaseResponse>() {
|
// .subscribe(new Observer<BaseResponse>() {
|
||||||
@Override
|
// @Override
|
||||||
public void onSubscribe(Disposable d) {
|
// public void onSubscribe(Disposable d) {
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onNext(BaseResponse baseResponse) {
|
// public void onNext(BaseResponse baseResponse) {
|
||||||
Log.e(TAG, "onNext: ");
|
// Log.e(TAG, "onNext: ");
|
||||||
int code = baseResponse.code;
|
// int code = baseResponse.code;
|
||||||
if (code == 200) {
|
// if (code == 200) {
|
||||||
JsonObject jsonObject = GsonUtils.getJsonObject(baseResponse.data.toString());
|
// JsonObject jsonObject = GsonUtils.getJsonObject(baseResponse.data.toString());
|
||||||
JsonObject work = jsonObject.get("work").getAsJsonObject();
|
// JsonObject work = jsonObject.get("work").getAsJsonObject();
|
||||||
String work_start_time = work.get("start_time").getAsString();
|
// String work_start_time = work.get("start_time").getAsString();
|
||||||
String work_end_time = work.get("end_time").getAsString();
|
// String work_end_time = work.get("end_time").getAsString();
|
||||||
JsonObject rest = jsonObject.get("rest").getAsJsonObject();
|
// JsonObject rest = jsonObject.get("rest").getAsJsonObject();
|
||||||
String rest_start_time = rest.get("start_time").getAsString();
|
// String rest_start_time = rest.get("start_time").getAsString();
|
||||||
String rest_end_time = rest.get("end_time").getAsString();
|
// String rest_end_time = rest.get("end_time").getAsString();
|
||||||
TimeUtils.ContralTime workingTime = TimeUtils.String2WorkingTime(mContext, work_start_time + "-" + work_end_time);
|
// TimeUtils.ContralTime workingTime = TimeUtils.String2WorkingTime(mContext, work_start_time + "-" + work_end_time);
|
||||||
TimeUtils.ContralTime weekTime = TimeUtils.String2WeekTime(mContext, rest_start_time + "-" + rest_end_time);
|
// TimeUtils.ContralTime weekTime = TimeUtils.String2WeekTime(mContext, rest_start_time + "-" + rest_end_time);
|
||||||
if (null != workingTime) {
|
// if (null != workingTime) {
|
||||||
Log.e("getTimeControlControl", "200:" + workingTime.toString());
|
// Log.e("getTimeControlControl", "200:" + workingTime.toString());
|
||||||
}
|
// }
|
||||||
if (null != weekTime) {
|
// if (null != weekTime) {
|
||||||
Log.e("getTimeControlControl", "200:" + weekTime.toString());
|
// Log.e("getTimeControlControl", "200:" + weekTime.toString());
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
TimeUtils.setEmpty(mContext);
|
// TimeUtils.setEmpty(mContext);
|
||||||
TimeUtils.ContralTime workingTime = TimeUtils.getWorkingDayContralTime(mContext);
|
// TimeUtils.ContralTime workingTime = TimeUtils.getWorkingDayContralTime(mContext);
|
||||||
if (null != workingTime) {
|
// if (null != workingTime) {
|
||||||
Log.e("getTimeControlControl", workingTime.toString());
|
// Log.e("getTimeControlControl", workingTime.toString());
|
||||||
}
|
// }
|
||||||
TimeUtils.ContralTime weekTime = TimeUtils.getWeekDayContralTime(mContext);
|
// TimeUtils.ContralTime weekTime = TimeUtils.getWeekDayContralTime(mContext);
|
||||||
if (null != weekTime) {
|
// if (null != weekTime) {
|
||||||
Log.e("getTimeControlControl", weekTime.toString());
|
// Log.e("getTimeControlControl", weekTime.toString());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onError(Throwable e) {
|
// public void onError(Throwable e) {
|
||||||
Log.e("getTimeControlControl", "onError: " + e.getMessage());
|
// Log.e("getTimeControlControl", "onError: " + e.getMessage());
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onComplete() {
|
// public void onComplete() {
|
||||||
Intent intent = new Intent();
|
// Intent intent = new Intent();
|
||||||
intent.setAction(ManagerService.ACTION_UPDATE);
|
// intent.setAction(ManagerService.ACTION_UPDATE);
|
||||||
mContext.sendBroadcast(intent);
|
// mContext.sendBroadcast(intent);
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendRunningApp() {
|
public void sendRunningApp() {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.uiui.sn.network.api;
|
|||||||
|
|
||||||
import com.uiui.sn.bean.BaseResponse;
|
import com.uiui.sn.bean.BaseResponse;
|
||||||
import com.uiui.sn.bean.SystemSettings;
|
import com.uiui.sn.bean.SystemSettings;
|
||||||
|
import com.uiui.sn.bean.SystemSettingsSet;
|
||||||
import com.uiui.sn.network.UrlAddress;
|
import com.uiui.sn.network.UrlAddress;
|
||||||
|
|
||||||
import io.reactivex.rxjava3.core.Observable;
|
import io.reactivex.rxjava3.core.Observable;
|
||||||
@@ -10,7 +11,7 @@ import retrofit2.http.Query;
|
|||||||
|
|
||||||
public interface Setting {
|
public interface Setting {
|
||||||
@GET(UrlAddress.GET_SETTINGS)
|
@GET(UrlAddress.GET_SETTINGS)
|
||||||
Observable<BaseResponse<SystemSettings>> getSetting(
|
Observable<BaseResponse<SystemSettingsSet>> getSetting(
|
||||||
@Query("sn") String sn
|
@Query("sn") String sn
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,7 @@ import retrofit2.http.Query;
|
|||||||
|
|
||||||
public interface TimeControl {
|
public interface TimeControl {
|
||||||
@GET(UrlAddress.GET_TIME_CONTROL)
|
@GET(UrlAddress.GET_TIME_CONTROL)
|
||||||
Observable<BaseResponse>
|
Observable<BaseResponse> getTimeControl(
|
||||||
getTimeControl(
|
|
||||||
@Query("sn") String sn
|
@Query("sn") String sn
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class RepeatRequestInterceptor implements Interceptor {
|
|||||||
// Response copy = response.newBuilder().body(responseBody).build();
|
// Response copy = response.newBuilder().body(responseBody).build();
|
||||||
ResponseBody copy = ResponseBody.create(responseBody.contentType(), content);
|
ResponseBody copy = ResponseBody.create(responseBody.contentType(), content);
|
||||||
if (BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
// Log.e(TAG, "请求体返回:| Response: " + request.url().encodedPath() + "\t body: " + content);
|
Log.e(TAG, "请求体返回:| Response: " + request.url().encodedPath() + "\t body: " + content);
|
||||||
}
|
}
|
||||||
//相同的请求
|
//相同的请求
|
||||||
String requestKey = MD5Util.getUpperMD5Str(request.method() + request.url().toString() + requestBodyToString(request.body()));
|
String requestKey = MD5Util.getUpperMD5Str(request.method() + request.url().toString() + requestBodyToString(request.body()));
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ public class MainSContact {
|
|||||||
void setLocked(int lockedStatus);
|
void setLocked(int lockedStatus);
|
||||||
void updateInfoFinish();
|
void updateInfoFinish();
|
||||||
void checkUpdateFinish();
|
void checkUpdateFinish();
|
||||||
|
void checkFXYUpdateFinish();
|
||||||
void getAllAppFinish();
|
void getAllAppFinish();
|
||||||
void setAppInside();
|
void setAppInside();
|
||||||
void setForceInstall();
|
void setForceInstall();
|
||||||
@@ -31,6 +32,8 @@ public class MainSContact {
|
|||||||
void updateDeviceInfo();
|
void updateDeviceInfo();
|
||||||
//检查更新
|
//检查更新
|
||||||
void checkUpdate();
|
void checkUpdate();
|
||||||
|
//检查扶小鹰App更新
|
||||||
|
void checkFXYUpdate();
|
||||||
//获取所有app包名
|
//获取所有app包名
|
||||||
void getAllApp();
|
void getAllApp();
|
||||||
//获取id管控
|
//获取id管控
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import com.uiui.sn.bean.AppStart;
|
|||||||
import com.uiui.sn.bean.BaseResponse;
|
import com.uiui.sn.bean.BaseResponse;
|
||||||
import com.uiui.sn.bean.Label;
|
import com.uiui.sn.bean.Label;
|
||||||
import com.uiui.sn.bean.SystemSettings;
|
import com.uiui.sn.bean.SystemSettings;
|
||||||
|
import com.uiui.sn.bean.SystemSettingsSet;
|
||||||
import com.uiui.sn.bean.browser.BrowserApiData;
|
import com.uiui.sn.bean.browser.BrowserApiData;
|
||||||
import com.uiui.sn.bean.browser.BrowserBean;
|
import com.uiui.sn.bean.browser.BrowserBean;
|
||||||
import com.uiui.sn.config.CommonConfig;
|
import com.uiui.sn.config.CommonConfig;
|
||||||
@@ -126,6 +127,16 @@ public class MainSPresenter implements MainSContact.Presenter {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void checkFXYUpdate() {
|
||||||
|
NetInterfaceManager.getInstance().checkFXYAppUpdate(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
mView.checkFXYUpdateFinish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
public void getAllApp() {
|
public void getAllApp() {
|
||||||
@@ -235,19 +246,19 @@ public class MainSPresenter implements MainSContact.Presenter {
|
|||||||
NetInterfaceManager.getInstance()
|
NetInterfaceManager.getInstance()
|
||||||
.getsettingControl()
|
.getsettingControl()
|
||||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||||
.subscribe(new Observer<BaseResponse<SystemSettings>>() {
|
.subscribe(new Observer<BaseResponse<SystemSettingsSet>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
Log.e("getSystemSettings", "onSubscribe: ");
|
Log.e("getSystemSettings", "onSubscribe: ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(BaseResponse<SystemSettings> systemSettingsBaseResponse) {
|
public void onNext(BaseResponse<SystemSettingsSet> systemSettingsBaseResponse) {
|
||||||
Log.e("getSystemSettings", "onNext: " + systemSettingsBaseResponse);
|
Log.e("getSystemSettings", "onNext: " + systemSettingsBaseResponse);
|
||||||
SPUtils.put(mContext, "is_first_connection", 0);
|
SPUtils.put(mContext, "is_first_connection", 0);
|
||||||
int code = systemSettingsBaseResponse.code;
|
int code = systemSettingsBaseResponse.code;
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
String data = new Gson().toJson(systemSettingsBaseResponse.data);
|
String data = new Gson().toJson(systemSettingsBaseResponse.data.getAdmin());
|
||||||
ControlManager.getInstance().setSystemSetting(data);
|
ControlManager.getInstance().setSystemSetting(data);
|
||||||
} else {
|
} else {
|
||||||
ControlManager.getInstance().setDisableSetting();
|
ControlManager.getInstance().setDisableSetting();
|
||||||
@@ -440,62 +451,63 @@ public class MainSPresenter implements MainSContact.Presenter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getTimeControl() {
|
public void getTimeControl() {
|
||||||
NetInterfaceManager.getInstance()
|
// NetInterfaceManager.getInstance()
|
||||||
.getTimeControlObservable()
|
// .getTimeControlObservable()
|
||||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
// .compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||||
.subscribe(new Observer<BaseResponse>() {
|
// .subscribe(new Observer<BaseResponse>() {
|
||||||
@Override
|
// @Override
|
||||||
public void onSubscribe(Disposable d) {
|
// public void onSubscribe(Disposable d) {
|
||||||
Log.e("getTimeControlControl", "onSubscribe: ");
|
// Log.e("getTimeControlControl", "onSubscribe: ");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onNext(BaseResponse baseResponse) {
|
// public void onNext(BaseResponse baseResponse) {
|
||||||
Log.e("getTimeControlControl", "onNext: ");
|
// Log.e("getTimeControlControl", "onNext: ");
|
||||||
int code = baseResponse.code;
|
// int code = baseResponse.code;
|
||||||
if (code == 200) {
|
// if (code == 200) {
|
||||||
JsonObject jsonObject = GsonUtils.getJsonObject(GsonUtils.toJSONString(baseResponse.data));
|
// JsonObject jsonObject = GsonUtils.getJsonObject(GsonUtils.toJSONString(baseResponse.data));
|
||||||
JsonObject work = jsonObject.getAsJsonObject("work");
|
// JsonObject work = jsonObject.getAsJsonObject("work");
|
||||||
String work_start_time = work.get("start_time").getAsString();
|
// String work_start_time = work.get("start_time").getAsString();
|
||||||
String work_end_time = work.get("end_time").getAsString();
|
// String work_end_time = work.get("end_time").getAsString();
|
||||||
JsonObject rest = jsonObject.getAsJsonObject("rest");
|
// JsonObject rest = jsonObject.getAsJsonObject("rest");
|
||||||
String rest_start_time = rest.get("start_time").getAsString();
|
// String rest_start_time = rest.get("start_time").getAsString();
|
||||||
String rest_end_time = rest.get("end_time").getAsString();
|
// String rest_end_time = rest.get("end_time").getAsString();
|
||||||
TimeUtils.ContralTime workingTime = TimeUtils.String2WorkingTime(mContext, work_start_time + "-" + work_end_time);
|
// TimeUtils.ContralTime workingTime = TimeUtils.String2WorkingTime(mContext, work_start_time + "-" + work_end_time);
|
||||||
TimeUtils.ContralTime weekTime = TimeUtils.String2WeekTime(mContext, rest_start_time + "-" + rest_end_time);
|
// TimeUtils.ContralTime weekTime = TimeUtils.String2WeekTime(mContext, rest_start_time + "-" + rest_end_time);
|
||||||
if (null != workingTime) {
|
// if (null != workingTime) {
|
||||||
Log.e("getTimeControlControl", "200:" + workingTime.toString());
|
// Log.e("getTimeControlControl", "200:" + workingTime.toString());
|
||||||
}
|
// }
|
||||||
if (null != weekTime) {
|
// if (null != weekTime) {
|
||||||
Log.e("getTimeControlControl", "200:" + weekTime.toString());
|
// Log.e("getTimeControlControl", "200:" + weekTime.toString());
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
TimeUtils.setEmpty(mContext);
|
// TimeUtils.setEmpty(mContext);
|
||||||
TimeUtils.ContralTime workingTime = TimeUtils.getWorkingDayContralTime(mContext);
|
// TimeUtils.ContralTime workingTime = TimeUtils.getWorkingDayContralTime(mContext);
|
||||||
if (null != workingTime) {
|
// if (null != workingTime) {
|
||||||
Log.e("getTimeControlControl", workingTime.toString());
|
// Log.e("getTimeControlControl", workingTime.toString());
|
||||||
}
|
// }
|
||||||
TimeUtils.ContralTime weekTime = TimeUtils.getWeekDayContralTime(mContext);
|
// TimeUtils.ContralTime weekTime = TimeUtils.getWeekDayContralTime(mContext);
|
||||||
if (null != weekTime) {
|
// if (null != weekTime) {
|
||||||
Log.e("getTimeControlControl", weekTime.toString());
|
// Log.e("getTimeControlControl", weekTime.toString());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onError(Throwable e) {
|
// public void onError(Throwable e) {
|
||||||
Log.e("getTimeControlControl", "onError: " + e.getMessage());
|
// Log.e("getTimeControlControl", "onError: " + e.getMessage());
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onComplete() {
|
// public void onComplete() {
|
||||||
Log.e("getTimeControlControl", "onComplete: ");
|
// Log.e("getTimeControlControl", "onComplete: ");
|
||||||
Intent intent = new Intent();
|
// Intent intent = new Intent();
|
||||||
intent.setAction(ManagerService.ACTION_UPDATE);
|
// intent.setAction(ManagerService.ACTION_UPDATE);
|
||||||
mContext.sendBroadcast(intent);
|
// mContext.sendBroadcast(intent);
|
||||||
mView.setTimeControl();
|
//
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
mView.setTimeControl();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -422,6 +422,11 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void checkUpdateFinish() {
|
public void checkUpdateFinish() {
|
||||||
|
mPresenter.checkFXYUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void checkFXYUpdateFinish() {
|
||||||
mPresenter.getAllApp();
|
mPresenter.getAllApp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -604,7 +604,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
|||||||
break;
|
break;
|
||||||
case JIGUANG_SYSTEM_SETTING:
|
case JIGUANG_SYSTEM_SETTING:
|
||||||
ToastUtil.debugShow("收到推送消息: 系统管控");
|
ToastUtil.debugShow("收到推送消息: 系统管控");
|
||||||
ControlManager.getInstance().setSystemSetting(extras);
|
// ControlManager.getInstance().setSystemSetting(extras);
|
||||||
|
MainService.getPresenter().getSystemSettings();
|
||||||
// if ("com.jiaoguanyi.os".equals(ForegroundAppUtil.getForegroundPackageName(context))) {
|
// if ("com.jiaoguanyi.os".equals(ForegroundAppUtil.getForegroundPackageName(context))) {
|
||||||
// JGYUtils.getInstance().killBackgroundProcesses(context, "com.jiaoguanyi.os");
|
// JGYUtils.getInstance().killBackgroundProcesses(context, "com.jiaoguanyi.os");
|
||||||
// Intent intent = context.getPackageManager().getLaunchIntentForPackage("com.jiaoguanyi.os");
|
// Intent intent = context.getPackageManager().getLaunchIntentForPackage("com.jiaoguanyi.os");
|
||||||
|
|||||||
@@ -109,15 +109,26 @@ public class JGYUtils {
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
HashSet<String> fuxiaoyingApp = new HashSet<String>() {{
|
HashSet<String> fuxiaoyingApp = new HashSet<String>() {{
|
||||||
this.add("com.fuying.fuxiaoying");
|
this.add(gkwxhd);
|
||||||
this.add("com.zhiduoke.fxy");
|
this.add(fuxiaoying);
|
||||||
this.add("com.fuying.english");
|
this.add(moshujia);
|
||||||
this.add("com.pengren.growthspace");
|
this.add(english);
|
||||||
this.add("com.moshujiamm.moshujia");
|
this.add(zhiduoke);
|
||||||
this.add("com.gankao.gkwxhd");
|
this.add(aobama);
|
||||||
this.add("com.fuying.aobama.pad");
|
this.add(growthspace);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
public static final String gkwxhd = "com.gankao.gkwxhd";
|
||||||
|
public static final String fuxiaoying = "com.fuying.fuxiaoying";
|
||||||
|
public static final String moshujia = "com.moshujiamm.moshujia";
|
||||||
|
public static final String english = "com.fuying.english";
|
||||||
|
public static final String zhiduoke = "com.zhiduoke.fxy";
|
||||||
|
public static final String aobama = "com.fuying.aobama.pad";
|
||||||
|
public static final String growthspace = "com.pengren.growthspace";
|
||||||
|
|
||||||
|
public static final String FUXIAOYING_KEY = "fuxiaoying_update_key";
|
||||||
|
|
||||||
|
|
||||||
public HashSet<String> getOwnApp() {
|
public HashSet<String> getOwnApp() {
|
||||||
return ownApp;
|
return ownApp;
|
||||||
}
|
}
|
||||||
@@ -1220,7 +1231,7 @@ public class JGYUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getIMEI() {
|
public String getIMEI() {
|
||||||
String IMEI = "unknow";
|
String IMEI = "unknow";
|
||||||
String IMEI1, IMEI2, IMEI3;
|
String IMEI1, IMEI2, IMEI3;
|
||||||
//获取手机设备号
|
//获取手机设备号
|
||||||
|
|||||||
Reference in New Issue
Block a user