version:3.3.4

fix:
update:修复无法安装
This commit is contained in:
tongtong committed 2025-05-24 09:45:07 +08:00
1 parent 3dcd25b5bf
commit 9e15d20837
7 files changed
+31 -17

No files matched your search

@@ -143,13 +143,14 @@ public class StepService extends Service implements NetworkUtils.OnNetworkStatus
case Intent.ACTION_USER_PRESENT:
case Intent.ACTION_SCREEN_ON:
mHandler.post(heartBeatRunnable);//开启心跳检测
sendMsg(1);
// sendMsg(1);
break;
case Intent.ACTION_SCREEN_OFF:
case Intent.ACTION_SHUTDOWN:
case Intent.ACTION_FACTORY_RESET:
case Intent.ACTION_MASTER_CLEAR:
sendMsg(0);
closeConnect();
// sendMsg(0);
break;
default:
break;
@@ -171,7 +172,8 @@ public class StepService extends Service implements NetworkUtils.OnNetworkStatus
* 初始化websocket连接
*/
private void initSocketClient() {
URI uri = URI.create(BuildConfig.WEBSOCKET_URL);
URI uri = URI.create("wss://as.fuyingy.com/wss/device?sn=" + Utils.getSerial());
// URI uri = URI.create(BuildConfig.WEBSOCKET_URL);
// URI uri = URI.create("ws://echo.websocket.org");
// URI uri = URI.create("ws://123.207.136.134:9010/ajaxchattest");
client = new JWebSocketClient(uri) {
@@ -184,7 +186,8 @@ public class StepService extends Service implements NetworkUtils.OnNetworkStatus
public void onOpen(ServerHandshake handshakedata) {
super.onOpen(handshakedata);
Log.i("JWebSocketClientService", "websocket连接成功");
sendMsg(1);
// sendMsg(1);
sendMsg();
}
@Override
@@ -240,19 +243,21 @@ public class StepService extends Service implements NetworkUtils.OnNetworkStatus
public void sendMsg() {
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("sn", Utils.getSerial());
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
if (!pm.isScreenOn()) {
jsonObject.addProperty("online", 0);
//熄屏状态
} else {
jsonObject.addProperty("online", 1);
}
// PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
// if (!pm.isScreenOn()) {
// jsonObject.addProperty("online", 0);
// //熄屏状态
// } else {
// jsonObject.addProperty("online", 1);
// }
jsonObject.addProperty("type", "ping");
if (null != client) {
Log.i("JWebSocketClientService", "发送的消息:" + jsonObject.toString());
client.send(jsonObject.toString());
}
}
@Deprecated
public void sendMsg(int state) {
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("sn", Utils.getSerial());
@@ -95,7 +95,7 @@ public class MainService extends BaseRxService implements MainSContact.MainView,
Handler.getMain().postDelayed(new Runnable() {
@Override
public void run() {
·// NetInterfaceManager.getInstance().updateAdminInfo();
// NetInterfaceManager.getInstance().updateAdminInfo();
// if (JGYUtils.getInstance().isScreenOn()) {
Log.e(TAG, "getSnInfo1");
NetInterfaceManager.getInstance().getAppWhiteList(() -> {
@@ -206,6 +206,9 @@ public class MainService extends BaseRxService implements MainSContact.MainView,
Log.e(TAG, "onCreate: " + "upgrade successful");
try {
Settings.System.putString(getContentResolver(), CommonConfig.APP_SOURCE_WHITE_LIST, DEFAULT_SOURCE);
String aole_app_forbid = Settings.System.getString(getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID);
ApkUtils.writeAppPackageList(MainService.this, aole_app_forbid);
new CacheUtils().cleanApplicationUserData(this, "com.aoleyun.os");
File file = new File(JGYUtils.getInstance().getDownLoadPath());
Log.e(TAG, "versionIsUpdate: " + file.getAbsolutePath());
@@ -215,6 +218,7 @@ public class MainService extends BaseRxService implements MainSContact.MainView,
Log.e(TAG, "versionIsUpdate: delete file " + path + " = " + new File(file.getAbsolutePath() + File.separator + path).delete());
}
}
} catch (Exception e) {
Log.e(TAG, "onReceive: " + e.getMessage());
e.printStackTrace();