version:3.3
fix:修复几个闪退问题,升级后清除桌面数据 update:时钟,摄像头允许打开,日历app允许显示
This commit is contained in:
@@ -61,8 +61,8 @@ android {
|
||||
//新平台正式
|
||||
cube {
|
||||
flavorDimensions "default"
|
||||
versionCode 22
|
||||
versionName "3.1"
|
||||
versionCode 24
|
||||
versionName "3.3"
|
||||
/*********************************极光推送************************************/
|
||||
manifestPlaceholders = [
|
||||
XG_ACCESS_ID : "1500026372",
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.aoleyun.sn.comm.JGYActions;
|
||||
import com.aoleyun.sn.comm.PackageNames;
|
||||
import com.aoleyun.sn.network.NetInterfaceManager;
|
||||
import com.aoleyun.sn.service.LogcatService;
|
||||
import com.aoleyun.sn.utils.ApkUtils;
|
||||
import com.aoleyun.sn.utils.JGYUtils;
|
||||
import com.aoleyun.sn.utils.SPUtils;
|
||||
import com.aoleyun.sn.utils.ServiceAliveUtils;
|
||||
@@ -83,6 +84,7 @@ public class SplashActivity extends AppCompatActivity {
|
||||
|
||||
private void initView() {
|
||||
if (BuildConfig.DEBUG) {
|
||||
ApkUtils.showAllAPP(this);
|
||||
// JGYUtils.getInstance().cleanBackgroundMemory();
|
||||
// NetInterfaceManager.getInstance().uploadLogFile();
|
||||
bt_log = findViewById(R.id.bt_log);
|
||||
|
||||
@@ -630,8 +630,8 @@ public class HTTPInterface {
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse baseResponse) {
|
||||
Log.e("getAppLimit", "onNext: " + baseResponse);
|
||||
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(baseResponse.data)).getAsJsonObject();
|
||||
if (baseResponse.code == 200) {
|
||||
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(baseResponse.data)).getAsJsonObject();
|
||||
String data = jsonObject.get("result").getAsString();
|
||||
//开机图标 只记录后台传的包名
|
||||
boolean write = Settings.System.putString(context.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST, data);
|
||||
|
||||
@@ -941,9 +941,9 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
public void onNext(@NonNull BaseResponse baseResponse) {
|
||||
requestSucceeded = true;
|
||||
Log.e(TAG + ":" + "getAppLimit", "onNext: " + baseResponse);
|
||||
Log.e(TAG + ":" + "getAppLimit", "onNext: " + baseResponse.data.toString());
|
||||
JsonObject jsonObject = parseString(new Gson().toJson(baseResponse.data)).getAsJsonObject();
|
||||
if (baseResponse.code == OK) {
|
||||
Log.e(TAG + ":" + "getAppLimit", "onNext: " + baseResponse.data.toString());
|
||||
JsonObject jsonObject = parseString(new Gson().toJson(baseResponse.data)).getAsJsonObject();
|
||||
String data = jsonObject.get("result").getAsString();
|
||||
//开机图标
|
||||
boolean write = Settings.System.putString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST, data);
|
||||
|
||||
@@ -45,6 +45,7 @@ import com.aoleyun.sn.manager.ConnectManager;
|
||||
import com.aoleyun.sn.network.NetInterfaceManager;
|
||||
import com.aoleyun.sn.rlog.LogDBManager;
|
||||
import com.aoleyun.sn.utils.ApkUtils;
|
||||
import com.aoleyun.sn.utils.CacheUtils;
|
||||
import com.aoleyun.sn.utils.ForegroundAppUtil;
|
||||
import com.aoleyun.sn.utils.JGYUtils;
|
||||
import com.aoleyun.sn.utils.SPUtils;
|
||||
@@ -105,7 +106,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
start.onstar(WiFiAlias);
|
||||
}
|
||||
}
|
||||
if (!checkAoleyunApp()){
|
||||
if (!checkAoleyunApp()) {
|
||||
mPresenter.checkInfoUpdate();
|
||||
}
|
||||
TimeTask task = new TimeTask();
|
||||
@@ -268,7 +269,12 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
task.execute("ntp.aliyun.com");
|
||||
ApkUtils.UninstallAPP(this, "com.joytv.live");
|
||||
ApkUtils.UninstallAPP(this, "com.tencent.android.qqdownloader");
|
||||
getPackageManager().setApplicationEnabledSetting("com.android.email", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
|
||||
try {
|
||||
getPackageManager().setApplicationEnabledSetting("com.android.email", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "onCreate: " + e.getMessage());
|
||||
}
|
||||
|
||||
lifecycleSubject.onNext(ActivityEvent.CREATE);
|
||||
mPresenter = new MainSPresenter(this);
|
||||
@@ -290,6 +296,12 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
int oldVersionCode = (int) SPUtils.get(this, CommonConfig.SN_VERSIONCODE, 0);
|
||||
if (oldVersionCode < BuildConfig.VERSION_CODE) {
|
||||
Log.e(TAG, "onCreate: " + "upgrade successful");
|
||||
try {
|
||||
new CacheUtils().cleanApplicationUserData(this, "com.aoleyun.os");
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "onReceive: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
// if (ConnectManager.getInstance().isRebootFistConnect()) {
|
||||
start.onstar(ConnectManager.REBOOT_LAST_ONNECT_TIME);
|
||||
@@ -309,7 +321,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
JGYUtils.getInstance().wakeUpAppstore();
|
||||
if (!checkAoleyunApp()){
|
||||
if (!checkAoleyunApp()) {
|
||||
mPresenter.checkInfoUpdate();
|
||||
}
|
||||
return START_STICKY;
|
||||
|
||||
@@ -1201,6 +1201,9 @@ public class JGYUtils {
|
||||
if (ApkUtils.desktopAPP.contains(packageName)) {
|
||||
continue;
|
||||
}
|
||||
if (ApkUtils.aoleyunAPP.contains(packageName)) {
|
||||
continue;
|
||||
}
|
||||
if (ApkUtils.canremove_systemapp.contains(packageName)) {
|
||||
continue;
|
||||
}
|
||||
@@ -1220,6 +1223,7 @@ public class JGYUtils {
|
||||
|
||||
HashSet<String> showAppList = new HashSet<String>() {{
|
||||
this.add("com.android.calendar");
|
||||
this.add("com.android.calendar2");
|
||||
this.add("com.android.contacts");
|
||||
this.add("com.android.deskclock");
|
||||
this.add("com.android.camera2");
|
||||
|
||||
@@ -172,15 +172,15 @@ public class SysSettingUtils {
|
||||
//MTP模式:usb_mtp
|
||||
//Midi模式:usb_midi
|
||||
if (!BuildConfig.DEBUG) {
|
||||
SuperPower mService = (SuperPower) context.getSystemService("mdm");
|
||||
try {
|
||||
SuperPower mService = (SuperPower) context.getSystemService("mdm");
|
||||
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);
|
||||
} catch (Exception e) {
|
||||
} catch (NoClassDefFoundError | Exception e) {
|
||||
Log.e(TAG, "setUSBstate: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -266,7 +266,7 @@ public class SysSettingUtils {
|
||||
//蓝牙总开关开启
|
||||
String setting_context = jsonObject.getString("setting_context");
|
||||
if (setting_bhtvideo == 0) {
|
||||
if (null != setting_context && !setting_context.equals("") && !setting_context.equals(" ") && !setting_context.equals("null")) {
|
||||
if (null != setting_context && !"".equals(setting_context) && !" ".equals(setting_context) && !"null".equals(setting_context)) {
|
||||
Log.e(TAG, "setting_context:" + setting_context);
|
||||
Settings.System.putString(context.getContentResolver(), "qch_bhtvideo_forbid_on", setting_context);
|
||||
} else {
|
||||
@@ -402,7 +402,7 @@ public class SysSettingUtils {
|
||||
private static void setCamera(Context context, int state) {
|
||||
try {
|
||||
//摄像头开关
|
||||
boolean qch_app_camera = Settings.System.putInt(context.getContentResolver(), "qch_app_camera", state);
|
||||
boolean qch_app_camera = Settings.System.putInt(context.getContentResolver(), "qch_app_camera", 0);
|
||||
Log.e(TAG, "qch_app_camera1:" + state);
|
||||
// ApkUtils.hideSystemSettingAPP(context, "com.mediatek.camera");
|
||||
Log.e(TAG, "setting_camera---------" + qch_app_camera);
|
||||
@@ -522,11 +522,10 @@ public class SysSettingUtils {
|
||||
|
||||
private static void setIcon(Context context, int state) {
|
||||
try {
|
||||
//added:2019.12.6
|
||||
//设置5个app的开关
|
||||
//时钟
|
||||
// int deskclock = 1;
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_deskclock", state);
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_deskclock", 0);
|
||||
ApkUtils.hideSystemSettingAPP(context, "com.android.deskclock");
|
||||
Log.e(TAG, "qch_app_deskclock" + state);
|
||||
//录音机
|
||||
|
||||
Reference in New Issue
Block a user