feat: 增加公共应用标签,增加指定包名安装应用

This commit is contained in:
2026-05-23 10:34:52 +08:00
parent c7851a8a64
commit d935d30c6c
18 changed files with 663 additions and 401 deletions

View File

@@ -41,6 +41,7 @@ import com.aoleyun.sn.gson.NullStringToEmptyAdapterFactory;
import com.aoleyun.sn.manager.MapManager;
import com.aoleyun.sn.network.NetInterfaceManager;
import com.aoleyun.sn.network.RetryCallback;
import com.aoleyun.sn.network.UrlAddress;
import com.aoleyun.sn.service.main.MainService;
import com.aoleyun.sn.utils.ApkUtils;
import com.aoleyun.sn.utils.BatteryUtils;
@@ -267,6 +268,12 @@ public class PushManager {
private static final String GROUP_APP_UNINSTALL = "81";
/*电子围栏*/
private static final String ELECTRONIC_FENCE = "82";
/*发出声音*/
private static final String PLAY_SOUND2 = "89";
/*更新公共应用设置,不安装*/
private static final String PUBLIC_APP_SETTING = "91";
/*公共应用卸载*/
private static final String PUBLIC_APP_UNINSTALL = "92";
public void setPushContent(String title, String extras) {
@@ -310,21 +317,23 @@ public class PushManager {
mMMKV.clearAll();
JgyUtils.getInstance().cleanAoleAppCache();
JgyUtils.getInstance().wakeUpAoleyunAPP();
NetInterfaceManager.getInstance().setPushTags();
NetInterfaceManager.getInstance().getPushAndPubAppTag();
NetInterfaceManager.clearAllCache();
sendRefreshBroadcast(mContext);
break;
case MSG_INSTALL:
Toaster.debugShow("收到管控:应用安装");
NetInterfaceManager.removeCache(UrlAddress.GET_FORCE_INSTALL_LIST);
NetInterfaceManager.removeCache(UrlAddress.GROUP_APP_INSTALL_LIST);
doDownloadAndInstall(extras);
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
@Override
public void run() {
NetInterfaceManager.getInstance().getDesktopIcon();
NetInterfaceManager.getInstance().getDefaultDesktop();
NetInterfaceManager.getInstance().getNetAndLaunchSetting();
NetInterfaceManager.getInstance().getAppAutoStartUpdateAndNet();
}
}, 1234);
}, 5234);
mContext.sendBroadcast(new Intent(AOLEYUN_REFRESH_DESKTOP));
break;
case MSG_LOCK:
@@ -522,6 +531,7 @@ public class PushManager {
setDefalutApp(extras);
break;
case PLAY_SOUND:
case PLAY_SOUND2:
Toaster.debugShow("收到管控:查找设备");
playSound(extras);
break;
@@ -551,7 +561,7 @@ public class PushManager {
break;
case UPDATE_CHILD_BATCH:
Toaster.debugShow("收到管控:更换批次不恢复出厂设置");
NetInterfaceManager.getInstance().setPushTags();
NetInterfaceManager.getInstance().getPushAndPubAppTag();
Aria.download(this).removeAllTask(true);
JgyUtils.getInstance().cleanAoleAppCache();
try {
@@ -682,6 +692,12 @@ public class PushManager {
}
case ELECTRONIC_FENCE:
break;
case PUBLIC_APP_SETTING:
updatePublicAppSettings(extras);
break;
case PUBLIC_APP_UNINSTALL:
uninstallPublicApp(extras);
break;
default:
}
@@ -734,7 +750,7 @@ public class PushManager {
public void run() {
NetInterfaceManager.getInstance().getDesktopIcon();
NetInterfaceManager.getInstance().getDefaultDesktop();
NetInterfaceManager.getInstance().getNetAndLaunchSetting();
NetInterfaceManager.getInstance().getAppAutoStartUpdateAndNet();
}
}, 1234);
}
@@ -1553,4 +1569,30 @@ public class PushManager {
ApkUtils.openPackage(mContext, app_package);
}
public void updatePublicAppSettings(String extras) {
Toaster.debugShow("收到管控:应用公共设置");
if (TextUtils.isEmpty(extras)) {
Log.e(TAG, "updatePublicAppSettings: extras is null");
return;
}
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
@Override
public void run() {
NetInterfaceManager.getInstance().getAppLimit();
NetInterfaceManager.getInstance().getAppAutoStartUpdateAndNet();
}
}, 2345);
ApkInfoPush apkInfoPush = GsonUtils.toJavaObject(extras, ApkInfoPush.class);
}
public void uninstallPublicApp(String extras) {
Toaster.debugShow("收到管控:应用公共删除");
if (!TextUtils.isEmpty(extras)) {
JsonObject jsonObject = GsonUtils.getJsonObject(extras);
String pkg = jsonObject.get("package_name").getAsString();
deleteApp(pkg);
}
}
}