From f114b2760654a80a958f10c0a6e99aac8bccbab8 Mon Sep 17 00:00:00 2001 From: FHT <981964879@qq.com> Date: Thu, 18 Mar 2021 11:40:25 +0800 Subject: [PATCH] =?UTF-8?q?version:=20update:2021.03.18=20fix:=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E8=87=AA=E5=8A=A8=E4=B8=8B=E8=BD=BD=EF=BC=8C=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9=E5=88=9B=E5=BB=BA=E5=A4=B1=E8=B4=A5=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E5=88=9B=E5=BB=BA=20add:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 8 ++++---- .../myappstore/receiver/MyJPushReceiver.java | 19 +++++++++++-------- .../myappstore/server/InitJpushServer.java | 6 ++++++ 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 284ac92..0e52500 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -41,8 +41,8 @@ android { productFlavors { official { flavorDimensions "default" - versionCode 1033 - versionName "2.0.3.3"// 正式jiaoguanyi.com 双数正式 单数测试 + versionCode 1034 + versionName "2.0.3.4"// 正式jiaoguanyi.com 双数正式 单数测试 /*********************************极光推送************************************/ manifestPlaceholders = [ JPUSH_PKGNAME: "com.jiaoguanyi.appstore", @@ -92,9 +92,9 @@ android { } newl { flavorDimensions "default" - versionCode 164 + versionCode 166 // versionCode 1031 - versionName "1.2.4" + versionName "1.2.6" /*********************************极光推送************************************/ manifestPlaceholders = [ JPUSH_PKGNAME: "com.jiaoguanyi.appstore", diff --git a/app/src/main/java/com/mjsheng/myappstore/receiver/MyJPushReceiver.java b/app/src/main/java/com/mjsheng/myappstore/receiver/MyJPushReceiver.java index 9af5b33..149b062 100644 --- a/app/src/main/java/com/mjsheng/myappstore/receiver/MyJPushReceiver.java +++ b/app/src/main/java/com/mjsheng/myappstore/receiver/MyJPushReceiver.java @@ -130,9 +130,9 @@ public class MyJPushReceiver extends BroadcastReceiver { private final String KILL_SERVER = "26";//结束进程 - private final String TIME_CONTROL = "27";//结束进程 + private final String TIME_CONTROL = "27";//时间管控 - private final String TOP_APP = "28";//结束进程 + private final String TOP_APP = "28";//app霸屏 private Context mContext; @@ -196,6 +196,8 @@ public class MyJPushReceiver extends BroadcastReceiver { // ToastUtils.showShort("message::" + message + "--type::" + type + "--title::" + title + "--extras::" + extras + "---package_name:" + package_name); // Toast.makeText(context, "message::" + message + "--type::" + type + "--title::" + title + "--extras::" + extras + "---package_name:" + package_name, Toast.LENGTH_SHORT).show(); switch (message) { + default: + break; case MSG_DELETE: if (!TextUtils.isEmpty(title)) { if (SaveListUtils.getlist().contains(title)) { @@ -356,7 +358,7 @@ public class MyJPushReceiver extends BroadcastReceiver { getTimeControl(context, extras); break; case TOP_APP: - getTopApp(context,extras); + getTopApp(context, extras); break; } @@ -929,6 +931,7 @@ public class MyJPushReceiver extends BroadcastReceiver { } } + @Override public void onSubscribe(Disposable param1Disposable) { } @@ -980,7 +983,7 @@ public class MyJPushReceiver extends BroadcastReceiver { String qch_disable_slide = Settings.System.getString(mContext.getApplicationContext().getContentResolver(), "qch_disable_slide"); Log.e("fht", "qch_disable_slide::" + qch_disable_slide); - if (!strban.equals("")) { + if (!"".equals(strban)) { Settings.System.putString(mContext.getContentResolver(), "qch_disable_slide", strban); Log.e("fht", "sendban::" + strban); } else { @@ -1024,7 +1027,7 @@ public class MyJPushReceiver extends BroadcastReceiver { // String str = jSONObject.optString("not"); Log.e("mymjsheng", "ban::" + s1); // Log.e("mymjsheng", "not::" + str); - if (s1.equals("0")) { + if ("0".equals(s1)) { Intent intent2 = new Intent("qch_camera_forbid").setPackage("com.android.settings"); // intent2.putExtra("camera_package_name", s1); this.mContext.sendBroadcast(intent2); @@ -1070,7 +1073,7 @@ public class MyJPushReceiver extends BroadcastReceiver { Log.e("fht", "qch_jgy_network_disallow::" + qch_jgy_network_disallow); Log.e("fht", "qch_jgy_network_allow::" + qch_jgy_network_allow); - if (strban != null && !strban.equals("")) { + if (strban != null && !"".equals(strban)) { Settings.System.putString(mContext.getContentResolver(), "qch_jgy_network_disallow", strban); // Log.e("fht", "qch_jgy_network_disallow::" + Settings.System.getString(mContext.getApplicationContext().getContentResolver(), "qch_jgy_network_disallow")); // Log.e("fht", "qch_jgy_network_allow::" + Settings.System.getString(mContext.getApplicationContext().getContentResolver(), "qch_jgy_network_allow")); @@ -1333,8 +1336,8 @@ public class MyJPushReceiver extends BroadcastReceiver { HTTPInterface.getSnTimeControl(context); } - private void getTopApp(Context context,String extras) { - com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(extras); + private void getTopApp(Context context, String extras) { + com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(extras); String packageName = jsonObject.getString("app_package"); SPUtils.put(context, ForegroundAppUtil.TOPAPP_KEY, packageName); ForegroundAppUtil.openTopApp(context); diff --git a/app/src/main/java/com/mjsheng/myappstore/server/InitJpushServer.java b/app/src/main/java/com/mjsheng/myappstore/server/InitJpushServer.java index c221ce6..5c55b5a 100644 --- a/app/src/main/java/com/mjsheng/myappstore/server/InitJpushServer.java +++ b/app/src/main/java/com/mjsheng/myappstore/server/InitJpushServer.java @@ -30,6 +30,7 @@ import android.widget.TextView; import com.alibaba.fastjson.JSON; import com.arialyy.aria.core.Aria; import com.blankj.utilcode.util.LogUtils; +import com.blankj.utilcode.util.PathUtils; import com.lzy.okgo.OkGo; import com.lzy.okgo.callback.StringCallback; import com.mjsheng.myappstore.BuildConfig; @@ -70,6 +71,7 @@ import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; +import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; @@ -114,6 +116,10 @@ public class InitJpushServer extends Service { super.onCreate(); registReceiver(); registerTimeReceiver(); + File file = new File(PathUtils.getExternalDownloadsPath() + "/jgy/"); + if (!file.exists()){ + file.mkdirs(); + } // android.os.Debug.waitForDebugger(); }