diff --git a/app/build.gradle b/app/build.gradle index 2687df9..5f54204 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -67,8 +67,8 @@ android { productFlavors { beta { flavorDimensions "default" - versionCode 15 - versionName "2.4" + versionCode 16 + versionName "2.5" } official { @@ -89,6 +89,15 @@ android { v2SigningEnabled true } + teclastuserdebug { + storeFile file("src/keys/TeclastUserDebug.jks") + storePassword "123456" + keyAlias "teclast" + keyPassword "123456" + v1SigningEnabled true + v2SigningEnabled true + } + mtk { storeFile file("src/keys/xueshibaoos.jks") storePassword "123456" @@ -103,8 +112,8 @@ android { zhanRuiDebug.initWith(debug) zhanRuiDebug { buildConfigField "String", "platform", '"ZhanRui"' - debuggable true versionNameSuffix "-debug" + debuggable true signingConfig signingConfigs.zhanRui } @@ -114,6 +123,15 @@ android { signingConfig signingConfigs.zhanRui } + //userdebug rom使用这个版本 + zhanRuiUserdebug.initWith(zhanRuiDebug) + zhanRuiUserdebug { + buildConfigField "String", "platform", '"ZhanRui"' + versionNameSuffix "-debug" + debuggable true + signingConfig signingConfigs.teclastuserdebug + } + debug { buildConfigField "String", "platform", '"MTK"' versionNameSuffix "-debug" diff --git a/app/src/keys/TeclastUserDebug.jks b/app/src/keys/TeclastUserDebug.jks new file mode 100644 index 0000000..072af4b Binary files /dev/null and b/app/src/keys/TeclastUserDebug.jks differ diff --git a/app/src/main/java/com/uiui/sn/activity/main/MainAPresenter.java b/app/src/main/java/com/uiui/sn/activity/main/MainAPresenter.java index 0bdedb0..cd652db 100644 --- a/app/src/main/java/com/uiui/sn/activity/main/MainAPresenter.java +++ b/app/src/main/java/com/uiui/sn/activity/main/MainAPresenter.java @@ -2,6 +2,7 @@ package com.uiui.sn.activity.main; import android.content.Context; import android.graphics.Bitmap; +import android.provider.Settings; import android.util.Log; import com.google.gson.Gson; @@ -16,7 +17,6 @@ import com.uiui.sn.disklrucache.CacheHelper; import com.uiui.sn.network.NetInterfaceManager; import com.uiui.sn.network.UrlAddress; import com.uiui.sn.utils.CXAESUtil; -import com.uiui.sn.utils.JGYUtils; import com.uiui.sn.utils.Utils; import java.lang.reflect.Type; @@ -151,7 +151,7 @@ public class MainAPresenter implements MainAContact.Presenter { NetInterfaceManager.getInstance().getForceInstallState(appInfos); } } else { - boolean aole_force_app = JGYUtils.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, ""); + boolean aole_force_app = Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, ""); Log.e("getForceInstall", "aole_force_app: invalid: " + aole_force_app); } } diff --git a/app/src/main/java/com/uiui/sn/activity/main/MainActivity.java b/app/src/main/java/com/uiui/sn/activity/main/MainActivity.java index 95b74a7..00ea090 100644 --- a/app/src/main/java/com/uiui/sn/activity/main/MainActivity.java +++ b/app/src/main/java/com/uiui/sn/activity/main/MainActivity.java @@ -9,6 +9,7 @@ import android.graphics.Bitmap; import android.media.AudioManager; import android.os.AsyncTask; import android.os.SystemClock; +import android.provider.Settings; import android.text.TextUtils; import android.util.Log; import android.view.Gravity; @@ -169,7 +170,7 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView, Log.e(TAG, "getWeekDayString: " + new TimeUtils().getWeekDayString(1627702095000L)); } if (DeviceManager.isDebugMode()) { - JGYUtils.putInt(getContentResolver(), CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, 0); + Settings.System.putInt(getContentResolver(), CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, 0); } startService(); registerReceiver(); diff --git a/app/src/main/java/com/uiui/sn/bean/AppUploadInfo.java b/app/src/main/java/com/uiui/sn/bean/AppUploadInfo.java index 1c915a1..3c502d6 100644 --- a/app/src/main/java/com/uiui/sn/bean/AppUploadInfo.java +++ b/app/src/main/java/com/uiui/sn/bean/AppUploadInfo.java @@ -7,6 +7,7 @@ public class AppUploadInfo implements Serializable { String app_name; String app_package; + String app_version_name; long app_version_code; long firstInstallTime; long lastUpdateTime; @@ -28,6 +29,14 @@ public class AppUploadInfo implements Serializable { this.app_package = app_package; } + public String getApp_version_name() { + return app_version_name; + } + + public void setApp_version_name(String app_version_name) { + this.app_version_name = app_version_name; + } + public long getApp_version_code() { return app_version_code; } diff --git a/app/src/main/java/com/uiui/sn/manager/ControlManager.java b/app/src/main/java/com/uiui/sn/manager/ControlManager.java index afe99a4..561535a 100644 --- a/app/src/main/java/com/uiui/sn/manager/ControlManager.java +++ b/app/src/main/java/com/uiui/sn/manager/ControlManager.java @@ -120,7 +120,7 @@ public class ControlManager { Log.e("SystemSetting", "setting_usb:" + setting_usb); if (!DeviceManager.isDebugMode()) { try { - boolean qch_usb_choose = JGYUtils.putString(mResolver, "qch_usb_choose", setting_usb); + boolean qch_usb_choose = Settings.System.putString(mResolver, "qch_usb_choose", setting_usb); Log.e("SystemSetting", "qch_usb_choose:" + qch_usb_choose); String usbStatus = ""; switch (setting_usb) { @@ -171,19 +171,19 @@ public class ControlManager { private void setPhoneList(SystemSettings settings) { //设置电话功能,电话白名单 int setting_call = changeNum(settings.getSetting_call()); - boolean qch_call_forbid = JGYUtils.putInt(mResolver, "qch_call_forbid", setting_call); + boolean qch_call_forbid = Settings.System.putInt(mResolver, "qch_call_forbid", setting_call); Log.e("SystemSetting", "qch_call_forbid: " + setting_call); int setting_phone = changeNum(settings.getSetting_phone()); - boolean aole_white_list_on = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_WHITE_LIST_ON, setting_phone); + boolean aole_white_list_on = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_WHITE_LIST_ON, setting_phone); Log.e("SystemSetting", "aole_white_list_on: " + setting_phone); String setting_phones = settings.getSetting_phones(); - boolean aole_white_list_Array = JGYUtils.putString(mResolver, CommonConfig.AOLE_ACTION_WHITE_LIST_ARRAY, setting_phones); + boolean aole_white_list_Array = Settings.System.putString(mResolver, CommonConfig.AOLE_ACTION_WHITE_LIST_ARRAY, setting_phones); Log.e("SystemSetting", "aole_white_list_Array: " + aole_white_list_Array + "=" + setting_phones); int setting_memory = changeNum(settings.getSetting_memory()); - boolean aole_sdcard_forbid_on = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON, setting_memory); + boolean aole_sdcard_forbid_on = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON, setting_memory); Log.e("SystemSetting", "aole_sdcard_forbid_on: " + setting_memory); } @@ -216,7 +216,7 @@ public class ControlManager { //蓝牙音频开关 int setting_bluetooth = changeNum(settings.getSetting_bluetooth()); //蓝牙传输开关 - boolean aole_bht_forbid_on = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_BHT_FORBID_ON, setting_bht); + boolean aole_bht_forbid_on = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_BHT_FORBID_ON, setting_bht); //写入系统数据库 Log.e("SystemSetting", "aole_bht_forbid_on:" + aole_bht_forbid_on); BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); @@ -232,14 +232,14 @@ public class ControlManager { if (setting_bhtvideo == 0) { if (null != setting_context && !"".equals(setting_context) && !" ".equals(setting_context) && !"null".equals(setting_context)) { Log.e("SystemSetting", "setting_context:" + setting_context); - JGYUtils.putString(mResolver, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, setting_context); + Settings.System.putString(mResolver, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, setting_context); } else { - JGYUtils.putString(mResolver, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty"); + Settings.System.putString(mResolver, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty"); } } else if (setting_bhtvideo == 1) { - JGYUtils.putString(mResolver, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty"); + Settings.System.putString(mResolver, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty"); } - JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_BT_FORBID_ON, setting_bluetooth); + Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_BT_FORBID_ON, setting_bluetooth); } else { mBluetoothAdapter.disable(); //设置关闭时关闭蓝牙 @@ -282,7 +282,7 @@ public class ControlManager { intent.setPackage("com.android.settings"); mContext.sendStickyBroadcast(intent); } - boolean aole_hotspot_forbid_on = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_HOTSPOT_FORBID_ON, setting_hotspot);//写入系统数据库 + boolean aole_hotspot_forbid_on = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_HOTSPOT_FORBID_ON, setting_hotspot);//写入系统数据库 Log.e("SystemSetting", "aole_hotspot_forbid_on:" + setting_hotspot); Log.e("SystemSetting", "aole_hotspot_forbid_on:" + aole_hotspot_forbid_on); } catch (Exception e) { @@ -306,7 +306,7 @@ public class ControlManager { private void setBar(SystemSettings settings) { //系统导航条显示开关 int setting_navigation = changeNum(settings.getSetting_navigation()); - boolean aole_hide_NavigationBar = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR, setting_navigation); + boolean aole_hide_NavigationBar = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR, setting_navigation); Log.e("SystemSetting", "aole_hide_NavigationBar:" + aole_hide_NavigationBar); String navigationStatus = ""; @@ -324,9 +324,9 @@ public class ControlManager { //状态栏显示开关 int setting_statusbar = changeNum(settings.getSetting_statusbar()); - int oldNum = JGYUtils.getInt(mResolver, CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, 0); + int oldNum = Settings.System.getInt(mResolver, CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, 0); if (oldNum != setting_statusbar) { - boolean aole_hide_statusBar = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, setting_statusbar); + boolean aole_hide_statusBar = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, setting_statusbar); Log.e("SystemSetting", "aole_hide_statusBar:" + aole_hide_statusBar); String statusbarStatus = ""; switch (setting_statusbar) { @@ -347,7 +347,7 @@ public class ControlManager { try { //摄像头开关 int setting_camera = changeNum(settings.getSetting_camera()); - JGYUtils.putInt(mResolver, "qch_app_camera", setting_camera); + Settings.System.putInt(mResolver, "qch_app_camera", setting_camera); // ApkUtils.hideSystemSettingAPP(mContext, "com.mediatek.camera"); Log.e("SystemSetting", "setting_camera:" + setting_camera); String cameraStatus = ""; @@ -393,7 +393,7 @@ public class ControlManager { private void setTF(SystemSettings settings) { //tfmedia开关 int setting_tfmedia = changeNum(settings.getSetting_tfmedia()); - boolean qch_tfmedia_forbid = JGYUtils.putInt(mResolver, "qch_tfmedia_forbid", setting_tfmedia); + boolean qch_tfmedia_forbid = Settings.System.putInt(mResolver, "qch_tfmedia_forbid", setting_tfmedia); Log.e("SystemSetting", "setting_tfmedia:" + qch_tfmedia_forbid); String tfmediaStatus = ""; switch (setting_tfmedia) { @@ -411,7 +411,7 @@ public class ControlManager { if (setting_tfmedia == 1) { String qch_tfmedia_filetypes = settings.getSetting_tfmedia_format(); if (TextUtils.isEmpty(qch_tfmedia_filetypes)) { - JGYUtils.putString(mResolver, "qch_tfmedia_filetypes", "");//影音管控 + Settings.System.putString(mResolver, "qch_tfmedia_filetypes", "");//影音管控 } else { HashSet types = new HashSet<>(Arrays.asList(qch_tfmedia_filetypes.split(","))); types.removeIf(new Predicate() { @@ -421,11 +421,11 @@ public class ControlManager { } }); String typesString = String.join(",", types); - JGYUtils.putString(mResolver, "qch_tfmedia_filetypes", typesString);//影音管控 + Settings.System.putString(mResolver, "qch_tfmedia_filetypes", typesString);//影音管控 Log.e("SystemSetting", "qch_tfmedia_filetypes :" + typesString); } } else { - JGYUtils.putInt(mResolver, "qch_tfmedia_forbid", 0); + Settings.System.putInt(mResolver, "qch_tfmedia_forbid", 0); } } @@ -463,31 +463,31 @@ public class ControlManager { //设置5个app的开关 //时钟 int deskclock = changeNum(settings.getSetting_clock()); - JGYUtils.putInt(mResolver, "qch_app_deskclock", deskclock); + Settings.System.putInt(mResolver, "qch_app_deskclock", deskclock); ApkUtils.hideSystemSettingAPP(mContext, "com.android.deskclock"); Log.e("SystemSetting", "qch_app_deskclock:" + deskclock); //录音机 int soundrecorder = changeNum(settings.getSetting_recording()); - JGYUtils.putInt(mResolver, "qch_app_soundrecorder", soundrecorder); + Settings.System.putInt(mResolver, "qch_app_soundrecorder", soundrecorder); ApkUtils.hideSystemSettingAPP(mContext, "com.android.soundrecorder"); Log.e("SystemSetting", "qch_app_soundrecorder:" + soundrecorder); //音乐 int music = changeNum(settings.getSetting_music()); - JGYUtils.putInt(mResolver, "qch_app_music", music); + Settings.System.putInt(mResolver, "qch_app_music", music); ApkUtils.hideSystemSettingAPP(mContext, "com.android.music"); Log.e("SystemSetting", "qch_app_music:" + music); //图库 int gallery = changeNum(settings.getSetting_picture()); - JGYUtils.putInt(mResolver, "qch_app_gallery", gallery); + Settings.System.putInt(mResolver, "qch_app_gallery", gallery); ApkUtils.hideSystemSettingAPP(mContext, "com.android.gallery3d"); Log.e("SystemSetting", "qch_app_gallery:" + gallery); //壁纸 int wallpaper = changeNum(settings.getSetting_wallpaper()); - JGYUtils.putInt(mResolver, "qch_app_wallpaper", wallpaper); + Settings.System.putInt(mResolver, "qch_app_wallpaper", wallpaper); Log.e("SystemSetting", "qch_app_wallpaper:" + wallpaper); //文件管理器 int filemanager = changeNum(settings.getSetting_file()); - JGYUtils.putInt(mResolver, "qch_app_filemanager", filemanager); + Settings.System.putInt(mResolver, "qch_app_filemanager", filemanager); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { ApkUtils.hideSystemSettingAPP(mContext, "com.mediatek.filemanager"); } else { @@ -496,7 +496,7 @@ public class ControlManager { Log.e("SystemSetting", "qch_app_filemanager:" + filemanager); //浏览器 int browser = changeNum(settings.getSetting_browser()); - JGYUtils.putInt(mResolver, "qch_app_browser", browser); + Settings.System.putInt(mResolver, "qch_app_browser", browser); Log.e(TAG, "qch_app_browser" + browser); } catch (Exception e) { Log.e(TAG, "setIcon: " + e.getMessage()); @@ -581,7 +581,7 @@ public class ControlManager { int dev_mode = changeNum(jsonObject.get("dev_mode").getAsInt()); Log.e(TAG, "getDeveloper: " + dev_mode); if (!DeviceManager.isDebugMode()) { - JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, dev_mode); + Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, dev_mode); if (dev_mode == 1) { Intent intent = new Intent(); intent.setAction("qch_developeroptions_close"); @@ -634,7 +634,7 @@ public class ControlManager { //仅充电:usb_charge //MTP模式:usb_mtp //Midi模式:usb_midi - String setting_usb = JGYUtils.getString(mResolver, "qch_usb_choose"); + String setting_usb = Settings.System.getString(mResolver, "qch_usb_choose"); Log.e("SystemSetting", "setting_usb:" + setting_usb); String usbStatus = ""; if (TextUtils.isEmpty(setting_usb)) { diff --git a/app/src/main/java/com/uiui/sn/network/NetInterfaceManager.java b/app/src/main/java/com/uiui/sn/network/NetInterfaceManager.java index 0b6a184..c40b25f 100644 --- a/app/src/main/java/com/uiui/sn/network/NetInterfaceManager.java +++ b/app/src/main/java/com/uiui/sn/network/NetInterfaceManager.java @@ -33,12 +33,13 @@ import com.uiui.sn.bean.BaseResponse; import com.uiui.sn.bean.BatchID; import com.uiui.sn.bean.CloudLessonSetting; import com.uiui.sn.bean.Label; -import com.uiui.sn.bean.UserAvatarInfo; import com.uiui.sn.bean.SnInfo; +import com.uiui.sn.bean.UserAvatarInfo; import com.uiui.sn.bean.browser.BrowserApiData; import com.uiui.sn.bean.browser.BrowserBean; import com.uiui.sn.config.CommonConfig; import com.uiui.sn.disklrucache.CacheHelper; +import com.uiui.sn.gson.GsonUtils; import com.uiui.sn.manager.ConnectManager; import com.uiui.sn.manager.ConnectMode; import com.uiui.sn.manager.ControlManager; @@ -73,7 +74,6 @@ import com.uiui.sn.utils.ApkUtils; import com.uiui.sn.utils.AppUsedTimeUtils; import com.uiui.sn.utils.CmdUtil; import com.uiui.sn.utils.FileUtils; -import com.uiui.sn.gson.GsonUtils; import com.uiui.sn.utils.JGYUtils; import com.uiui.sn.utils.MD5Util; import com.uiui.sn.utils.SPUtils; @@ -679,11 +679,12 @@ public class NetInterfaceManager { this.add("com.uiui.city"); //扶小鹰 this.add("com.fuying.fuxiaoying"); - this.add("com.fuying.aobama.pad"); - this.add("com.fuying.english"); - this.add("com.moshujiamm.moshujia"); - this.add("com.pengren.growthspace"); this.add("com.zhiduoke.fxy"); + this.add("com.fuying.english"); + this.add("com.pengren.growthspace"); + this.add("com.moshujiamm.moshujia"); + this.add("com.gankao.gkwxhd"); + this.add("com.fuying.aobama.pad"); }}; public static long getPackageSize(Context context, String filePath) { @@ -721,6 +722,7 @@ public class NetInterfaceManager { AppUploadInfo uploadInfo = new AppUploadInfo(); uploadInfo.setApp_name(info.applicationInfo.loadLabel(pm).toString()); uploadInfo.setApp_package(info.packageName); + uploadInfo.setApp_version_name(info.versionName); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { uploadInfo.setApp_version_code(info.getLongVersionCode()); } else { @@ -1190,24 +1192,24 @@ public class NetInterfaceManager { //白名单 List white = response.data.getWhiteList(); if (null != white && white.size() != 0) { - boolean whiteList = JGYUtils.putString(crv, "DeselectBrowserArray", + boolean whiteList = Settings.System.putString(crv, "DeselectBrowserArray", white.stream().map(BrowserBean::getAddress).collect(Collectors.joining(","))); Log.e("getBrowserWhiteList", "setBrowserList_white:" + white + ":" + whiteList); } else { - JGYUtils.putString(crv, "DeselectBrowserArray", " "); + Settings.System.putString(crv, "DeselectBrowserArray", " "); } //黑名单 List black = response.data.getBlackList(); if (null != black && black.size() != 0) { - boolean blackList = JGYUtils.putString(crv, "qch_webblack_url", + boolean blackList = Settings.System.putString(crv, "qch_webblack_url", black.stream().map(BrowserBean::getAddress).collect(Collectors.joining(","))); Log.e("getBrowserWhiteList", "setBrowserList_black:" + black + ":" + blackList); } else { - JGYUtils.putString(crv, "qch_webblack_url", " "); + Settings.System.putString(crv, "qch_webblack_url", " "); } } else { - JGYUtils.putString(crv, "DeselectBrowserArray", " "); - JGYUtils.putString(crv, "qch_webblack_url", " "); + Settings.System.putString(crv, "DeselectBrowserArray", " "); + Settings.System.putString(crv, "qch_webblack_url", " "); } } @@ -1241,7 +1243,7 @@ public class NetInterfaceManager { private void setLabelResponse(BaseResponse