From cf04e4c0b823efcda8223a6a1ba7361abafa201c Mon Sep 17 00:00:00 2001 From: Fanhuitong <981964879@qq.com> Date: Sat, 17 Jun 2023 09:24:50 +0800 Subject: [PATCH] =?UTF-8?q?version:m40se=203.0.2=20fix:=20update:=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E8=80=97=E7=94=B5=E5=92=8C=E7=AE=A1=E6=8E=A7=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 27 ++++++++-- app/keystore/zhanxunUserdebug.keystore | Bin 0 -> 2931 bytes app/src/main/AndroidManifest.xml | 2 +- .../fuying/sn/activity/main/MainActivity.java | 2 + .../com/fuying/sn/base/BaseApplication.java | 1 + .../fuying/sn/desktop/RunningAppManager.java | 8 +-- .../com/fuying/sn/manager/AmapManager.java | 7 +-- .../sn/network/NetInterfaceManager.java | 48 +++++++++--------- .../com/fuying/sn/receiver/BootReceiver.java | 20 ++++---- .../fuying/sn/service/main/MainService.java | 9 ++-- 10 files changed, 73 insertions(+), 51 deletions(-) create mode 100644 app/keystore/zhanxunUserdebug.keystore diff --git a/app/build.gradle b/app/build.gradle index 5a05576..2192600 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -73,8 +73,8 @@ android { official { flavorDimensions "default" - versionCode 40 - versionName "3.0.0" + versionCode 42 + versionName "3.0.2" } } @@ -89,6 +89,15 @@ android { v2SigningEnabled true } + zhanRuiUserdebug { + storeFile file("keystore/zhanxunUserdebug.keystore") + storePassword "123456" + keyAlias "zhanxunUserdebug" + keyPassword "123456" + v1SigningEnabled true + v2SigningEnabled false + } + teclastUnisoc { storeFile file("keystore/TeclastUnisoc.keystore") storePassword "123456" @@ -287,6 +296,9 @@ android { teclastUnisocUserdebug.initWith(zhanRuiDebug) teclastUnisocUserdebug { + manifestPlaceholders = [ + AK: "u5qGsILQ7qlXI8GDv6T6cGl8IWMtsPSu" + ] buildConfigField "String", "platform", '"M40SE"' versionNameSuffix "-debug" debuggable true @@ -313,6 +325,15 @@ android { signingConfig signingConfigs.zhanRui } + zhanRuiUserdebugReleas.initWith(debug) + zhanRuiUserdebugReleas { + manifestPlaceholders = [ + AK: "EiqcGW9LWDvfMKl7mZxUtt1UkNKpdQI5" + ] + buildConfigField "String", "platform", '"ZhanRui"' + signingConfig signingConfigs.zhanRuiUserdebug + } + debug { buildConfigField "String", "platform", '"MTK"' versionNameSuffix "-debug" @@ -404,8 +425,6 @@ dependencies { annotationProcessor 'com.github.bumptech.glide:compiler:4.13.2' //磁盘缓存 implementation 'com.jakewharton:disklrucache:2.0.2' -// //fastjson -// implementation 'com.alibaba:fastjson:1.2.83' //Aria implementation 'com.arialyy.aria:core:3.8.15' annotationProcessor 'com.arialyy.aria:compiler:3.8.15' diff --git a/app/keystore/zhanxunUserdebug.keystore b/app/keystore/zhanxunUserdebug.keystore new file mode 100644 index 0000000000000000000000000000000000000000..6d8f9ee9b0b99a74008916ccdf8ddb3c208ba0c5 GIT binary patch literal 2931 zcmY+Ec{~%28^^cVCRZl+Rqk8cm?P!B%YEc5%#oCg+$tI7K4u}bAwM~D-${+4R$66l zktVm6kc#p1`@Md@@Avin<9VLf^Ld`n^WXDEU^zlSKo$g+LjlUBgtNfyasgR^Wmpbj zFqVV=NajIcA-DfAg4_UOAwfrSz)_%~9RG81vI9Y7SnwVK3*JR2LfQW>9~~D3^HHXX zwafMKm~lR$?11N@dd52`5{LybUbvzy;7niB66!OuT|~1 zwGgOjFj?;nES!}=*^(N>%{hJc#(}e!_>T9t)pR) zNw?j_M14=a(?_^`^E&^~CS7GK_Q^4MZtL?NYBKNaDR0jVJf+(S;qulcLJTXqJV@_8 zyBEfXMotSDEV#6vbxF~gD1@t|09 zG5phOKDJeACJ&SM4C5l~=DFhr|3uikm{)EGkrSVgLaJ}u?3uuURH-RLqKNU*ruKJw&?5O{V=8L-^+bKrdPIap{3-4)n$Jet8XGZ5z0%88=0L> zw&fo^62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9%Yim7}e%s-xM%lF+7laM>}wCBB4Cc^{>&pG2BFH?`7Oz%K3mbG=Ob`so- zMBgU$_s)3|z4~^GUW7bjJAYbkYpmZEQFm1jF9)1bjP1STfOG4+8T_5#raVvI4314+J z&tpfAo|QQmLYmhE^91+oM<``H}>g+?$ zgHHFaYee2jI?xsHmG*BY+xvKR&eiNNXYV1jOcMHTaGG!w2h^358H7zCcWDy>xWQUq zA~MHT2y37|OVu7>%m`1N=g;YmjppY*t30W=bNDGLHBdovzP_=xqWxOpdg@HUW;_GU zsVd^9RvsYIAh?(ssKRrls7(F$Nu7jtsbI(>O;V0Qv&RA3N1+2zN3)(kvyW?##ix}o z8?U;Zl8NtpCZ%Gwt>ws3X0oCvr_e3=tmZKTlqwQuyZmy^XaL0CE1U0DadATH*a1Qh zA&FpvLX?lQfJ7hwFy9vI!nq$O3qOSAEjO__0~&(!JQl%xo(+ZxmVlNCOZ!)h{$7j4 NNR_Qz5DO4j_HPr2YefJ6 literal 0 HcmV?d00001 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c99c76a..253e093 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -46,7 +46,7 @@ - + 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 6ac9936..c847026 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 @@ -238,6 +238,7 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView, @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); + Log.e(TAG, "onNewIntent: " ); if (REFRESHACTION.equals(intent.getAction())) { mPresenter.getSnInfo(); } @@ -374,6 +375,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: " ); if (REFRESHACTION.equals(intent.getAction())) { mPresenter.getSnInfo(); } diff --git a/app/src/main/java/com/fuying/sn/base/BaseApplication.java b/app/src/main/java/com/fuying/sn/base/BaseApplication.java index 5b2bbef..e4448d0 100644 --- a/app/src/main/java/com/fuying/sn/base/BaseApplication.java +++ b/app/src/main/java/com/fuying/sn/base/BaseApplication.java @@ -127,6 +127,7 @@ public class BaseApplication extends Application { private void tPushInit() { XGPushConfig.enableDebug(this, true); + XGPushConfig.enablePullUpOtherApp(this, false); XGPushManager.registerPush(this, new XGIOperateCallback() { @Override public void onSuccess(Object data, int flag) { 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 ee8b4da..5a0ed44 100644 --- a/app/src/main/java/com/fuying/sn/desktop/RunningAppManager.java +++ b/app/src/main/java/com/fuying/sn/desktop/RunningAppManager.java @@ -183,7 +183,7 @@ public class RunningAppManager { */ private void checkForegroundAppName() { String topPackage = getTopActivityInfo(); - if ("org.chromium.browser".equals(topPackage)){ + if ("org.chromium.browser".equals(topPackage)) { JGYUtils.getInstance().killPackage("org.chromium.browser"); } Log.i(TAG, "checkForegroundAppName: topPackage = " + topPackage); @@ -744,7 +744,6 @@ public class RunningAppManager { } } else { if (appTimeControl.getIs_quota() == 0) { -// ToastUtil.show("没有使用额度"); Log.e(TAG, "inControlTime: " + "没有使用额度"); return false; } @@ -1069,7 +1068,7 @@ public class RunningAppManager { // return restTime - todayTime <= 0; // } Log.i(TAG, "haveUseTime: " + globalRemainingTime); - return !(globalRemainingTime > 0); + return (globalRemainingTime > 0); } @@ -1183,7 +1182,8 @@ public class RunningAppManager { inPartTimes.add(inControlTime(partTime)); } //禁用时段需要满足所有 - return inPartTimes.indexOf(true) >= 0; + boolean inPartTime = inPartTimes.indexOf(true) >= 0; + return !inPartTime; } else if (partType == 1) { //开放时段只需要满足一个就行 for (PartTime partTime : partTimeHashSet) { 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 070d5e4..567a5a2 100644 --- a/app/src/main/java/com/fuying/sn/manager/AmapManager.java +++ b/app/src/main/java/com/fuying/sn/manager/AmapManager.java @@ -22,7 +22,7 @@ public class AmapManager { private AmapManager(Context context) { this.mContext = context; - Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "+gps"); +// Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "+gps"); Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "+network"); Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.ASSISTED_GPS_ENABLED, 1); initAmap(); @@ -48,7 +48,7 @@ public class AmapManager { if (mLocationClient == null) { mLocationClient = new LocationClient(mContext); } - Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "+gps"); +// Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "+gps"); Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "+network"); Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.ASSISTED_GPS_ENABLED, 1); mLocationClient.setLocOption(getDefaultLocationClientOption()); @@ -132,8 +132,9 @@ public class AmapManager { } Log.e(TAG, "AmapAddress: " + (String) SPUtils.get(mContext, "AmapAddress", "-")); Log.e(TAG, "AmapError: " + (String) SPUtils.get(mContext, "AmapError", "-")); - Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "-network"); 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); } 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 4e9db29..2c5905e 100644 --- a/app/src/main/java/com/fuying/sn/network/NetInterfaceManager.java +++ b/app/src/main/java/com/fuying/sn/network/NetInterfaceManager.java @@ -2809,30 +2809,30 @@ public class NetInterfaceManager { } - public void getAdminApp() { - getAdminAppObservable() - .subscribe(new Observer>>() { - @Override - public void onSubscribe(@NonNull Disposable d) { - Log.e("getAdminApp", "onSubscribe: "); - } - - @Override - public void onNext(@NonNull BaseResponse> baseResponse) { - Log.e("getAdminApp", "onNext: " + baseResponse); - } - - @Override - public void onError(@NonNull Throwable e) { - Log.e("getAdminApp", "onError: "); - } - - @Override - public void onComplete() { - Log.e("getAdminApp", "onComplete: "); - } - }); - } +// public void getAdminApp() { +// getAdminAppObservable() +// .subscribe(new Observer>>() { +// @Override +// public void onSubscribe(@NonNull Disposable d) { +// Log.e("getAdminApp", "onSubscribe: "); +// } +// +// @Override +// public void onNext(@NonNull BaseResponse> baseResponse) { +// Log.e("getAdminApp", "onNext: " + baseResponse); +// } +// +// @Override +// public void onError(@NonNull Throwable e) { +// Log.e("getAdminApp", "onError: "); +// } +// +// @Override +// public void onComplete() { +// Log.e("getAdminApp", "onComplete: "); +// } +// }); +// } public interface WhiteListCallback { void onComplet(); diff --git a/app/src/main/java/com/fuying/sn/receiver/BootReceiver.java b/app/src/main/java/com/fuying/sn/receiver/BootReceiver.java index 8dda432..909b38e 100644 --- a/app/src/main/java/com/fuying/sn/receiver/BootReceiver.java +++ b/app/src/main/java/com/fuying/sn/receiver/BootReceiver.java @@ -27,16 +27,16 @@ public class BootReceiver extends BroadcastReceiver { String action = intent.getAction(); Log.e("SNBootReceiver", action); if (Intent.ACTION_BOOT_COMPLETED.equals(action) - || Intent.ACTION_BATTERY_CHANGED.equals(action) - || Intent.ACTION_BATTERY_LOW.equals(action) - || Intent.ACTION_BATTERY_OKAY.equals(action) - || Intent.ACTION_POWER_CONNECTED.equals(action) - || Intent.ACTION_POWER_DISCONNECTED.equals(action) - || Intent.ACTION_DATE_CHANGED.equals(action) - || Intent.ACTION_TIME_TICK.equals(action) - || Intent.ACTION_USER_PRESENT.equals(action) - || Intent.ACTION_SCREEN_ON.equals(action) - || Intent.ACTION_SCREEN_OFF.equals(action) +// || Intent.ACTION_BATTERY_CHANGED.equals(action) +// || Intent.ACTION_BATTERY_LOW.equals(action) +// || Intent.ACTION_BATTERY_OKAY.equals(action) +// || Intent.ACTION_POWER_CONNECTED.equals(action) +// || Intent.ACTION_POWER_DISCONNECTED.equals(action) +// || Intent.ACTION_DATE_CHANGED.equals(action) +// || Intent.ACTION_TIME_TICK.equals(action) +// || Intent.ACTION_USER_PRESENT.equals(action) +// || Intent.ACTION_SCREEN_ON.equals(action) +// || Intent.ACTION_SCREEN_OFF.equals(action) || BOOT_COMPLETED.equals(action) || "android.intent.action.BATTERY_LEVEL_CHANGED".equals(action) ) { 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 f4e0fe2..104dbc7 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 @@ -79,9 +79,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo //执行所有请求的时间 long runningTime; - //MainService上次执行时间 - long startCommandTime = 0; - private final BehaviorSubject lifecycleSubject = BehaviorSubject.create(); @NotNull @@ -124,6 +121,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo public void run() { // NetInterfaceManager.getInstance().updateAdminInfo(); if (JGYUtils.getInstance().isScreenOn()) { + Log.e(TAG, "getSnInfo1"); mPresenter.getSnInfo(); mPresenter.getAppAndWhite(); SPUtils.put(MainService.this, CommonConfig.JGY_FIRST_BOOT, 1); @@ -165,11 +163,12 @@ public class MainService extends Service implements MainSContact.MainView, Netwo Handler.getMain().postDelayed(new Runnable() { @Override public void run() { - Log.e("TimeObserver", "run: "+NetStateUtils.isNetworkConnected(MainService.this) ); + Log.e("TimeObserver", "run: " + NetStateUtils.isNetworkConnected(MainService.this)); if (NetStateUtils.isNetworkConnected(MainService.this)) { NetInterfaceManager.getInstance().getAppWhiteList(() -> { Log.e("TimeObserver", "onNext: getAppWhiteList"); }); + Log.e(TAG, "getSnInfo1"); mPresenter.getSnInfo(); mPresenter.getAppAndWhite(); NetInterfaceManager.getInstance().updateAdminInfo(); @@ -229,7 +228,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo @Override public int onStartCommand(Intent intent, int flags, int startId) { Log.e(TAG, "onStartCommand: " + System.currentTimeMillis()); - configStart.onstar("onStartCommand"); +// configStart.onstar("onStartCommand"); return START_STICKY; }