From dbce88be883f10f1459d5ee4672809d3d349aefc Mon Sep 17 00:00:00 2001 From: Fanhuitong <981964879@qq.com> Date: Wed, 26 Jul 2023 10:31:33 +0800 Subject: [PATCH] =?UTF-8?q?version:3.0.8=20fix:=20update:=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E7=A6=81=E7=94=A8=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 53 ++++++- app/keystore/iPlay50SE.keystore | Bin 0 -> 2717 bytes app/src/main/AndroidManifest.xml | 148 ++++-------------- .../fuying/sn/activity/main/MainActivity.java | 10 +- .../fuying/sn/desktop/RunningAppManager.java | 89 +++++++++-- .../fuying/sn/desktop/TimeControlManager.java | 2 +- .../com/fuying/sn/manager/AmapManager.java | 6 +- .../sn/network/NetInterfaceManager.java | 59 ++----- .../sn/receiver/APKinstallReceiver.java | 4 +- .../com/fuying/sn/service/RemoteService.java | 1 + .../sn/service/main/MainSPresenter.java | 8 +- .../fuying/sn/service/main/MainService.java | 2 + .../com/fuying/sn/tpush/MessageReceiver.java | 4 +- .../java/com/fuying/sn/utils/JGYUtils.java | 32 ++++ .../main/java/com/fuying/sn/utils/Utils.java | 4 +- 15 files changed, 224 insertions(+), 198 deletions(-) create mode 100644 app/keystore/iPlay50SE.keystore diff --git a/app/build.gradle b/app/build.gradle index 2192600..bce1a8d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -73,8 +73,8 @@ android { official { flavorDimensions "default" - versionCode 42 - versionName "3.0.2" + versionCode 48 + versionName "3.0.8" } } @@ -169,9 +169,38 @@ android { v1SigningEnabled true v2SigningEnabled true } + + iPlay50SE { + storeFile file("keystore/iPlay50SE.keystore") + storePassword "123456" + keyAlias "iplay50se" + keyPassword "123456" + v1SigningEnabled true + v2SigningEnabled true + } } buildTypes { + iPlay50SEDebug.initWith(debug) + iPlay50SEDebug { + manifestPlaceholders = [ + AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq" + ] + buildConfigField "String", "platform", '"ipaly50"' + versionNameSuffix "-debug" + debuggable true + signingConfig signingConfigs.iPlay50SE + } + + iPlay50SERelease.initWith(release) + iPlay50SERelease { + manifestPlaceholders = [ + AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq" + ] + buildConfigField "String", "platform", '"ipaly50"' + signingConfig signingConfigs.iPlay50SE + } + unisocDebug.initWith(debug) unisocDebug { manifestPlaceholders = [ @@ -233,6 +262,26 @@ android { signingConfig signingConfigs.teclastMTK } + G6Debug.initWith(debug) + G6Debug { + manifestPlaceholders = [ + AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq" + ] + buildConfigField "String", "platform", '"G6"' + versionNameSuffix "-debug" + debuggable true + signingConfig signingConfigs.G10P + } + + G6Release.initWith(release) + G6Release { + manifestPlaceholders = [ + AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq" + ] + buildConfigField "String", "platform", '"G6"' + signingConfig signingConfigs.G10P + } + G13Debug.initWith(debug) G13Debug { manifestPlaceholders = [ diff --git a/app/keystore/iPlay50SE.keystore b/app/keystore/iPlay50SE.keystore new file mode 100644 index 0000000000000000000000000000000000000000..57f25214373c57f853a55218da54d97b8db56ff9 GIT binary patch literal 2717 zcmY+EX*d*&8ir@a7>u>ZGNde7nlSdUON1Ix_HAlJW6e4;*@t8qd$Pos3|X>AmSL

bvkAc=6`>&K!G4K0epxcfOip+5a@sKX*oZbODyY; zP8Evz>XC%KN8-vYi@@V9T@W3h!vstK_XKY!ndJM|i3N*?a}Vs=Em%UuZ#j>-LC227 zpG6{1nv|9v^X-DC(BnxiL)6sdsNa!MUgbo4vI!}oB=_ybgJ$d~%L6lumN{K@LIMcN zZsRw<{L|9=4XRoL7JSRYW-svKHadfn2t}yzK7Z<1t8>HrMYJ`Owd{EKI~iiu@}^UL zgaJ+kB$Hm=zG@%;rD*p^XYeN{^X!sC#(DY{#VbNggUf}!Uj6uV`>O@;RmZPy`=EA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_1&UX35)xw-nG43mPJ?>Z#{G=4XcTUD@>lDeog zJlE%?hqAGE_80j1{UTjS}Em3LMCisHNmKy{4foKqnSk80=RrI~9L} zD<8L8wjagwu=a+GdcGCqd7!(^Gd6b1FG(B|k(z|^!X>xxWS!sGicO!it`dYMLI}YG zp@*~4fnf9iFqhq^#Zy+XlXr(f9}Etpe&^2}V5GrZ1RMrz<@SndRj^O@DZSRNgQx#K Jhz=M<{s*yh`NseN literal 0 HcmV?d00001 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 253e093..fc42867 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -26,29 +26,29 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -56,7 +56,7 @@ - + - - - + + + - - + + - + - + android:screenOrientation="portrait" /> + + android:exported="true" /> + + + android:process=":remote" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -315,18 +233,7 @@ - - - - - + android:value="${AK}" /> \ No newline at end of file diff --git a/app/src/main/java/com/fuying/sn/activity/main/MainActivity.java b/app/src/main/java/com/fuying/sn/activity/main/MainActivity.java index c847026..fd1837d 100644 --- a/app/src/main/java/com/fuying/sn/activity/main/MainActivity.java +++ b/app/src/main/java/com/fuying/sn/activity/main/MainActivity.java @@ -124,9 +124,11 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView, setOnClickListener(); tv_customversion.setText(JGYUtils.getCustomVersion()); - if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G13Platform) { + if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G13Platform + || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.iPlay50SEPlatform + ) { tv_sn.setText("SN:" + Utils.getSerial()); - }else { + } else { tv_sn.setText("IMEI:" + Utils.getIMEI(MainActivity.this)); } @@ -238,7 +240,7 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView, @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); - Log.e(TAG, "onNewIntent: " ); + Log.e(TAG, "onNewIntent: "); if (REFRESHACTION.equals(intent.getAction())) { mPresenter.getSnInfo(); } @@ -375,7 +377,7 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView, class RefreshReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - Log.e("RefreshReceiver", "onReceive: " ); + Log.e("RefreshReceiver", "onReceive: "); if (REFRESHACTION.equals(intent.getAction())) { mPresenter.getSnInfo(); } diff --git a/app/src/main/java/com/fuying/sn/desktop/RunningAppManager.java b/app/src/main/java/com/fuying/sn/desktop/RunningAppManager.java index 5a0ed44..f90739b 100644 --- a/app/src/main/java/com/fuying/sn/desktop/RunningAppManager.java +++ b/app/src/main/java/com/fuying/sn/desktop/RunningAppManager.java @@ -74,7 +74,6 @@ public class RunningAppManager { @SuppressLint("StaticFieldLeak") private static RunningAppManager mRunningAppManager; private Context mContext; - private CacheHelper mCacheHelper; private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE); public static final String RemainingTimeMap = "RemainingTimeMap_KEY"; @@ -84,7 +83,9 @@ public class RunningAppManager { public static final String AllApplUsageTimeMap = "AllAppUsageTimeMap_KEY"; //剩余时间 - private long globalRemainingTime = 0L; + private long globalRemainingTime; + private String GLOBAL_REMAINING_TIME_KEY = "GLOBAL_REMAINING_TIME_KEY"; + //存储每个单独有配置app剩余时间 private HashMap mRemainingTimeMap = new HashMap<>(); //存储整机配置app使用时间 @@ -92,8 +93,8 @@ public class RunningAppManager { //存储所有app使用时间 private HashMap mAllAppUsageTime = new HashMap<>(); - public static long minuteTime = 60 * 1000; - public static long dayTime = minuteTime * 60 * 24; + public static final long minuteTime = 60 * 1000; + public static final long dayTime = minuteTime * 60 * 24; //日期格式化 private static DateFormat dateFormat = new SimpleDateFormat("HH:mm"); @@ -110,9 +111,9 @@ public class RunningAppManager { throw new RuntimeException("Context is NULL"); } this.mContext = context; - this.mCacheHelper = new CacheHelper(context); registerTimeReceiver(mContext); + globalRemainingTime = mMMKV.decodeLong(GLOBAL_REMAINING_TIME_KEY, 0); String remainsTimeJson = mMMKV.decodeString(RemainingTimeMap, ""); Log.i(TAG, "remainsTimeJson: " + remainsTimeJson); Gson gson = new Gson(); @@ -230,7 +231,7 @@ public class RunningAppManager { Log.i(TAG, "checkForegroundAppName: getAppPackageName = " + appPackageName); if (appPackageName.equals(topPackage)) { Log.i(TAG, "checkForegroundAppName: 没有切换应用"); - if (RunningAppManager.getInstance().inControlTime(appPackageName)) { + if (inControlTime(appPackageName)) { removeTask(topPackage); killApp(); gotoLauncher(); @@ -259,13 +260,13 @@ public class RunningAppManager { onClickTime = System.currentTimeMillis() / 1000; // NetInterfaceManager.getInstance().sendRunningApp(); AppUsedTimeUtils.getInstance().setStart_time(onClickTime); - if (RunningAppManager.getInstance().inControlTime(appPackageName)) { + if (inControlTime(appPackageName)) { Log.i(TAG, "checkForegroundAppName: 没有剩余时间2"); removeTask(topPackage); killApp(); gotoLauncher(); } else { - RunningAppManager.getInstance().recordPackageOpenTime(topPackage); + recordPackageOpenTime(topPackage); Log.i(TAG, "checkForegroundAppName: 没有管控2"); } } @@ -467,6 +468,10 @@ public class RunningAppManager { public void setGlobalUsageTime(long time) { this.globalRemainingTime = time; + if (globalRemainingTime < 0) { + globalRemainingTime = 0; + } + mMMKV.encode(GLOBAL_REMAINING_TIME_KEY, globalRemainingTime); } /** @@ -577,6 +582,18 @@ public class RunningAppManager { } boolean havaConfigure = TimeControlManager.getInstance().havaConfigure(pkg); MachineControl machineControl = TimeControlManager.getInstance().getGlobalMachineControl(); + + Log.e(TAG, "inControlTime: globalRemainingTime = " + globalRemainingTime); + if (globalRemainingTime <= 0) { + if (machineControl != null) { + if (machineControl.getIs_part() == 0 && machineControl.getIs_quota() == 0) { + return; + } + } else { + ToastUtil.show("今日可使用时间已用完"); + return; + } + } if (havaConfigure) { AppTimeControl appTimeControl = TimeControlManager.getInstance().getAppTimeControl(pkg); //全局配置的 @@ -593,6 +610,8 @@ public class RunningAppManager { appUsageTime.setUsageTime(appUsageTime.getUsageTime() + 1); } mGlobalUsageTime.put(pkg, appUsageTime); + } else if (appTimeControl.getTc_use_type() == 0) { + return; } else { mGlobalUsageTime.remove(pkg); } @@ -622,6 +641,7 @@ public class RunningAppManager { mRemainingTimeMap.put(pkg, timeBean); appTimeControl.setToday_time(remainingTime); TimeControlManager.getInstance().setAppTimeControl(pkg, appTimeControl); + setGlobalUsageTime(globalRemainingTime - time); } else { if (machineControl == null) { return; @@ -684,6 +704,9 @@ public class RunningAppManager { this.add("com.uiui.info"); this.add("com.tt.ttutils"); this.add(JGYUtils.fuxiaoying); + this.add("com.sprd.engineermode"); + this.add("com.teclast.update"); + this.add("com.incar.update"); }}; /** @@ -703,9 +726,9 @@ public class RunningAppManager { if (isControl == 0) { return false; } - boolean havaConfigure = TimeControlManager.getInstance().havaConfigure(pkg); MachineControl machineControl = TimeControlManager.getInstance().getGlobalMachineControl(); + if (havaConfigure) { //有单独设置 不管是分类整机还是其他都是这个设置 AppTimeControl appTimeControl = TimeControlManager.getInstance().getAppTimeControl(pkg); @@ -715,8 +738,34 @@ public class RunningAppManager { return true; } if (appTimeControl.getTc_use_type() == 0) { + Log.e(TAG, "inControlTime: " + "应用始终可用"); return false; } + } + Log.e(TAG, "inControlTime: globalRemainingTime = " + globalRemainingTime); + if (globalRemainingTime <= 0) { + if (machineControl != null) { + if (machineControl.getIs_part() == 0 && machineControl.getIs_quota() == 0) { + return false; + } + } else { + ToastUtil.show("今日可使用时间已用完"); + return true; + } + } + if (havaConfigure) { + //有单独设置 不管是分类整机还是其他都是这个设置 + AppTimeControl appTimeControl = TimeControlManager.getInstance().getAppTimeControl(pkg); +// if (appTimeControl.getIs_control() == 0) { +// ToastUtil.show("应用已被禁用"); +// Log.e(TAG, "inControlTime: " + "应用已被禁用"); +// return true; +// } +// if (appTimeControl.getTc_use_type() == 0) { +// Log.e(TAG, "inControlTime: " + "应用始终可用"); +// return false; +// } + //打开时间段管控 if (appTimeControl.getIs_part() == 1) { boolean inControlTime = inControlTime(machineControl, appTimeControl); @@ -725,7 +774,6 @@ public class RunningAppManager { Log.i(TAG, "inControlTime: " + "应用在管控时间段不能打开" + appTimeControl.time_part.toString()); ToastUtil.show("该应用" + partTime2String(appTimeControl)); Log.e(TAG, "inControlTime: " + "该应用" + partTime2String(appTimeControl)); - return true; } else { if (appTimeControl.getIs_quota() == 0) { @@ -829,6 +877,10 @@ public class RunningAppManager { } + /** + * @param pkg + * @return json数据 + */ public String getDisableContent(String pkg) { // NetInterfaceManager.getInstance().getMyAppList(new NetInterfaceManager.MyAppListCallback() { // @Override @@ -850,6 +902,17 @@ public class RunningAppManager { // } boolean havaConfigure = TimeControlManager.getInstance().havaConfigure(pkg); MachineControl machineControl = TimeControlManager.getInstance().getGlobalMachineControl(); + + Log.e(TAG, "inControlTime: globalRemainingTime = " + globalRemainingTime); + if (globalRemainingTime <= 0) { + if (machineControl != null) { + if (machineControl.getIs_part() == 0 && machineControl.getIs_quota() == 0) { + return ""; + } + } else { + return ""; + } + } if (havaConfigure) { //有单独设置 不管是分类整机还是其他都是这个设置 AppTimeControl appTimeControl = TimeControlManager.getInstance().getAppTimeControl(pkg); @@ -877,7 +940,7 @@ public class RunningAppManager { } else { if (appTimeControl.getIs_quota() == 0) { //要求设置了管控时间段没有设置使用额度也可以使用 - return "没有管控"; + return ""; } if (getAppRemainingTime(pkg) <= 0) { //没有剩余时间 @@ -904,7 +967,7 @@ public class RunningAppManager { } } else { if (appTimeControl.getIs_quota() == 0) { - return "没有管控"; + return ""; } if (getAppRemainingTime(pkg) <= 0) { //没有剩余时间 @@ -1183,7 +1246,7 @@ public class RunningAppManager { } //禁用时段需要满足所有 boolean inPartTime = inPartTimes.indexOf(true) >= 0; - return !inPartTime; + return inPartTime; } else if (partType == 1) { //开放时段只需要满足一个就行 for (PartTime partTime : partTimeHashSet) { diff --git a/app/src/main/java/com/fuying/sn/desktop/TimeControlManager.java b/app/src/main/java/com/fuying/sn/desktop/TimeControlManager.java index 3061e8d..613b6a9 100644 --- a/app/src/main/java/com/fuying/sn/desktop/TimeControlManager.java +++ b/app/src/main/java/com/fuying/sn/desktop/TimeControlManager.java @@ -110,7 +110,7 @@ public class TimeControlManager { public void setGlobalMachineControl(MachineControl machineControl) { this.mGlobalMachineControl = machineControl; if (machineControl != null) { - RunningAppManager.getInstance().setGlobalUsageTime(machineControl.getRest_time()); + RunningAppManager.getInstance().setGlobalUsageTime(machineControl.getToday_time()); } } diff --git a/app/src/main/java/com/fuying/sn/manager/AmapManager.java b/app/src/main/java/com/fuying/sn/manager/AmapManager.java index 567a5a2..9038d4f 100644 --- a/app/src/main/java/com/fuying/sn/manager/AmapManager.java +++ b/app/src/main/java/com/fuying/sn/manager/AmapManager.java @@ -130,12 +130,13 @@ public class AmapManager { default: } } - Log.e(TAG, "AmapAddress: " + (String) SPUtils.get(mContext, "AmapAddress", "-")); - Log.e(TAG, "AmapError: " + (String) SPUtils.get(mContext, "AmapError", "-")); + Log.e(TAG, "AmapAddress: " + SPUtils.get(mContext, "AmapAddress", "-")); + Log.e(TAG, "AmapError: " + SPUtils.get(mContext, "AmapError", "-")); Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "-gps"); Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "-network"); Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, ""); Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.ASSISTED_GPS_ENABLED, 0); + mLocationClient.stop(); } @Override @@ -194,6 +195,7 @@ public class AmapManager { Log.e(TAG, "onLocationChanged: " + "定位失败"); SPUtils.put(mContext, "AmapError", sb); Log.e(TAG, "onLocDiagnosticMessage: " + sb); + mLocationClient.stop(); } }; } diff --git a/app/src/main/java/com/fuying/sn/network/NetInterfaceManager.java b/app/src/main/java/com/fuying/sn/network/NetInterfaceManager.java index 2c5905e..9463bbf 100644 --- a/app/src/main/java/com/fuying/sn/network/NetInterfaceManager.java +++ b/app/src/main/java/com/fuying/sn/network/NetInterfaceManager.java @@ -631,9 +631,11 @@ public class NetInterfaceManager { } else if (code == 300) { mCacheHelper.put(UrlAddress.SNINFO, ""); SPUtils.put(mContext, CommonConfig.isLogined, 0); + Settings.System.putInt(mContext.getContentResolver(), CommonConfig.KEY_IS_CONTROL, 0); } else if (code == 401) { mCacheHelper.put(UrlAddress.SNINFO, ""); SPUtils.put(mContext, CommonConfig.isLogined, 2); + Settings.System.putInt(mContext.getContentResolver(), CommonConfig.KEY_IS_CONTROL, 0); } } @@ -673,6 +675,10 @@ public class NetInterfaceManager { set.add(JGYUtils.MTK8515Tag); } else if (platform == JGYUtils.G13Platform) { set.add(JGYUtils.G13Tag); + } else if (platform == JGYUtils.G6Platform) { + set.add(JGYUtils.G6Tag); + } else if (platform == JGYUtils.iPlay50SEPlatform) { + set.add(JGYUtils.iPlay50SETag); } }); clearAndAppendTags(set); @@ -809,7 +815,7 @@ public class NetInterfaceManager { public void checkDeviceType(int type) { switch (type) { case cElderlyUsers: - getElderlyUsersApp(); +// getElderlyUsersApp(); break; default: } @@ -1873,49 +1879,6 @@ public class NetInterfaceManager { } }); -// getQueryAllAppControl() -// .subscribe(new Observer>>() { -// @Override -// public void onSubscribe(@NonNull Disposable d) { -// Log.e("getAllappPackage", "onSubscribe: "); -// } -// -// @Override -// public void onNext(@NonNull BaseResponse> listBaseResponse) { -// int code = listBaseResponse.code; -// if (code == 200) { -// Log.e("getAllappPackage", "onNext: " + listBaseResponse); -// List appInfoList = listBaseResponse.data; -// if (null != appInfoList && appInfoList.size() != 0) { -// mMMKV.encode(UrlAddress.GET_ALL_PACKAGE, GsonUtils.toJSONString(appInfoList)); -// HashSet allAppPkg = new HashSet<>(); -// for (AppInfo appInfo : appInfoList) { -// allAppPkg.add(appInfo.getApp_package()); -// } -// String allPkgSet = String.join(",", allAppPkg); -// Settings.System.putString(crv, CommonConfig.ONLY_SHORTCUT_LIST, allPkgSet); -// ApkUtils.writeAppPackageList(mContext, allPkgSet); -// getAppStart(appInfoList); -// } else { -// mMMKV.encode(UrlAddress.GET_ALL_PACKAGE, ""); -// ApkUtils.writeAppPackageList(mContext, ""); -// } -// } else { -// mMMKV.encode(UrlAddress.GET_ALL_PACKAGE, ""); -// ApkUtils.writeAppPackageList(mContext, ""); -// } -// } -// -// @Override -// public void onError(@NonNull Throwable e) { -// Log.e("getAllappPackage", "onError: " + e.getMessage()); -// } -// -// @Override -// public void onComplete() { -// Log.e("getAllappPackage", "onComplete: "); -// } -// }); } public void getForceInstall(boolean refresh, BehaviorSubject lifecycle, CompleteCallback callback) { @@ -2093,6 +2056,7 @@ public class NetInterfaceManager { String data = new Gson().toJson(systemSettingsBaseResponse.data.getUser()); ControlManager.getInstance().setSystemSetting(data); } else { + Settings.System.putInt(mContext.getContentResolver(), CommonConfig.KEY_IS_CONTROL, 0); ControlManager.getInstance().setDisableSetting(); } } else { @@ -2427,7 +2391,7 @@ public class NetInterfaceManager { public void getSnTimeControl(boolean refresh, BehaviorSubject lifecycle, CompleteCallback callback) { - ConnectMode connectMode = ConnectMode.ONE_MINUTE; + ConnectMode connectMode = ConnectMode.DEFAULT; if (refresh) { connectMode = ConnectMode.DEFAULT; } @@ -2477,7 +2441,7 @@ public class NetInterfaceManager { @Override public void onNext(@NonNull BaseResponse machineControlBaseResponse) { - Log.e("getSnTimeControlObserver", "onNext: "); + Log.e("getSnTimeControlObserver", "onNext: " + machineControlBaseResponse); if (machineControlBaseResponse.code == 200) { MachineControl machineControl = machineControlBaseResponse.data; TimeControlManager.getInstance().setGlobalMachineControl(machineControl); @@ -2637,6 +2601,9 @@ public class NetInterfaceManager { Log.e(TAG, "installOverallApp: " + packageList); for (OverallAppBean overallAppBean : overallAppBeanList) { String packages = overallAppBean.getApp_package(); + if (JGYUtils.fuyingApp.contains(packages)) { + continue; + } String url = overallAppBean.getApp_url(); if (TextUtils.isEmpty(url)) { continue; diff --git a/app/src/main/java/com/fuying/sn/receiver/APKinstallReceiver.java b/app/src/main/java/com/fuying/sn/receiver/APKinstallReceiver.java index c69a7e6..e9f05ad 100644 --- a/app/src/main/java/com/fuying/sn/receiver/APKinstallReceiver.java +++ b/app/src/main/java/com/fuying/sn/receiver/APKinstallReceiver.java @@ -68,10 +68,10 @@ public class APKinstallReceiver extends BroadcastReceiver { newAppListener.setNewAppListener(packageName); if (JGYUtils.PACKAGE_APPSTORE.equals(packageName)) { //启动应用市场 - JGYUtils.getInstance().wakeUpDeviceInfo(); +// JGYUtils.getInstance().wakeUpDeviceInfo(); } else if (JGYUtils.PACKAGE_UPDATETOOLS.equals(packageName)) { //启动升级组件 - JGYUtils.getInstance().wakeUpUpdateTools(); +// JGYUtils.getInstance().wakeUpUpdateTools(); } } diff --git a/app/src/main/java/com/fuying/sn/service/RemoteService.java b/app/src/main/java/com/fuying/sn/service/RemoteService.java index f2f4387..02d229d 100644 --- a/app/src/main/java/com/fuying/sn/service/RemoteService.java +++ b/app/src/main/java/com/fuying/sn/service/RemoteService.java @@ -51,6 +51,7 @@ public class RemoteService extends Service { @Override public boolean inControl(String pkg) throws RemoteException { + Log.e(TAG, "inControl: " + RunningAppManager.getInstance().inControlTime(pkg)); return RunningAppManager.getInstance().inControlTime(pkg); } diff --git a/app/src/main/java/com/fuying/sn/service/main/MainSPresenter.java b/app/src/main/java/com/fuying/sn/service/main/MainSPresenter.java index f8a3e71..591b71d 100644 --- a/app/src/main/java/com/fuying/sn/service/main/MainSPresenter.java +++ b/app/src/main/java/com/fuying/sn/service/main/MainSPresenter.java @@ -125,23 +125,23 @@ public class MainSPresenter implements MainSContact.Presenter { NetInterfaceManager.getInstance().getSnInfo(true, getLifecycle(), new NetInterfaceManager.ObserverCallback() { @Override public void onSubscribe(Disposable d) { - Log.e("getSnInfo", "onSubscribe: "); + Log.e("getSnInfom", "onSubscribe: "); } @Override public void onNext(BaseResponse response) { - Log.e("getSnInfo", "onNext: "); + Log.e("getSnInfom", "onNext: " + response); mView.setSnInfo(response); } @Override public void onError(Throwable e) { - Log.e("getSnInfo", "onError: " + e.getMessage()); + Log.e("getSnInfom", "onError: " + e.getMessage()); } @Override public void onComplete() { - Log.e("getSnInfo", "onComplete: "); + Log.e("getSnInfom", "onComplete: "); } }); } diff --git a/app/src/main/java/com/fuying/sn/service/main/MainService.java b/app/src/main/java/com/fuying/sn/service/main/MainService.java index 104dbc7..9afbd08 100644 --- a/app/src/main/java/com/fuying/sn/service/main/MainService.java +++ b/app/src/main/java/com/fuying/sn/service/main/MainService.java @@ -125,6 +125,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo mPresenter.getSnInfo(); mPresenter.getAppAndWhite(); SPUtils.put(MainService.this, CommonConfig.JGY_FIRST_BOOT, 1); + tPushInit(); } } }, 15000); @@ -242,6 +243,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo @Override public void onReceiveLocation(BDLocation bdLocation) { Log.e("initConfig", "onReceiveLocation: "); + locationClient.stop(); } }); } diff --git a/app/src/main/java/com/fuying/sn/tpush/MessageReceiver.java b/app/src/main/java/com/fuying/sn/tpush/MessageReceiver.java index dbe0b17..cd9d9f4 100644 --- a/app/src/main/java/com/fuying/sn/tpush/MessageReceiver.java +++ b/app/src/main/java/com/fuying/sn/tpush/MessageReceiver.java @@ -784,6 +784,7 @@ public class MessageReceiver extends XGPushBaseReceiver { NetInterfaceManager.getInstance().getSystemSettings(); break; case ACTION_WHOLE_MACHINE_QUOTA: + NetInterfaceManager.getInstance().getSystemSettings(); NetInterfaceManager.getInstance().getAppTimeControl(); NetInterfaceManager.getInstance().getSnTimeControl(); break; @@ -1022,7 +1023,6 @@ 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 = GsonUtils.getJsonObject(jsonString); String packageName = object.get("app_package").getAsString(); // 台电设备不删除无法静默卸载 @@ -1030,7 +1030,7 @@ public class MessageReceiver extends XGPushBaseReceiver { ToastUtil.debugShow("收到应用卸载消息:包名" + packageName); if (!"".equals(packageName) && !packageName.equals(context.getApplicationContext().getPackageName())) { if (!ApkUtils.isAvailable(context.getApplicationContext(), packageName)) { -// NetInterfaceManager.getInstance().setAppuninstallInfo(sn_id, packageName); + } else { ApkUtils.uninstallApp(context, packageName); } diff --git a/app/src/main/java/com/fuying/sn/utils/JGYUtils.java b/app/src/main/java/com/fuying/sn/utils/JGYUtils.java index c52caf9..527f321 100644 --- a/app/src/main/java/com/fuying/sn/utils/JGYUtils.java +++ b/app/src/main/java/com/fuying/sn/utils/JGYUtils.java @@ -97,6 +97,9 @@ public class JGYUtils { public static final int MTK8515Platform = 6; public static final int G13Platform = 7; public static final int UnknowPlatform = 0; + public static final int iPlay50SEPlatform = 8; + public static final int G6Platform = 10; + public static final String MTKTag = "MTK"; public static final String ZhanruiTag = "展锐"; @@ -104,6 +107,8 @@ public class JGYUtils { public static final String T30PROTag = "T30PRO"; public static final String MTK8515Tag = "8515"; public static final String G13Tag = "G13"; + public static final String iPlay50SETag = "ipaly50SE"; + public static final String G6Tag = "G6"; private HashSet ownApp = new HashSet() {{ @@ -159,6 +164,21 @@ public class JGYUtils { public static final String growthspace = "com.pengren.growthspace"; public static final String pandaabc = "com.pandaabc.stu"; public static final String qibenyi = "com.goer.fuying"; + public static final String word = "com.fuying.word"; + + public static Set fuyingApp = new HashSet() {{ + this.add(fxyywgj); + this.add(gkwxhd); + this.add(fuxiaoying); + this.add(moshujia); + this.add(english); + this.add(zhiduoke); + this.add(aobama); + this.add(growthspace); + this.add(pandaabc); + this.add(qibenyi); + this.add(word); + }}; public static final String FUXIAOYING_KEY = "fuxiaoying_update_key"; @@ -499,6 +519,12 @@ public class JGYUtils { } else if (G13Tag.equalsIgnoreCase(platform)) { Log.i(TAG, "checkAppPlatform: " + "G13"); return G13Platform; + } else if (G6Tag.equalsIgnoreCase(platform)) { + Log.i(TAG, "checkAppPlatform: " + "G6"); + return G6Platform; + } else if (iPlay50SETag.equalsIgnoreCase(platform)) { + Log.i(TAG, "checkAppPlatform: " + "ipaly50SE"); + return iPlay50SEPlatform; } else { Log.i(TAG, "checkAppPlatform: " + "没有数据"); return UnknowPlatform; @@ -532,6 +558,10 @@ public class JGYUtils { getAppPlatformCallback.AppPlatform(MTK8515Platform); } else if (G13Tag.equalsIgnoreCase(platform)) { getAppPlatformCallback.AppPlatform(G13Platform); + } else if (G6Tag.equalsIgnoreCase(platform)) { + getAppPlatformCallback.AppPlatform(G6Platform); + } else if (iPlay50SETag.equalsIgnoreCase(platform)) { + getAppPlatformCallback.AppPlatform(iPlay50SEPlatform); } else { getAppPlatformCallback.AppPlatform(UnknowPlatform); } @@ -543,6 +573,8 @@ public class JGYUtils { || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.T30ProPlatform || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTK8515Platform || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G13Platform + || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G6Platform + || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.iPlay50SEPlatform ) { return getProperty("ro.build.display.id", "获取失败"); } else { diff --git a/app/src/main/java/com/fuying/sn/utils/Utils.java b/app/src/main/java/com/fuying/sn/utils/Utils.java index 45eac7a..6b7993c 100644 --- a/app/src/main/java/com/fuying/sn/utils/Utils.java +++ b/app/src/main/java/com/fuying/sn/utils/Utils.java @@ -615,7 +615,9 @@ public class Utils { * @return */ public static String getSerial() { - if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G13Platform) { + if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G13Platform + || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.iPlay50SEPlatform + ) { return getSn(); } else { return JGYUtils.getInstance().getIMEI();