version:3.4.8
fix: update:修改主页ui
This commit is contained in:
1 parent
b8b951650b
commit
d62f7ea042
91 files changed
+8580
-1279
No files matched your search
@@ -17,12 +17,12 @@ import com.arialyy.annotations.Download;
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.arialyy.aria.core.task.DownloadTask;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.fuying.sn.KeepAliveConnection;
|
||||
import com.fuying.sn.R;
|
||||
import com.fuying.sn.gson.GsonUtils;
|
||||
import com.fuying.sn.service.main.MainService;
|
||||
import com.fuying.sn.utils.ApkUtils;
|
||||
import com.fuying.sn.gson.GsonUtils;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -30,6 +30,15 @@ import java.io.File;
|
||||
public class DownloadService extends Service {
|
||||
private static final String TAG = "DownloadService";
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
Log.e(TAG, "onCreate: ");
|
||||
Aria.download(this).register();
|
||||
//恢复所有未完成的下载任务
|
||||
Aria.download(this).resumeAllTask();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
startService(new Intent(this, StepService.class));
|
||||
@@ -37,21 +46,14 @@ public class DownloadService extends Service {
|
||||
startService(new Intent(this, MainService.class));
|
||||
startService(new Intent(this, ManagerService.class));
|
||||
startService(new Intent(this, ControlPanelService.class));
|
||||
Aria.download(this).register();
|
||||
//恢复所有未完成的下载任务
|
||||
Aria.download(this).resumeAllTask();
|
||||
return START_STICKY;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
Log.e(TAG, "onDestroy: ");
|
||||
Aria.download(this).unRegister();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -156,6 +158,7 @@ public class DownloadService extends Service {
|
||||
}
|
||||
Log.e(TAG, "taskFail: " + packageName + "filepath: " + filepath);
|
||||
Aria.download(this).load(task.getDownloadEntity().getId()).cancel(true);
|
||||
|
||||
// Aria.download(this)
|
||||
// .load(task.getDownloadEntity().getRealUrl()) //读取下载地址
|
||||
// .setFilePath(task.getFilePath())
|
||||
|
||||
@@ -11,14 +11,6 @@ import com.fuying.sn.BuildConfig;
|
||||
import com.fuying.sn.IGetInfoInterface;
|
||||
import com.fuying.sn.config.CommonConfig;
|
||||
import com.fuying.sn.desktop.RunningAppManager;
|
||||
import com.fuying.sn.network.NetInterfaceManager;
|
||||
import com.fuying.sn.utils.Utils;
|
||||
import com.tencent.android.tpush.XGIOperateCallback;
|
||||
import com.tencent.android.tpush.XGPushConfig;
|
||||
import com.tencent.android.tpush.XGPushManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RemoteService extends Service {
|
||||
private static final String TAG = "RemoteService";
|
||||
@@ -36,38 +28,6 @@ public class RemoteService extends Service {
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
Log.e(TAG, "onCreate: ");
|
||||
tPushInit();
|
||||
}
|
||||
|
||||
private void tPushInit() {
|
||||
XGPushConfig.enableDebug(this, true);
|
||||
XGPushManager.registerPush(this, new XGIOperateCallback() {
|
||||
@Override
|
||||
public void onSuccess(Object data, int flag) {
|
||||
//token在设备卸载重装的时候有可能会变
|
||||
Log.e("TPush", "注册成功,设备token为:" + data);
|
||||
List<XGPushManager.AccountInfo> accountInfoList = new ArrayList<>();
|
||||
Log.e("TPush", "onSuccess: " + Utils.getSerial());
|
||||
accountInfoList.add(new XGPushManager.AccountInfo(XGPushManager.AccountType.CUSTOM.getValue(), Utils.getSerial()));
|
||||
XGPushManager.upsertAccounts(RemoteService.this, accountInfoList, new XGIOperateCallback() {
|
||||
@Override
|
||||
public void onSuccess(Object data, int flag) {
|
||||
Log.e("TPush", "upsertAccounts onSuccess, data:" + data + ", flag:" + flag);
|
||||
NetInterfaceManager.getInstance().setPushTags();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(Object data, int errCode, String msg) {
|
||||
Log.e("TPush", "upsertAccounts onFail, data:" + data + ", code:" + errCode + ", msg:" + msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(Object data, int errCode, String msg) {
|
||||
Log.e("TPush", "注册失败,错误码:" + errCode + ",错误信息:" + msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,16 +17,14 @@ import android.content.ServiceConnection;
|
||||
import android.os.Binder;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.PowerManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.blankj.utilcode.util.NetworkUtils;
|
||||
import com.fuying.sn.BuildConfig;
|
||||
import com.fuying.sn.KeepAliveConnection;
|
||||
import com.fuying.sn.utils.JGYUtils;
|
||||
import com.fuying.sn.utils.JgyUtils;
|
||||
import com.fuying.sn.utils.ServiceAliveUtils;
|
||||
import com.fuying.sn.utils.Utils;
|
||||
import com.fuying.sn.websocket.JWebSocketClient;
|
||||
@@ -196,7 +194,7 @@ public class StepService extends Service implements NetworkUtils.OnNetworkStatus
|
||||
Log.i("JWebSocketClientService", "websocket连接关闭:" + reason);
|
||||
// client.close();
|
||||
// initSocketClient();
|
||||
if (JGYUtils.getInstance().isScreenOn()) {
|
||||
if (JgyUtils.getInstance().isScreenOn()) {
|
||||
mHandler.postDelayed(heartBeatRunnable, HEART_BEAT_RATE);//开启心跳检测
|
||||
}
|
||||
}
|
||||
@@ -207,7 +205,7 @@ public class StepService extends Service implements NetworkUtils.OnNetworkStatus
|
||||
Log.i("JWebSocketClientService", "websocket连接错误:" + ex.getMessage());
|
||||
// client.close();
|
||||
// initSocketClient();
|
||||
if (JGYUtils.getInstance().isScreenOn()) {
|
||||
if (JgyUtils.getInstance().isScreenOn()) {
|
||||
mHandler.postDelayed(heartBeatRunnable, HEART_BEAT_RATE);//开启心跳检测
|
||||
} else {
|
||||
Log.i("JWebSocketClientService", "postDelayed off");
|
||||
@@ -302,7 +300,7 @@ public class StepService extends Service implements NetworkUtils.OnNetworkStatus
|
||||
sendMsg();
|
||||
} else if (client.isClosed()) {
|
||||
Log.i("JWebSocketClientService", "websocket重连中");
|
||||
if (JGYUtils.getInstance().isScreenOn()) {
|
||||
if (JgyUtils.getInstance().isScreenOn()) {
|
||||
reconnectWs();
|
||||
} else {
|
||||
Log.i("JWebSocketClientService", "reconnectWs off");
|
||||
@@ -314,7 +312,7 @@ public class StepService extends Service implements NetworkUtils.OnNetworkStatus
|
||||
initSocketClient();
|
||||
}
|
||||
//每隔一定的时间,对长连接进行一次心跳检测
|
||||
if (JGYUtils.getInstance().isScreenOn()) {
|
||||
if (JgyUtils.getInstance().isScreenOn()) {
|
||||
mHandler.postDelayed(this, HEART_BEAT_RATE);
|
||||
} else {
|
||||
Log.i("JWebSocketClientService", "websocket息屏不重连");
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.fuying.sn.disklrucache.CacheHelper;
|
||||
import com.fuying.sn.gson.GsonUtils;
|
||||
import com.fuying.sn.network.NetInterfaceManager;
|
||||
import com.fuying.sn.service.ManagerService;
|
||||
import com.fuying.sn.utils.JGYUtils;
|
||||
import com.fuying.sn.utils.JgyUtils;
|
||||
import com.fuying.sn.utils.SPUtils;
|
||||
import com.fuying.sn.utils.ServiceAliveUtils;
|
||||
import com.fuying.sn.utils.Utils;
|
||||
@@ -177,7 +177,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
JsonObject jsonObject = GsonUtils.getJsonObject(jsonString);
|
||||
String ids = jsonObject.get("ids").getAsString();
|
||||
String packages = jsonObject.get("package").getAsString();
|
||||
JGYUtils.getInstance().writeDeselectIDtoSystem(ids, packages);
|
||||
JgyUtils.getInstance().writeDeselectIDtoSystem(ids, packages);
|
||||
} else {
|
||||
Log.e("getAppInside", "onNext: " + baseResponse.msg);
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID_ID, " ");
|
||||
|
||||
@@ -19,9 +19,6 @@ import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.baidu.location.BDAbstractLocationListener;
|
||||
import com.baidu.location.BDLocation;
|
||||
import com.baidu.location.LocationClient;
|
||||
import com.blankj.utilcode.util.NetworkUtils;
|
||||
import com.fuying.sn.BuildConfig;
|
||||
import com.fuying.sn.base.rx.BaseRxService;
|
||||
@@ -39,22 +36,17 @@ import com.fuying.sn.service.GuardService;
|
||||
import com.fuying.sn.service.StepService;
|
||||
import com.fuying.sn.utils.ApkUtils;
|
||||
import com.fuying.sn.utils.CacheUtils;
|
||||
import com.fuying.sn.utils.JGYUtils;
|
||||
import com.fuying.sn.utils.JgyUtils;
|
||||
import com.fuying.sn.utils.NetStateUtils;
|
||||
import com.fuying.sn.utils.SPUtils;
|
||||
import com.fuying.sn.utils.TimeUtils;
|
||||
import com.fuying.sn.utils.ToastUtil;
|
||||
import com.fuying.sn.utils.Utils;
|
||||
import com.tencent.android.tpush.XGIOperateCallback;
|
||||
import com.tencent.android.tpush.XGPushConfig;
|
||||
import com.tencent.android.tpush.XGPushManager;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.trello.rxlifecycle4.LifecycleProvider;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
@@ -99,7 +91,7 @@ public class MainService extends BaseRxService implements MainSContact.MainView,
|
||||
@Override
|
||||
public void run() {
|
||||
// TODO: 2025/11/11 不确定某些机型状态获取是否正常
|
||||
if (JGYUtils.getInstance().isScreenOn()) {
|
||||
if (JgyUtils.getInstance().isScreenOn()) {
|
||||
Log.e(TAG, "getSnInfo1");
|
||||
NetInterfaceManager.getInstance().getAppWhiteList(() -> {
|
||||
Log.e("onConnected", "onNext: getAppWhiteList");
|
||||
@@ -109,7 +101,6 @@ public class MainService extends BaseRxService implements MainSContact.MainView,
|
||||
NetInterfaceManager.getInstance().updateAdminInfo();
|
||||
NetInterfaceManager.getInstance().SendAppInstallInfo();
|
||||
SPUtils.put(MainService.this, CommonConfig.JGY_FIRST_BOOT, 1);
|
||||
tPushInit();
|
||||
}
|
||||
}
|
||||
}, 15000);
|
||||
@@ -154,7 +145,7 @@ public class MainService extends BaseRxService implements MainSContact.MainView,
|
||||
|
||||
boolean reboot = mMMKV.decodeBool(CommonConfig.DEVICES_REBOOT, false);
|
||||
Log.e(TAG, "onCreate: reboot = " + reboot);
|
||||
boolean networkConnected = JGYUtils.getInstance().isNetworkConnected();
|
||||
boolean networkConnected = JgyUtils.getInstance().isNetworkConnected();
|
||||
Log.e(TAG, "onCreate: networkConnected = " + networkConnected);
|
||||
// if (networkConnected && reboot) {
|
||||
Log.e(TAG, "onCreate run: 20秒后请求网络");
|
||||
@@ -205,7 +196,7 @@ public class MainService extends BaseRxService implements MainSContact.MainView,
|
||||
startService();
|
||||
Settings.System.putString(getContentResolver(), CommonConfig.APP_SOURCE_WHITE_LIST, DEFAULT_SOURCE);
|
||||
|
||||
JGYUtils.getInstance().putBuiltInApps();
|
||||
JgyUtils.getInstance().putBuiltInApps();
|
||||
}
|
||||
|
||||
private static final String DEFAULT_SOURCE = "com.fuying.sn,com.fuying.appstore,com.fuying.fuxiaoying";
|
||||
@@ -220,7 +211,7 @@ public class MainService extends BaseRxService implements MainSContact.MainView,
|
||||
ApkUtils.writeAppPackageList(MainService.this, aole_app_forbid);
|
||||
|
||||
new CacheUtils().cleanApplicationUserData(this, "com.aoleyun.os");
|
||||
File file = new File(JGYUtils.getInstance().getDownLoadPath());
|
||||
File file = new File(JgyUtils.getInstance().getDownLoadPath());
|
||||
Log.e(TAG, "versionIsUpdate: " + file.getAbsolutePath());
|
||||
String[] fileList = file.list();
|
||||
if (fileList != null) {
|
||||
@@ -247,18 +238,8 @@ public class MainService extends BaseRxService implements MainSContact.MainView,
|
||||
}
|
||||
|
||||
private void initConfig() {
|
||||
tPushInit();
|
||||
// Utils.getPublicIP(MainService.this);
|
||||
LocationClient locationClient = AmapManager.getInstance().getLocationClient();
|
||||
locationClient.stop();
|
||||
locationClient.start();
|
||||
locationClient.registerLocationListener(new BDAbstractLocationListener() {
|
||||
@Override
|
||||
public void onReceiveLocation(BDLocation bdLocation) {
|
||||
Log.e("initConfig", "onReceiveLocation: ");
|
||||
locationClient.stop();
|
||||
}
|
||||
});
|
||||
AmapManager.getInstance().startLocation();
|
||||
}
|
||||
|
||||
private interface ConfigStart {
|
||||
@@ -324,40 +305,9 @@ public class MainService extends BaseRxService implements MainSContact.MainView,
|
||||
// am.setTime(aLong);
|
||||
SystemClock.setCurrentTimeMillis(aLong);
|
||||
Log.e(TAG, "getTimeFromNtpServer: " + aLong);
|
||||
tPushInit();
|
||||
}
|
||||
}
|
||||
|
||||
private void tPushInit() {
|
||||
XGPushConfig.enableDebug(this, true);
|
||||
XGPushManager.registerPush(this, new XGIOperateCallback() {
|
||||
@Override
|
||||
public void onSuccess(Object data, int flag) {
|
||||
//token在设备卸载重装的时候有可能会变
|
||||
Log.e("TPush", "注册成功,设备token为:" + data);
|
||||
List<XGPushManager.AccountInfo> accountInfoList = new ArrayList<>();
|
||||
Log.e("TPush", "onSuccess: " + Utils.getSerial());
|
||||
accountInfoList.add(new XGPushManager.AccountInfo(XGPushManager.AccountType.CUSTOM.getValue(), Utils.getSerial()));
|
||||
XGPushManager.upsertAccounts(MainService.this, accountInfoList, new XGIOperateCallback() {
|
||||
@Override
|
||||
public void onSuccess(Object data, int flag) {
|
||||
Log.e("TPush", "upsertAccounts onSuccess, data:" + data + ", flag:" + flag);
|
||||
NetInterfaceManager.getInstance().setPushTags();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(Object data, int errCode, String msg) {
|
||||
Log.e("TPush", "upsertAccounts onFail, data:" + data + ", code:" + errCode + ", msg:" + msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(Object data, int errCode, String msg) {
|
||||
Log.e("TPush", "注册失败,错误码:" + errCode + ",错误信息:" + msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void registerReceivers() {
|
||||
registerWiFiReceiver();
|
||||
|
||||
Reference in new issue
Block a user