version:1.5.1216

bugfixes:
add:统一aidl,为中性mdm版本提供状态获取
This commit is contained in:
2026-01-30 19:11:51 +08:00
parent 6797c7a6bd
commit 1dd810dcfe
6 changed files with 95 additions and 76 deletions

View File

@@ -5,22 +5,14 @@ import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
import com.aoleyun.sn.SystemInfoInterface;
import com.aoleyun.sn.comm.CommonConfig;
import com.aoleyun.sn.comm.PackageNames;
import com.aoleyun.sn.utils.CacheUtils;
import com.aoleyun.sn.utils.ForegroundAppUtil;
import com.aoleyun.sn.utils.JgyUtils;
import com.aoleyun.sn.comm.JGYActions;
import com.aoleyun.sn.utils.Utils;
import com.tencent.mmkv.MMKV;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class RemoteService extends Service {
private String TAG = "RemoteService";
@@ -52,60 +44,73 @@ public class RemoteService extends Service {
}
@Override
public List<String> getHideIcon() throws RemoteException {
List<String> hide = JgyUtils.getInstance().getHidePackage();
return hide;
public boolean isDeviceLocked() throws RemoteException {
int locked = Settings.System.getInt(getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED);
Log.e(TAG, "isDeviceLocked: " + locked);
return locked == JGYActions.FRAME_CODE_LOCKED;
}
@Override
public List<String> getDisableIcon() throws RemoteException {
List<String> disable = JgyUtils.getInstance().getDisablePackage();
return disable;
public boolean isBrowserInput() throws RemoteException {
int state = Settings.System.getInt(getContentResolver(), "qch_Browser_input", 1);
return state == 0;
}
@Override
public String getTopAppPackage() throws RemoteException {
String pkg = Settings.Global.getString(getContentResolver(), ForegroundAppUtil.TOPAPP_KEY);
Log.e(TAG, "getTopAppPackage: " + pkg);
return pkg;
}
@Override
public boolean SystemPutInt(String name, int value) throws RemoteException {
Log.e(TAG, "SystemPutInt: " + "name = " + name + "\t value = " + value);
return Settings.System.putInt(getContentResolver(), name, value);
}
@Override
public void setDefaultDesktop(String pkg) throws RemoteException {
Log.e(TAG, "setDefaultDesktop: " + "pkg = " + pkg);
// SPUtils.put(RemoteService.this, "default_launcher", pkg);
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, pkg);
JgyUtils.getInstance().setDefaultDesktop(pkg);
if (PackageNames.DESKTOP.equals(pkg)) {
// JgyUtils.getInstance().killPackage(PackageNames.DESKTOP);
try {
new CacheUtils().cleanApplicationUserData(RemoteService.this, PackageNames.DESKTOP);
new CacheUtils().cleanApplicationUserData(RemoteService.this, PackageNames.APPSTORE);
new CacheUtils().cleanApplicationUserData(RemoteService.this, "com.aoleyunos.dop2");
} catch (Exception e) {
Log.e(TAG, "onReceive: " + e.getMessage());
e.printStackTrace();
}
JgyUtils.getInstance().killPackage("com.aoleyunos.dop2");
}
}
@Override
public List<String> getDisableApp() throws RemoteException {
String disable_app_list = Settings.Global.getString(getContentResolver(), CommonConfig.AOLE_ACTION_DISABLE_APP);
Log.e(TAG, "getDisableApp: " + disable_app_list);
if (TextUtils.isEmpty(disable_app_list)) {
return new ArrayList<>();
} else {
return new ArrayList<>(Arrays.asList(disable_app_list.split(",")));
}
}
// @Override
// public List<String> getHideIcon() throws RemoteException {
// List<String> hide = JgyUtils.getInstance().getHidePackage();
// return hide;
// }
//
// @Override
// public List<String> getDisableIcon() throws RemoteException {
// List<String> disable = JgyUtils.getInstance().getDisablePackage();
// return disable;
// }
//
// @Override
// public String getTopAppPackage() throws RemoteException {
// String pkg = Settings.Global.getString(getContentResolver(), ForegroundAppUtil.TOPAPP_KEY);
// Log.e(TAG, "getTopAppPackage: " + pkg);
// return pkg;
// }
//
// @Override
// public boolean SystemPutInt(String name, int value) throws RemoteException {
// Log.e(TAG, "SystemPutInt: " + "name = " + name + "\t value = " + value);
// return Settings.System.putInt(getContentResolver(), name, value);
// }
//
// @Override
// public void setDefaultDesktop(String pkg) throws RemoteException {
// Log.e(TAG, "setDefaultDesktop: " + "pkg = " + pkg);
//// SPUtils.put(RemoteService.this, "default_launcher", pkg);
// mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, pkg);
// JgyUtils.getInstance().setDefaultDesktop(pkg);
// if (PackageNames.DESKTOP.equals(pkg)) {
//// JgyUtils.getInstance().killPackage(PackageNames.DESKTOP);
// try {
// new CacheUtils().cleanApplicationUserData(RemoteService.this, PackageNames.DESKTOP);
// new CacheUtils().cleanApplicationUserData(RemoteService.this, PackageNames.APPSTORE);
// new CacheUtils().cleanApplicationUserData(RemoteService.this, "com.aoleyunos.dop2");
// } catch (Exception e) {
// Log.e(TAG, "onReceive: " + e.getMessage());
// e.printStackTrace();
// }
// JgyUtils.getInstance().killPackage("com.aoleyunos.dop2");
// }
//
// }
//
// @Override
// public List<String> getDisableApp() throws RemoteException {
// String disable_app_list = Settings.Global.getString(getContentResolver(), CommonConfig.AOLE_ACTION_DISABLE_APP);
// Log.e(TAG, "getDisableApp: " + disable_app_list);
// if (TextUtils.isEmpty(disable_app_list)) {
// return new ArrayList<>();
// } else {
// return new ArrayList<>(Arrays.asList(disable_app_list.split(",")));
// }
// }
};
}