3 Commits

13 changed files with 122 additions and 81 deletions

View File

@@ -29,8 +29,8 @@ android {
defaultConfig {
applicationId "com.aoleyun.sn"
versionCode 210
versionName "1.6.0403"
versionCode 214
versionName "1.6.0427"
//There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature.
minSdkVersion 24

View File

@@ -25,7 +25,6 @@ import com.aoleyun.sn.BuildConfig;
import com.aoleyun.sn.R;
import com.aoleyun.sn.activity.main.MainActivity;
import com.aoleyun.sn.comm.CommonConfig;
import com.aoleyun.sn.comm.JGYActions;
import com.aoleyun.sn.comm.PackageNames;
import com.aoleyun.sn.network.NetInterfaceManager;
import com.aoleyun.sn.service.LogcatService;
@@ -101,7 +100,7 @@ public class SplashActivity extends AppCompatActivity {
Utils.getAndroiodScreenProperty(SplashActivity.this);
Log.e(TAG, "getOperators: " + NetworkUtils.getOperators(this));
Log.e(TAG, "PublicIP: " + mMMKV.decodeString(NetInterfaceManager.PublicIP, ""));
NetInterfaceManager.GetWhois();
NetInterfaceManager.getWhois();
Log.e(TAG, "initView: " + NetworkUtils.getPhoneNumber(this));
FlowInfo flowInfo1 = GetFlowUtil.getAppFlowInfo(BuildConfig.APPLICATION_ID, this);
Log.e(TAG, "initView: " + GetFlowUtil.byteToMB(flowInfo1.getUpKb()));

View File

@@ -115,6 +115,8 @@ public class CommonConfig {
public final static String AOLE_APP_ALLOW_INSTALL = "aole_app_allow_install";
/*应用安装白名单*/
public final static String AOLE_ACTION_APP_FORBID = "aole_app_forbid";
/*公共应用白名单*/
public final static String AOLE_PUBLIC_APP_INSTALL_WHITELIST = "aole_public_app_install_whitelist_set";
/*强制安装应用,禁止卸载*/
public final static String AOLE_ACTION_FORCE_APP = "aole_force_app";
/*指定应用安装源 非指定包名不能安装apk*/

View File

@@ -117,6 +117,7 @@ import com.aoleyun.sn.network.api.post.MACAddressApi;
import com.aoleyun.sn.network.api.post.NetAndLaunchApi;
import com.aoleyun.sn.network.api.post.NetworkConnectApi;
import com.aoleyun.sn.network.api.post.NewAppinsideWebApi;
import com.aoleyun.sn.network.api.post.RankCommonAppApi;
import com.aoleyun.sn.network.api.post.SendDownloadInfoApi;
import com.aoleyun.sn.network.api.post.SendDownloadTimesApi;
import com.aoleyun.sn.network.api.post.SendRestoreTimesApi;
@@ -182,6 +183,7 @@ import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.Observer;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.functions.BiFunction;
import io.reactivex.rxjava3.functions.Function3;
import io.reactivex.rxjava3.functions.Function6;
import io.reactivex.rxjava3.functions.Function7;
import io.reactivex.rxjava3.schedulers.Schedulers;
@@ -718,7 +720,7 @@ public class NetInterfaceManager {
public Observable<BaseResponse<SnRunLog>> getSnRunLogControl() {
return mRetrofit.create(GetSnRunLogApi.class)
.GetSnRunLog(Utils.getSerial(mContext))
.getSnRunLog(Utils.getSerial(mContext))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
}
@@ -730,14 +732,14 @@ public class NetInterfaceManager {
.observeOn(AndroidSchedulers.mainThread());
}
public Observable<BaseResponse<List<AppListInfo>>> GetAllAppApiControl() {
public Observable<BaseResponse<List<AppListInfo>>> getAllAppApiControl() {
return mRetrofit.create(GetAllAppApi.class)
.getAllAppList(NetInterfaceManager.HTTP_KEY, Utils.getSerial(mContext))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
}
public Observable<BaseResponse> GetNetworkConnectControl(String time) {
public Observable<BaseResponse> getNetworkConnectControl(String time) {
return mRetrofit.create(NetworkConnectApi.class)
.sendNetwork(Utils.getSerial(mContext), time)
.subscribeOn(Schedulers.io())
@@ -801,6 +803,13 @@ public class NetInterfaceManager {
.observeOn(AndroidSchedulers.mainThread());
}
public Observable<BaseResponse<List<AppDateInfo>>> getRankCommonAppObservable() {
return mRetrofit.create(RankCommonAppApi.class)
.getRankApp(HTTP_KEY, Utils.getSerial(mContext), "1")
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
}
/*
*
* API
@@ -1362,26 +1371,20 @@ public class NetInterfaceManager {
public void onNext(@NonNull BaseResponse<List<ForceDownloadData>> forceDownloadBean) {
Log.e("getForceDownload", "onNext: " + forceDownloadBean);
if (forceDownloadBean.code == OK) {
Log.e("getForceDownload", "onNext: getAsString: " + cacheHelper.getAsString(UrlAddress.GET_FORCE_INSTALL_LIST));
List<ForceDownloadData> forceDownloadData = forceDownloadBean.data;
cacheHelper.put(UrlAddress.GET_FORCE_INSTALL_LIST, GsonUtils.toJSONString(forceDownloadData));
Aria.download(this).resumeAllTask();
JgyUtils.getInstance().forceDownload(forceDownloadData);
List<String> forceApp = forceDownloadData.stream().map(ForceDownloadData::getApp_package).collect(Collectors.toList());
boolean aole_force_app = Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, String.join(",", forceApp));
Log.e("getForceDownload", "aole_force_app:" + aole_force_app);
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, String.join(",", forceApp));
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setForbidUnInstallPackageList(forceApp);
}
} else if (forceDownloadBean.code == -200) {
cacheHelper.put(UrlAddress.GET_FORCE_INSTALL_LIST, "");
boolean aole_force_app = Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "invalid");
Log.e("getForceDownload", "aole_force_app:" + aole_force_app);
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "invalid");
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setForbidUnInstallPackageList(new ArrayList<>());
}
} else {
cacheHelper.put(UrlAddress.GET_FORCE_INSTALL_LIST, "");
Log.e("getForceDownload", forceDownloadBean.msg);
}
}
@@ -1413,8 +1416,6 @@ public class NetInterfaceManager {
public void onNext(@NonNull List<ForceDownloadData> forceDownloadBean) {
Log.e("getForceDownload", "onNext: " + forceDownloadBean);
if (forceDownloadBean != null && !forceDownloadBean.isEmpty()) {
Log.e("getForceDownload", "onNext: getAsString: " + cacheHelper.getAsString(UrlAddress.GET_FORCE_INSTALL_LIST));
cacheHelper.put(UrlAddress.GET_FORCE_INSTALL_LIST, GsonUtils.toJSONString(forceDownloadBean));
Aria.download(this).resumeAllTask();
JgyUtils.getInstance().forceDownload(forceDownloadBean);
List<String> forceApp = forceDownloadBean.stream().map(ForceDownloadData::getApp_package).collect(Collectors.toList());
@@ -1424,7 +1425,6 @@ public class NetInterfaceManager {
AllwinnerCubeMdmManager.getInstance().setForbidUnInstallPackageList(forceApp);
}
} else {
cacheHelper.put(UrlAddress.GET_FORCE_INSTALL_LIST, "");
boolean aole_force_app = Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "invalid");
Log.e("getForceDownload", "aole_force_app:" + aole_force_app);
if (JgyUtils.isAllWinnerDevice()) {
@@ -1772,6 +1772,7 @@ public class NetInterfaceManager {
});
}
@Deprecated
public void getDesktopIcon(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
ConnectMode connectMode = ConnectMode.SIX_HOUR;
if (refresh) {
@@ -2036,7 +2037,7 @@ public class NetInterfaceManager {
} catch (Exception e) {
e.printStackTrace();
}
} else if ("G10".equals(Build.MODEL) || "D1".equals(Build.MODEL)) {
} else if ("G10".equals(Build.MODEL) || "D1".equals(Build.MODEL) || "Aiud_A8_ag_1095".equals(Build.MODEL)) {
Settings.System.putString(mContext.getContentResolver(), CommonConfig.APP_VIEW_CLICK_DISABLED, "com.ttstd.utils:12345");
} else {
Settings.System.putString(mContext.getContentResolver(), CommonConfig.APP_VIEW_CLICK_DISABLED, "com.arivoc.wordhd:2131624676,2131624689;com.ttstd.utils:12345");
@@ -2717,15 +2718,15 @@ public class NetInterfaceManager {
public void setPushTags(BehaviorSubject<ActivityEvent> lifecycle, PushTagCallback callback) {
getPushTagsObservable()
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
.subscribe(getgetPushTagsObserver(callback));
.subscribe(getPushTagsObserver(callback));
}
public void setPushTags() {
getPushTagsObservable()
.subscribe(getgetPushTagsObserver(null));
.subscribe(getPushTagsObserver(null));
}
private Observer<BaseResponse<Batch>> getgetPushTagsObserver(PushTagCallback callback) {
private Observer<BaseResponse<Batch>> getPushTagsObserver(PushTagCallback callback) {
return new Observer<BaseResponse<Batch>>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
@@ -3454,7 +3455,7 @@ public class NetInterfaceManager {
}
public void getAppLimit(BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
Observable.zip(getAppLimitObservable(), getAdminAppObservable(), getBiFunction())
Observable.zip(getAppLimitObservable(), getAdminAppObservable(), getRankCommonAppObservable(), getBiFunction())
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
.subscribe(getAppLimitListObserver(callback));
// getAppLimitObservable()
@@ -3463,29 +3464,29 @@ public class NetInterfaceManager {
}
public void getAppLimit(onCompleteCallback callback) {
Observable.zip(getAppLimitObservable(), getAdminAppObservable(), getBiFunction())
Observable.zip(getAppLimitObservable(), getAdminAppObservable(), getRankCommonAppObservable(), getBiFunction())
.subscribe(getAppLimitListObserver(callback));
// getAppLimitObservable()
// .subscribe(getAppLimitObserver(callback));
}
public void getAppLimit() {
Observable.zip(getAppLimitObservable(), getAdminAppObservable(), getBiFunction())
Observable.zip(getAppLimitObservable(), getAdminAppObservable(), getRankCommonAppObservable(), getBiFunction())
.subscribe(getAppLimitListObserver(null));
// getAppLimitObservable()
// .subscribe(getAppLimitObserver(null));
}
private void getAppLimitList() {
Observable.zip(getAppLimitObservable(), getAdminAppObservable(), getBiFunction())
Observable.zip(getAppLimitObservable(), getAdminAppObservable(), getRankCommonAppObservable(), getBiFunction())
.subscribe(getAppLimitListObserver(null));
}
private BiFunction<BaseResponse<AppLimit>, BaseResponse<List<AppDateInfo>>, List<String>> getBiFunction() {
return new BiFunction<BaseResponse<AppLimit>, BaseResponse<List<AppDateInfo>>, List<String>>() {
private Function3<BaseResponse<AppLimit>, BaseResponse<List<AppDateInfo>>, BaseResponse<List<AppDateInfo>>, List<String>> getBiFunction() {
return new Function3<BaseResponse<AppLimit>, BaseResponse<List<AppDateInfo>>, BaseResponse<List<AppDateInfo>>, List<String>>() {
@Override
public List<String> apply(BaseResponse<AppLimit> appLimitBaseResponse, BaseResponse<List<AppDateInfo>> listBaseResponse) throws Throwable {
public List<String> apply(BaseResponse<AppLimit> appLimitBaseResponse, BaseResponse<List<AppDateInfo>> listBaseResponse, BaseResponse<List<AppDateInfo>> appDateInfoResponse) throws Throwable {
List<String> appNames = new ArrayList<>();
if (appLimitBaseResponse.code == 200) {
AppLimit appLimit = appLimitBaseResponse.data;
@@ -3503,6 +3504,19 @@ public class NetInterfaceManager {
}).collect(Collectors.toSet());
appNames.addAll(pkgs);
}
if (appDateInfoResponse.code == 200) {
List<AppDateInfo> appDateInfos = appDateInfoResponse.data;
Set<String> pkgs = appDateInfos.stream().map(new Function<AppDateInfo, String>() {
@Override
public String apply(AppDateInfo appDateInfo) {
return appDateInfo.getApp_baoming();
}
}).collect(Collectors.toSet());
mMMKV.encode(CommonConfig.AOLE_PUBLIC_APP_INSTALL_WHITELIST, pkgs);
appNames.addAll(pkgs);
} else {
mMMKV.remove(CommonConfig.AOLE_PUBLIC_APP_INSTALL_WHITELIST);
}
return appNames;
}
};
@@ -3570,18 +3584,18 @@ public class NetInterfaceManager {
}
public void getAllAppList(BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
GetAllAppApiControl()
getAllAppApiControl()
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
.subscribe(getAllAppListObserver(callback));
}
public void getAllAppList(onCompleteCallback callback) {
GetAllAppApiControl()
getAllAppApiControl()
.subscribe(getAllAppListObserver(callback));
}
public void getAllAppList() {
GetAllAppApiControl()
getAllAppApiControl()
.subscribe(getAllAppListObserver(null));
}
@@ -3597,12 +3611,11 @@ public class NetInterfaceManager {
Log.e("getAllAppList", "onNext: " + listBaseResponse);
if (listBaseResponse.code == 200) {
List<AppListInfo> appListInfos = listBaseResponse.data;
cacheHelper.put(UrlAddress.GET_ALL_APP, GsonUtils.toJSONString(appListInfos));
getAppAutoStartUpdateAndNet(appListInfos);
Set<String> pkgList = appListInfos.stream().map(AppListInfo::getApp_package).collect(Collectors.toSet());
mMMKV.encode(CommonConfig.ALL_APP_PKG_SET, pkgList);
} else {
cacheHelper.put(UrlAddress.GET_ALL_APP, "");
mMMKV.remove(CommonConfig.ALL_APP_PKG_SET);
}
}
@@ -4111,7 +4124,7 @@ public class NetInterfaceManager {
public static final String WHOIS_ADDR = "whois_ip_addr";
public static void GetWhois() {
public static void getWhois() {
Retrofit retrofit = new Retrofit.Builder()
.client(NetInterfaceManager.getInstance().getOkHttpClient())
.baseUrl(UrlAddress.PCONLINE_WHOIS)
@@ -4125,12 +4138,12 @@ public class NetInterfaceManager {
.subscribe(new Observer<WhoisBean>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
Log.e("GetWhois", "onSubscribe: ");
Log.e("getWhois", "onSubscribe: ");
}
@Override
public void onNext(@NonNull WhoisBean whoisBean) {
Log.e("GetWhois", "onNext: " + whoisBean);
Log.e("getWhois", "onNext: " + whoisBean);
if (whoisBean != null && !TextUtils.isEmpty(whoisBean.getAddr())) {
MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE).encode(WHOIS_ADDR, whoisBean.getAddr());
}
@@ -4138,12 +4151,12 @@ public class NetInterfaceManager {
@Override
public void onError(@NonNull Throwable e) {
Log.e("GetWhois", "onError: ");
Log.e("getWhois", "onError: ");
}
@Override
public void onComplete() {
Log.e("GetWhois", "onComplete: ");
Log.e("getWhois", "onComplete: ");
}
});
}

View File

@@ -39,6 +39,8 @@ public class UrlAddress {
public static final String SET_WHITE_PACKAGE_LIST = "firmware/index";
/*获取全部应用*/
public static final String GET_ALL_APP = "recommend/index";
/*公共应用*/
public static final String HTTP_TAG_COMMOAPP = "Rank/commonApp";
/*强制安装应用*/
public static final String GET_FORCE_INSTALL_LIST = "forceinstall/index";
/*分组应用强制安装*/

View File

@@ -10,7 +10,7 @@ import retrofit2.http.Query;
public interface GetSnRunLogApi {
@GET(UrlAddress.GET_LOG_ORDER)
Observable<BaseResponse<SnRunLog>> GetSnRunLog(
Observable<BaseResponse<SnRunLog>> getSnRunLog(
@Query("sn") String sn
);
}

View File

@@ -0,0 +1,22 @@
package com.aoleyun.sn.network.api.post;
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.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
public interface RankCommonAppApi {
@FormUrlEncoded
@POST(UrlAddress.HTTP_TAG_COMMOAPP)
Observable<BaseResponse<List<AppDateInfo>>> getRankApp(
@Field("key") String key,
@Field("sn") String sn,
@Field("page") String page
);
}

View File

@@ -8,11 +8,9 @@ import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
import com.aoleyun.sn.comm.CommonConfig;
import com.aoleyun.sn.comm.PackageNames;
import com.aoleyun.sn.network.NetInterfaceManager;
import com.aoleyun.sn.utils.ApkUtils;
import com.aoleyun.sn.utils.CmdUtil;
import com.aoleyun.sn.utils.JgyUtils;
import java.util.concurrent.TimeUnit;
@@ -76,7 +74,6 @@ public class NewAppReceiver extends BroadcastReceiver {
JgyUtils.getInstance().setAllowPermissionsPackage();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (!PackageNames.APPSTORE.equals(packageName) || !PackageNames.DEVICE_INFO.equals(packageName)) {
ApkUtils.addShortcut(context);
ApkUtils.RemoveTask(context, packageName);
}
JgyUtils.getInstance().wakeUpAoleyunAPP();
@@ -122,6 +119,7 @@ public class NewAppReceiver extends BroadcastReceiver {
NetInterfaceManager.getInstance().getAppLimit();
// NetInterfaceManager.getInstance().getDefaultDesktop();
NetInterfaceManager.getInstance().getNetAndLaunchSetting();
NetInterfaceManager.getInstance().getDesktopIcon();
NetInterfaceManager.getInstance().sendInstalledAppInfo(new NetInterfaceManager.onCompleteCallback() {
@Override
public void onComplete() {

View File

@@ -99,9 +99,9 @@ public class MainSPresenter implements MainSContact.Presenter {
Log.e("getLockedState", "onComplete: ");
int locked = Settings.System.getInt(crv, JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED);
Log.e("getLockedState", "locked: " + locked);
if (locked == 0) {
JgyUtils.getInstance().deleteOtherApp();
}
// if (locked == 0) {
// JgyUtils.getInstance().deleteOtherApp();
// }
mView.setLockedState(locked == JGYActions.FRAME_CODE_LOCKED);
}
});
@@ -109,7 +109,7 @@ public class MainSPresenter implements MainSContact.Presenter {
@Override
public void setPushTags() {
NetInterfaceManager.getInstance().setPushTags( getLifecycle(), new NetInterfaceManager.PushTagCallback() {
NetInterfaceManager.getInstance().setPushTags(getLifecycle(), new NetInterfaceManager.PushTagCallback() {
@Override
public void setPushTag(String tag) {
mView.setTagsFinish(TextUtils.isEmpty(tag));
@@ -184,7 +184,7 @@ public class MainSPresenter implements MainSContact.Presenter {
Log.e(TAG, "sendNetwork: " + "time empty");
return;
}
NetInterfaceManager.getInstance().GetNetworkConnectControl(time.toString())
NetInterfaceManager.getInstance().getNetworkConnectControl(time.toString())
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
.subscribe(new Observer<BaseResponse>() {
@Override
@@ -236,12 +236,12 @@ public class MainSPresenter implements MainSContact.Presenter {
mView.updateDeviceInfoFinish();
}
// if (!JgyUtils.getInstance().tagEmpty()) {
NetInterfaceManager.getInstance().updateDeviceInfo(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
@Override
public void onComplete() {
mView.updateDeviceInfoFinish();
}
});
NetInterfaceManager.getInstance().updateDeviceInfo(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
@Override
public void onComplete() {
mView.updateDeviceInfoFinish();
}
});
// }
}
@@ -251,12 +251,12 @@ public class MainSPresenter implements MainSContact.Presenter {
@Override
public void sendInstalled() {
// if (!JgyUtils.getInstance().tagEmpty()) {
NetInterfaceManager.getInstance().sendInstalledAppInfo(new NetInterfaceManager.onCompleteCallback() {
@Override
public void onComplete() {
mView.sendInstalledFinish();
}
});
NetInterfaceManager.getInstance().sendInstalledAppInfo(new NetInterfaceManager.onCompleteCallback() {
@Override
public void onComplete() {
mView.sendInstalledFinish();
}
});
// }
}
@@ -380,7 +380,7 @@ public class MainSPresenter implements MainSContact.Presenter {
mView.getDefaultDesktopFinish();
} else {
NetInterfaceManager.getInstance()
.getDefaultDesktop( getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
.getDefaultDesktop(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
@Override
public void onComplete() {
mView.getDefaultDesktopFinish();
@@ -418,7 +418,7 @@ public class MainSPresenter implements MainSContact.Presenter {
@Override
public void getAllAppList() {
NetInterfaceManager.getInstance()
.getAllAppList(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
.getAllAppList(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
@Override
public void onComplete() {
mView.getAllAppListFinish();
@@ -459,7 +459,7 @@ public class MainSPresenter implements MainSContact.Presenter {
@Override
public void getAppAutoStartUpdateAndNet() {
NetInterfaceManager.getInstance()
.getAppAutoStartUpdateAndNet( getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
.getAppAutoStartUpdateAndNet(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
@Override
public void onComplete() {
mView.getAppAutoStartUpdateAndNetFinish();

View File

@@ -599,13 +599,14 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
registerReceivers();
NetworkUtils.registerNetworkStatusChangedListener(this);
addShortcut();
timeChangedStart.onstar(System.currentTimeMillis());
setStatusbar();
setFloatingWindow();
JgyUtils.getInstance().writeAppPackageList();
// notificationManager = NotificationManagerCompat.from(this);
// createNotificationChannel();
notificationManager = NotificationManagerCompat.from(this);
createNotificationChannel();
sendSimpleNotification();
// aliyunPushInit();
IActivityManager activityManager = ActivityManagerNative.getDefault();
@@ -673,7 +674,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
channel.setDescription(CHANNEL_DESCRIPTION);
// Register the channel with the system; you can't change the importance
// or other notification behaviors after this
NotificationManager notificationManager = getSystemService(NotificationManager.class);
notificationManager.createNotificationChannel(channel);
}
}
@@ -691,11 +691,8 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
.setOngoing(true)
.setPriority(NotificationCompat.PRIORITY_MAX);
// notificationId is a unique int for each notification that you must define
notificationManager.notify(NotificationID, builder.build());
}
private void addShortcut() {
ApkUtils.addShortcut(this);
// notificationManager.notify(NotificationID, builder.build());
startForeground(NotificationID, builder.build());
}
private void setStatusbar() {
@@ -923,7 +920,11 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
@Override
public void onReceive(Context context, Intent intent) {
Log.e("TimeChangedReceiver", "onReceive: " + intent.getAction());
switch (intent.getAction()) {
String action = intent.getAction();
if (TextUtils.isEmpty(action)) {
return;
}
switch (action) {
case Intent.ACTION_DATE_CHANGED:
case Intent.ACTION_TIME_CHANGED:
case Intent.ACTION_TIMEZONE_CHANGED:
@@ -1168,7 +1169,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
Log.e(TAG, "setLockedState: " + loocked);
if (loocked) {
Toaster.debugShow("设备已上锁");
// sendSimpleNotification();
mPresenter.setPushTags();
ApkUtils.UninstallAPP(this, "com.joytv.live");
ApkUtils.UninstallAPP(this, "com.tencent.android.qqdownloader");
@@ -1192,6 +1192,9 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
// mPresenter.getStudesInfo(true);
mPresenter.checkAoleyunUpdate();
// SysSettingUtils.setEnableSetting(this);
Settings.System.putString(getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "");
mPresenter.getForceDownload();
mPresenter.getAppLimit();
} else {
mPresenter.getFirstConnect();
mPresenter.getStudesInfo();

View File

@@ -1365,10 +1365,6 @@ public class ApkUtils {
}
}
public static void addShortcut(Context context) {
}
private static final Set<String> AoleyunOSApp = new HashSet<String>() {{
this.add("com.aoleyun.info");
this.add("com.aoleyun.os");

View File

@@ -245,7 +245,11 @@ public class JgyUtils {
public static void init(Context context) {
if (sInstance == null) {
Log.e(TAG, "init: ");
sInstance = new JgyUtils(context);
synchronized (JgyUtils.class) {
if (sInstance == null) {
sInstance = new JgyUtils(context);
}
}
}
}
@@ -1527,7 +1531,6 @@ public class JgyUtils {
setAppRestriction(0);
return;
}
ApkUtils.addShortcut(mContext);
HashSet<String> pkgSet = new HashSet<>(defaultPackages);
if (BuildConfig.DEBUG) {
pkgSet.add("com.reqable.android");
@@ -1805,6 +1808,8 @@ public class JgyUtils {
Log.e(TAG, "deleteOtherApp: " + "start");
Set<String> allAppWhiteSet = mMMKV.decodeStringSet(CommonConfig.AOLE_ALL_APP_WHITE_LIST_KEY, new HashSet<>());
Log.e("deleteOtherApp", "allAppWhiteSet:" + allAppWhiteSet);
Set<String> pubAppSet = mMMKV.decodeStringSet(CommonConfig.AOLE_PUBLIC_APP_INSTALL_WHITELIST, new HashSet<>());
Log.e(TAG, "deleteOtherApp: pubAppSet = " + pubAppSet);
List<String> resulWhitetList = new ArrayList<>(defaultPackages);
resulWhitetList.addAll(allAppWhiteSet);
@@ -3009,6 +3014,7 @@ public class JgyUtils {
}
}
@Deprecated
public List<String> getHidePackage() {
String jsonString = cacheHelper.getAsString(UrlAddress.GET_HIDE_DESKTOPICON);
//为 "" 是已经请求成功的

View File

@@ -28,7 +28,7 @@ allprojects {
repositories {
google()
mavenCentral()
// mavenCentral()
maven { url "https://jitpack.io" }
maven { url 'https://developer.huawei.com/repo/' }
maven { url 'https://maven.aliyun.com/repository/central/' }