style: 修改更新界面描述
This commit is contained in:
@@ -18,8 +18,8 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.aoleyun.sn"
|
applicationId "com.aoleyun.sn"
|
||||||
versionCode 228
|
versionCode 229
|
||||||
versionName "1.6.0629-2"
|
versionName "1.6.0711"
|
||||||
|
|
||||||
//There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature.
|
//There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature.
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
@@ -776,6 +776,7 @@ dependencies {
|
|||||||
//Google
|
//Google
|
||||||
implementation 'com.google.code.gson:gson:2.9.0'
|
implementation 'com.google.code.gson:gson:2.9.0'
|
||||||
implementation 'com.google.zxing:core:3.5.0'
|
implementation 'com.google.zxing:core:3.5.0'
|
||||||
|
// implementation 'com.google.mlkit:face-detection:16.1.7'
|
||||||
//图片加载框架
|
//图片加载框架
|
||||||
implementation 'com.github.bumptech.glide:glide:4.13.2'
|
implementation 'com.github.bumptech.glide:glide:4.13.2'
|
||||||
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.2'
|
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.2'
|
||||||
|
|||||||
@@ -214,7 +214,7 @@
|
|||||||
android:name=".activity.update.UpdateActivity"
|
android:name=".activity.update.UpdateActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:icon="@drawable/com_aoleyun_update"
|
android:icon="@drawable/com_aoleyun_update"
|
||||||
android:label="检查更新"
|
android:label="策略更新"
|
||||||
android:launchMode="singleInstance">
|
android:launchMode="singleInstance">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|||||||
@@ -6,10 +6,7 @@ import android.graphics.drawable.Drawable;
|
|||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.aoleyun.sn.comm.CommonConfig;
|
|
||||||
import com.jakewharton.disklrucache.DiskLruCache;
|
import com.jakewharton.disklrucache.DiskLruCache;
|
||||||
import com.tencent.mmkv.BuildConfig;
|
|
||||||
import com.tencent.mmkv.MMKV;
|
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
@@ -20,29 +17,28 @@ import java.io.ByteArrayOutputStream;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
import java.io.ObjectInputStream;
|
import java.io.ObjectInputStream;
|
||||||
import java.io.ObjectOutputStream;
|
import java.io.ObjectOutputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.OutputStreamWriter;
|
import java.io.OutputStreamWriter;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 磁盘缓存帮助类
|
* 磁盘缓存帮助类
|
||||||
|
* https://www.cnblogs.com/aademeng/articles/6817058.html
|
||||||
*/
|
*/
|
||||||
public class CacheHelper {
|
public class CacheHelper {
|
||||||
private static final String TAG = "CacheHelper";
|
private static final String TAG = "DiskLruCacheHelper";
|
||||||
|
|
||||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
|
||||||
|
|
||||||
private static final String DIR_NAME = "diskCache";
|
private static final String DIR_NAME = "diskCache";
|
||||||
private static final int MAX_COUNT = 1024 * 1024 * 1024;
|
private static final int MAX_COUNT = 1024 * 1024 * 1024;
|
||||||
private static final int DEFAULT_APP_VERSION = 1;
|
private static final int DEFAULT_APP_VERSION = 1;
|
||||||
|
|
||||||
private DiskLruCache mDiskLruCache;
|
private DiskLruCache mDiskLruCache;
|
||||||
private Context mContext;
|
|
||||||
|
|
||||||
public CacheHelper(Context context) {
|
public CacheHelper(Context context) {
|
||||||
this.mContext = context;
|
|
||||||
mDiskLruCache = generateCache(context, DIR_NAME, MAX_COUNT);
|
mDiskLruCache = generateCache(context, DIR_NAME, MAX_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,9 +71,8 @@ public class CacheHelper {
|
|||||||
|
|
||||||
int appVersion = context == null ? DEFAULT_APP_VERSION : Utils.getAppVersion(context);
|
int appVersion = context == null ? DEFAULT_APP_VERSION : Utils.getAppVersion(context);
|
||||||
|
|
||||||
DiskLruCache diskLruCache = null;
|
|
||||||
try {
|
try {
|
||||||
diskLruCache = DiskLruCache.open(
|
return DiskLruCache.open(
|
||||||
dir,
|
dir,
|
||||||
appVersion,
|
appVersion,
|
||||||
DEFAULT_APP_VERSION,
|
DEFAULT_APP_VERSION,
|
||||||
@@ -85,13 +80,12 @@ public class CacheHelper {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return diskLruCache;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private DiskLruCache generateCache(Context context, String dirName, int maxCount) {
|
private DiskLruCache generateCache(Context context, String dirName, int maxCount) {
|
||||||
DiskLruCache diskLruCache = null;
|
|
||||||
try {
|
try {
|
||||||
diskLruCache = DiskLruCache.open(
|
return DiskLruCache.open(
|
||||||
getDiskCacheDir(context, dirName),
|
getDiskCacheDir(context, dirName),
|
||||||
Utils.getAppVersion(context),
|
Utils.getAppVersion(context),
|
||||||
DEFAULT_APP_VERSION,
|
DEFAULT_APP_VERSION,
|
||||||
@@ -99,7 +93,7 @@ public class CacheHelper {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return diskLruCache;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================
|
// =======================================
|
||||||
@@ -107,9 +101,7 @@ public class CacheHelper {
|
|||||||
// =======================================
|
// =======================================
|
||||||
|
|
||||||
public void put(String key, String value) {
|
public void put(String key, String value) {
|
||||||
Log.e(TAG, "put: " + key);
|
Log.e(TAG, "put: key = " + key + " value = " + value);
|
||||||
mMMKV.encode(key + "_time", System.currentTimeMillis());
|
|
||||||
mMMKV.encode(key + "_mmkv", value);
|
|
||||||
|
|
||||||
DiskLruCache.Editor edit = null;
|
DiskLruCache.Editor edit = null;
|
||||||
BufferedWriter bw = null;
|
BufferedWriter bw = null;
|
||||||
@@ -119,15 +111,16 @@ public class CacheHelper {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
OutputStream os = edit.newOutputStream(0);
|
OutputStream os = edit.newOutputStream(0);
|
||||||
bw = new BufferedWriter(new OutputStreamWriter(os));
|
bw = new BufferedWriter(new OutputStreamWriter(os, StandardCharsets.UTF_8));
|
||||||
bw.write(value);
|
bw.write(value);
|
||||||
edit.commit();//write CLEAN
|
edit.commit();//write CLEAN
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Log.e(TAG, "put: " + e.getMessage());
|
Log.e(TAG, "put: " + e.getMessage());
|
||||||
try {
|
try {
|
||||||
//s
|
if (edit != null) {
|
||||||
edit.abort();//write REMOVE
|
edit.abort();//write REMOVE
|
||||||
|
}
|
||||||
} catch (IOException e1) {
|
} catch (IOException e1) {
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
Log.e(TAG, "put: " + e1.getMessage());
|
Log.e(TAG, "put: " + e1.getMessage());
|
||||||
@@ -148,30 +141,27 @@ public class CacheHelper {
|
|||||||
Log.e(TAG, "getAsString: " + key);
|
Log.e(TAG, "getAsString: " + key);
|
||||||
InputStream inputStream = null;
|
InputStream inputStream = null;
|
||||||
try {
|
try {
|
||||||
//write READ
|
|
||||||
inputStream = get(key);
|
inputStream = get(key);
|
||||||
if (inputStream == null) {
|
if (inputStream == null) {
|
||||||
return mMMKV.decodeString(key + "_mmkv", null);
|
return null;
|
||||||
}
|
}
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
int len = 0;
|
InputStreamReader isr = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
|
||||||
byte[] buf = new byte[128];
|
char[] buf = new char[1024];
|
||||||
while ((len = inputStream.read(buf)) != -1) {
|
int len;
|
||||||
sb.append(new String(buf, 0, len));
|
while ((len = isr.read(buf)) != -1) {
|
||||||
}
|
sb.append(buf, 0, len);
|
||||||
if (BuildConfig.DEBUG) {
|
|
||||||
Log.e(TAG, "getAsString: " + sb.toString());
|
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Log.e(TAG, "getAsString: " + e.getMessage());
|
Log.e(TAG, "getAsString: " + e.getMessage());
|
||||||
|
} finally {
|
||||||
if (inputStream != null) {
|
if (inputStream != null) {
|
||||||
try {
|
try {
|
||||||
inputStream.close();
|
inputStream.close();
|
||||||
} catch (IOException e1) {
|
} catch (IOException e) {
|
||||||
e1.printStackTrace();
|
e.printStackTrace();
|
||||||
Log.e(TAG, "getAsString: " + e1.getMessage());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -205,9 +195,9 @@ public class CacheHelper {
|
|||||||
|
|
||||||
public JSONArray getAsJSONArray(String key) {
|
public JSONArray getAsJSONArray(String key) {
|
||||||
String JSONString = getAsString(key);
|
String JSONString = getAsString(key);
|
||||||
|
if (JSONString == null) return null;
|
||||||
try {
|
try {
|
||||||
JSONArray obj = new JSONArray(JSONString);
|
return new JSONArray(JSONString);
|
||||||
return obj;
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return null;
|
return null;
|
||||||
@@ -239,7 +229,9 @@ public class CacheHelper {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
try {
|
try {
|
||||||
editor.abort();//write REMOVE
|
if (editor != null) {
|
||||||
|
editor.abort();//write REMOVE
|
||||||
|
}
|
||||||
} catch (IOException e1) {
|
} catch (IOException e1) {
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -262,8 +254,8 @@ public class CacheHelper {
|
|||||||
if (is == null) {
|
if (is == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
|
||||||
try {
|
try {
|
||||||
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
byte[] buf = new byte[256];
|
byte[] buf = new byte[256];
|
||||||
int len = 0;
|
int len = 0;
|
||||||
while ((len = is.read(buf)) != -1) {
|
while ((len = is.read(buf)) != -1) {
|
||||||
@@ -272,6 +264,12 @@ public class CacheHelper {
|
|||||||
res = baos.toByteArray();
|
res = baos.toByteArray();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
is.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -295,7 +293,9 @@ public class CacheHelper {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
try {
|
try {
|
||||||
editor.abort();
|
if (editor != null) {
|
||||||
|
editor.abort();
|
||||||
|
}
|
||||||
} catch (IOException e1) {
|
} catch (IOException e1) {
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -371,8 +371,8 @@ public class CacheHelper {
|
|||||||
// =======================================
|
// =======================================
|
||||||
public boolean remove(String key) {
|
public boolean remove(String key) {
|
||||||
try {
|
try {
|
||||||
key = Utils.hashKeyForDisk(key);
|
String hashKey = Utils.hashKeyForDisk(key);
|
||||||
return mDiskLruCache.remove(key);
|
return mDiskLruCache.remove(hashKey);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -385,7 +385,6 @@ public class CacheHelper {
|
|||||||
|
|
||||||
public void delete() throws IOException {
|
public void delete() throws IOException {
|
||||||
mDiskLruCache.delete();
|
mDiskLruCache.delete();
|
||||||
mMMKV.clearAll();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void flush() throws IOException {
|
public void flush() throws IOException {
|
||||||
@@ -419,12 +418,12 @@ public class CacheHelper {
|
|||||||
//basic editor
|
//basic editor
|
||||||
public DiskLruCache.Editor editor(String key) {
|
public DiskLruCache.Editor editor(String key) {
|
||||||
try {
|
try {
|
||||||
key = Utils.hashKeyForDisk(key);
|
String hashKey = Utils.hashKeyForDisk(key);
|
||||||
//wirte DIRTY
|
//wirte DIRTY
|
||||||
DiskLruCache.Editor edit = mDiskLruCache.edit(key);
|
DiskLruCache.Editor edit = mDiskLruCache.edit(hashKey);
|
||||||
//edit maybe null :the entry is editing
|
//edit maybe null :the entry is editing
|
||||||
if (edit == null) {
|
if (edit == null) {
|
||||||
Log.w(TAG, "the entry spcified key:" + key + " is editing by other . ");
|
Log.w(TAG, "the entry spcified key:" + hashKey + " is editing by other . ");
|
||||||
}
|
}
|
||||||
return edit;
|
return edit;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -461,19 +460,17 @@ public class CacheHelper {
|
|||||||
// =======================================
|
// =======================================
|
||||||
|
|
||||||
private File getDiskCacheDir(Context context, String uniqueName) {
|
private File getDiskCacheDir(Context context, String uniqueName) {
|
||||||
String cachePath;
|
File cacheDir;
|
||||||
if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())
|
if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())
|
||||||
|| !Environment.isExternalStorageRemovable()) {
|
|| !Environment.isExternalStorageRemovable()) {
|
||||||
if (context.getExternalCacheDir() != null) {
|
cacheDir = context.getExternalCacheDir();
|
||||||
cachePath = context.getExternalCacheDir().getPath();
|
if (cacheDir == null) {
|
||||||
} else if (context.getExternalFilesDir("cache") != null) {
|
cacheDir = context.getCacheDir();
|
||||||
cachePath = context.getExternalFilesDir("cache").getPath();
|
|
||||||
} else {
|
|
||||||
cachePath = context.getCacheDir().getPath();
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cachePath = context.getCacheDir().getPath();
|
cacheDir = context.getCacheDir();
|
||||||
}
|
}
|
||||||
return new File(cachePath + File.separator + uniqueName);
|
return new File(cacheDir, uniqueName);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -407,19 +407,19 @@ public class NetInterfaceManager {
|
|||||||
public static <T> Observable<T> withCache(Observable<T> networkObservable, String cacheKey, long expireTimeMillis) {
|
public static <T> Observable<T> withCache(Observable<T> networkObservable, String cacheKey, long expireTimeMillis) {
|
||||||
return Observable.defer(() -> {
|
return Observable.defer(() -> {
|
||||||
// Log.e(TAG, "withCache: cacheKey = " + cacheKey);
|
// Log.e(TAG, "withCache: cacheKey = " + cacheKey);
|
||||||
// 1. 读取缓存
|
// 1. 读取缓存
|
||||||
T cacheData = CACHE_MANAGER.getCache(cacheKey);
|
T cacheData = CACHE_MANAGER.getCache(cacheKey);
|
||||||
if (cacheData != null) {
|
if (cacheData != null) {
|
||||||
Log.e(TAG, "withCache: getCache " + cacheKey);
|
Log.e(TAG, "withCache: getCache " + cacheKey);
|
||||||
return Observable.just(cacheData);
|
return Observable.just(cacheData);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.e(TAG, "withCache: request " + cacheKey);
|
Log.e(TAG, "withCache: request " + cacheKey);
|
||||||
// 2. 无缓存则发起网络请求,成功后缓存
|
// 2. 无缓存则发起网络请求,成功后缓存
|
||||||
return networkObservable
|
return networkObservable
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.doOnNext(data -> CACHE_MANAGER.saveCache(cacheKey, data, expireTimeMillis));
|
.doOnNext(data -> CACHE_MANAGER.saveCache(cacheKey, data, expireTimeMillis));
|
||||||
})
|
})
|
||||||
.subscribeOn(Schedulers.io()) // 缓存IO切到子线程
|
.subscribeOn(Schedulers.io()) // 缓存IO切到子线程
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
@@ -644,13 +644,13 @@ public class NetInterfaceManager {
|
|||||||
public Observable<BaseResponse<Batch>> getSnTagObservable() {
|
public Observable<BaseResponse<Batch>> getSnTagObservable() {
|
||||||
return withCache(schedule(getDevicesStatusApi().getSnTag(Utils.getSerial(mContext))),
|
return withCache(schedule(getDevicesStatusApi().getSnTag(Utils.getSerial(mContext))),
|
||||||
UrlAddress.GET_DEVICES_TAGS,
|
UrlAddress.GET_DEVICES_TAGS,
|
||||||
10 * CACHE_EXPIRE_ONE_MINUTE);
|
CACHE_EXPIRE_ONE_MINUTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<BaseResponse<PushTag>> getPushTagObservable() {
|
public Observable<BaseResponse<PushTag>> getPushTagObservable() {
|
||||||
return withCache(schedule(getDevicesStatusApi().getPushTag(Utils.getSerial(mContext), 1)),
|
return withCache(schedule(getDevicesStatusApi().getPushTag(Utils.getSerial(mContext), 1)),
|
||||||
UrlAddress.GET_PUSH_TAG,
|
UrlAddress.GET_PUSH_TAG,
|
||||||
10 * CACHE_EXPIRE_ONE_MINUTE);
|
CACHE_EXPIRE_ONE_MINUTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<BaseResponse<ScreenLockState>> getScreenLockObservable() {
|
public Observable<BaseResponse<ScreenLockState>> getScreenLockObservable() {
|
||||||
@@ -881,36 +881,36 @@ public class NetInterfaceManager {
|
|||||||
Observable<BaseResponse<AppUpdateInfo>> ailogUpdateObservable = getUpdateObservable(PackageNames.AILOG);
|
Observable<BaseResponse<AppUpdateInfo>> ailogUpdateObservable = getUpdateObservable(PackageNames.AILOG);
|
||||||
|
|
||||||
Observable.zip(infoUpdateObservable, storeUpdateObservable, desktopUpdateObservable,
|
Observable.zip(infoUpdateObservable, storeUpdateObservable, desktopUpdateObservable,
|
||||||
notifyUpdateObservable, browserUpdateObservable, ailogUpdateObservable,
|
notifyUpdateObservable, browserUpdateObservable, ailogUpdateObservable,
|
||||||
new Function6<BaseResponse<AppUpdateInfo>, BaseResponse<AppUpdateInfo>, BaseResponse<AppUpdateInfo>,
|
new Function6<BaseResponse<AppUpdateInfo>, BaseResponse<AppUpdateInfo>, BaseResponse<AppUpdateInfo>,
|
||||||
BaseResponse<AppUpdateInfo>, BaseResponse<AppUpdateInfo>, BaseResponse<AppUpdateInfo>,
|
BaseResponse<AppUpdateInfo>, BaseResponse<AppUpdateInfo>, BaseResponse<AppUpdateInfo>,
|
||||||
List<AppUpdateInfo>>() {
|
List<AppUpdateInfo>>() {
|
||||||
@Override
|
@Override
|
||||||
public List<AppUpdateInfo> apply
|
public List<AppUpdateInfo> apply
|
||||||
(BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse, BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse2, BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse3,
|
(BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse, BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse2, BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse3,
|
||||||
BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse4, BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse5, BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse6) throws Throwable {
|
BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse4, BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse5, BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse6) throws Throwable {
|
||||||
List<AppUpdateInfo> appUpdateInfos = new ArrayList<>();
|
List<AppUpdateInfo> appUpdateInfos = new ArrayList<>();
|
||||||
if (appUpdateInfoBaseResponse.isSuccess()) {
|
if (appUpdateInfoBaseResponse.isSuccess()) {
|
||||||
appUpdateInfos.add(appUpdateInfoBaseResponse.data);
|
appUpdateInfos.add(appUpdateInfoBaseResponse.data);
|
||||||
}
|
}
|
||||||
if (appUpdateInfoBaseResponse2.isSuccess()) {
|
if (appUpdateInfoBaseResponse2.isSuccess()) {
|
||||||
appUpdateInfos.add(appUpdateInfoBaseResponse2.data);
|
appUpdateInfos.add(appUpdateInfoBaseResponse2.data);
|
||||||
}
|
}
|
||||||
if (appUpdateInfoBaseResponse3.isSuccess()) {
|
if (appUpdateInfoBaseResponse3.isSuccess()) {
|
||||||
appUpdateInfos.add(appUpdateInfoBaseResponse3.data);
|
appUpdateInfos.add(appUpdateInfoBaseResponse3.data);
|
||||||
}
|
}
|
||||||
if (appUpdateInfoBaseResponse4.isSuccess()) {
|
if (appUpdateInfoBaseResponse4.isSuccess()) {
|
||||||
appUpdateInfos.add(appUpdateInfoBaseResponse4.data);
|
appUpdateInfos.add(appUpdateInfoBaseResponse4.data);
|
||||||
}
|
}
|
||||||
if (appUpdateInfoBaseResponse5.isSuccess()) {
|
if (appUpdateInfoBaseResponse5.isSuccess()) {
|
||||||
appUpdateInfos.add(appUpdateInfoBaseResponse5.data);
|
appUpdateInfos.add(appUpdateInfoBaseResponse5.data);
|
||||||
}
|
}
|
||||||
if (appUpdateInfoBaseResponse6.isSuccess()) {
|
if (appUpdateInfoBaseResponse6.isSuccess()) {
|
||||||
appUpdateInfos.add(appUpdateInfoBaseResponse6.data);
|
appUpdateInfos.add(appUpdateInfoBaseResponse6.data);
|
||||||
}
|
}
|
||||||
return appUpdateInfos;
|
return appUpdateInfos;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
||||||
@@ -1031,40 +1031,40 @@ public class NetInterfaceManager {
|
|||||||
Observable<BaseResponse<AppUpdateInfo>> learningDesktopObservable = getUpdateObservable(desktop, useCache);
|
Observable<BaseResponse<AppUpdateInfo>> learningDesktopObservable = getUpdateObservable(desktop, useCache);
|
||||||
|
|
||||||
Observable.zip(infoUpdateObservable, storeUpdateObservable, desktopUpdateObservable,
|
Observable.zip(infoUpdateObservable, storeUpdateObservable, desktopUpdateObservable,
|
||||||
notifyUpdateObservable, browserUpdateObservable, learningDesktopObservable, ailogUpdateObservable,
|
notifyUpdateObservable, browserUpdateObservable, learningDesktopObservable, ailogUpdateObservable,
|
||||||
new Function7<BaseResponse<AppUpdateInfo>, BaseResponse<AppUpdateInfo>, BaseResponse<AppUpdateInfo>, BaseResponse<AppUpdateInfo>,
|
new Function7<BaseResponse<AppUpdateInfo>, BaseResponse<AppUpdateInfo>, BaseResponse<AppUpdateInfo>, BaseResponse<AppUpdateInfo>,
|
||||||
BaseResponse<AppUpdateInfo>, BaseResponse<AppUpdateInfo>, BaseResponse<AppUpdateInfo>, List<AppUpdateInfo>>() {
|
BaseResponse<AppUpdateInfo>, BaseResponse<AppUpdateInfo>, BaseResponse<AppUpdateInfo>, List<AppUpdateInfo>>() {
|
||||||
@Override
|
@Override
|
||||||
public List<AppUpdateInfo> apply
|
public List<AppUpdateInfo> apply
|
||||||
(BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse, BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse2, BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse3,
|
(BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse, BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse2, BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse3,
|
||||||
BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse4, BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse5, BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse6,
|
BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse4, BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse5, BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse6,
|
||||||
BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse7
|
BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse7
|
||||||
) throws Throwable {
|
) throws Throwable {
|
||||||
List<AppUpdateInfo> appUpdateInfos = new ArrayList<>();
|
List<AppUpdateInfo> appUpdateInfos = new ArrayList<>();
|
||||||
if (appUpdateInfoBaseResponse.isSuccess()) {
|
if (appUpdateInfoBaseResponse.isSuccess()) {
|
||||||
appUpdateInfos.add(appUpdateInfoBaseResponse.data);
|
appUpdateInfos.add(appUpdateInfoBaseResponse.data);
|
||||||
}
|
}
|
||||||
if (appUpdateInfoBaseResponse2.isSuccess()) {
|
if (appUpdateInfoBaseResponse2.isSuccess()) {
|
||||||
appUpdateInfos.add(appUpdateInfoBaseResponse2.data);
|
appUpdateInfos.add(appUpdateInfoBaseResponse2.data);
|
||||||
}
|
}
|
||||||
if (appUpdateInfoBaseResponse3.isSuccess()) {
|
if (appUpdateInfoBaseResponse3.isSuccess()) {
|
||||||
appUpdateInfos.add(appUpdateInfoBaseResponse3.data);
|
appUpdateInfos.add(appUpdateInfoBaseResponse3.data);
|
||||||
}
|
}
|
||||||
if (appUpdateInfoBaseResponse4.isSuccess()) {
|
if (appUpdateInfoBaseResponse4.isSuccess()) {
|
||||||
appUpdateInfos.add(appUpdateInfoBaseResponse4.data);
|
appUpdateInfos.add(appUpdateInfoBaseResponse4.data);
|
||||||
}
|
}
|
||||||
if (appUpdateInfoBaseResponse5.isSuccess()) {
|
if (appUpdateInfoBaseResponse5.isSuccess()) {
|
||||||
appUpdateInfos.add(appUpdateInfoBaseResponse5.data);
|
appUpdateInfos.add(appUpdateInfoBaseResponse5.data);
|
||||||
}
|
}
|
||||||
if (appUpdateInfoBaseResponse6.isSuccess()) {
|
if (appUpdateInfoBaseResponse6.isSuccess()) {
|
||||||
appUpdateInfos.add(appUpdateInfoBaseResponse6.data);
|
appUpdateInfos.add(appUpdateInfoBaseResponse6.data);
|
||||||
}
|
}
|
||||||
if (appUpdateInfoBaseResponse7.isSuccess()) {
|
if (appUpdateInfoBaseResponse7.isSuccess()) {
|
||||||
appUpdateInfos.add(appUpdateInfoBaseResponse7.data);
|
appUpdateInfos.add(appUpdateInfoBaseResponse7.data);
|
||||||
}
|
}
|
||||||
return appUpdateInfos;
|
return appUpdateInfos;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
||||||
@@ -1186,53 +1186,53 @@ public class NetInterfaceManager {
|
|||||||
|
|
||||||
public void getDefaultDesktop(BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
public void getDefaultDesktop(BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
Observable.zip(getDesktopObservable(), getDesktopsDiyUpdate(), new BiFunction<BaseResponse<ForceDownloadData>, BaseResponse<ForceDownloadData>, List<ForceDownloadData>>() {
|
Observable.zip(getDesktopObservable(), getDesktopsDiyUpdate(), new BiFunction<BaseResponse<ForceDownloadData>, BaseResponse<ForceDownloadData>, List<ForceDownloadData>>() {
|
||||||
@Override
|
@Override
|
||||||
public List<ForceDownloadData> apply(BaseResponse<ForceDownloadData> forceDownloadDataBaseResponse, BaseResponse<ForceDownloadData> forceDownloadDataBaseResponse2) throws Throwable {
|
public List<ForceDownloadData> apply(BaseResponse<ForceDownloadData> forceDownloadDataBaseResponse, BaseResponse<ForceDownloadData> forceDownloadDataBaseResponse2) throws Throwable {
|
||||||
List<ForceDownloadData> forceDownloadDataList = new ArrayList<>();
|
List<ForceDownloadData> forceDownloadDataList = new ArrayList<>();
|
||||||
if (forceDownloadDataBaseResponse.isSuccess()) {
|
if (forceDownloadDataBaseResponse.isSuccess()) {
|
||||||
forceDownloadDataList.add(forceDownloadDataBaseResponse.data);
|
forceDownloadDataList.add(forceDownloadDataBaseResponse.data);
|
||||||
}
|
}
|
||||||
if (forceDownloadDataBaseResponse2.isSuccess()) {
|
if (forceDownloadDataBaseResponse2.isSuccess()) {
|
||||||
forceDownloadDataList.add(forceDownloadDataBaseResponse2.data);
|
forceDownloadDataList.add(forceDownloadDataBaseResponse2.data);
|
||||||
}
|
}
|
||||||
return forceDownloadDataList;
|
return forceDownloadDataList;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
||||||
.subscribe(getDefaultDesktopObserver(callback));
|
.subscribe(getDefaultDesktopObserver(callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getDefaultDesktop(onCompleteCallback callback) {
|
public void getDefaultDesktop(onCompleteCallback callback) {
|
||||||
Observable.zip(getDesktopObservable(), getDesktopsDiyUpdate(), new BiFunction<BaseResponse<ForceDownloadData>, BaseResponse<ForceDownloadData>, List<ForceDownloadData>>() {
|
Observable.zip(getDesktopObservable(), getDesktopsDiyUpdate(), new BiFunction<BaseResponse<ForceDownloadData>, BaseResponse<ForceDownloadData>, List<ForceDownloadData>>() {
|
||||||
@Override
|
@Override
|
||||||
public List<ForceDownloadData> apply(BaseResponse<ForceDownloadData> forceDownloadDataBaseResponse, BaseResponse<ForceDownloadData> forceDownloadDataBaseResponse2) throws Throwable {
|
public List<ForceDownloadData> apply(BaseResponse<ForceDownloadData> forceDownloadDataBaseResponse, BaseResponse<ForceDownloadData> forceDownloadDataBaseResponse2) throws Throwable {
|
||||||
List<ForceDownloadData> forceDownloadDataList = new ArrayList<>();
|
List<ForceDownloadData> forceDownloadDataList = new ArrayList<>();
|
||||||
if (forceDownloadDataBaseResponse.isSuccess()) {
|
if (forceDownloadDataBaseResponse.isSuccess()) {
|
||||||
forceDownloadDataList.add(forceDownloadDataBaseResponse.data);
|
forceDownloadDataList.add(forceDownloadDataBaseResponse.data);
|
||||||
}
|
}
|
||||||
if (forceDownloadDataBaseResponse2.isSuccess()) {
|
if (forceDownloadDataBaseResponse2.isSuccess()) {
|
||||||
forceDownloadDataList.add(forceDownloadDataBaseResponse2.data);
|
forceDownloadDataList.add(forceDownloadDataBaseResponse2.data);
|
||||||
}
|
}
|
||||||
return forceDownloadDataList;
|
return forceDownloadDataList;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.subscribe(getDefaultDesktopObserver(callback));
|
.subscribe(getDefaultDesktopObserver(callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getDefaultDesktop() {
|
public void getDefaultDesktop() {
|
||||||
Observable.zip(getDesktopObservable(), getDesktopsDiyUpdate(), new BiFunction<BaseResponse<ForceDownloadData>, BaseResponse<ForceDownloadData>, List<ForceDownloadData>>() {
|
Observable.zip(getDesktopObservable(), getDesktopsDiyUpdate(), new BiFunction<BaseResponse<ForceDownloadData>, BaseResponse<ForceDownloadData>, List<ForceDownloadData>>() {
|
||||||
@Override
|
@Override
|
||||||
public List<ForceDownloadData> apply(BaseResponse<ForceDownloadData> forceDownloadDataBaseResponse, BaseResponse<ForceDownloadData> forceDownloadDataBaseResponse2) throws Throwable {
|
public List<ForceDownloadData> apply(BaseResponse<ForceDownloadData> forceDownloadDataBaseResponse, BaseResponse<ForceDownloadData> forceDownloadDataBaseResponse2) throws Throwable {
|
||||||
List<ForceDownloadData> forceDownloadDataList = new ArrayList<>();
|
List<ForceDownloadData> forceDownloadDataList = new ArrayList<>();
|
||||||
if (forceDownloadDataBaseResponse.isSuccess()) {
|
if (forceDownloadDataBaseResponse.isSuccess()) {
|
||||||
forceDownloadDataList.add(forceDownloadDataBaseResponse.data);
|
forceDownloadDataList.add(forceDownloadDataBaseResponse.data);
|
||||||
}
|
}
|
||||||
if (forceDownloadDataBaseResponse2.isSuccess()) {
|
if (forceDownloadDataBaseResponse2.isSuccess()) {
|
||||||
forceDownloadDataList.add(forceDownloadDataBaseResponse2.data);
|
forceDownloadDataList.add(forceDownloadDataBaseResponse2.data);
|
||||||
}
|
}
|
||||||
return forceDownloadDataList;
|
return forceDownloadDataList;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.subscribe(getDefaultDesktopObserver(null));
|
.subscribe(getDefaultDesktopObserver(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2555,18 +2555,18 @@ public class NetInterfaceManager {
|
|||||||
|
|
||||||
public void getBookMarkBlackWhiteList(BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
public void getBookMarkBlackWhiteList(BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
Observable.zip(getBrowserBookmarksObservable(), getBrowserListSettingObservable(), new BiFunction<BaseResponse<BrowserBookmarks>, BaseResponse<BrowserData>, String>() {
|
Observable.zip(getBrowserBookmarksObservable(), getBrowserListSettingObservable(), new BiFunction<BaseResponse<BrowserBookmarks>, BaseResponse<BrowserData>, String>() {
|
||||||
@Override
|
@Override
|
||||||
public String apply(BaseResponse<BrowserBookmarks> browserBookmarksBaseResponse, BaseResponse<BrowserData> browserDataBaseResponse) throws Throwable {
|
public String apply(BaseResponse<BrowserBookmarks> browserBookmarksBaseResponse, BaseResponse<BrowserData> browserDataBaseResponse) throws Throwable {
|
||||||
String homePage = "";
|
String homePage = "";
|
||||||
if (browserBookmarksBaseResponse.isSuccess()) {
|
if (browserBookmarksBaseResponse.isSuccess()) {
|
||||||
homePage = browserBookmarksBaseResponse.data.getHomepage();
|
homePage = browserBookmarksBaseResponse.data.getHomepage();
|
||||||
}
|
}
|
||||||
|
|
||||||
setBrowserBookmarks(browserBookmarksBaseResponse);
|
setBrowserBookmarks(browserBookmarksBaseResponse);
|
||||||
setBlackWhiteList(browserDataBaseResponse, homePage);
|
setBlackWhiteList(browserDataBaseResponse, homePage);
|
||||||
return homePage;
|
return homePage;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
||||||
@@ -2599,18 +2599,18 @@ public class NetInterfaceManager {
|
|||||||
|
|
||||||
public void getBookMarkBlackWhiteList() {
|
public void getBookMarkBlackWhiteList() {
|
||||||
Observable.zip(getBrowserBookmarksObservable(), getBrowserListSettingObservable(), new BiFunction<BaseResponse<BrowserBookmarks>, BaseResponse<BrowserData>, String>() {
|
Observable.zip(getBrowserBookmarksObservable(), getBrowserListSettingObservable(), new BiFunction<BaseResponse<BrowserBookmarks>, BaseResponse<BrowserData>, String>() {
|
||||||
@Override
|
@Override
|
||||||
public String apply(BaseResponse<BrowserBookmarks> browserBookmarksBaseResponse, BaseResponse<BrowserData> browserDataBaseResponse) throws Throwable {
|
public String apply(BaseResponse<BrowserBookmarks> browserBookmarksBaseResponse, BaseResponse<BrowserData> browserDataBaseResponse) throws Throwable {
|
||||||
String homePage = "";
|
String homePage = "";
|
||||||
if (browserBookmarksBaseResponse.isSuccess()) {
|
if (browserBookmarksBaseResponse.isSuccess()) {
|
||||||
homePage = browserBookmarksBaseResponse.data.getHomepage();
|
homePage = browserBookmarksBaseResponse.data.getHomepage();
|
||||||
}
|
}
|
||||||
|
|
||||||
setBrowserBookmarks(browserBookmarksBaseResponse);
|
setBrowserBookmarks(browserBookmarksBaseResponse);
|
||||||
setBlackWhiteList(browserDataBaseResponse, homePage);
|
setBlackWhiteList(browserDataBaseResponse, homePage);
|
||||||
return homePage;
|
return homePage;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Observer<String>() {
|
.subscribe(new Observer<String>() {
|
||||||
@@ -3164,31 +3164,31 @@ public class NetInterfaceManager {
|
|||||||
|
|
||||||
public void getAllInfoAndSetting(BehaviorSubject<ActivityEvent> lifecycle) {
|
public void getAllInfoAndSetting(BehaviorSubject<ActivityEvent> lifecycle) {
|
||||||
Observable.zip(getAllAppControl(), getAppAutoStartUpdateAndNetObservable(), new BiFunction<BaseResponse<List<AppListInfo>>, BaseResponse<List<NetAndLaunchData>>, List<AppListInfo>>() {
|
Observable.zip(getAllAppControl(), getAppAutoStartUpdateAndNetObservable(), new BiFunction<BaseResponse<List<AppListInfo>>, BaseResponse<List<NetAndLaunchData>>, List<AppListInfo>>() {
|
||||||
@Override
|
@Override
|
||||||
public List<AppListInfo> apply(BaseResponse<List<AppListInfo>> appListInfoResponse, BaseResponse<List<NetAndLaunchData>> netAndLaunchDataResponse) throws Throwable {
|
public List<AppListInfo> apply(BaseResponse<List<AppListInfo>> appListInfoResponse, BaseResponse<List<NetAndLaunchData>> netAndLaunchDataResponse) throws Throwable {
|
||||||
Log.e("getAllInfoAndSetting", "apply: appListInfoResponse code = " + appListInfoResponse.code);
|
Log.e("getAllInfoAndSetting", "apply: appListInfoResponse code = " + appListInfoResponse.code);
|
||||||
Log.e("getAllInfoAndSetting", "apply: netAndLaunchDataResponse code = " + netAndLaunchDataResponse.code);
|
Log.e("getAllInfoAndSetting", "apply: netAndLaunchDataResponse code = " + netAndLaunchDataResponse.code);
|
||||||
|
|
||||||
if (appListInfoResponse.isSuccess() && netAndLaunchDataResponse.isSuccess()) {
|
if (appListInfoResponse.isSuccess() && netAndLaunchDataResponse.isSuccess()) {
|
||||||
List<AppListInfo> appListInfos = appListInfoResponse.data;
|
List<AppListInfo> appListInfos = appListInfoResponse.data;
|
||||||
Set<String> pkgList = appListInfos.stream().map(AppListInfo::getApp_package).collect(Collectors.toSet());
|
Set<String> pkgList = appListInfos.stream().map(AppListInfo::getApp_package).collect(Collectors.toSet());
|
||||||
mMMKV.encode(CommonConfig.ALL_APP_PKG_SET, pkgList);
|
mMMKV.encode(CommonConfig.ALL_APP_PKG_SET, pkgList);
|
||||||
|
|
||||||
List<NetAndLaunchData> netAndLaunchDataList = netAndLaunchDataResponse.data;
|
List<NetAndLaunchData> netAndLaunchDataList = netAndLaunchDataResponse.data;
|
||||||
JgyUtils.getInstance().setNetAndlaunch(netAndLaunchDataList, appListInfos);
|
JgyUtils.getInstance().setNetAndlaunch(netAndLaunchDataList, appListInfos);
|
||||||
return appListInfos;
|
return appListInfos;
|
||||||
} else if (appListInfoResponse.isSuccess()) {
|
} else if (appListInfoResponse.isSuccess()) {
|
||||||
List<AppListInfo> appListInfos = appListInfoResponse.data;
|
List<AppListInfo> appListInfos = appListInfoResponse.data;
|
||||||
Set<String> pkgList = appListInfos.stream().map(AppListInfo::getApp_package).collect(Collectors.toSet());
|
Set<String> pkgList = appListInfos.stream().map(AppListInfo::getApp_package).collect(Collectors.toSet());
|
||||||
mMMKV.encode(CommonConfig.ALL_APP_PKG_SET, pkgList);
|
mMMKV.encode(CommonConfig.ALL_APP_PKG_SET, pkgList);
|
||||||
return appListInfos;
|
return appListInfos;
|
||||||
} else if (netAndLaunchDataResponse.isSuccess()) {
|
} else if (netAndLaunchDataResponse.isSuccess()) {
|
||||||
List<NetAndLaunchData> netAndLaunchDataList = netAndLaunchDataResponse.data;
|
List<NetAndLaunchData> netAndLaunchDataList = netAndLaunchDataResponse.data;
|
||||||
JgyUtils.getInstance().setNetAndlaunch(netAndLaunchDataList);
|
JgyUtils.getInstance().setNetAndlaunch(netAndLaunchDataList);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
||||||
@@ -3218,31 +3218,31 @@ public class NetInterfaceManager {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
public void getAllInfoAndSetting() {
|
public void getAllInfoAndSetting() {
|
||||||
Observable.zip(getAllAppControl(), getAppAutoStartUpdateAndNetObservable(), new BiFunction<BaseResponse<List<AppListInfo>>, BaseResponse<List<NetAndLaunchData>>, List<AppListInfo>>() {
|
Observable.zip(getAllAppControl(), getAppAutoStartUpdateAndNetObservable(), new BiFunction<BaseResponse<List<AppListInfo>>, BaseResponse<List<NetAndLaunchData>>, List<AppListInfo>>() {
|
||||||
@Override
|
@Override
|
||||||
public List<AppListInfo> apply(BaseResponse<List<AppListInfo>> appListInfoResponse, BaseResponse<List<NetAndLaunchData>> netAndLaunchDataResponse) throws Throwable {
|
public List<AppListInfo> apply(BaseResponse<List<AppListInfo>> appListInfoResponse, BaseResponse<List<NetAndLaunchData>> netAndLaunchDataResponse) throws Throwable {
|
||||||
Log.e("getAllInfoAndSetting", "apply: appListInfoResponse code = " + appListInfoResponse.code);
|
Log.e("getAllInfoAndSetting", "apply: appListInfoResponse code = " + appListInfoResponse.code);
|
||||||
Log.e("getAllInfoAndSetting", "apply: netAndLaunchDataResponse code = " + netAndLaunchDataResponse.code);
|
Log.e("getAllInfoAndSetting", "apply: netAndLaunchDataResponse code = " + netAndLaunchDataResponse.code);
|
||||||
|
|
||||||
if (appListInfoResponse.isSuccess() && netAndLaunchDataResponse.isSuccess()) {
|
if (appListInfoResponse.isSuccess() && netAndLaunchDataResponse.isSuccess()) {
|
||||||
List<AppListInfo> appListInfos = appListInfoResponse.data;
|
List<AppListInfo> appListInfos = appListInfoResponse.data;
|
||||||
Set<String> pkgList = appListInfos.stream().map(AppListInfo::getApp_package).collect(Collectors.toSet());
|
Set<String> pkgList = appListInfos.stream().map(AppListInfo::getApp_package).collect(Collectors.toSet());
|
||||||
mMMKV.encode(CommonConfig.ALL_APP_PKG_SET, pkgList);
|
mMMKV.encode(CommonConfig.ALL_APP_PKG_SET, pkgList);
|
||||||
|
|
||||||
List<NetAndLaunchData> netAndLaunchDataList = netAndLaunchDataResponse.data;
|
List<NetAndLaunchData> netAndLaunchDataList = netAndLaunchDataResponse.data;
|
||||||
JgyUtils.getInstance().setNetAndlaunch(netAndLaunchDataList, appListInfos);
|
JgyUtils.getInstance().setNetAndlaunch(netAndLaunchDataList, appListInfos);
|
||||||
return appListInfos;
|
return appListInfos;
|
||||||
} else if (appListInfoResponse.isSuccess()) {
|
} else if (appListInfoResponse.isSuccess()) {
|
||||||
List<AppListInfo> appListInfos = appListInfoResponse.data;
|
List<AppListInfo> appListInfos = appListInfoResponse.data;
|
||||||
Set<String> pkgList = appListInfos.stream().map(AppListInfo::getApp_package).collect(Collectors.toSet());
|
Set<String> pkgList = appListInfos.stream().map(AppListInfo::getApp_package).collect(Collectors.toSet());
|
||||||
mMMKV.encode(CommonConfig.ALL_APP_PKG_SET, pkgList);
|
mMMKV.encode(CommonConfig.ALL_APP_PKG_SET, pkgList);
|
||||||
return appListInfos;
|
return appListInfos;
|
||||||
} else if (netAndLaunchDataResponse.isSuccess()) {
|
} else if (netAndLaunchDataResponse.isSuccess()) {
|
||||||
List<NetAndLaunchData> netAndLaunchDataList = netAndLaunchDataResponse.data;
|
List<NetAndLaunchData> netAndLaunchDataList = netAndLaunchDataResponse.data;
|
||||||
JgyUtils.getInstance().setNetAndlaunch(netAndLaunchDataList);
|
JgyUtils.getInstance().setNetAndlaunch(netAndLaunchDataList);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Observer<List<AppListInfo>>() {
|
.subscribe(new Observer<List<AppListInfo>>() {
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.aoleyun.sn.utils;
|
package com.aoleyun.sn.utils;
|
||||||
|
|
||||||
|
import static android.app.ActivityManager.RECENT_IGNORE_UNAVAILABLE;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
import android.app.ActivityManagerNative;
|
import android.app.ActivityManagerNative;
|
||||||
@@ -125,8 +127,6 @@ import io.reactivex.rxjava3.core.ObservableOnSubscribe;
|
|||||||
import io.reactivex.rxjava3.core.Observer;
|
import io.reactivex.rxjava3.core.Observer;
|
||||||
import io.reactivex.rxjava3.disposables.Disposable;
|
import io.reactivex.rxjava3.disposables.Disposable;
|
||||||
|
|
||||||
import static android.app.ActivityManager.RECENT_IGNORE_UNAVAILABLE;
|
|
||||||
|
|
||||||
|
|
||||||
public class JgyUtils {
|
public class JgyUtils {
|
||||||
private static final String TAG = "JgyUtils";
|
private static final String TAG = "JgyUtils";
|
||||||
@@ -1804,8 +1804,10 @@ public class JgyUtils {
|
|||||||
if (ApkUtils.canremove_systemapp.contains(packageName)) {
|
if (ApkUtils.canremove_systemapp.contains(packageName)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ApkUtils.aihuaApp.contains(packageName)) {
|
if ("K101".equals(Build.MODEL) || "AS001".equals(Build.MODEL)) {
|
||||||
continue;
|
if (ApkUtils.aihuaApp.contains(packageName)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (ApkUtils.mJxwApp.contains(packageName)) {
|
if (ApkUtils.mJxwApp.contains(packageName)) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 9.2 KiB |
@@ -41,7 +41,7 @@
|
|||||||
android:id="@+id/textView5"
|
android:id="@+id/textView5"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="应用更新检测"
|
android:text="管控策略检测"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_14"
|
android:textSize="@dimen/sp_14"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '2.3.21'
|
ext.kotlin_version = '2.4.0'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
|
|||||||
Reference in New Issue
Block a user