version:6.4.4
fix:修复从应用分类下载的app会被卸载 update:
This commit is contained in:
@@ -29,8 +29,8 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.aoleyun.sn"
|
applicationId "com.aoleyun.sn"
|
||||||
versionCode 83
|
versionCode 84
|
||||||
versionName "6.4.3"
|
versionName "6.4.4"
|
||||||
|
|
||||||
//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
|
||||||
|
|||||||
@@ -1,28 +1,40 @@
|
|||||||
package com.aoleyun.sn.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class AppDateInfo implements Serializable {
|
public class AppDateInfo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 8711338410072780246L;
|
||||||
|
|
||||||
private static final long serialVersionUID = -8954939883956606971L;
|
String id;
|
||||||
|
String app_id;
|
||||||
|
String app_name;
|
||||||
|
String app_package;
|
||||||
|
String app_version_name;
|
||||||
|
long app_version_code;
|
||||||
|
String app_desc;
|
||||||
|
String app_downloads;
|
||||||
|
String app_size;
|
||||||
|
String app_img;
|
||||||
|
String app_url;
|
||||||
|
String app_createtime;
|
||||||
|
String app_score;
|
||||||
|
String xitong_id;
|
||||||
|
String zixitong_id;
|
||||||
|
String app_tag;
|
||||||
|
String app_md5;
|
||||||
|
|
||||||
public String id;
|
public String getApp_id() {
|
||||||
public String app_name;
|
return app_id;
|
||||||
public String app_package;
|
}
|
||||||
public String app_version_name;
|
|
||||||
public String app_desc;
|
public void setApp_id(String app_id) {
|
||||||
public String app_downloads;
|
this.app_id = app_id;
|
||||||
public String app_size;
|
}
|
||||||
public String app_img;
|
|
||||||
public String app_url;
|
|
||||||
public String app_createtime;
|
|
||||||
public String app_score;
|
|
||||||
public String xitong_id;
|
|
||||||
public String zixitong_id;
|
|
||||||
public String app_tag;
|
|
||||||
|
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return app_tag;
|
return app_tag;
|
||||||
@@ -144,6 +156,23 @@ public class AppDateInfo implements Serializable {
|
|||||||
this.app_createtime = app_time;
|
this.app_createtime = app_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getApp_md5() {
|
||||||
|
return app_md5;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApp_md5(String app_md5) {
|
||||||
|
this.app_md5 = app_md5;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getApp_version_code() {
|
||||||
|
return app_version_code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApp_version_code(long app_version_code) {
|
||||||
|
this.app_version_code = app_version_code;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory;
|
|||||||
import com.aoleyun.sn.BuildConfig;
|
import com.aoleyun.sn.BuildConfig;
|
||||||
import com.aoleyun.sn.base.BaseApplication;
|
import com.aoleyun.sn.base.BaseApplication;
|
||||||
import com.aoleyun.sn.bean.AppAttr;
|
import com.aoleyun.sn.bean.AppAttr;
|
||||||
|
import com.aoleyun.sn.bean.AppDateInfo;
|
||||||
import com.aoleyun.sn.bean.AppID;
|
import com.aoleyun.sn.bean.AppID;
|
||||||
import com.aoleyun.sn.bean.AppLimit;
|
import com.aoleyun.sn.bean.AppLimit;
|
||||||
import com.aoleyun.sn.bean.AppListInfo;
|
import com.aoleyun.sn.bean.AppListInfo;
|
||||||
@@ -57,6 +58,7 @@ import com.aoleyun.sn.network.api.GetWhoisApi;
|
|||||||
import com.aoleyun.sn.network.api.get.CheckTestUpdateApi;
|
import com.aoleyun.sn.network.api.get.CheckTestUpdateApi;
|
||||||
import com.aoleyun.sn.network.api.get.DefaultAppApi;
|
import com.aoleyun.sn.network.api.get.DefaultAppApi;
|
||||||
import com.aoleyun.sn.network.api.get.DesktopsDiyUpdateApi;
|
import com.aoleyun.sn.network.api.get.DesktopsDiyUpdateApi;
|
||||||
|
import com.aoleyun.sn.network.api.get.GetAdminAppApi;
|
||||||
import com.aoleyun.sn.network.api.get.GetDesktopApi;
|
import com.aoleyun.sn.network.api.get.GetDesktopApi;
|
||||||
import com.aoleyun.sn.network.api.get.GetDeveloperApi;
|
import com.aoleyun.sn.network.api.get.GetDeveloperApi;
|
||||||
import com.aoleyun.sn.network.api.get.GetPushTagsApi;
|
import com.aoleyun.sn.network.api.get.GetPushTagsApi;
|
||||||
@@ -142,6 +144,7 @@ import java.util.Map;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||||
@@ -608,6 +611,13 @@ public class NetInterfaceManager {
|
|||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Observable<BaseResponse<List<AppDateInfo>>> getAdminAppObservable() {
|
||||||
|
return mRetrofit.create(GetAdminAppApi.class)
|
||||||
|
.getAdminApp(Utils.getSerial(mContext))
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* API
|
* API
|
||||||
@@ -2894,19 +2904,97 @@ public class NetInterfaceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void getAppLimit(BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
public void getAppLimit(BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
getAppLimitObservable()
|
Observable.zip(getAppLimitObservable(), getAdminAppObservable(), getBiFunction())
|
||||||
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
||||||
.subscribe(getAppLimitObserver(callback));
|
.subscribe(getAppLimitListObserver(callback));
|
||||||
|
// getAppLimitObservable()
|
||||||
|
// .compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
||||||
|
// .subscribe(getAppLimitObserver(callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getAppLimit(onCompleteCallback callback) {
|
public void getAppLimit(onCompleteCallback callback) {
|
||||||
getAppLimitObservable()
|
Observable.zip(getAppLimitObservable(), getAdminAppObservable(), getBiFunction())
|
||||||
.subscribe(getAppLimitObserver(callback));
|
.subscribe(getAppLimitListObserver(callback));
|
||||||
|
// getAppLimitObservable()
|
||||||
|
// .subscribe(getAppLimitObserver(callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getAppLimit() {
|
public void getAppLimit() {
|
||||||
getAppLimitObservable()
|
Observable.zip(getAppLimitObservable(), getAdminAppObservable(), getBiFunction())
|
||||||
.subscribe(getAppLimitObserver(null));
|
.subscribe(getAppLimitListObserver(null));
|
||||||
|
// getAppLimitObservable()
|
||||||
|
// .subscribe(getAppLimitObserver(null));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getAppLimitList() {
|
||||||
|
Observable.zip(getAppLimitObservable(), getAdminAppObservable(), getBiFunction())
|
||||||
|
.subscribe(getAppLimitListObserver(null));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private BiFunction<BaseResponse<AppLimit>, BaseResponse<List<AppDateInfo>>, List<String>> getBiFunction() {
|
||||||
|
return new BiFunction<BaseResponse<AppLimit>, BaseResponse<List<AppDateInfo>>, List<String>>() {
|
||||||
|
@Override
|
||||||
|
public List<String> apply(BaseResponse<AppLimit> appLimitBaseResponse, BaseResponse<List<AppDateInfo>> listBaseResponse) throws Throwable {
|
||||||
|
List<String> appNames = new ArrayList<>();
|
||||||
|
if (appLimitBaseResponse.code == 200) {
|
||||||
|
AppLimit appLimit = appLimitBaseResponse.data;
|
||||||
|
String result = appLimit.getResult();
|
||||||
|
List<String> pkgs = new ArrayList<>(Arrays.asList(result.split(",")));
|
||||||
|
appNames.addAll(pkgs);
|
||||||
|
}
|
||||||
|
if (listBaseResponse.code == 200) {
|
||||||
|
List<AppDateInfo> appDateInfos = listBaseResponse.data;
|
||||||
|
Set<String> pkgs = appDateInfos.stream().map(new Function<AppDateInfo, String>() {
|
||||||
|
@Override
|
||||||
|
public String apply(AppDateInfo appDateInfo) {
|
||||||
|
return appDateInfo.getApp_baoming();
|
||||||
|
}
|
||||||
|
}).collect(Collectors.toSet());
|
||||||
|
appNames.addAll(pkgs);
|
||||||
|
}
|
||||||
|
return appNames;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private Observer<List<String>> getAppLimitListObserver(onCompleteCallback callback) {
|
||||||
|
return new Observer<List<String>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
Log.e("getAppLimitList", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull List<String> strings) {
|
||||||
|
Log.e("getAppLimitList", "onNext: " + strings);
|
||||||
|
if (strings.size() == 0) {
|
||||||
|
Settings.System.putString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST, "");
|
||||||
|
JGYUtils.getInstance().writeAppPackageList();
|
||||||
|
cacheHelper.put(UrlAddress.SET_WHITE_PACKAGE_LIST, "");
|
||||||
|
} else {
|
||||||
|
String pkgString = String.join(",", strings);
|
||||||
|
cacheHelper.put(UrlAddress.SET_WHITE_PACKAGE_LIST, GsonUtils.toJSONString(strings));
|
||||||
|
//开机图标 只记录后台传的包名
|
||||||
|
Log.e(TAG, "onNext: only_jgy_shortcut_list: " + Settings.System.putString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST, pkgString));
|
||||||
|
JGYUtils.getInstance().writeAppPackageList(mContext, pkgString);
|
||||||
|
JGYUtils.getInstance().deleteOtherApp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
Log.e("getAppLimitList", "onError: " + e.getMessage());
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e("getAppLimitList", "onComplete: ");
|
||||||
|
if (callback != null)
|
||||||
|
callback.onComplete();
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private Observer<BaseResponse<AppLimit>> getAppLimitObserver(onCompleteCallback callback) {
|
private Observer<BaseResponse<AppLimit>> getAppLimitObserver(onCompleteCallback callback) {
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ public class UrlAddress {
|
|||||||
public static final String GET_APPID = "application/index";
|
public static final String GET_APPID = "application/index";
|
||||||
/*app内部网页管控*/
|
/*app内部网页管控*/
|
||||||
public static final String SET_APPINSIDEWEB = "Appground";
|
public static final String SET_APPINSIDEWEB = "Appground";
|
||||||
|
/*应用管控的应用*/
|
||||||
|
public static final String GET_ADMIN_APP = "And/app/getAdminApp";
|
||||||
|
|
||||||
/*app下载完成发送下载次数*/
|
/*app下载完成发送下载次数*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.aoleyun.sn.network.api.get;
|
||||||
|
|
||||||
|
import com.aoleyun.sn.bean.AppDateInfo;
|
||||||
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
|
import com.aoleyun.sn.network.UrlAddress;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.reactivex.rxjava3.core.Observable;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface GetAdminAppApi {
|
||||||
|
@GET(UrlAddress.GET_ADMIN_APP)
|
||||||
|
Observable<BaseResponse<List<AppDateInfo>>> getAdminApp(
|
||||||
|
@Query("sn") String sn
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user