From fc826c656c2c8dd4977158fbdff5ca93db041f2e Mon Sep 17 00:00:00 2001 From: Administrator <981964879@qq.com> Date: Fri, 13 Nov 2020 14:33:10 +0800 Subject: [PATCH] =?UTF-8?q?version:=20update:2020.11.13=20fix:=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0WiFi=E7=83=AD=E7=82=B9=E7=AE=A1=E6=8E=A7=20add:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 9 +-- app/src/main/AndroidManifest.xml | 2 + .../myappstore/activity/MainActivity.java | 56 ++++++++++++++++++- .../myappstore/receiver/MyJPushReceiver.java | 6 ++ .../myappstore/server/InitJpushServer.java | 6 ++ 5 files changed, 72 insertions(+), 7 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f0c94bf..9566ddd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,11 +9,11 @@ def releaseTime() { } android { - compileSdkVersion 29 + compileSdkVersion 30 defaultConfig { applicationId "com.jiaoguanyi.appstore" minSdkVersion 20 - targetSdkVersion 29 + targetSdkVersion 30 // versionCode 105 // versionName "3.1.0"//测试jiaoguanyi.cn @@ -89,8 +89,9 @@ android { } newl { flavorDimensions "default" - versionCode 161 - versionName "1.1.6" + versionCode 157 +// versionCode 1028 + versionName "1.1.7" /*********************************极光推送************************************/ manifestPlaceholders = [ JPUSH_PKGNAME: "com.jiaoguanyi.appstore", diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 86f93ee..1b5acc3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -4,6 +4,7 @@ package="com.mjsheng.myappstore" android:sharedUserId="android.uid.system"> + @@ -19,6 +20,7 @@ + iConnMgrClass = Class.forName(iConnMgr.getClass().getName()); +// +//// if(isEnable){ +//// Method startTethering = iConnMgrClass.getMethod("startTethering", int.class, ResultReceiver.class, boolean.class,String.class); +//// startTethering.invoke(iConnMgr, 0, null, true,context.getPackageName()); +//// }else{ +// Method startTethering = iConnMgrClass.getMethod("stopTethering", int.class, String.class); +// startTethering.invoke(iConnMgr, 0, getPackageName()); +//// } +// +// } catch (NoSuchFieldException e) { +// e.printStackTrace(); +// } catch (NoSuchMethodException e) { +// e.printStackTrace(); +// } catch (IllegalAccessException e) { +// e.printStackTrace(); +// } catch (InvocationTargetException e) { +// e.printStackTrace(); +// } catch (ClassNotFoundException e) { +// e.printStackTrace(); +// } + + int setting_hotspot = changeNum(data.optInt("setting_hotspot")); + if (setting_hotspot == 1) { + Intent intent = new Intent(); + intent.setAction("qch_hotspot_close"); + intent.setPackage("com.android.settings"); + sendStickyBroadcast(intent); + } + boolean qch_hotspot_forbid_on = Settings.System.putInt(getContentResolver(), "qch_hotspot_forbid_on", setting_hotspot);//写入系统数据库 Log.e("SystemSetting", "qch_hotspot_forbid_on---------" + setting_hotspot); Log.e("SystemSetting", "qch_hotspot_forbid_on---------" + qch_hotspot_forbid_on); 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 754797a..111ccab 100644 --- a/app/src/main/java/com/mjsheng/myappstore/receiver/MyJPushReceiver.java +++ b/app/src/main/java/com/mjsheng/myappstore/receiver/MyJPushReceiver.java @@ -393,6 +393,12 @@ public class MyJPushReceiver extends BroadcastReceiver { } int setting_hotspot = changeNum(data.optInt("setting_hotspot"));//热点 + if (setting_hotspot == 1) { + Intent intent = new Intent(); + intent.setAction("qch_hotspot_close"); + intent.setPackage("com.android.settings"); + this.mContext.sendStickyBroadcast(intent); + } boolean qch_hotspot_forbid_on = Settings.System.putInt(this.mContext.getContentResolver(), "qch_hotspot_forbid_on", setting_hotspot);//写入系统数据库 Log.e("SystemSetting", "qch_hotspot_forbid_on---------" + setting_hotspot); Log.e("SystemSetting", "qch_hotspot_forbid_on---------" + qch_hotspot_forbid_on); 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 d69b755..b2ca152 100644 --- a/app/src/main/java/com/mjsheng/myappstore/server/InitJpushServer.java +++ b/app/src/main/java/com/mjsheng/myappstore/server/InitJpushServer.java @@ -1003,6 +1003,12 @@ public class InitJpushServer extends Service { } int setting_hotspot = changeNum(data.optInt("setting_hotspot"));//热点 + if (setting_hotspot == 1) { + Intent intent = new Intent(); + intent.setAction("qch_hotspot_close"); + intent.setPackage("com.android.settings"); + this.sendStickyBroadcast(intent); + } boolean qch_hotspot_forbid_on = Settings.System.putInt(this.getContentResolver(), "qch_hotspot_forbid_on", setting_hotspot);//写入系统数据库 Log.e("SystemSetting", "qch_hotspot_forbid_on---------" + setting_hotspot); Log.e("SystemSetting", "qch_hotspot_forbid_on---------" + qch_hotspot_forbid_on);