version:m40se 3.0.0

fix:
update:上传安装app接口不进行缓存
This commit is contained in:
2023-05-29 09:35:15 +08:00
parent 6b9a1d99b5
commit a6fd0862e3
15 changed files with 27 additions and 27 deletions

View File

@@ -73,8 +73,8 @@ android {
official {
flavorDimensions "default"
versionCode 38
versionName "2.9.8"
versionCode 40
versionName "3.0.0"
}
}
@@ -264,6 +264,7 @@ android {
signingConfig signingConfigs.Teclast8515
}
//m40se
teclastUnisocdebug.initWith(zhanRuiDebug)
teclastUnisocdebug {
manifestPlaceholders = [

View File

@@ -133,8 +133,9 @@ public class BaseApplication extends Application {
//token在设备卸载重装的时候有可能会变
Log.e("TPush", "注册成功设备token为" + data);
List<XGPushManager.AccountInfo> accountInfoList = new ArrayList<>();
// accountInfoList.add(new XGPushManager.AccountInfo(XGPushManager.AccountType.CUSTOM.getValue(), Utils.getSerial()));
accountInfoList.add(new XGPushManager.AccountInfo(XGPushManager.AccountType.CUSTOM.getValue(), Utils.getIMEI(getApplicationContext())));
Log.e("TPush", "onSuccess: " + Utils.getSerial());
accountInfoList.add(new XGPushManager.AccountInfo(XGPushManager.AccountType.CUSTOM.getValue(), Utils.getSerial()));
// accountInfoList.add(new XGPushManager.AccountInfo(XGPushManager.AccountType.CUSTOM.getValue(), Utils.getIMEI(getApplicationContext())));
XGPushManager.upsertAccounts(getApplicationContext(), accountInfoList, new XGIOperateCallback() {
@Override
public void onSuccess(Object data, int flag) {

View File

@@ -1,6 +1,8 @@
package com.fuying.sn.config;
public class CommonConfig {
public static final String MMKV_ID = "InterProcessKV";
/*首次开机*/
public final static String JGY_FIRST_BOOT = "first_boot";
/*保存的应用版本号*/

View File

@@ -75,7 +75,7 @@ public class RunningAppManager {
private static RunningAppManager mRunningAppManager;
private Context mContext;
private CacheHelper mCacheHelper;
private MMKV mMMKV = MMKV.defaultMMKV();
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
public static final String RemainingTimeMap = "RemainingTimeMap_KEY";

View File

@@ -6,6 +6,7 @@ import android.graphics.drawable.Drawable;
import android.os.Environment;
import android.util.Log;
import com.fuying.sn.config.CommonConfig;
import com.jakewharton.disklrucache.DiskLruCache;
import com.tencent.mmkv.MMKV;
@@ -30,7 +31,7 @@ import java.io.Serializable;
public class CacheHelper {
private static final String TAG = "DiskLruCacheHelper";
private MMKV mMMKV = MMKV.defaultMMKV();
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
private static final String DIR_NAME = "diskCache";
private static final int MAX_COUNT = 1024 * 1024 * 1024;

View File

@@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
import android.content.Context;
import android.util.Log;
import com.fuying.sn.config.CommonConfig;
import com.tencent.mmkv.MMKV;
import com.fuying.sn.utils.TimeUtils;
@@ -30,7 +31,7 @@ public class ConnectManager {
@SuppressLint("StaticFieldLeak")
private static ConnectManager sInstance;
private Context mContext;
private MMKV mMMKV = MMKV.defaultMMKV();
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
private ConnectManager(Context context) {
if (context == null) {

View File

@@ -37,7 +37,7 @@ public class ControlManager {
private static ControlManager sInstance;
private Context mContext;
private ContentResolver mResolver;
private MMKV mMMKV = MMKV.defaultMMKV();
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
private ControlManager(Context context) {
if (context == null) {

View File

@@ -6,6 +6,7 @@ import android.content.Context;
import android.hardware.usb.UsbManager;
import android.util.Log;
import com.fuying.sn.config.CommonConfig;
import com.tencent.mmkv.MMKV;
/**
@@ -33,7 +34,7 @@ public class ControlPanelManager {
this.mContext = context;
this.mResolver = context.getContentResolver();
mUsbManager = (UsbManager) context.getSystemService(Context.USB_SERVICE);
mmkv = MMKV.defaultMMKV();
mmkv = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
}
public static void init(Context context) {

View File

@@ -142,7 +142,7 @@ public class NetInterfaceManager {
private static NetInterfaceManager INSTANCE;
private Context mContext;
private ContentResolver crv;
private MMKV mMMKV = MMKV.defaultMMKV();
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
private Retrofit mRetrofit;
private OkHttpClient okHttpClient;
private CacheHelper mCacheHelper;
@@ -765,12 +765,8 @@ public class NetInterfaceManager {
uploadInfos.add(uploadInfo);
}
String json = GsonUtils.toJSONString(uploadInfos);
String old = mCacheHelper.getAsString(UrlAddress.SEND_INSTALLEDORREMOVED);
if (!json.equals(old)) {
emitter.onNext(json);
} else {
Log.e("SendAppInstallInfo", "subscribe: skip");
}
Log.e("SendAppInstallInfo", "subscribe: json = " + json);
emitter.onNext(json);
}
})
.subscribeOn(Schedulers.io())
@@ -779,7 +775,6 @@ public class NetInterfaceManager {
@Override
public ObservableSource<BaseResponse> apply(String s) throws Throwable {
Log.e("SendAppInstallInfo", "apply: " + s);
mCacheHelper.put(UrlAddress.SEND_INSTALLEDORREMOVED, s);
return getAddAppInstallControl()
.installorRemove(Utils.getSerial(), s);
}
@@ -794,9 +789,6 @@ public class NetInterfaceManager {
@Override
public void onNext(@NonNull BaseResponse baseResponse) {
Log.e("SendAppInstallInfo", "onNext: " + baseResponse);
if (baseResponse.code != 200) {
mCacheHelper.put(UrlAddress.SEND_INSTALLEDORREMOVED, "");
}
}
@Override

View File

@@ -42,7 +42,7 @@ public class MainSPresenter implements MainSContact.Presenter {
private MainSContact.MainView mView;
private Context mContext;
private CacheHelper mCacheHelper;
private MMKV mMMKV = MMKV.defaultMMKV();
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
public MainSPresenter(Context context) {
this.mContext = context;

View File

@@ -74,7 +74,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
private String TAG = MainService.class.getSimpleName();
public MainSPresenter mPresenter;
private MMKV mMMKV = MMKV.defaultMMKV();
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
//执行所有请求的时间
long runningTime;
@@ -172,6 +172,8 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
});
mPresenter.getSnInfo();
mPresenter.getAppAndWhite();
NetInterfaceManager.getInstance().updateAdminInfo();
NetInterfaceManager.getInstance().SendAppInstallInfo();
}
}
}, 20000);

View File

@@ -872,8 +872,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
}
synchronized private void sendStartTime(Context context, String jsonString) {
NetInterfaceManager.getInstance().updateAdminInfo();
NetInterfaceManager.getInstance().sendRunningApp();
NetInterfaceManager.getInstance().updateAdminInfo();
NetInterfaceManager.getInstance().SendAppInstallInfo();
NetInterfaceManager.getInstance().getAppAndWhite();
NetInterfaceManager.getInstance().getSnInfo();

View File

@@ -88,7 +88,7 @@ public class JGYUtils {
private static JGYUtils sInstance;
private Context mContext;
private ContentResolver resolver;
private MMKV mMMKV = MMKV.defaultMMKV();
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
public static final int MTKPlatform = 1;
public static final int ZhanruiPlatform = 2;

View File

@@ -614,7 +614,6 @@ public class Utils {
*
* @return
*/
@SuppressLint({"MissingPermission", "NewApi"})
public static String getSerial() {
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G13Platform) {
return getSn();
@@ -880,7 +879,8 @@ public class Utils {
String upgrade_disallow = Settings.System.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_DISALLOW_UPGRADE);
//所有app
String only_jgy_shortcut_list = Settings.System.getString(context.getContentResolver(), CommonConfig.ONLY_SHORTCUT_LIST);
String overall_app_list = MMKV.defaultMMKV().decodeString(CommonConfig.AOLE_ACTION_OVERALL_APP, "");
MMKV mmkv = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
String overall_app_list = mmkv.decodeString(CommonConfig.AOLE_ACTION_OVERALL_APP, "");
Log.e("writeDisableUpdateList", "aole_app_forbid: " + now);
HashSet<String> nowList = new HashSet<>();
HashSet<String> disallowList = new HashSet<>();

View File

@@ -17,7 +17,6 @@
<string name="hint">请务必仔细核对并选择正确学龄段,激活后无法更改或退费</string>
<string name="privacy_policy"><u>隐私政策</u></string>
<string name="user_agreement"><u>用户协议</u></string>
<string name="scan_tips">请使用UIUI小程序扫码添加设备</string>
<string name="bind_succeed">设备已绑定成功</string>
<string name="device_unauthorized">设备未经授权</string>
<string name="locked_hint">家长设置了屏幕锁定,你可以联系家长解锁屏幕,或通过密码解锁</string>