增加酷比mdm,修改推送标签,卸载预装apk,隐藏电子邮件

This commit is contained in:
18682260825
2022-03-05 14:32:48 +08:00
parent f2b312c477
commit 5aac5e802b
10 changed files with 42 additions and 27 deletions

View File

@@ -61,8 +61,8 @@ android {
//新平台正式
cube {
flavorDimensions "default"
versionCode 20
versionName "2.9"
versionCode 21
versionName "3.0"
/*********************************极光推送************************************/
manifestPlaceholders = [
XG_ACCESS_ID : "1500026372",
@@ -233,6 +233,7 @@ android {
dependencies {
// implementation fileTree(dir: "libs", include: ["*.jar"])
compileOnly files('libs/framework.jar')
compileOnly files('libs/cube_mdm.jar')
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.cardview:cardview:1.0.0'

BIN
app/libs/cube_mdm.jar Normal file

Binary file not shown.

View File

@@ -630,7 +630,7 @@ public class HTTPInterface {
@Override
public void onNext(@NonNull BaseResponse baseResponse) {
Log.e("getAppLimit", "onNext: " + baseResponse);
JsonObject jsonObject = JsonParser.parseString(baseResponse.data.toString()).getAsJsonObject();
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(baseResponse.data)).getAsJsonObject();
if (baseResponse.code == 200) {
String data = jsonObject.get("result").getAsString();
//开机图标 只记录后台传的包名

View File

@@ -439,7 +439,7 @@ public class GuardService extends Service {
}
private void setDefaultUSBStatus() {
String setting_usb = Settings.System.getString(getContentResolver(), "qch_usb_choose");
String setting_usb = Settings.System.getString(getContentResolver(), "aole_usb_choose");
Log.e("setDefaultUSBStatus", "setting_usb---------" + setting_usb);
String usbStatus = "";
if (TextUtils.isEmpty(setting_usb)) {
@@ -453,7 +453,7 @@ public class GuardService extends Service {
usbStatus = "aole_action_usb_usb_mtp";
break;
case "usb_midi":
usbStatus = "qch_action_usb_usb_midi";
usbStatus = "aole_action_usb_usb_midi";
break;
default:
break;

View File

@@ -61,6 +61,8 @@ import io.reactivex.rxjava3.schedulers.Schedulers;
import io.reactivex.rxjava3.subjects.BehaviorSubject;
import okhttp3.ResponseBody;
import static com.google.gson.JsonParser.parseString;
//import static com.aoleyun.sn.jpush.TagAliasOperatorHelper.ACTION_SET;
//import static com.aoleyun.sn.jpush.TagAliasOperatorHelper.sequence;
@@ -137,7 +139,7 @@ public class MainSPresenter implements MainSContact.Presenter {
requestSucceeded = true;
Log.e(TAG + ":" + "getLockedState", "onNext: " + JSONObject.toJSONString(response));
if (response.code == OK) {
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(response.data)).getAsJsonObject();
JsonObject jsonObject = parseString(new Gson().toJson(response.data)).getAsJsonObject();
int locked = jsonObject.get("lock").getAsInt();
Log.e(TAG + ":" + "getLockedState", "locked: " + locked);
int oldState = Settings.System.getInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, 0);
@@ -191,7 +193,7 @@ public class MainSPresenter implements MainSContact.Presenter {
public void onNext(@NonNull BaseResponse response) {
requestSucceeded = true;
if (response.code == OK) {
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(response.data)).getAsJsonObject();
JsonObject jsonObject = parseString(new Gson().toJson(response.data)).getAsJsonObject();
String batch = jsonObject.get("batch").getAsString();
Log.e(TAG + ":" + "setPushTags", "onNext: " + batch);
if (!TextUtils.isEmpty(batch)) {
@@ -477,7 +479,7 @@ public class MainSPresenter implements MainSContact.Presenter {
requestSucceeded = true;
Log.e("checkInfoUpdate", "onNext: " + response.data);
if (response.code == OK) {
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(response.data)).getAsJsonObject();
JsonObject jsonObject = parseString(new Gson().toJson(response.data)).getAsJsonObject();
JGYUtils.getInstance().installAPK(jsonObject);
} else {
Log.e("checkInfoUpdate", "onNext: " + response);
@@ -518,7 +520,7 @@ public class MainSPresenter implements MainSContact.Presenter {
requestSucceeded = true;
Log.e(TAG + ":" + "checkUpdateStore", "onNext: " + response.data);
if (response.code == OK) {
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(response.data)).getAsJsonObject();
JsonObject jsonObject = parseString(new Gson().toJson(response.data)).getAsJsonObject();
JGYUtils.getInstance().installAPK(jsonObject);
} else {
Log.e(TAG + ":" + "checkUpdateStore", "onNext: " + response);
@@ -561,7 +563,7 @@ public class MainSPresenter implements MainSContact.Presenter {
requestSucceeded = true;
Log.e("checkDesktopUpdate", "onNext: " + response.data);
if (response.code == OK) {
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(response.data)).getAsJsonObject();
JsonObject jsonObject = parseString(new Gson().toJson(response.data)).getAsJsonObject();
JGYUtils.getInstance().installAPK(jsonObject);
} else {
Log.e("checkDesktopUpdate", "onNext: " + response);
@@ -602,7 +604,7 @@ public class MainSPresenter implements MainSContact.Presenter {
requestSucceeded = true;
Log.e("checkNotifyUpdate", "onNext: " + response.data);
if (response.code == OK) {
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(response.data)).getAsJsonObject();
JsonObject jsonObject = parseString(new Gson().toJson(response.data)).getAsJsonObject();
JGYUtils.getInstance().installAPK(jsonObject);
} else {
Log.e("checkNotifyUpdate", "onNext: " + response);
@@ -643,7 +645,7 @@ public class MainSPresenter implements MainSContact.Presenter {
requestSucceeded = true;
Log.e("checkBrowserUpdate", "onNext: " + response.data);
if (response.code == OK) {
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(response.data)).getAsJsonObject();
JsonObject jsonObject = parseString(new Gson().toJson(response.data)).getAsJsonObject();
JGYUtils.getInstance().installAPK(jsonObject);
} else {
Log.e("checkBrowserUpdate", "onNext: " + response);
@@ -939,7 +941,8 @@ public class MainSPresenter implements MainSContact.Presenter {
public void onNext(@NonNull BaseResponse baseResponse) {
requestSucceeded = true;
Log.e(TAG + ":" + "getAppLimit", "onNext: " + baseResponse);
JsonObject jsonObject = JsonParser.parseString(baseResponse.data.toString()).getAsJsonObject();
Log.e(TAG + ":" + "getAppLimit", "onNext: " + baseResponse.data.toString());
JsonObject jsonObject = parseString(new Gson().toJson(baseResponse.data)).getAsJsonObject();
if (baseResponse.code == OK) {
String data = jsonObject.get("result").getAsString();
//开机图标
@@ -992,7 +995,7 @@ public class MainSPresenter implements MainSContact.Presenter {
requestSucceeded = true;
Log.e(TAG + ":" + "getROMApp", "onNext: " + baseResponse);
if (baseResponse.code == OK) {
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(baseResponse.data)).getAsJsonObject();
JsonObject jsonObject = parseString(new Gson().toJson(baseResponse.data)).getAsJsonObject();
String packageName = jsonObject.get("package_name").getAsString();
Settings.System.putString(mContext.getContentResolver(), "jgy_customromapp", packageName);
} else {
@@ -1170,7 +1173,7 @@ public class MainSPresenter implements MainSContact.Presenter {
try {
String bodyString = responseBody.string();
Log.e(TAG + ":" + "getAppIDControl", "bodyString: " + bodyString);
JsonObject jsonObject = JsonParser.parseString(bodyString).getAsJsonObject();
JsonObject jsonObject = parseString(bodyString).getAsJsonObject();
int code = jsonObject.get("code").getAsInt();
if (code == OK) {
JsonObject data = jsonObject.getAsJsonObject("data");
@@ -1238,7 +1241,7 @@ public class MainSPresenter implements MainSContact.Presenter {
try {
String bodyString = responseBody.string();
Log.e(TAG + ":" + "setSystemSetting", "onNext: " + bodyString);
JsonObject jsonObject = JsonParser.parseString(bodyString).getAsJsonObject();
JsonObject jsonObject = parseString(bodyString).getAsJsonObject();
int code = jsonObject.get("code").getAsInt();
if (code == OK) {
String data = jsonObject.getAsJsonObject("data").toString();
@@ -1475,7 +1478,7 @@ public class MainSPresenter implements MainSContact.Presenter {
Log.e(TAG + ":" + "getEBagCode", "onNext: " + baseResponse);
int code = baseResponse.code;
if (code == OK) {
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(baseResponse.data)).getAsJsonObject();
JsonObject jsonObject = parseString(new Gson().toJson(baseResponse.data)).getAsJsonObject();
String ebagCode = jsonObject.get("ebagCode").getAsString();
SPUtils.put(mContext, "ebagCode", ebagCode);
} else {
@@ -1512,7 +1515,7 @@ public class MainSPresenter implements MainSContact.Presenter {
Log.e("getWiFiPasswd", "onNext: ");
if (listBaseResponse.code == OK) {
WiFiUtils.saveWiFiPasswd(listBaseResponse.data);
mMMKV.encode("WiFiPassword", JsonParser.parseString(new Gson().toJson(listBaseResponse.data)).toString());
mMMKV.encode("WiFiPassword", parseString(new Gson().toJson(listBaseResponse.data)).toString());
} else {
Log.e("getWiFiPasswd", "onNext: msg = " + listBaseResponse.msg);
WiFiUtils.saveWiFiPasswd(listBaseResponse.data);
@@ -1564,7 +1567,7 @@ public class MainSPresenter implements MainSContact.Presenter {
Log.e(TAG + ":" + "getScreenLockState", "onNext: ");
if (response.code == OK) {
String bodyString = response.data.toString();
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(response.data)).getAsJsonObject();
JsonObject jsonObject = parseString(new Gson().toJson(response.data)).getAsJsonObject();
int is_screen_lock = jsonObject.get("is_screen_lock").getAsInt();
String name = jsonObject.get("name").getAsString();
mView.setScreenLockStateFinish(is_screen_lock == 1, name);

View File

@@ -8,6 +8,7 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.graphics.PixelFormat;
import android.net.ConnectivityManager;
@@ -244,6 +245,10 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
public void onCreate() {
super.onCreate();
Log.e(TAG, "onCreate: ");
ApkUtils.UninstallAPP(this, "com.joytv.live");
ApkUtils.UninstallAPP(this, "com.tencent.android.qqdownloader");
getPackageManager().setApplicationEnabledSetting("com.android.email", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
lifecycleSubject.onNext(ActivityEvent.CREATE);
mPresenter = new MainSPresenter(this);
mPresenter.attachView(this);

View File

@@ -696,7 +696,7 @@ public class ApkUtils {
this.add("com.android.calendar");
this.add("com.android.dreams.basic");
this.add("com.android.musicfx");
this.add("com.android.email");
// this.add("com.android.email");
this.add("com.jiaoguanyi.sysc");
}};

View File

@@ -103,7 +103,7 @@ public class JGYUtils {
public static int ZhanruiPlatform = 2;
public static int UnknowPlatform = 0;
public static String MTKTag = "MTK";
public static String ZhanruiTag = "展锐";
public static String ZhanruiTag = "展锐cube";
public static String Other = "其他";
static {

View File

@@ -5,6 +5,7 @@ import android.app.StatusBarManager;
import android.bluetooth.BluetoothAdapter;
import android.content.Context;
import android.content.Intent;
import android.mdm.SuperPower;
import android.os.Build;
import android.provider.Settings;
import android.text.TextUtils;
@@ -171,9 +172,11 @@ public class SysSettingUtils {
//MTP模式usb_mtp
//Midi模式usb_midi
if (!BuildConfig.DEBUG) {
SuperPower mService = (SuperPower) context.getSystemService("mdm");
try {
boolean qch_usb_choose = Settings.System.putString(context.getContentResolver(), "qch_usb_choose", "usb_charge");
Log.e(TAG, "qch_usb_choose:" + qch_usb_choose);
mService.setUSBDataDisabled(true);
boolean aole_usb_choose = Settings.System.putString(context.getContentResolver(), "aole_usb_choose", "usb_charge");
Log.e(TAG, "aole_usb_choose:" + aole_usb_choose);
String usbStatus = "aole_action_usb_usb_charge";
Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings");
context.sendBroadcast(usbIntent);
@@ -190,19 +193,22 @@ public class SysSettingUtils {
//Midi模式usb_midi
String setting_usb = jsonObject.getString("setting_usb");
if (!BuildConfig.DEBUG) {
SuperPower mService = (SuperPower) context.getSystemService("mdm");
try {
boolean qch_usb_choose = Settings.System.putString(context.getContentResolver(), "qch_usb_choose", setting_usb);
Log.e(TAG, "qch_usb_choose---------" + qch_usb_choose);
boolean aole_usb_choose = Settings.System.putString(context.getContentResolver(), "aole_usb_choose", setting_usb);
Log.e("setUSBstate", "aole_usb_choose---------" + aole_usb_choose);
String usbStatus = "";
switch (setting_usb) {
case "usb_charge":
mService.setUSBDataDisabled(true);
usbStatus = "aole_action_usb_usb_charge";
break;
case "usb_mtp":
mService.setUSBDataDisabled(false);
usbStatus = "aole_action_usb_usb_mtp";
break;
case "usb_midi":
usbStatus = "qch_action_usb_usb_midi";
usbStatus = "aole_action_usb_usb_midi";
break;
}

View File

@@ -708,7 +708,7 @@ public class Utils {
}
} catch (Exception e) {
e.printStackTrace();
Log.e("e", "读取设备序列号异常:" + e.toString());
Log.e("getSerial", "读取设备序列号异常:" + e.toString());
}
if (BuildConfig.DEBUG) {
// return "QNG2DKB00463";