version:1.5.1216
bugfixes: add:统一aidl,为中性mdm版本提供状态获取
This commit is contained in:
@@ -12,10 +12,6 @@ interface SystemInfoInterface {
|
|||||||
double aDouble, String aString);
|
double aDouble, String aString);
|
||||||
|
|
||||||
String getSerial();
|
String getSerial();
|
||||||
List<String> getHideIcon();
|
boolean isDeviceLocked();
|
||||||
List<String> getDisableIcon();
|
boolean isBrowserInput();
|
||||||
String getTopAppPackage();
|
|
||||||
boolean SystemPutInt(String name, int value);
|
|
||||||
void setDefaultDesktop(String pkg);
|
|
||||||
List<String> getDisableApp();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -482,7 +482,7 @@ public class NetInterfaceManager {
|
|||||||
Utils.obtainWifiInfo(mContext),
|
Utils.obtainWifiInfo(mContext),
|
||||||
mMMKV.decodeString(NetInterfaceManager.PublicIP, ""),
|
mMMKV.decodeString(NetInterfaceManager.PublicIP, ""),
|
||||||
Utils.getIPAddress(mContext),
|
Utils.getIPAddress(mContext),
|
||||||
Utils.getBluetoothList(),
|
Utils.getBluetoothList(mContext),
|
||||||
Utils.getWifiAlias(mContext),
|
Utils.getWifiAlias(mContext),
|
||||||
Utils.getAPPVersionName(PackageNames.BROWSER, mContext),
|
Utils.getAPPVersionName(PackageNames.BROWSER, mContext),
|
||||||
Utils.getAPPVersionName(PackageNames.NOTIFICATIONS, mContext),
|
Utils.getAPPVersionName(PackageNames.NOTIFICATIONS, mContext),
|
||||||
|
|||||||
@@ -5,22 +5,14 @@ import android.content.Intent;
|
|||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.aoleyun.sn.SystemInfoInterface;
|
import com.aoleyun.sn.SystemInfoInterface;
|
||||||
import com.aoleyun.sn.comm.CommonConfig;
|
import com.aoleyun.sn.comm.CommonConfig;
|
||||||
import com.aoleyun.sn.comm.PackageNames;
|
import com.aoleyun.sn.comm.JGYActions;
|
||||||
import com.aoleyun.sn.utils.CacheUtils;
|
|
||||||
import com.aoleyun.sn.utils.ForegroundAppUtil;
|
|
||||||
import com.aoleyun.sn.utils.JgyUtils;
|
|
||||||
import com.aoleyun.sn.utils.Utils;
|
import com.aoleyun.sn.utils.Utils;
|
||||||
import com.tencent.mmkv.MMKV;
|
import com.tencent.mmkv.MMKV;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class RemoteService extends Service {
|
public class RemoteService extends Service {
|
||||||
private String TAG = "RemoteService";
|
private String TAG = "RemoteService";
|
||||||
|
|
||||||
@@ -52,60 +44,73 @@ public class RemoteService extends Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getHideIcon() throws RemoteException {
|
public boolean isDeviceLocked() throws RemoteException {
|
||||||
List<String> hide = JgyUtils.getInstance().getHidePackage();
|
int locked = Settings.System.getInt(getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED);
|
||||||
return hide;
|
Log.e(TAG, "isDeviceLocked: " + locked);
|
||||||
|
return locked == JGYActions.FRAME_CODE_LOCKED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getDisableIcon() throws RemoteException {
|
public boolean isBrowserInput() throws RemoteException {
|
||||||
List<String> disable = JgyUtils.getInstance().getDisablePackage();
|
int state = Settings.System.getInt(getContentResolver(), "qch_Browser_input", 1);
|
||||||
return disable;
|
return state == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public String getTopAppPackage() throws RemoteException {
|
// public List<String> getHideIcon() throws RemoteException {
|
||||||
String pkg = Settings.Global.getString(getContentResolver(), ForegroundAppUtil.TOPAPP_KEY);
|
// List<String> hide = JgyUtils.getInstance().getHidePackage();
|
||||||
Log.e(TAG, "getTopAppPackage: " + pkg);
|
// return hide;
|
||||||
return pkg;
|
// }
|
||||||
}
|
//
|
||||||
|
// @Override
|
||||||
@Override
|
// public List<String> getDisableIcon() throws RemoteException {
|
||||||
public boolean SystemPutInt(String name, int value) throws RemoteException {
|
// List<String> disable = JgyUtils.getInstance().getDisablePackage();
|
||||||
Log.e(TAG, "SystemPutInt: " + "name = " + name + "\t value = " + value);
|
// return disable;
|
||||||
return Settings.System.putInt(getContentResolver(), name, value);
|
// }
|
||||||
}
|
//
|
||||||
|
// @Override
|
||||||
@Override
|
// public String getTopAppPackage() throws RemoteException {
|
||||||
public void setDefaultDesktop(String pkg) throws RemoteException {
|
// String pkg = Settings.Global.getString(getContentResolver(), ForegroundAppUtil.TOPAPP_KEY);
|
||||||
Log.e(TAG, "setDefaultDesktop: " + "pkg = " + pkg);
|
// Log.e(TAG, "getTopAppPackage: " + pkg);
|
||||||
// SPUtils.put(RemoteService.this, "default_launcher", pkg);
|
// return pkg;
|
||||||
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, pkg);
|
// }
|
||||||
JgyUtils.getInstance().setDefaultDesktop(pkg);
|
//
|
||||||
if (PackageNames.DESKTOP.equals(pkg)) {
|
// @Override
|
||||||
// JgyUtils.getInstance().killPackage(PackageNames.DESKTOP);
|
// public boolean SystemPutInt(String name, int value) throws RemoteException {
|
||||||
try {
|
// Log.e(TAG, "SystemPutInt: " + "name = " + name + "\t value = " + value);
|
||||||
new CacheUtils().cleanApplicationUserData(RemoteService.this, PackageNames.DESKTOP);
|
// return Settings.System.putInt(getContentResolver(), name, value);
|
||||||
new CacheUtils().cleanApplicationUserData(RemoteService.this, PackageNames.APPSTORE);
|
// }
|
||||||
new CacheUtils().cleanApplicationUserData(RemoteService.this, "com.aoleyunos.dop2");
|
//
|
||||||
} catch (Exception e) {
|
// @Override
|
||||||
Log.e(TAG, "onReceive: " + e.getMessage());
|
// public void setDefaultDesktop(String pkg) throws RemoteException {
|
||||||
e.printStackTrace();
|
// Log.e(TAG, "setDefaultDesktop: " + "pkg = " + pkg);
|
||||||
}
|
//// SPUtils.put(RemoteService.this, "default_launcher", pkg);
|
||||||
JgyUtils.getInstance().killPackage("com.aoleyunos.dop2");
|
// mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, pkg);
|
||||||
}
|
// JgyUtils.getInstance().setDefaultDesktop(pkg);
|
||||||
|
// if (PackageNames.DESKTOP.equals(pkg)) {
|
||||||
}
|
//// JgyUtils.getInstance().killPackage(PackageNames.DESKTOP);
|
||||||
|
// try {
|
||||||
@Override
|
// new CacheUtils().cleanApplicationUserData(RemoteService.this, PackageNames.DESKTOP);
|
||||||
public List<String> getDisableApp() throws RemoteException {
|
// new CacheUtils().cleanApplicationUserData(RemoteService.this, PackageNames.APPSTORE);
|
||||||
String disable_app_list = Settings.Global.getString(getContentResolver(), CommonConfig.AOLE_ACTION_DISABLE_APP);
|
// new CacheUtils().cleanApplicationUserData(RemoteService.this, "com.aoleyunos.dop2");
|
||||||
Log.e(TAG, "getDisableApp: " + disable_app_list);
|
// } catch (Exception e) {
|
||||||
if (TextUtils.isEmpty(disable_app_list)) {
|
// Log.e(TAG, "onReceive: " + e.getMessage());
|
||||||
return new ArrayList<>();
|
// e.printStackTrace();
|
||||||
} else {
|
// }
|
||||||
return new ArrayList<>(Arrays.asList(disable_app_list.split(",")));
|
// 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(",")));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2912,7 +2912,7 @@ public class JgyUtils {
|
|||||||
// jsonObject.addProperty("wifi_status", Utils.obtainWifiInfo(mContext));
|
// jsonObject.addProperty("wifi_status", Utils.obtainWifiInfo(mContext));
|
||||||
jsonObject.addProperty("PN_ip", mMMKV.decodeString(NetInterfaceManager.PublicIP, ""));
|
jsonObject.addProperty("PN_ip", mMMKV.decodeString(NetInterfaceManager.PublicIP, ""));
|
||||||
jsonObject.addProperty("LAN_ip", Utils.getIPAddress(mContext));
|
jsonObject.addProperty("LAN_ip", Utils.getIPAddress(mContext));
|
||||||
jsonObject.addProperty("bluetooth", Utils.getBluetoothList());
|
jsonObject.addProperty("bluetooth", Utils.getBluetoothList(mContext));
|
||||||
jsonObject.addProperty("wifi_name", Utils.getWifiAlias(mContext));
|
jsonObject.addProperty("wifi_name", Utils.getWifiAlias(mContext));
|
||||||
jsonObject.addProperty("platform", JgyUtils.getInstance().getAppPlatform());
|
jsonObject.addProperty("platform", JgyUtils.getInstance().getAppPlatform());
|
||||||
return jsonObject.toString();
|
return jsonObject.toString();
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import android.annotation.SuppressLint;
|
|||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
import android.bluetooth.BluetoothAdapter;
|
import android.bluetooth.BluetoothAdapter;
|
||||||
import android.bluetooth.BluetoothDevice;
|
import android.bluetooth.BluetoothDevice;
|
||||||
|
import android.bluetooth.BluetoothManager;
|
||||||
|
import android.bluetooth.BluetoothProfile;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -806,7 +808,7 @@ public class Utils {
|
|||||||
// if (NOSN.equalsIgnoreCase(getSn())) {
|
// if (NOSN.equalsIgnoreCase(getSn())) {
|
||||||
// return getIMEI(context);
|
// return getIMEI(context);
|
||||||
// } else {
|
// } else {
|
||||||
return getSn();
|
return getSn();
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1940,13 +1942,24 @@ public class Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static String getBluetoothList() {
|
public static String getBluetoothList(Context context) {
|
||||||
|
BluetoothManager bluetoothManager = (BluetoothManager) context.getSystemService(Context.BLUETOOTH_SERVICE);
|
||||||
|
// 获取所有通过 GATT 连接的设备(适用于低功耗蓝牙 BLE)
|
||||||
|
List<BluetoothDevice> connectedDevices = bluetoothManager.getConnectedDevices(BluetoothProfile.GATT);
|
||||||
|
|
||||||
|
for (BluetoothDevice device : connectedDevices) {
|
||||||
|
String deviceName = device.getName(); // 获取设备名称
|
||||||
|
String deviceAddress = device.getAddress(); // 获取 MAC 地址
|
||||||
|
Log.e("getBluetoothList", "已连接设备: " + deviceName + "(" + deviceAddress + ")");
|
||||||
|
}
|
||||||
|
|
||||||
BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
|
BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
|
||||||
if (bluetoothAdapter == null) {
|
if (bluetoothAdapter == null) {
|
||||||
return "没有蓝牙设备";
|
return "没有蓝牙设备";
|
||||||
} else {
|
} else {
|
||||||
if (!bluetoothAdapter.isEnabled())//判断蓝牙设备是否已开起
|
Log.e(TAG, "getBluetoothList: getName = " + bluetoothAdapter.getName());
|
||||||
{
|
//判断蓝牙设备是否已开起
|
||||||
|
if (!bluetoothAdapter.isEnabled()) {
|
||||||
return "蓝牙未开启";
|
return "蓝牙未开启";
|
||||||
// //开起蓝牙设备
|
// //开起蓝牙设备
|
||||||
// Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
|
// Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
|
||||||
@@ -1956,9 +1969,12 @@ public class Utils {
|
|||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
for (Iterator<BluetoothDevice> iterator = devices.iterator(); iterator.hasNext(); ) {
|
for (Iterator<BluetoothDevice> iterator = devices.iterator(); iterator.hasNext(); ) {
|
||||||
BluetoothDevice device = iterator.next();
|
BluetoothDevice device = iterator.next();
|
||||||
stringBuilder.append(device.getAlias()).append(";");
|
if (device.isConnected()) {
|
||||||
|
stringBuilder.append(device.getAlias()).append(";");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Log.e(TAG, "getBluetoothList: " + stringBuilder.toString());
|
Log.e(TAG, "getConnectedBluetoothList: " + stringBuilder.toString());
|
||||||
|
|
||||||
return stringBuilder.toString();
|
return stringBuilder.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,13 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
// mavenCentral()
|
||||||
maven { url "https://jitpack.io" }
|
maven { url "https://jitpack.io" }
|
||||||
maven { url 'https://developer.huawei.com/repo/' }
|
maven { url 'https://developer.huawei.com/repo/' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/central/' }
|
maven { url 'https://maven.aliyun.com/repository/central' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/public/' }
|
maven { url "https://maven.aliyun.com/repository/jcenter" }
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.6.4'
|
classpath 'com.android.tools.build:gradle:3.6.4'
|
||||||
|
|||||||
Reference in New Issue
Block a user