update:2021.03.18
fix:不能自动下载,文件夹创建失败手动创建
add:
This commit is contained in:
FHT
2021-03-18 11:40:25 +08:00
parent d7e1bd9f7c
commit f114b27606
3 changed files with 21 additions and 12 deletions

View File

@@ -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",

View File

@@ -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);

View File

@@ -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();
}