version:zhanrui 6.3.1,MTK 2.3.1
fix:讯飞输入法加入白名单 update:接口优化,bug修复
This commit is contained in:
@@ -82,16 +82,16 @@ android {
|
|||||||
//酷比魔方
|
//酷比魔方
|
||||||
cube {
|
cube {
|
||||||
flavorDimensions "default"
|
flavorDimensions "default"
|
||||||
versionCode 60
|
versionCode 71
|
||||||
versionName "6.2.11.23"
|
versionName "6.3.1"
|
||||||
buildConfigField "String", "platform", '"ZhanRuiCube"'
|
buildConfigField "String", "platform", '"ZhanRuiCube"'
|
||||||
}
|
}
|
||||||
|
|
||||||
//MTK
|
//MTK
|
||||||
MTKnewly {
|
MTKnewly {
|
||||||
flavorDimensions "default"
|
flavorDimensions "default"
|
||||||
versionCode 33
|
versionCode 41
|
||||||
versionName "2.2.11.23"
|
versionName "2.3.1"
|
||||||
buildConfigField "String", "platform", '"MTK"'
|
buildConfigField "String", "platform", '"MTK"'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import android.os.Bundle;
|
|||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
@@ -164,7 +165,9 @@ public class SplashActivity extends AppCompatActivity {
|
|||||||
String only_jgy_shortcut_list = Settings.System.getString(getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST);
|
String only_jgy_shortcut_list = Settings.System.getString(getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST);
|
||||||
Log.i(TAG, "debugTest: only_jgy_shortcut_list:" + only_jgy_shortcut_list);
|
Log.i(TAG, "debugTest: only_jgy_shortcut_list:" + only_jgy_shortcut_list);
|
||||||
String aole_app_forbid = Settings.System.getString(getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID);
|
String aole_app_forbid = Settings.System.getString(getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID);
|
||||||
Settings.System.putString(getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, aole_app_forbid + ",com.aoleyun.browser");
|
if (!TextUtils.isEmpty(aole_app_forbid)) {
|
||||||
|
Settings.System.putString(getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, aole_app_forbid + ",com.aoleyun.browser");
|
||||||
|
}
|
||||||
Log.e(TAG, "debugTest: aole_app_forbid:" + aole_app_forbid);
|
Log.e(TAG, "debugTest: aole_app_forbid:" + aole_app_forbid);
|
||||||
Log.i(TAG, "debugTest: ip = " + JGYUtils.getInstance().getIPAddress());
|
Log.i(TAG, "debugTest: ip = " + JGYUtils.getInstance().getIPAddress());
|
||||||
Log.i(TAG, "debugTest: getPackage = " + Utils.getPackage());
|
Log.i(TAG, "debugTest: getPackage = " + Utils.getPackage());
|
||||||
|
|||||||
@@ -287,7 +287,6 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
|||||||
public void onServiceConnected(ComponentName name, IBinder service) {
|
public void onServiceConnected(ComponentName name, IBinder service) {
|
||||||
Log.e(TAG, "onServiceConnected: ");
|
Log.e(TAG, "onServiceConnected: ");
|
||||||
mMainBinder = (MainService.MainBinder) service;
|
mMainBinder = (MainService.MainBinder) service;
|
||||||
mMainBinder.getService().getLockedState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -338,22 +337,22 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
|||||||
|
|
||||||
settradeType(trade_type);
|
settradeType(trade_type);
|
||||||
if (TextUtils.isEmpty(sno)) {
|
if (TextUtils.isEmpty(sno)) {
|
||||||
setNumberText("", View.GONE);
|
setNumberText("未设置", View.GONE);
|
||||||
} else {
|
} else {
|
||||||
setNumberText(sno, View.VISIBLE);
|
setNumberText(sno, View.VISIBLE);
|
||||||
}
|
}
|
||||||
if (TextUtils.isEmpty(realname)) {
|
if (TextUtils.isEmpty(realname)) {
|
||||||
setNameText("", View.GONE);
|
setNameText("未设置", View.GONE);
|
||||||
} else {
|
} else {
|
||||||
setNameText(realname, View.VISIBLE);
|
setNameText(realname, View.VISIBLE);
|
||||||
}
|
}
|
||||||
if (TextUtils.isEmpty(classes)) {
|
if (TextUtils.isEmpty(classes)) {
|
||||||
setClassText("", View.GONE);
|
setClassText("未设置", View.GONE);
|
||||||
} else {
|
} else {
|
||||||
setClassText(classes, View.VISIBLE);
|
setClassText(classes, View.VISIBLE);
|
||||||
}
|
}
|
||||||
if (TextUtils.isEmpty(batch)) {
|
if (TextUtils.isEmpty(batch)) {
|
||||||
setBatchText("", View.GONE);
|
setBatchText("未设置", View.GONE);
|
||||||
} else {
|
} else {
|
||||||
setBatchText(batch, View.VISIBLE);
|
setBatchText(batch, View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,37 +115,37 @@ public class ConnectManager {
|
|||||||
/**
|
/**
|
||||||
* @return 重启后是否连接
|
* @return 重启后是否连接
|
||||||
*/
|
*/
|
||||||
public boolean isRebootFistConnect() {
|
// public boolean isRebootFistConnect() {
|
||||||
long rebootTime = mMMKV.decodeLong(REBOOT_LAST_ONNECT_TIME, 0);
|
// long rebootTime = mMMKV.decodeLong(REBOOT_LAST_ONNECT_TIME, 0);
|
||||||
//只在开机后15内连接,其他情况为service重启
|
// //只在开机后15内连接,其他情况为service重启
|
||||||
long time = System.currentTimeMillis() - rebootTime;
|
// long time = System.currentTimeMillis() - rebootTime;
|
||||||
return time < 15 * 1000;
|
// return time < 15 * 1000;
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 今天WiFi连接是否有连接
|
* @return 今天WiFi连接是否有连接
|
||||||
*/
|
*/
|
||||||
public boolean isWiFiFistConnect() {
|
// public boolean isWiFiFistConnect() {
|
||||||
long time = mMMKV.decodeLong(WIFI_LAST_CONNECT_TIME, 0);
|
// long time = mMMKV.decodeLong(WIFI_LAST_CONNECT_TIME, 0);
|
||||||
return !TimeUtils.isTodayTime(time);
|
// return !TimeUtils.isTodayTime(time);
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 今天打开设备信息后是否连接
|
* @return 今天打开设备信息后是否连接
|
||||||
*/
|
*/
|
||||||
public boolean isOpenInfoFistConnect() {
|
// public boolean isOpenInfoFistConnect() {
|
||||||
long time = mMMKV.decodeLong(OPENINFO_LAST_ONNECT_TIME, 0);
|
// long time = mMMKV.decodeLong(OPENINFO_LAST_ONNECT_TIME, 0);
|
||||||
return !TimeUtils.isTodayTime(time);
|
// return !TimeUtils.isTodayTime(time);
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param WiFiAlias
|
* @param WiFiAlias
|
||||||
* @return 今天切换WiFi后是否连接
|
* @return 今天切换WiFi后是否连接
|
||||||
*/
|
*/
|
||||||
public boolean isWiFiCutoverFistConnect(String WiFiAlias) {
|
// public boolean isWiFiCutoverFistConnect(String WiFiAlias) {
|
||||||
long time = mMMKV.decodeLong(WiFiAlias, 0);
|
// long time = mMMKV.decodeLong(WiFiAlias, 0);
|
||||||
return !TimeUtils.isTodayTime(time);
|
// return !TimeUtils.isTodayTime(time);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -699,9 +699,9 @@ public class NetInterfaceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
synchronized public void checkAoleyunUpdate(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
synchronized public void checkAoleyunUpdate(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
ConnectMode connectMode = ConnectMode.SIX_HOUR;
|
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.ONE_HOUR;
|
connectMode = ConnectMode.ONE_MINUTE;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.CHECK_UPDATE, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.CHECK_UPDATE, connectMode)) {
|
||||||
checkAoleyunUpdate(lifecycle, callback);
|
checkAoleyunUpdate(lifecycle, callback);
|
||||||
@@ -715,9 +715,11 @@ public class NetInterfaceManager {
|
|||||||
Type listType = new TypeToken<List<AppUpdateInfo>>() {
|
Type listType = new TypeToken<List<AppUpdateInfo>>() {
|
||||||
}.getType();
|
}.getType();
|
||||||
List<AppUpdateInfo> appUpdateInfos = gson.fromJson(jsonString, listType);
|
List<AppUpdateInfo> appUpdateInfos = gson.fromJson(jsonString, listType);
|
||||||
for (AppUpdateInfo info : appUpdateInfos) {
|
if (appUpdateInfos!=null&&appUpdateInfos.size()!=0) {
|
||||||
JsonObject jsonObject = parseString(new Gson().toJson(info)).getAsJsonObject();
|
for (AppUpdateInfo info : appUpdateInfos) {
|
||||||
JGYUtils.getInstance().installAPK(jsonObject);
|
JsonObject jsonObject = parseString(new Gson().toJson(info)).getAsJsonObject();
|
||||||
|
JGYUtils.getInstance().installAPK(jsonObject);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
callback.onComplete();
|
callback.onComplete();
|
||||||
}
|
}
|
||||||
@@ -777,11 +779,15 @@ public class NetInterfaceManager {
|
|||||||
@Override
|
@Override
|
||||||
public void onNext(@NonNull List<AppUpdateInfo> appUpdateInfos) {
|
public void onNext(@NonNull List<AppUpdateInfo> appUpdateInfos) {
|
||||||
String jsonString = GsonUtils.toJSONString(appUpdateInfos);
|
String jsonString = GsonUtils.toJSONString(appUpdateInfos);
|
||||||
cacheHelper.put(UrlAddress.CHECK_UPDATE, jsonString);
|
|
||||||
Log.e("checkAoleyunUpdate", "onNext: " + jsonString);
|
Log.e("checkAoleyunUpdate", "onNext: " + jsonString);
|
||||||
for (AppUpdateInfo info : appUpdateInfos) {
|
if (appUpdateInfos != null && appUpdateInfos.size() != 0) {
|
||||||
JsonObject jsonObject = parseString(new Gson().toJson(info)).getAsJsonObject();
|
cacheHelper.put(UrlAddress.CHECK_UPDATE, jsonString);
|
||||||
JGYUtils.getInstance().installAPK(jsonObject);
|
for (AppUpdateInfo info : appUpdateInfos) {
|
||||||
|
JsonObject jsonObject = parseString(new Gson().toJson(info)).getAsJsonObject();
|
||||||
|
JGYUtils.getInstance().installAPK(jsonObject);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cacheHelper.put(UrlAddress.CHECK_UPDATE, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -816,9 +822,9 @@ public class NetInterfaceManager {
|
|||||||
* 获取灰度测试更新
|
* 获取灰度测试更新
|
||||||
*/
|
*/
|
||||||
public void checkTestUpdate(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
public void checkTestUpdate(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
ConnectMode connectMode = ConnectMode.SIX_HOUR;
|
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.ONE_HOUR;
|
connectMode = ConnectMode.ONE_MINUTE;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_SN_APP_TEST, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_SN_APP_TEST, connectMode)) {
|
||||||
checkTestUpdate(lifecycle, callback);
|
checkTestUpdate(lifecycle, callback);
|
||||||
@@ -879,7 +885,7 @@ public class NetInterfaceManager {
|
|||||||
public void getForceDownload(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
public void getForceDownload(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.DEFAULT;
|
connectMode = ConnectMode.ONE_MINUTE;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_FORCE_INSTALL_LIST, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_FORCE_INSTALL_LIST, connectMode)) {
|
||||||
getForceDownload(lifecycle, callback);
|
getForceDownload(lifecycle, callback);
|
||||||
@@ -921,7 +927,7 @@ public class NetInterfaceManager {
|
|||||||
.subscribe(getForceDownloadObserver(null));
|
.subscribe(getForceDownloadObserver(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Observer getForceDownloadObserver(onCompleteCallback callback) {
|
private Observer<BaseResponse<List<ForceDownloadData>>> getForceDownloadObserver(onCompleteCallback callback) {
|
||||||
return new Observer<BaseResponse<List<ForceDownloadData>>>() {
|
return new Observer<BaseResponse<List<ForceDownloadData>>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
@@ -932,7 +938,7 @@ public class NetInterfaceManager {
|
|||||||
public void onNext(@NonNull BaseResponse<List<ForceDownloadData>> forceDownloadBean) {
|
public void onNext(@NonNull BaseResponse<List<ForceDownloadData>> forceDownloadBean) {
|
||||||
Log.e("getForceDownload", "onNext: " + forceDownloadBean);
|
Log.e("getForceDownload", "onNext: " + forceDownloadBean);
|
||||||
if (forceDownloadBean.code == OK) {
|
if (forceDownloadBean.code == OK) {
|
||||||
cacheHelper.getAsString(UrlAddress.GET_FORCE_INSTALL_LIST);
|
Log.e("getForceDownload", "onNext: getAsString: "+cacheHelper.getAsString(UrlAddress.GET_FORCE_INSTALL_LIST) );
|
||||||
List<ForceDownloadData> forceDownloadData = forceDownloadBean.data;
|
List<ForceDownloadData> forceDownloadData = forceDownloadBean.data;
|
||||||
cacheHelper.put(UrlAddress.GET_FORCE_INSTALL_LIST, GsonUtils.toJSONString(forceDownloadData));
|
cacheHelper.put(UrlAddress.GET_FORCE_INSTALL_LIST, GsonUtils.toJSONString(forceDownloadData));
|
||||||
Aria.download(this).resumeAllTask();
|
Aria.download(this).resumeAllTask();
|
||||||
@@ -970,7 +976,7 @@ public class NetInterfaceManager {
|
|||||||
public void getDefaultDesktop(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
public void getDefaultDesktop(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.DEFAULT;
|
connectMode = ConnectMode.ONE_MINUTE;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_DESKTOP, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_DESKTOP, connectMode)) {
|
||||||
getDefaultDesktop(lifecycle, callback);
|
getDefaultDesktop(lifecycle, callback);
|
||||||
@@ -1005,7 +1011,7 @@ public class NetInterfaceManager {
|
|||||||
.subscribe(getDefaultDesktopObserver(null));
|
.subscribe(getDefaultDesktopObserver(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observer getDefaultDesktopObserver(onCompleteCallback callback) {
|
public Observer<BaseResponse<ForceDownloadData>> getDefaultDesktopObserver(onCompleteCallback callback) {
|
||||||
return new Observer<BaseResponse<ForceDownloadData>>() {
|
return new Observer<BaseResponse<ForceDownloadData>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
@@ -1066,9 +1072,9 @@ public class NetInterfaceManager {
|
|||||||
|
|
||||||
|
|
||||||
public void setLogoImg(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
public void setLogoImg(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
ConnectMode connectMode = ConnectMode.HALF_DAY;
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.DEFAULT;
|
connectMode = ConnectMode.SIX_HOUR;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_LOGO_IMG, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_LOGO_IMG, connectMode)) {
|
||||||
setLogoImg(lifecycle, callback);
|
setLogoImg(lifecycle, callback);
|
||||||
@@ -1140,7 +1146,7 @@ public class NetInterfaceManager {
|
|||||||
public void getDeveloper(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
public void getDeveloper(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.DEFAULT;
|
connectMode = ConnectMode.ONE_MINUTE;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_DEVELOPER, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_DEVELOPER, connectMode)) {
|
||||||
getDeveloper(lifecycle, callback);
|
getDeveloper(lifecycle, callback);
|
||||||
@@ -1204,9 +1210,9 @@ public class NetInterfaceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void getCustomROMApp(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
public void getCustomROMApp(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
ConnectMode connectMode = ConnectMode.HALF_DAY;
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.DEFAULT;
|
connectMode = ConnectMode.SIX_HOUR;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_ROM_APP, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_ROM_APP, connectMode)) {
|
||||||
getCustomROMApp(lifecycle, callback);
|
getCustomROMApp(lifecycle, callback);
|
||||||
@@ -1265,9 +1271,9 @@ public class NetInterfaceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void getDesktopIcon(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
public void getDesktopIcon(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
ConnectMode connectMode = ConnectMode.SIX_HOUR;
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.DEFAULT;
|
connectMode = ConnectMode.ONE_HOUR;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_HIDE_DESKTOPICON, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_HIDE_DESKTOPICON, connectMode)) {
|
||||||
getDesktopIcon(lifecycle, callback);
|
getDesktopIcon(lifecycle, callback);
|
||||||
@@ -1382,7 +1388,7 @@ public class NetInterfaceManager {
|
|||||||
public void getAppAutoStartUpdateAndNet(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
public void getAppAutoStartUpdateAndNet(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.DEFAULT;
|
connectMode = ConnectMode.ONE_MINUTE;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.NET_AND_LAUNCH_API, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.NET_AND_LAUNCH_API, connectMode)) {
|
||||||
getAppAutoStartUpdateAndNet(lifecycle, callback);
|
getAppAutoStartUpdateAndNet(lifecycle, callback);
|
||||||
@@ -1658,9 +1664,9 @@ public class NetInterfaceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void getEBagCode(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
public void getEBagCode(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
ConnectMode connectMode = ConnectMode.HALF_DAY;
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.DEFAULT;
|
connectMode = ConnectMode.SIX_HOUR;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_EBAG_CODE, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_EBAG_CODE, connectMode)) {
|
||||||
getEBagCode(lifecycle, callback);
|
getEBagCode(lifecycle, callback);
|
||||||
@@ -1812,9 +1818,9 @@ public class NetInterfaceManager {
|
|||||||
* @param studesInfoListener
|
* @param studesInfoListener
|
||||||
*/
|
*/
|
||||||
public void getStudesInfo(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, StudesInfoListener studesInfoListener) {
|
public void getStudesInfo(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, StudesInfoListener studesInfoListener) {
|
||||||
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
ConnectMode connectMode = ConnectMode.FIFTEEN_MINUTES;
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.DEFAULT;
|
connectMode = ConnectMode.ONE_MINUTE;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_STUDENTS_INFO, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_STUDENTS_INFO, connectMode)) {
|
||||||
getInfo(lifecycle, studesInfoListener);
|
getInfo(lifecycle, studesInfoListener);
|
||||||
@@ -1947,7 +1953,7 @@ public class NetInterfaceManager {
|
|||||||
|
|
||||||
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.DEFAULT;
|
connectMode = ConnectMode.ONE_MINUTE;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.SEND_DEVICES, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.SEND_DEVICES, connectMode)) {
|
||||||
if (macJson.equals(macJsonString)) {
|
if (macJson.equals(macJsonString)) {
|
||||||
@@ -2009,10 +2015,10 @@ public class NetInterfaceManager {
|
|||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.ONE_DAY;
|
connectMode = ConnectMode.ONE_DAY;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(CommonConfig.DEVICES_TAG, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_DEVICES_TAGS, connectMode)) {
|
||||||
setPushTags(lifecycle, callback);
|
setPushTags(lifecycle, callback);
|
||||||
} else {
|
} else {
|
||||||
String jsonString = cacheHelper.getAsString(CommonConfig.DEVICES_TAG);
|
String jsonString = cacheHelper.getAsString(UrlAddress.GET_DEVICES_TAGS);
|
||||||
//为 "" 是已经请求成功的
|
//为 "" 是已经请求成功的
|
||||||
if (jsonString == null) {
|
if (jsonString == null) {
|
||||||
setPushTags(lifecycle, callback);
|
setPushTags(lifecycle, callback);
|
||||||
@@ -2057,7 +2063,7 @@ public class NetInterfaceManager {
|
|||||||
public void onNext(@NonNull BaseResponse<Batch> response) {
|
public void onNext(@NonNull BaseResponse<Batch> response) {
|
||||||
if (response.code == OK) {
|
if (response.code == OK) {
|
||||||
String batch = response.data.getBatch();
|
String batch = response.data.getBatch();
|
||||||
cacheHelper.put(CommonConfig.DEVICES_TAG, GsonUtils.toJSONString(response.data));
|
cacheHelper.put(UrlAddress.GET_DEVICES_TAGS, GsonUtils.toJSONString(response.data));
|
||||||
Log.e(TAG + ":" + "setPushTags", "onNext: " + batch);
|
Log.e(TAG + ":" + "setPushTags", "onNext: " + batch);
|
||||||
if (!TextUtils.isEmpty(batch)) {
|
if (!TextUtils.isEmpty(batch)) {
|
||||||
set.add(batch);
|
set.add(batch);
|
||||||
@@ -2065,7 +2071,7 @@ public class NetInterfaceManager {
|
|||||||
Log.e(TAG + ":" + "setPushTags", "onNext: " + "batch empty");
|
Log.e(TAG + ":" + "setPushTags", "onNext: " + "batch empty");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cacheHelper.put(CommonConfig.DEVICES_TAG, "");
|
cacheHelper.put(UrlAddress.GET_DEVICES_TAGS, "");
|
||||||
Log.e(TAG + ":" + "setPushTags", "onNext: " + response.toString());
|
Log.e(TAG + ":" + "setPushTags", "onNext: " + response.toString());
|
||||||
}
|
}
|
||||||
mMMKV.encode(CommonConfig.DEVICES_TAG, set);
|
mMMKV.encode(CommonConfig.DEVICES_TAG, set);
|
||||||
@@ -2148,7 +2154,7 @@ public class NetInterfaceManager {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Observer getUpdateDeviceObserver(onCompleteCallback callback) {
|
private Observer<BaseResponse> getUpdateDeviceObserver(onCompleteCallback callback) {
|
||||||
return new Observer<BaseResponse>() {
|
return new Observer<BaseResponse>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
@@ -2631,9 +2637,9 @@ public class NetInterfaceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void getAppLimit(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
public void getAppLimit(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
ConnectMode connectMode = ConnectMode.HALF_HOUR;
|
ConnectMode connectMode = ConnectMode.HALF_DAY;
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.DEFAULT;
|
connectMode = ConnectMode.SIX_HOUR;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.SET_WHITE_PACKAGE_LIST, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.SET_WHITE_PACKAGE_LIST, connectMode)) {
|
||||||
getAppLimit(lifecycle, callback);
|
getAppLimit(lifecycle, callback);
|
||||||
@@ -2671,7 +2677,7 @@ public class NetInterfaceManager {
|
|||||||
.subscribe(getAppLimitObserver(null));
|
.subscribe(getAppLimitObserver(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Observer getAppLimitObserver(onCompleteCallback callback) {
|
private Observer<BaseResponse<AppLimit>> getAppLimitObserver(onCompleteCallback callback) {
|
||||||
return new Observer<BaseResponse<AppLimit>>() {
|
return new Observer<BaseResponse<AppLimit>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
@@ -2717,9 +2723,9 @@ public class NetInterfaceManager {
|
|||||||
* 获取所有app详细信息
|
* 获取所有app详细信息
|
||||||
*/
|
*/
|
||||||
public void getAllAppList(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
public void getAllAppList(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
ConnectMode connectMode = ConnectMode.HALF_HOUR;
|
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.DEFAULT;
|
connectMode = ConnectMode.HALF_HOUR;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_ALL_APP, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_ALL_APP, connectMode)) {
|
||||||
getAllAppList(lifecycle, callback);
|
getAllAppList(lifecycle, callback);
|
||||||
@@ -2945,9 +2951,9 @@ public class NetInterfaceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void getTopApp(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
public void getTopApp(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
ConnectMode connectMode = ConnectMode.HALF_DAY;
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.DEFAULT;
|
connectMode = ConnectMode.SIX_HOUR;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_TOP_APP_CONTROL, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_TOP_APP_CONTROL, connectMode)) {
|
||||||
getTopApp(lifecycle, callback);
|
getTopApp(lifecycle, callback);
|
||||||
@@ -3238,8 +3244,7 @@ public class NetInterfaceManager {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final int REQUEST_CODE = 12345;
|
||||||
private static int REQUEST_CODE = 12345;
|
|
||||||
|
|
||||||
public void getRunLog() {
|
public void getRunLog() {
|
||||||
getSnRunLogControl()
|
getSnRunLogControl()
|
||||||
@@ -3403,9 +3408,9 @@ public class NetInterfaceManager {
|
|||||||
|
|
||||||
public void sendAppUsedTime(String random, String type) {
|
public void sendAppUsedTime(String random, String type) {
|
||||||
StatisticsInfo statisticsInfo = null;
|
StatisticsInfo statisticsInfo = null;
|
||||||
if (type.equals("0")) {
|
if ("0".equals(type)) {
|
||||||
statisticsInfo = new StatisticsInfo(mContext);
|
statisticsInfo = new StatisticsInfo(mContext);
|
||||||
} else if (type.equals("1")) {
|
} else if ("1".equals(type)) {
|
||||||
statisticsInfo = new StatisticsInfo(mContext, StatisticsInfo.WEEK);
|
statisticsInfo = new StatisticsInfo(mContext, StatisticsInfo.WEEK);
|
||||||
}
|
}
|
||||||
List<AppInformation> list = null;
|
List<AppInformation> list = null;
|
||||||
@@ -3506,7 +3511,6 @@ public class NetInterfaceManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void sendBatteryInfo(BatteryInfo info) {
|
public void sendBatteryInfo(BatteryInfo info) {
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
Log.e(TAG, "sendBatteryInfo: " + "BatteryInfo is NULL");
|
Log.e(TAG, "sendBatteryInfo: " + "BatteryInfo is NULL");
|
||||||
|
|||||||
@@ -43,12 +43,12 @@ public class BootReceiver extends BroadcastReceiver {
|
|||||||
@Override
|
@Override
|
||||||
public void onNext(Long aLong) {
|
public void onNext(Long aLong) {
|
||||||
Log.e("getLockedState", "onNext: ");
|
Log.e("getLockedState", "onNext: ");
|
||||||
if (MainService.mPresenter != null) {
|
// if (MainService.mPresenter != null) {
|
||||||
// MainService.mPresenter.getLockedState();
|
//// MainService.mPresenter.getLockedState();
|
||||||
Log.e("getLockedState", "mPresenter: " + "getLockedState");
|
// Log.e("getLockedState", "mPresenter: " + "getLockedState");
|
||||||
} else {
|
// } else {
|
||||||
Log.e("getLockedState", "mPresenter is NULL");
|
// Log.e("getLockedState", "mPresenter is NULL");
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -82,9 +82,9 @@ public class BootReceiver extends BroadcastReceiver {
|
|||||||
SPUtils.put(context, CommonConfig.FIRST_STARTUP, 1);
|
SPUtils.put(context, CommonConfig.FIRST_STARTUP, 1);
|
||||||
} else {
|
} else {
|
||||||
LogDBManager.getInstance().creatRebootLog("设备重启", TimeUtils.transferLongToDate(System.currentTimeMillis()));
|
LogDBManager.getInstance().creatRebootLog("设备重启", TimeUtils.transferLongToDate(System.currentTimeMillis()));
|
||||||
Intent checkNetintent = new Intent(context, CheckNetActivity.class);
|
// Intent checkNetintent = new Intent(context, CheckNetActivity.class);
|
||||||
checkNetintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
// checkNetintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
context.startActivity(checkNetintent);
|
// context.startActivity(checkNetintent);
|
||||||
}
|
}
|
||||||
JGYUtils.startServices(context);
|
JGYUtils.startServices(context);
|
||||||
JGYUtils.getInstance().onBootOpenApp();
|
JGYUtils.getInstance().onBootOpenApp();
|
||||||
|
|||||||
@@ -64,9 +64,7 @@ public class NewAppReceiver extends BroadcastReceiver {
|
|||||||
}
|
}
|
||||||
Log.e(TAG, "sendAppInfo: " + state + packageName);
|
Log.e(TAG, "sendAppInfo: " + state + packageName);
|
||||||
JGYUtils.getInstance().checkDefaultDesktop(packageName);
|
JGYUtils.getInstance().checkDefaultDesktop(packageName);
|
||||||
JGYUtils.getInstance().checkForceDownload();
|
|
||||||
NetInterfaceManager.getInstance().checkUpdate();
|
NetInterfaceManager.getInstance().checkUpdate();
|
||||||
NetInterfaceManager.getInstance().getDefaultDesktop();
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
if (!PackageNames.APPSTORE.equals(packageName) || !PackageNames.DEVICE_INFO.equals(packageName)) {
|
if (!PackageNames.APPSTORE.equals(packageName) || !PackageNames.DEVICE_INFO.equals(packageName)) {
|
||||||
ApkUtils.addShortcut(context);
|
ApkUtils.addShortcut(context);
|
||||||
@@ -97,6 +95,8 @@ public class NewAppReceiver extends BroadcastReceiver {
|
|||||||
@Override
|
@Override
|
||||||
public void onNext(@NonNull String s) {
|
public void onNext(@NonNull String s) {
|
||||||
Log.e(TAG, "sendAppInfo: onNext: " + s);
|
Log.e(TAG, "sendAppInfo: onNext: " + s);
|
||||||
|
JGYUtils.getInstance().checkForceDownload();
|
||||||
|
NetInterfaceManager.getInstance().getDefaultDesktop();
|
||||||
NetInterfaceManager.getInstance().sendInstalledAppInfo(new NetInterfaceManager.onCompleteCallback() {
|
NetInterfaceManager.getInstance().sendInstalledAppInfo(new NetInterfaceManager.onCompleteCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onComplete() {
|
||||||
|
|||||||
@@ -267,7 +267,6 @@ public class MainSPresenter implements MainSContact.Presenter {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.aoleyun.sn.BuildConfig;
|
import com.aoleyun.sn.BuildConfig;
|
||||||
import com.aoleyun.sn.R;
|
import com.aoleyun.sn.R;
|
||||||
import com.aoleyun.sn.activity.checknet.CheckNetActivity;
|
|
||||||
import com.aoleyun.sn.activity.main.MainActivity;
|
import com.aoleyun.sn.activity.main.MainActivity;
|
||||||
import com.aoleyun.sn.bean.PoweroffBean;
|
import com.aoleyun.sn.bean.PoweroffBean;
|
||||||
import com.aoleyun.sn.comm.CommonConfig;
|
import com.aoleyun.sn.comm.CommonConfig;
|
||||||
@@ -88,10 +87,8 @@ import io.reactivex.rxjava3.subjects.BehaviorSubject;
|
|||||||
|
|
||||||
public class MainService extends Service implements MainSContact.MainView, NetworkUtils.OnNetworkStatusChangedListener, LifecycleProvider<ActivityEvent> {
|
public class MainService extends Service implements MainSContact.MainView, NetworkUtils.OnNetworkStatusChangedListener, LifecycleProvider<ActivityEvent> {
|
||||||
private static final String TAG = MainService.class.getSimpleName();
|
private static final String TAG = MainService.class.getSimpleName();
|
||||||
private String connectKey;
|
|
||||||
|
|
||||||
@SuppressLint("StaticFieldLeak")
|
public MainSPresenter mPresenter;
|
||||||
public static MainSPresenter mPresenter;
|
|
||||||
private MMKV mMMKV = MMKV.defaultMMKV();
|
private MMKV mMMKV = MMKV.defaultMMKV();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -102,29 +99,24 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConnected(NetworkUtils.NetworkType networkType) {
|
public void onConnected(NetworkUtils.NetworkType networkType) {
|
||||||
// Debug.waitForDebugger();
|
|
||||||
ToastUtil.betaShow("网络已连接");
|
ToastUtil.betaShow("网络已连接");
|
||||||
Aria.download(this).resumeAllTask();
|
Aria.download(this).resumeAllTask();
|
||||||
String WiFiAlias = Utils.getWifiAlias(this);
|
String WiFiAlias = Utils.getWifiAlias(this);
|
||||||
Log.e("OnNetworkStatusChanged", "onConnected: " + WiFiAlias);
|
Log.e("OnNetworkStatusChanged", "onConnected: " + WiFiAlias);
|
||||||
Utils.getPublicIP(this);
|
|
||||||
if (mMMKV.decodeInt(CommonConfig.DEVICES_FRIST_START, 1) == 1) {
|
|
||||||
Intent intent = new Intent(this, CheckNetActivity.class);
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
if (ConnectManager.getInstance().isWiFiFistConnect()) {
|
|
||||||
start.onstar(ConnectManager.WIFI_LAST_CONNECT_TIME);
|
|
||||||
} else {
|
|
||||||
if (ConnectManager.getInstance().isWiFiCutoverFistConnect(WiFiAlias)) {
|
|
||||||
start.onstar(WiFiAlias);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!checkAoleyunApp()) {
|
if (!checkAoleyunApp()) {
|
||||||
mPresenter.checkAoleyunUpdate();
|
mPresenter.checkAoleyunUpdate();
|
||||||
}
|
}
|
||||||
|
Utils.getPublicIP(this);
|
||||||
TimeTask task = new TimeTask();
|
TimeTask task = new TimeTask();
|
||||||
task.execute("ntp.aliyun.com");
|
task.execute("ntp.aliyun.com");
|
||||||
|
mPresenter.getLockedState("onConnected");
|
||||||
|
|
||||||
|
if (mMMKV.decodeInt(CommonConfig.DEVICES_FRIST_START, 1) == 1) {
|
||||||
|
// Intent intent = new Intent(this, CheckNetActivity.class);
|
||||||
|
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
// startActivity(intent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TimeTask extends AsyncTask<String, Long, Long> {
|
private class TimeTask extends AsyncTask<String, Long, Long> {
|
||||||
@@ -245,9 +237,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
if (!oldSSID.equals(newSSID)) {
|
if (!oldSSID.equals(newSSID)) {
|
||||||
LogDBManager.getInstance().creatNetChangeLog("", oldSSID + " change to: " + newSSID);
|
LogDBManager.getInstance().creatNetChangeLog("", oldSSID + " change to: " + newSSID);
|
||||||
//直接获取数据
|
//直接获取数据
|
||||||
if (ConnectManager.getInstance().isWiFiCutoverFistConnect(newSSID)) {
|
|
||||||
start.onstar(newSSID);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
LogDBManager.getInstance().creatNetChangeLog("接入WiFi",
|
LogDBManager.getInstance().creatNetChangeLog("接入WiFi",
|
||||||
"connect to: " + newSSID + " time: "
|
"connect to: " + newSSID + " time: "
|
||||||
@@ -270,45 +259,30 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private interface Start {
|
private RefreshReceiver mRefreshReceiver;
|
||||||
void onstar(String key);
|
|
||||||
|
private void registerRefreshReceiver() {
|
||||||
|
if (mRefreshReceiver == null) {
|
||||||
|
mRefreshReceiver = new RefreshReceiver();
|
||||||
|
}
|
||||||
|
IntentFilter filter = new IntentFilter();
|
||||||
|
filter.addAction(RefreshReceiver.REFRESH_RECEIVER_ACTION);
|
||||||
|
registerReceiver(mRefreshReceiver, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Start start;
|
|
||||||
|
|
||||||
private ObservableOnSubscribe<String> timeSubscribe = new ObservableOnSubscribe<String>() {
|
public class RefreshReceiver extends BroadcastReceiver {
|
||||||
@Override
|
public static final String REFRESH_RECEIVER_ACTION = "Receiver_Refresh_Action";
|
||||||
public void subscribe(ObservableEmitter<String> emitter) throws Exception {
|
|
||||||
start = emitter::onNext;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private Observer<String> timeObserver = new Observer<String>() {
|
|
||||||
@Override
|
|
||||||
public void onSubscribe(Disposable d) {
|
|
||||||
Log.e("timeObserver", "onSubscribe: ");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(String string) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
connectKey = string;
|
String action = intent.getAction();
|
||||||
if (!connectKey.equals(ConnectManager.REBOOT_LAST_ONNECT_TIME)) {
|
Log.e("RefreshReceiver", "onReceive: " + action);
|
||||||
mMMKV.encode(connectKey, System.currentTimeMillis());
|
if (!TextUtils.isEmpty(action)) {
|
||||||
|
mPresenter.getLockedState("refresh");
|
||||||
}
|
}
|
||||||
Log.e("timeObserver", "onNext: " + string);
|
|
||||||
mPresenter.getLockedState(string);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@Override
|
|
||||||
public void onError(Throwable e) {
|
|
||||||
Log.e("timeObserver", "onError: " + e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onComplete() {
|
|
||||||
Log.e("timeObserver", "onComplete: ");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
public MainService() {
|
public MainService() {
|
||||||
|
|
||||||
@@ -327,15 +301,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getLockedState() {
|
|
||||||
Log.e(TAG, "getLockedState: MainBinder");
|
|
||||||
if (!mPresenter.isRequesting()) {
|
|
||||||
mPresenter.getLockedState("MainBinder");
|
|
||||||
} else {
|
|
||||||
Log.e(TAG, "getLockedState: MainSPresenter is requesting now");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
@@ -347,6 +312,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
|
|
||||||
TimeTask task = new TimeTask();
|
TimeTask task = new TimeTask();
|
||||||
task.execute("ntp.aliyun.com");
|
task.execute("ntp.aliyun.com");
|
||||||
|
mPresenter.getLockedState("onCreate");
|
||||||
|
|
||||||
//根据要求卸载这两个应用
|
//根据要求卸载这两个应用
|
||||||
if (!JGYUtils.getInstance().getDeviceIsLocked()) {
|
if (!JGYUtils.getInstance().getDeviceIsLocked()) {
|
||||||
@@ -360,9 +326,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
Log.e(TAG, "onCreate: " + e.getMessage());
|
Log.e(TAG, "onCreate: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
Observable.create(timeSubscribe)
|
|
||||||
.throttleFirst(1, TimeUnit.MINUTES)
|
|
||||||
.subscribe(timeObserver);
|
|
||||||
Observable.create(topAppSubscribe)
|
Observable.create(topAppSubscribe)
|
||||||
.throttleFirst(1, TimeUnit.MINUTES)
|
.throttleFirst(1, TimeUnit.MINUTES)
|
||||||
.subscribe(topAppObserver);
|
.subscribe(topAppObserver);
|
||||||
@@ -371,10 +334,9 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
.subscribe(timeChangedObserver);
|
.subscribe(timeChangedObserver);
|
||||||
|
|
||||||
if ((int) SPUtils.get(this, CommonConfig.JGY_FIRST_CONNECT, 0) == 0) {
|
if ((int) SPUtils.get(this, CommonConfig.JGY_FIRST_CONNECT, 0) == 0) {
|
||||||
// TODO: 2021/5/26 待底层修改,临时解决办法
|
|
||||||
Log.e(TAG, "onCreate: " + "Disable All Settings");
|
Log.e(TAG, "onCreate: " + "Disable All Settings");
|
||||||
SysSettingUtils.setDisableSetting(this);
|
SysSettingUtils.setDisableSetting(this);
|
||||||
start.onstar(ConnectManager.REBOOT_LAST_ONNECT_TIME);
|
// mPresenter.getLockedState(CommonConfig.JGY_FIRST_CONNECT);
|
||||||
}
|
}
|
||||||
int oldVersionCode = (int) SPUtils.get(this, CommonConfig.SN_VERSIONCODE, 0);
|
int oldVersionCode = (int) SPUtils.get(this, CommonConfig.SN_VERSIONCODE, 0);
|
||||||
if (oldVersionCode < BuildConfig.VERSION_CODE) {
|
if (oldVersionCode < BuildConfig.VERSION_CODE) {
|
||||||
@@ -385,12 +347,9 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
Log.e(TAG, "onReceive: " + e.getMessage());
|
Log.e(TAG, "onReceive: " + e.getMessage());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
mPresenter.getLockedState("upgrade");
|
// mPresenter.checkAoleyunUpdate();
|
||||||
mPresenter.checkAoleyunUpdate();
|
|
||||||
} else {
|
} else {
|
||||||
if (ConnectManager.getInstance().isRebootFistConnect()) {
|
|
||||||
start.onstar(ConnectManager.REBOOT_LAST_ONNECT_TIME);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
SPUtils.put(this, CommonConfig.SN_VERSIONCODE, BuildConfig.VERSION_CODE);
|
SPUtils.put(this, CommonConfig.SN_VERSIONCODE, BuildConfig.VERSION_CODE);
|
||||||
registerReceivers();
|
registerReceivers();
|
||||||
@@ -399,8 +358,8 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
timeChangedStart.onstar(System.currentTimeMillis());
|
timeChangedStart.onstar(System.currentTimeMillis());
|
||||||
setStatusbar();
|
setStatusbar();
|
||||||
setFloatingWindow();
|
setFloatingWindow();
|
||||||
notificationManager = NotificationManagerCompat.from(this);
|
// notificationManager = NotificationManagerCompat.from(this);
|
||||||
createNotificationChannel();
|
// createNotificationChannel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -410,7 +369,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
if (mMMKV.decodeInt(CommonConfig.DEVICES_FRIST_START, 1) == 0) {
|
if (mMMKV.decodeInt(CommonConfig.DEVICES_FRIST_START, 1) == 0) {
|
||||||
if (!checkAoleyunApp()) {
|
if (!checkAoleyunApp()) {
|
||||||
Log.e(TAG, "onStartCommand: " + "checkAoleyunApp");
|
Log.e(TAG, "onStartCommand: " + "checkAoleyunApp");
|
||||||
mPresenter.checkAoleyunUpdate();
|
// mPresenter.checkAoleyunUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NetInterfaceManager.getInstance().checkUpdate();
|
NetInterfaceManager.getInstance().checkUpdate();
|
||||||
@@ -491,6 +450,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
registerLockScreenReceiver();
|
registerLockScreenReceiver();
|
||||||
registerTimeReceiver();
|
registerTimeReceiver();
|
||||||
registerInstallReceiver();
|
registerInstallReceiver();
|
||||||
|
registerRefreshReceiver();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void unRegisterReceivers() {
|
private void unRegisterReceivers() {
|
||||||
@@ -506,6 +466,9 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
if (null != mWifiReceiver) {
|
if (null != mWifiReceiver) {
|
||||||
unregisterReceiver(mWifiReceiver);
|
unregisterReceiver(mWifiReceiver);
|
||||||
}
|
}
|
||||||
|
if (null != mRefreshReceiver) {
|
||||||
|
unregisterReceiver(mRefreshReceiver);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static WindowManager windowManager;
|
private static WindowManager windowManager;
|
||||||
@@ -882,7 +845,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
Log.e(TAG, "setLockedState: " + loocked);
|
Log.e(TAG, "setLockedState: " + loocked);
|
||||||
if (loocked) {
|
if (loocked) {
|
||||||
ToastUtil.betaShow("设备已上锁");
|
ToastUtil.betaShow("设备已上锁");
|
||||||
sendSimpleNotification();
|
// sendSimpleNotification();
|
||||||
mPresenter.setPushTags();
|
mPresenter.setPushTags();
|
||||||
mPresenter.getDeveloper();
|
mPresenter.getDeveloper();
|
||||||
ApkUtils.UninstallAPP(this, "com.joytv.live");
|
ApkUtils.UninstallAPP(this, "com.joytv.live");
|
||||||
@@ -902,7 +865,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
if (noTag) {
|
if (noTag) {
|
||||||
//没有批次就没有管控
|
//没有批次就没有管控
|
||||||
Log.e(TAG, "setTagsFinish: " + "not set tag");
|
Log.e(TAG, "setTagsFinish: " + "not set tag");
|
||||||
mPresenter.getStudesInfo(true);
|
// mPresenter.getStudesInfo(true);
|
||||||
} else {
|
} else {
|
||||||
mPresenter.getDeviceBatch();
|
mPresenter.getDeviceBatch();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -514,7 +514,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
|||||||
MMKV.defaultMMKV().clearAll();
|
MMKV.defaultMMKV().clearAll();
|
||||||
JGYUtils.getInstance().cleanAoleAppCache();
|
JGYUtils.getInstance().cleanAoleAppCache();
|
||||||
JGYUtils.getInstance().wakeUpAoleyunAPP();
|
JGYUtils.getInstance().wakeUpAoleyunAPP();
|
||||||
MainService.mPresenter.getLockedState("MSG_PUSH_RESET");
|
sendRefreshBroadcast(context);
|
||||||
break;
|
break;
|
||||||
case MSG_INSTALL:
|
case MSG_INSTALL:
|
||||||
ToastUtil.betaShow("收到管控:应用安装");
|
ToastUtil.betaShow("收到管控:应用安装");
|
||||||
@@ -620,13 +620,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
|||||||
case GET_DEVICES_INFO:
|
case GET_DEVICES_INFO:
|
||||||
ToastUtil.betaShow("收到管控:获取设备信息");
|
ToastUtil.betaShow("收到管控:获取设备信息");
|
||||||
getBatteryInfo(context);
|
getBatteryInfo(context);
|
||||||
if (MainService.mPresenter != null) {
|
sendRefreshBroadcast(context);
|
||||||
MainService.mPresenter.getLockedState("XGPush");
|
|
||||||
MainService.mPresenter.sendMACAddress();
|
|
||||||
Log.e(TAG, "mPresenter: " + "getLockedState");
|
|
||||||
} else {
|
|
||||||
Log.e(TAG, "mPresenter is NULL");
|
|
||||||
}
|
|
||||||
LocationClient locationClient = MapManager.getInstance().getLocationClient();
|
LocationClient locationClient = MapManager.getInstance().getLocationClient();
|
||||||
locationClient.stop();
|
locationClient.stop();
|
||||||
locationClient.start();
|
locationClient.start();
|
||||||
@@ -779,12 +773,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Log.e(TAG, "setHomepagtag: " + e.getMessage());
|
Log.e(TAG, "setHomepagtag: " + e.getMessage());
|
||||||
}
|
}
|
||||||
if (MainService.mPresenter != null) {
|
sendRefreshBroadcast(context);
|
||||||
MainService.mPresenter.getLockedState("XGPush_RESTORE");
|
|
||||||
Log.e("getLockedState", "mPresenter: " + "getLockedState");
|
|
||||||
} else {
|
|
||||||
Log.e("getLockedState", "mPresenter is NULL");
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case UPDATE_WIFI_PW:
|
case UPDATE_WIFI_PW:
|
||||||
NetInterfaceManager.getInstance().getWiFiPasswd();
|
NetInterfaceManager.getInstance().getWiFiPasswd();
|
||||||
@@ -1442,4 +1431,9 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
|||||||
NetInterfaceManager.getInstance().sendBatteryInfo(batteryInfo);
|
NetInterfaceManager.getInstance().sendBatteryInfo(batteryInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendRefreshBroadcast(Context context) {
|
||||||
|
Intent intent = new Intent(MainService.RefreshReceiver.REFRESH_RECEIVER_ACTION);
|
||||||
|
context.sendBroadcast(intent);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.aoleyun.sn.utils;
|
package com.aoleyun.sn.utils;
|
||||||
|
|
||||||
import android.app.ActivityManager;
|
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -739,11 +738,12 @@ public class ApkUtils {
|
|||||||
|
|
||||||
//桌面app
|
//桌面app
|
||||||
public static List<String> desktopAPP = new ArrayList<String>() {{
|
public static List<String> desktopAPP = new ArrayList<String>() {{
|
||||||
this.add("com.aoleyunos.dop1");
|
// this.add("com.aoleyunos.dop1");
|
||||||
this.add("com.aoleyunos.dop2");
|
// this.add("com.aoleyunos.dop2");
|
||||||
this.add("com.uiuios.jgy1");
|
this.add("com.uiuios.jgy1");
|
||||||
this.add("com.uiuios.jgy2");
|
this.add("com.uiuios.jgy2");
|
||||||
this.add("com.android.uiuios");
|
this.add("com.android.uiuios");
|
||||||
|
this.add("com.shoufei.aole");
|
||||||
}};
|
}};
|
||||||
|
|
||||||
public static List<String> aoleyunAPP = new ArrayList<String>() {{
|
public static List<String> aoleyunAPP = new ArrayList<String>() {{
|
||||||
@@ -752,6 +752,7 @@ public class ApkUtils {
|
|||||||
this.add("com.aoleyun.info");
|
this.add("com.aoleyun.info");
|
||||||
this.add("com.aoleyun.os");
|
this.add("com.aoleyun.os");
|
||||||
this.add("com.aoleyun.browser");
|
this.add("com.aoleyun.browser");
|
||||||
|
this.add("com.aoleyun.browser");
|
||||||
}};
|
}};
|
||||||
|
|
||||||
//出厂自带的app
|
//出厂自带的app
|
||||||
@@ -973,6 +974,8 @@ public class ApkUtils {
|
|||||||
this.add("com.creative.strokeprovider");
|
this.add("com.creative.strokeprovider");
|
||||||
this.add("com.ckl.oraltraining");
|
this.add("com.ckl.oraltraining");
|
||||||
this.add("com.ckl.fcfilemanager");
|
this.add("com.ckl.fcfilemanager");
|
||||||
|
|
||||||
|
this.add("com.iflytek.inputmethod");
|
||||||
}};
|
}};
|
||||||
|
|
||||||
public static void showAllAPP(Context context) {
|
public static void showAllAPP(Context context) {
|
||||||
|
|||||||
Reference in New Issue
Block a user