version:2.4 beta

fix:
add:优化接口请求,修复一下报错,删除极光推送和高德地图sdk
This commit is contained in:
2022-06-29 19:59:19 +08:00
parent ace28e65b5
commit 657d45ab33
67 changed files with 13003 additions and 2963 deletions

View File

@@ -10,7 +10,6 @@ import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.media.AudioManager;
import android.os.CountDownTimer;
import android.os.Environment;
import android.os.Handler;
import android.provider.Settings;
@@ -20,8 +19,6 @@ import android.view.Gravity;
import android.view.WindowManager;
import android.widget.Toast;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.android.internal.view.RotationPolicy;
import com.arialyy.aria.core.Aria;
import com.arialyy.aria.core.download.DownloadEntity;
@@ -49,6 +46,7 @@ import com.uiui.sn.tpush.po.XGNotification;
import com.uiui.sn.utils.ApkUtils;
import com.uiui.sn.utils.CacheUtils;
import com.uiui.sn.utils.CmdUtil;
import com.uiui.sn.gson.GsonUtils;
import com.uiui.sn.utils.JGYUtils;
import com.uiui.sn.utils.SPUtils;
import com.uiui.sn.utils.ServiceAliveUtils;
@@ -608,8 +606,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
break;
case JIGUANG_FORCE_KILL:
ToastUtil.debugShow("收到推送消息: 强制停止应用");
JSONObject killJSONObject = JSON.parseObject(extras);
String packages = killJSONObject.getString("app_package");
JsonObject killJSONObject = GsonUtils.getJsonObject(extras);
String packages = killJSONObject.get("app_package").getAsString();
JGYUtils.getInstance().killBackgroundProcesses(packages);
Log.e(TAG, extras);
break;
@@ -741,27 +739,27 @@ public class MessageReceiver extends XGPushBaseReceiver {
}
private void setAdminApp(Context context, String extras) {
JSONObject jsonObject = JSON.parseObject(extras);
int setting_admin_app = jsonObject.getInteger("setting_admin_app");
JsonObject jsonObject = GsonUtils.getJsonObject(extras);
int setting_admin_app = jsonObject.get("setting_admin_app").getAsInt();
Settings.System.putInt(context.getContentResolver(), "setting_admin_app", setting_admin_app);
}
private void setZenMode(Context context, String extras) {
JSONObject jsonObject = JSON.parseObject(extras);
int setting_disturbance = jsonObject.getInteger("setting_disturbance");
JsonObject jsonObject = GsonUtils.getJsonObject(extras);
int setting_disturbance = jsonObject.get("setting_disturbance").getAsInt();
}
private void setRotationLock(Context context, String extras) {
JSONObject jsonObject = JSON.parseObject(extras);
int setting_rotation = jsonObject.getInteger("setting_rotation");
JsonObject jsonObject = GsonUtils.getJsonObject(extras);
int setting_rotation = jsonObject.get("setting_rotation").getAsInt();
RotationPolicy.setRotationLock(context, setting_rotation == 0);
}
private void setScreenBrightness(Context context, String extras) {
JSONObject jsonObject = JSON.parseObject(extras);
int setting_luminance = jsonObject.getInteger("setting_luminance");
JsonObject jsonObject = GsonUtils.getJsonObject(extras);
int setting_luminance = jsonObject.get("setting_luminance").getAsInt();
Settings.System.putInt(context.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE, Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
int Scrern_brightness = (int) ((1.0 * 255 / 100) * setting_luminance);
Settings.System.putInt(context.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, Scrern_brightness);
@@ -778,8 +776,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
protected List<String> mEntries;
private void setFontSize(Context context, String extras) {
JSONObject jsonObject = JSON.parseObject(extras);
String setting_typeface = jsonObject.getString("setting_typeface");
JsonObject jsonObject = GsonUtils.getJsonObject(extras);
String setting_typeface = jsonObject.get("setting_typeface").getAsString();
final Resources res = context.getResources();
mEntries = Arrays.asList(res.getStringArray(R.array.entries_font_size));
final String[] strEntryValues = res.getStringArray(R.array.entryvalues_font_size);
@@ -795,8 +793,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
}
private void setVolume(Context context, String extras) {
JSONObject jsonObject = JSON.parseObject(extras);
int setting_volume = jsonObject.getInteger("setting_volume");
JsonObject jsonObject = GsonUtils.getJsonObject(extras);
int setting_volume = jsonObject.get("setting_volume").getAsInt();
//获取系统的Audio管理者
AudioManager mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
//最大音量
@@ -822,11 +820,11 @@ public class MessageReceiver extends XGPushBaseReceiver {
synchronized private void setUsbStatus(Context context, String jsonString) {
if (!TextUtils.isEmpty(jsonString)) {
JSONObject jsonObject = JSON.parseObject(jsonString);
String setting_usb = jsonObject.getString("setting_usb");
JsonObject jsonObject = GsonUtils.getJsonObject(jsonString);
String setting_usb = jsonObject.get("setting_usb").getAsString();
ControlPanelManager.getInstance().setUsbStatus(setting_usb);
// boolean qch_usb_choose = JGYUtils.putString(context.getContentResolver(), "qch_usb_choose", setting_usb);
// Log.e("setUsbState:", JGYUtils.getString(context.getContentResolver(), "qch_usb_choose"));
// Log.e("setUsbState:", JGYUtils.get(context.getContentResolver(), "qch_usb_choose"));
// String usbStatus = "";
// switch (setting_usb) {
// case "usb_charge":
@@ -851,8 +849,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
synchronized private void setTfcardState(Context context, String jsonString) {
if (!TextUtils.isEmpty(jsonString)) {
JSONObject extra = JSON.parseObject(jsonString);
int is_tf = extra.getIntValue("setting_memory");
JsonObject extra = GsonUtils.getJsonObject(jsonString);
int is_tf = extra.get("setting_memory").getAsInt();
boolean aole_sdcard_forbid_on = JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON, changeNum(is_tf));
if (aole_sdcard_forbid_on) {
Log.e("setTfcardState:", JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON));
@@ -871,8 +869,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
if (null == mBluetoothAdapter) {
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();//获取默认蓝牙适配器
}
JSONObject extra = JSON.parseObject(jsonString);
int is_bluetooth = changeNum(extra.getIntValue("setting_bht"));
JsonObject extra = GsonUtils.getJsonObject(jsonString);
int is_bluetooth = changeNum(extra.get("setting_bht").getAsInt());
Log.e(TAG, "aole_bht_forbid_on: " + is_bluetooth);
try {
//写入系统数据库
@@ -901,9 +899,9 @@ public class MessageReceiver extends XGPushBaseReceiver {
synchronized private void setAppNetworkstate(Context context, String jsonString) {
if (!TextUtils.isEmpty(jsonString)) {
JSONObject extra = JSON.parseObject(jsonString);
String package0 = extra.getString("package0");
String package1 = extra.getString("package1");
JsonObject extra = GsonUtils.getJsonObject(jsonString);
String package0 = extra.get("package0").getAsString();
String package1 = extra.get("package1").getAsString();
if (package0.length() != 0) {
boolean aole_network_allow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW, package0);
Log.e("fht", "aole_network_allow::" + aole_network_allow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW));
@@ -925,9 +923,9 @@ public class MessageReceiver extends XGPushBaseReceiver {
synchronized private void setAppLockedstate(Context context, String jsonString) {
if (!TextUtils.isEmpty(jsonString)) {
JSONObject extra = JSON.parseObject(jsonString);
String packageName = extra.getString("package");
int is_lock = extra.getIntValue("is_lock");
JsonObject extra = GsonUtils.getJsonObject(jsonString);
String packageName = extra.get("package").getAsString();
int is_lock = extra.get("is_lock").getAsInt();
ToastUtil.debugShow("收到应用锁管控消息:包名" + packageName + "is_lock_state:" + is_lock);
PackageManager pm = context.getPackageManager();
//后台为0可能传过来null
@@ -947,10 +945,10 @@ public class MessageReceiver extends XGPushBaseReceiver {
return;
}
// NetInterfaceManager.getInstance().getAllAppPackageName(context);
JSONObject extra = JSON.parseObject(jsonString);
final String packages = extra.getString("package");
JsonObject extra = GsonUtils.getJsonObject(jsonString);
final String packages = extra.get("package").getAsString();
ToastUtil.debugShow("收到应用安装消息:包名" + packages);
String url = extra.getString("url");
String url = extra.get("url").getAsString();
if (TextUtils.isEmpty(url)) {
return;
}
@@ -974,8 +972,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
synchronized private void unintallApk(Context context, String jsonString) {
int sn_id = (int) SPUtils.get(context, "sn_id", -1);
JSONObject object = JSON.parseObject(jsonString);
String packageName = object.getString("app_package");
JsonObject object = GsonUtils.getJsonObject(jsonString);
String packageName = object.get("app_package").getAsString();
ToastUtil.debugShow("收到应用卸载消息:包名" + packageName);
if (!"".equals(packageName) && !packageName.equals(context.getApplicationContext().getPackageName())) {
if (!ApkUtils.isAvailable(context.getApplicationContext(), packageName)) {
@@ -992,10 +990,10 @@ public class MessageReceiver extends XGPushBaseReceiver {
synchronized void bindService(final Context context, String jsonString) {
ToastUtil.debugShow("收到绑定设备请求");
JSONObject object = JSON.parseObject(jsonString);
String userName = object.getString("member_name");
final String id = object.getString("id");
String phoneNum = object.getString("member_phone");
JsonObject object = GsonUtils.getJsonObject(jsonString);
String userName = object.get("member_name").getAsString();
final String id = object.get("id").getAsString();
String phoneNum = object.get("member_phone").getAsString();
dialog = new CustomDialog(context);
subscribe = Observable.interval(1, TimeUnit.SECONDS)
.subscribeOn(Schedulers.io())
@@ -1101,9 +1099,9 @@ public class MessageReceiver extends XGPushBaseReceiver {
@SuppressLint("NewApi")
private void setTFmedia(Context context, String jsonString) {
JSONObject jsonObject = JSON.parseObject(jsonString);
JsonObject jsonObject = GsonUtils.getJsonObject(jsonString);
//影音管控开关
int setting_tfmedia = jsonObject.getIntValue("setting_tfmedia");
int setting_tfmedia = jsonObject.get("setting_tfmedia").getAsInt();
Log.e("SystemSetting", "qch_tfmedia_forbid---------" + setting_tfmedia);
if (setting_tfmedia == 1) {
@@ -1112,7 +1110,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
String s = JGYUtils.getString(context.getContentResolver(), "qch_tfmedia_filetypes");//影音管控
Log.e("SystemSetting", "qch_tfmedia_filetypes old" + s);
JGYUtils.putInt(context.getContentResolver(), "qch_tfmedia_forbid", 1);
String setting_tfmedia_format = jsonObject.getString("setting_tfmedia_format");
String setting_tfmedia_format = jsonObject.get("setting_tfmedia_format").getAsString();
HashSet<String> types = new HashSet<>(Arrays.asList(setting_tfmedia_format.split(",")));
types.removeIf(TextUtils::isEmpty);
boolean b = JGYUtils.putString(context.getContentResolver(), "qch_tfmedia_filetypes", String.join(",", types));//影音管控
@@ -1121,9 +1119,9 @@ public class MessageReceiver extends XGPushBaseReceiver {
}
private void setCameta(Context context, String jsonString) {
JSONObject jsonObject = JSON.parseObject(jsonString);
JsonObject jsonObject = GsonUtils.getJsonObject(jsonString);
//摄像头开关
int setting_camera = changeNum(jsonObject.getIntValue("setting_camera"));
int setting_camera = changeNum(jsonObject.get("setting_camera").getAsInt());
JGYUtils.putInt(context.getContentResolver(), "qch_app_camera", setting_camera);
ApkUtils.hideSystemSettingAPP(context, "com.mediatek.camera");
Log.e("SystemSetting", "setting_camera---------" + setting_camera);
@@ -1149,9 +1147,9 @@ public class MessageReceiver extends XGPushBaseReceiver {
@SuppressLint("NewApi")
private void setAppUpdate(Context context, String jsonString) {
JSONObject jsonObject = JSON.parseObject(jsonString);
String is_upgrade = jsonObject.getString("is_upgrade");
String packageName = jsonObject.getString("package");
JsonObject jsonObject = GsonUtils.getJsonObject(jsonString);
String is_upgrade = jsonObject.get("is_upgrade").getAsString();
String packageName = jsonObject.get("package").getAsString();
String nowApplist = JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID);
List<String> applist = new ArrayList<>(Arrays.asList(nowApplist.split(",")));
if ("0".equals(is_upgrade)) {
@@ -1171,8 +1169,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
private void setLock_screen(Context context, String jsonString) {
int type = 0;
JSONObject jSONObject = JSON.parseObject(jsonString);
type = jSONObject.getInteger("type");
JsonObject jSONObject = GsonUtils.getJsonObject(jsonString);
type = jSONObject.get("type").getAsInt();
if (!ServiceAliveUtils.isServiceAlice(context, ManagerService.class.getName())) {
context.startService(new Intent(context, ManagerService.class));
@@ -1286,8 +1284,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
synchronized private void setBrowserUrlpath(Context context, String jsonString) {
if (!TextUtils.isEmpty(jsonString)) {
JSONObject extra = JSON.parseObject(jsonString);
String white = extra.getString("white");
JsonObject extra = GsonUtils.getJsonObject(jsonString);
String white = extra.get("white").getAsString();
if (white != null && !"".equals(white)) {
boolean whiteList = JGYUtils.putString(context.getContentResolver(), "DeselectBrowserArray", white);
Log.e("SystemSetting", "setBrowserList-whiteList" + whiteList + ":" + white);
@@ -1295,7 +1293,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
JGYUtils.putString(context.getContentResolver(), "DeselectBrowserArray", " ");
}
Log.e("whiteList", JGYUtils.getString(context.getContentResolver(), "DeselectBrowserArray"));
String black = extra.getString("black");
String black = extra.get("black").getAsString();
if (black != null && !"".equals(black)) {
boolean blackList = JGYUtils.putString(context.getContentResolver(), "qch_webblack_url", black);
Log.e("SystemSetting", "setBrowserList-blackList" + blackList + ":" + black);
@@ -1318,8 +1316,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
* @param jsonString 设置热点开关
*/
private void setHotspot(Context context, String jsonString) {
JSONObject jsonObject = JSON.parseObject(jsonString);
int setting_hotspot = changeNum(jsonObject.getIntValue("setting_hotspot"));//热点
JsonObject jsonObject = GsonUtils.getJsonObject(jsonString);
int setting_hotspot = changeNum(jsonObject.get("setting_hotspot").getAsInt());//热点
try {
if (setting_hotspot == 1) {
Intent intent = new Intent();
@@ -1336,21 +1334,21 @@ public class MessageReceiver extends XGPushBaseReceiver {
}
private void setRestore(Context context, String jsonString) {
JSONObject jsonObject = JSON.parseObject(jsonString);
int mode = jsonObject.getIntValue("qch_restore");
JsonObject jsonObject = GsonUtils.getJsonObject(jsonString);
int mode = jsonObject.get("qch_restore").getAsInt();
boolean aole_restore_forbid_on = JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, changeNum(mode));
Log.e(TAG, "aole_restore_forbid_on:" + aole_restore_forbid_on);
}
private void setBrowserInput(Context context, String jsonString) {
JSONObject jsonObject = JSON.parseObject(jsonString);
int setting_browserInput = changeNum(jsonObject.getIntValue("setting_browserInput"));
JsonObject jsonObject = GsonUtils.getJsonObject(jsonString);
int setting_browserInput = changeNum(jsonObject.get("setting_browserInput").getAsInt());
JGYUtils.putInt(context.getContentResolver(), "qch_Browser_input", setting_browserInput);
}
private void setDeveloper(Context context, String jsonString) {
JSONObject jsonObject = JSON.parseObject(jsonString);
int dev_mode = changeNum(jsonObject.getIntValue("dev_mode"));
JsonObject jsonObject = GsonUtils.getJsonObject(jsonString);
int dev_mode = changeNum(jsonObject.get("dev_mode").getAsInt());
Log.e(TAG, "getDeveloper: " + dev_mode);
if (!DeviceManager.isDebugMode()) {
JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, dev_mode);
@@ -1369,8 +1367,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
}
private void cleanAppCache(Context context, String jsonString) {
JSONObject jsonObject = JSON.parseObject(jsonString);
String pkg = jsonObject.getString("package");
JsonObject jsonObject = GsonUtils.getJsonObject(jsonString);
String pkg = jsonObject.get("package").getAsString();
if (TextUtils.isEmpty(pkg)) {
Log.e(TAG, "cleanAppCache: pkg is null");
return;
@@ -1389,8 +1387,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
private void searchTopic(Context context, String jsonString) {
Log.e(TAG, "searchTopic: " + jsonString);
JSONObject jsonObject = JSON.parseObject(jsonString);
int search_topic = jsonObject.getIntValue("search_topic");
JsonObject jsonObject = GsonUtils.getJsonObject(jsonString);
int search_topic = jsonObject.get("search_topic").getAsInt();
Log.e(TAG, "searchTopic: put = " + SPUtils.put(context, "search_topic", search_topic));
JGYUtils.getInstance().updateForbidList();
}
@@ -1402,8 +1400,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
}
private void setSOSPhoneNumber(Context context, String extras) {
JSONObject jsonObject = JSON.parseObject(extras);
String setting_sos = jsonObject.getString("setting_sos");
JsonObject jsonObject = GsonUtils.getJsonObject(extras);
String setting_sos = jsonObject.get("setting_sos").getAsString();
Settings.System.putString(context.getContentResolver(), "setting_sos", setting_sos);
Intent intent = new Intent("setting_sos");
intent.putExtra("setting_sos", setting_sos);
@@ -1412,8 +1410,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
}
private void reinstallApp(Context context, String extras) {
JSONObject jsonObject = JSON.parseObject(extras);
String packages = jsonObject.getString("package");
String app_url = jsonObject.getString("app_url");
JsonObject jsonObject = GsonUtils.getJsonObject(extras);
String packages = jsonObject.get("package").getAsString();
String app_url = jsonObject.get("app_url").getAsString();
}
}