version:2.3
fix:增加上传日志功能,优化一键加速功能 update:
This commit is contained in:
@@ -12,7 +12,6 @@ import android.media.AudioManager;
|
||||
import android.media.MediaPlayer;
|
||||
import android.os.BatteryManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
@@ -25,15 +24,17 @@ import com.amap.api.location.AMapLocation;
|
||||
import com.amap.api.location.AMapLocationClient;
|
||||
import com.amap.api.location.AMapLocationListener;
|
||||
import com.aoleyun.sn.R;
|
||||
import com.aoleyun.sn.action.JGYActions;
|
||||
import com.aoleyun.sn.base.BaseApplication;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.RemoteDebug;
|
||||
import com.aoleyun.sn.comm.CommonDatas;
|
||||
import com.aoleyun.sn.bean.SnRunLog;
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.comm.JGYActions;
|
||||
import com.aoleyun.sn.manager.AmapManager;
|
||||
import com.aoleyun.sn.network.HTTPInterface;
|
||||
import com.aoleyun.sn.network.NetInterfaceManager;
|
||||
import com.aoleyun.sn.service.MainService;
|
||||
import com.aoleyun.sn.rlog.LogDBManager;
|
||||
import com.aoleyun.sn.service.main.MainService;
|
||||
import com.aoleyun.sn.tpush.common.NotificationService;
|
||||
import com.aoleyun.sn.tpush.po.XGNotification;
|
||||
import com.aoleyun.sn.utils.ApkUtils;
|
||||
@@ -87,86 +88,90 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
|
||||
private static final String TAG = MessageReceiver.class.getSimpleName();
|
||||
|
||||
//删除应用
|
||||
/*删除应用*/
|
||||
private final String MSG_DELETE = "1";
|
||||
//系统设置管控
|
||||
/*系统设置管控*/
|
||||
private final String MSG_SETTING = "2";
|
||||
//浏览器网址管控
|
||||
/*浏览器网址管控*/
|
||||
private final String MSG_BROWSER = "4";
|
||||
//app id管控
|
||||
/*app id管控*/
|
||||
private final String MSG_APPID = "5";
|
||||
//应用联网管控
|
||||
/*应用联网管控*/
|
||||
private final String MSG_NET_CONTROL = "6";
|
||||
//APP自启联网滑动管控
|
||||
/*APP自启联网滑动管控*/
|
||||
private final String MSG_POWER_ON = "7";
|
||||
//重置
|
||||
/*重置*/
|
||||
private final String MSG_RESET = "8";
|
||||
//强制安装
|
||||
/*强制安装*/
|
||||
private final String MSG_INSTALL = "9";
|
||||
//解锁
|
||||
/*解锁*/
|
||||
private final String MSG_LOCK = "10";
|
||||
//旧版相机管控
|
||||
/*旧版相机管控*/
|
||||
private final String MSG_CAMERA = "11";
|
||||
|
||||
private final String MSG_ONEPACKAGES = "12";
|
||||
//app使用时间
|
||||
/*app使用时间*/
|
||||
private final String GET_APP_USEDTIME = "13";
|
||||
//强制下载
|
||||
/*强制下载*/
|
||||
private final String GET_FORCEDOWNLOADURL = "14";
|
||||
//主页和书签管控
|
||||
/*主页和书签管控*/
|
||||
private final String SET_HOMEPAG_TAG = "15";
|
||||
//app内网页管控
|
||||
/*app内网页管控*/
|
||||
private final String APP_WEBSITE = "16";
|
||||
//禁止app升级
|
||||
/*禁止app升级*/
|
||||
private final String DISABLE_APPUPDATE = "17";
|
||||
//隐藏桌面图标
|
||||
/*隐藏桌面图标*/
|
||||
private final String HIDE_DESKTOP_ICON = "18";
|
||||
//禁止滑动
|
||||
/*禁止滑动*/
|
||||
private final String DISABLE_APP_SLIDE = "19";
|
||||
//更新引用白名单
|
||||
/*更新引用白名单*/
|
||||
private final String UPDATE_INFO = "20";
|
||||
//截图
|
||||
/*截图*/
|
||||
private final String SN_SCREENSHOT = "21";
|
||||
//重启
|
||||
/*重启*/
|
||||
private final String DEVICES_REBOOT = "22";
|
||||
//获取设备详细信息
|
||||
/*获取设备详细信息*/
|
||||
private final String GET_DEVICES_INFO = "23";
|
||||
//霸屏
|
||||
/*霸屏*/
|
||||
private final String LOCK_SCREEN = "24";
|
||||
//取消霸屏
|
||||
/*取消霸屏*/
|
||||
private final String UNLOCK_SCREEN = "25";
|
||||
//结束进程
|
||||
/*结束进程*/
|
||||
private final String KILL_SERVER = "26";
|
||||
//时间管控
|
||||
/*时间管控*/
|
||||
private final String TIME_CONTROL = "27";
|
||||
//app霸屏
|
||||
/*app霸屏*/
|
||||
private final String TOP_APP = "28";
|
||||
//开机动画
|
||||
/*开机动画*/
|
||||
private final String LOGO_IMG = "29";
|
||||
//默认应用
|
||||
/*默认应用*/
|
||||
private final String DEFAULTP_APP = "30";
|
||||
//发出声音
|
||||
/*发出声音*/
|
||||
private final String PLAY_SOUND = "31";
|
||||
//清除app数据
|
||||
/*清除app数据*/
|
||||
private final String CLEAN_APP_CACHE = "32";
|
||||
//开发人员选项
|
||||
/*开发人员选项*/
|
||||
private final String DEVELOPER_OPTIONS = "33";
|
||||
//全局更新
|
||||
/*全局更新*/
|
||||
private final String GLOBAL_UPDATE = "34";
|
||||
//电子书包激活码
|
||||
/*电子书包激活码*/
|
||||
private final String EBAG_CODE = "35";
|
||||
//更新白名单
|
||||
/*更新白名单*/
|
||||
private final String UPDATE_WHITELIST = "36";
|
||||
//更换批次不恢复出厂
|
||||
/*更换批次不恢复出厂*/
|
||||
private final String UPDATE_BATCH = "37";
|
||||
//添加wifi
|
||||
/*添加wifi*/
|
||||
private final String UPDATE_WIFI_PW = "38";
|
||||
//远程关机
|
||||
/*远程关机*/
|
||||
private final String DEVICES_POWEROFF = "41";
|
||||
//远程log
|
||||
/*远程log*/
|
||||
private final String SN_RUN_LOG = "43";
|
||||
//自定义指令
|
||||
/*自定义指令*/
|
||||
private final String CUSTOM_ORDER = "44";
|
||||
/*优化内存*/
|
||||
private final String CLEAN_MEMORY = "47";
|
||||
/*运行日志设置*/
|
||||
private final String SN_LOG_SETTING = "48";
|
||||
|
||||
private Context mContext;
|
||||
private ContentResolver mResolver;
|
||||
@@ -612,7 +617,28 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
Log.e(TAG, (String) SPUtils.get(mContext, "AmapAddress", "-"));
|
||||
Log.e(TAG, (String) SPUtils.get(mContext, "AmapError", "-"));
|
||||
Log.e(TAG, "amap: " + sb.toString());
|
||||
HTTPInterface.updateDeviceInfo(mContext);
|
||||
NetInterfaceManager.getInstance().updateDeviceInfo(new NetInterfaceManager.ObserverCallback() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse response) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
break;
|
||||
@@ -630,7 +656,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
ToastUtil.betaShow("收到管控:停止应用");
|
||||
JSONObject killJSONObject = JSON.parseObject(extras);
|
||||
String packages = killJSONObject.getString("package_name");
|
||||
JGYUtils.getInstance().killBackgroundProcesses(mContext, packages);
|
||||
JGYUtils.getInstance().killBackgroundProcesses(packages);
|
||||
break;
|
||||
case TIME_CONTROL:
|
||||
ToastUtil.betaShow("收到管控:使用时间管控");
|
||||
@@ -668,7 +694,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
case EBAG_CODE:
|
||||
ToastUtil.betaShow("收到管控:电子书包激活码");
|
||||
setEbagCode(extras);
|
||||
JGYUtils.getInstance().killBackgroundProcesses(mContext, "com.jxw.launcher");
|
||||
JGYUtils.getInstance().killBackgroundProcesses("com.jxw.launcher");
|
||||
break;
|
||||
case UPDATE_WHITELIST:
|
||||
ToastUtil.betaShow("收到管控:更新白名单");
|
||||
@@ -702,6 +728,12 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
case CUSTOM_ORDER:
|
||||
customOrder(extras);
|
||||
break;
|
||||
case CLEAN_MEMORY:
|
||||
JGYUtils.getInstance().cleanBackgroundMemory();
|
||||
break;
|
||||
case SN_LOG_SETTING:
|
||||
senSNLogFile(extras);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -960,10 +992,10 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
Settings.System.putInt(mResolver, JGYActions.ACTION_QCH_UNLOCK_IPAD, i);
|
||||
Log.e("SystemSetting", "qch_unlock_ipad---------" + i);
|
||||
|
||||
if (getBatteryLevel() >= CommonDatas.MIN_POWER) {
|
||||
if (getBatteryLevel() >= CommonConfig.MIN_POWER) {
|
||||
Utils.doMasterClear(mContext);
|
||||
} else {
|
||||
MySQLData.SetBooleanData(mContext, CommonDatas.IS_RESET, true);
|
||||
MySQLData.SetBooleanData(mContext, CommonConfig.IS_RESET, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1279,4 +1311,23 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonString
|
||||
* "is_log": 1,//是否开启运行日志 0关闭 1开启
|
||||
* "is_log_type": 1 //获取运行日志类型 0即时 1定时
|
||||
*/
|
||||
private void senSNLogFile(String jsonString) {
|
||||
JSONObject jsonObject = JSON.parseObject(jsonString);
|
||||
int is_log = jsonObject.getInteger("is_log");
|
||||
int is_log_type = jsonObject.getInteger("is_log_type");
|
||||
if (is_log == 0) {
|
||||
return;
|
||||
}
|
||||
if (is_log_type == 0) {
|
||||
NetInterfaceManager.getInstance().uploadLogFile();
|
||||
} else {
|
||||
SPUtils.put(mContext, CommonConfig.UPLOAD_LOG_TYPE, 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user