version:
update: fix: add:增加清除应用数据功能
This commit is contained in:
@@ -105,9 +105,9 @@ android {
|
||||
|
||||
newl {
|
||||
flavorDimensions "default"
|
||||
versionCode 169
|
||||
versionCode 171
|
||||
// versionCode 1036
|
||||
versionName "1.2.9"
|
||||
versionName "1.3.1"
|
||||
/*********************************极光推送************************************/
|
||||
manifestPlaceholders = [
|
||||
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
|
||||
|
||||
@@ -128,6 +128,7 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
mView.setBatchText(batch, View.VISIBLE);
|
||||
SPUtils.put(mContext, "batch", batch);
|
||||
}
|
||||
SPUtils.put(mContext, "admin_id", studentsInfoBaseResponse.data.getAdmin_id());
|
||||
} else {
|
||||
Log.e("getStudesInfo", "onNext: " + studentsInfoBaseResponse.toString());
|
||||
}
|
||||
|
||||
@@ -71,7 +71,6 @@ public class NetInterfaceManager {
|
||||
public static final String WEBSOCKET_URL = BuildConfig.WebsocketURL;
|
||||
public static final String HTTP_KEY = "YTM3YTAxNTJmMmZmNzkyM2E2YzIwZjlhZTc0NzNmMGI=";
|
||||
|
||||
|
||||
private NetInterfaceManager(Context context) {
|
||||
this.mContext = context;
|
||||
if (null == mRetrofit) {
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.amap.api.location.AMapLocation;
|
||||
import com.amap.api.location.AMapLocationClient;
|
||||
import com.amap.api.location.AMapLocationListener;
|
||||
import com.blankj.utilcode.util.PathUtils;
|
||||
import com.mjsheng.myappstore.utils.CacheUtils;
|
||||
import com.mjsheng.myappstore.utils.JGYUtils;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.callback.StringCallback;
|
||||
@@ -119,6 +120,8 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
|
||||
private final String LOGO_IMG = "29";//开机动画
|
||||
|
||||
private final String CLEAN_APP_CACHE = "32";//清除app数据
|
||||
|
||||
|
||||
private Context mContext;
|
||||
|
||||
@@ -344,7 +347,9 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
setBootanimation(context, extras);
|
||||
Log.e(TAG, "processCustomMessage: " + extras);
|
||||
break;
|
||||
|
||||
case CLEAN_APP_CACHE:
|
||||
cleanCache(context, extras);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1321,8 +1326,25 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
JGYUtils.getInstance().checkBootFile(file_url, file_md5);
|
||||
} else {
|
||||
JGYUtils.getInstance().removeBootanimation();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void cleanCache(Context context, String extras) {
|
||||
com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(extras);
|
||||
String packageName = jsonObject.getString("app_package");
|
||||
if (TextUtils.isEmpty(packageName)) {
|
||||
Log.e(TAG, "cleanCache: " + "package is empty");
|
||||
} else {
|
||||
try {
|
||||
if (new CacheUtils().cleanApplicationUserData(context, packageName)) {
|
||||
Log.e(TAG, "cleanCache: " + packageName + " success");
|
||||
} else {
|
||||
Log.e(TAG, "cleanCache: " + packageName + " failed");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.e(TAG, "cleanCache: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ import rx.android.schedulers.AndroidSchedulers;
|
||||
import rx.schedulers.Schedulers;
|
||||
|
||||
public class ApkUtils {
|
||||
|
||||
private static String TAG = ApkUtils.class.getSimpleName();
|
||||
|
||||
public static synchronized boolean getRootAhth() {
|
||||
Process process = null;
|
||||
@@ -1071,10 +1071,9 @@ public class ApkUtils {
|
||||
}
|
||||
appList.add(uploadAppInfo);
|
||||
}
|
||||
// Log.e("mjsheng", "UploadAppInfo========" + appList.toString());
|
||||
Gson gson = new Gson();
|
||||
String jsonString = gson.toJson(appList);
|
||||
// Log.e("mjsheng", "json========" + jsonString);
|
||||
Log.e(TAG, "getAppInfo: " + jsonString);
|
||||
|
||||
UploadAppInfoApi uploadAppInfoApi = NetInterfaceManager.getUploadAppInfoApi();
|
||||
uploadAppInfoApi.getUploadAppInfoApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial(), jsonString)
|
||||
|
||||
Reference in New Issue
Block a user