工作空间 v3.7.4.6版本的 MD5 值为:94c1c0052e9f2e949ae1349e6caf437b
以下内容为反编译后的 DiagnosisUtils.java 源代码,内容仅作参考
package com.uusafe.commbase.utils;
import android.content.Context;
import android.text.TextUtils;
import com.uusafe.base.modulesdk.module.SandboxSdkModule;
import com.uusafe.base.modulesdk.module.global.CommGlobal;
import com.uusafe.base.modulesdk.module.global.MosConstants;
import com.uusafe.base.modulesdk.module.manager.BaseModuleManager;
import com.uusafe.base.modulesdk.module.netapi.BaseApis;
import com.uusafe.commbase.global.BaseGlobal;
import com.uusafe.common.device.env.AppEnv;
import com.uusafe.common.device.env.DevEnv;
import com.uusafe.mbs.commsdk.R;
import com.uusafe.sandbox.controller.Protocol;
import com.uusafe.utils.common.DeviceUtils;
import com.uusafe.utils.common.PreferenceUtils;
import com.uusafe.utils.common.RomEnvUtil;
import com.uusafe.utils.common.StringUtils;
import com.zhizhangyi.mbs.buildsetting.BuildSetting;
import com.zhizhangyi.platform.mbsframe.MbsComponent;
import java.util.regex.Pattern;
import org.json.JSONException;
import org.json.JSONObject;
public class DiagnosisUtils {
public static boolean checkContainDigit(String str) {
int i = 0;
for (char c2 : str.toCharArray()) {
if (Character.isDigit(c2)) {
i++;
}
}
return i >= 1;
}
public static boolean checkContainLowerCase(String str) {
int i = 0;
for (char c2 : str.toCharArray()) {
if (Character.isLowerCase(c2)) {
i++;
}
}
return i >= 1;
}
public static boolean checkContainUpperCase(String str) {
int i = 0;
for (char c2 : str.toCharArray()) {
if (Character.isUpperCase(c2)) {
i++;
}
}
return i >= 1;
}
public static String getConfigInfo(Context context) {
StringBuilder sb = new StringBuilder();
sb.append("---------------客户端配置信息---------------");
sb.append("\n");
String baseUrl = BaseApis.getBaseUrl();
sb.append("MBS服务器: ");
sb.append(baseUrl);
sb.append("\n");
String loginName = PreferenceUtils.getLoginName(context, BaseGlobal.getMosKey());
sb.append("用户名: ");
sb.append(loginName);
sb.append("\n");
long userId = PreferenceUtils.getUserId(context);
sb.append("用户标识: ");
sb.append(userId);
sb.append("\n");
String loginPassword = PreferenceUtils.getLoginPassword(context, BaseGlobal.getMosKey());
sb.append("密码: ");
sb.append(loginPassword);
sb.append("\n");
String companyCode = PreferenceUtils.getCompanyCode(context, BaseGlobal.getMosKey());
sb.append("企业标识: ");
sb.append(companyCode);
sb.append("\n");
String token = PreferenceUtils.getToken(context, BaseGlobal.getMosKey());
sb.append("Token: ");
sb.append(token);
sb.append("\n");
int adStatus = PreferenceUtils.getAdStatus(context);
sb.append("是否为AD用户: ");
sb.append(adStatus == 0 ? "是" : "否");
sb.append("\n");
boolean isMdm = PreferenceUtils.isMdm(context);
sb.append("设备: ");
sb.append(isMdm ? "管控设备" : "办公设备");
sb.append("\n");
int loginReqType = PreferenceUtils.getLoginReqType(context);
sb.append("登录类型: ");
sb.append(loginReqType);
sb.append("\n");
int emmLoginStatus = PreferenceUtils.getEmmLoginStatus(context);
sb.append("EMM登录状态: ");
sb.append(emmLoginStatus);
sb.append("\n");
sb.append("moskey: ");
sb.append(CommGlobal.getMosKey());
sb.append("\n");
int viewModel = CommGlobal.enableCloudPhoneLoading ? 0 : PreferenceUtils.getViewModel(context);
sb.append("客户端展示模型: ");
sb.append(viewModel == 0 ? "桌面模式" : "门户模式");
sb.append("\n");
String modules = PreferenceUtils.getModules(context, BaseGlobal.getMosKey());
sb.append("功能模块: ");
sb.append(modules);
sb.append("\n");
sb.append("推送长连接URL: ");
sb.append(BaseApis.getBaseUrl() + BaseApis.PUSH_LONG_LINK_URL);
sb.append("\n");
sb.append("推送短连接URL: ");
sb.append(BaseApis.getBaseUrl() + BaseApis.PUSH_SHORT_LINK_URL);
sb.append("\n");
sb.append("推送日志上报URL: ");
sb.append(BaseApis.getBaseUrl() + BaseApis.PUSH_REPORT_URL);
sb.append("\n");
String romInfo = RomEnvUtil.getRomInfo();
sb.append("系统推送类型: ");
sb.append(romInfo.equalsIgnoreCase(RomEnvUtil.EMUI) ? "华为推送" : "小米推送");
sb.append("\n");
String pushToken = PreferenceUtils.getPushToken(context, BaseGlobal.getMosKey());
sb.append("系统推送token: ");
sb.append(pushToken);
sb.append("\n");
long sessionItemId = PreferenceUtils.getSessionItemId(context);
sb.append("SocketIo推送session: ");
sb.append(sessionItemId);
sb.append("\n");
boolean equals = "true".equals(BuildSetting.getString(AppEnv.getContext(), R.string.mbs_config_component_securehttp_enable));
sb.append("双向加密状态: ");
sb.append(equals ? "开启" : "关闭");
sb.append("\n");
sb.append("双向加密: ");
sb.append(BuildSetting.getString(AppEnv.getContext(), R.string.mbs_config_component_securehttp_key));
sb.append("\n");
return sb.toString();
}
public static String getDevicesBasicInfo(Context context) {
StringBuilder sb = new StringBuilder();
sb.append("---------------设备信息---------------");
sb.append("\n");
String brand = DeviceUtils.getBrand();
sb.append("品牌: ");
sb.append(brand);
sb.append("\n");
String deviceModel = DeviceUtils.getDeviceModel();
sb.append("型号: ");
sb.append(deviceModel);
sb.append("\n");
String osVersion = DeviceUtils.getOsVersion();
sb.append("操作系统版本: ");
sb.append(osVersion);
sb.append("\n");
boolean isDeviceRooted = DeviceUtils.isDeviceRooted();
sb.append("是否破解: ");
sb.append(isDeviceRooted ? "已经破解" : "未破解");
sb.append("\n");
String packageName = CommGlobal.getPackageName(context);
sb.append("包名: ");
sb.append(packageName);
sb.append("\n");
String zid = DevEnv.Hardware.getZID(CommGlobal.getContext());
sb.append("SecurityId: ");
sb.append(zid);
sb.append("\n");
String deviceUniqueId = DeviceUtils.getDeviceUniqueId(context);
sb.append("OldSecurityId: ");
sb.append(deviceUniqueId);
sb.append("\n");
String deviceMac = DeviceUtils.getDeviceMac(context);
sb.append("wifi地址: ");
sb.append(deviceMac);
sb.append("\n");
String bTMacAddress = DeviceUtils.getBTMacAddress(context);
sb.append("蓝牙地址: ");
sb.append(bTMacAddress);
sb.append("\n");
sb.append("沙箱渠道号: ");
sb.append(CommGlobal.mbsClientId);
sb.append("\n");
if (StringUtils.areNotEmpty(BaseGlobal.SdpVersion)) {
sb.append("SDP版本号: ");
sb.append(BaseGlobal.SdpVersion);
sb.append("\n");
}
return sb.toString();
}
public static String getDiagnosisInfo(Context context, boolean z) {
if (z) {
return getVersionInfo(context, z) + "\n" + getConfigInfo(context);
}
return getDevicesBasicInfo(context) + "\n" + getVersionInfo(context, z) + "\n" + getConfigInfo(context) + "\n" + getSecMailInnerConfig(context) + "\n" + getWrappingAppConfig(context);
}
public static String getMbsAppConfig(Context context) {
return "---------------MBS自身Dlp策略---------------\n" + BaseModuleManager.getInstance().getSandboxSdkModule().getConfigPushApp(MosConstants.MAIL_PKG, MosConstants.SECMAIL_POLICY) + "\n";
}
public static String getSecMailInnerConfig(Context context) {
return "---------------安全邮件服务器配置信息---------------\n" + BaseModuleManager.getInstance().getSandboxSdkModule().getConfigPushApp(MosConstants.MAIL_PKG, MosConstants.SECMAIL_POLICY) + "\n";
}
public static String getVersionInfo(Context context, boolean z) {
StringBuilder sb = new StringBuilder();
sb.append("---------------MBS版本信息---------------");
sb.append("\n");
sb.append(String.format("MBS %s %s", "3.7.4.6", 2061490498));
sb.append("\n");
sb.append(String.format("MBS Base %s %s %s %s %s %s", "3.7.4", "23314", "20231206145900", "mbs-android-3.7.4", "a196f8a", "2023-12-05 17:40:38 +0800"));
sb.append("\n");
if (!z) {
sb.append(String.format("Sandbox %s", BaseGlobal.getInstance().getSandboxVersion()));
sb.append("\n");
}
if (!z) {
sb.append(String.format("MAG SDK %s", BaseGlobal.getInstance().getGatewayVersion()));
sb.append("\n");
}
if (BaseModuleManager.getInstance().getEmmModule() != null) {
sb.append(String.format("EMM SDK %s %s %s %s", BaseModuleManager.getInstance().getEmmModule().getVersion(), BaseModuleManager.getInstance().getEmmModule().getBuildConfig(), BaseModuleManager.getInstance().getEmmModule().getBuildTime(), BaseModuleManager.getInstance().getEmmModule().getBuildSerial()));
sb.append("\n");
}
try {
sb.append(String.format("MMBA-VSS %s", MbsComponent.parse("com.zhizhangyi.emm.sdk", "plugin-oaudit-vss").getVersion()));
sb.append("\n");
} catch (Throwable unused) {
sb.append(String.format("MMBA-VSS %s", "不支持审计VSS功能"));
sb.append("\n");
}
try {
sb.append(String.format("VSS-ENGINE %s", BaseModuleManager.getInstance().getSandboxSdkModule().getApopVersion().getString(Protocol.Client2Ctrl.BUNDLE_KEY_APP_PACK_ENGINE_VERSION)));
sb.append("\n");
} catch (Throwable unused2) {
sb.append(String.format("MMBA-VSS %s", "不支持VSS引擎"));
sb.append("\n");
}
if (!TextUtils.isEmpty("23314") && !TextUtils.isEmpty("a196f8a")) {
sb.append(String.format("BuildInfo %s-%s\n%s", "23314", "a196f8a", !TextUtils.isEmpty("BAA6A6A2E8FDFDB8B9A1E7E7FCA8BABBA8BAB3BCB5ABBBFCB1BDBFE8EAE2EAE2FDB8BDB0FD93BCB6A0BDBBB68D9FB0A18D91A7A1A6BDBFFDE0E1E1E3E6FD") ? CommGlobal.decryptAndHexStr2Byte("BAA6A6A2E8FDFDB8B9A1E7E7FCA8BABBA8BAB3BCB5ABBBFCB1BDBFE8EAE2EAE2FDB8BDB0FD93BCB6A0BDBBB68D9FB0A18D91A7A1A6BDBFFDE0E1E1E3E6FD") : ""));
sb.append("\n");
}
return sb.toString();
}
public static String getWrappingAppConfig(Context context) {
StringBuilder sb = new StringBuilder();
if (BaseModuleManager.getInstance().getSandboxSdkModule() != null) {
SandboxSdkModule sandboxSdkModule = BaseModuleManager.getInstance().getSandboxSdkModule();
for (String str : CommPackageUtils.getAllSandboxApps()) {
sb.append("---");
sb.append(str);
sb.append("应用Dlp策略---");
sb.append("\n");
String sandboxPermission = sandboxSdkModule.getSandboxPermission(str);
if (sandboxPermission == null) {
sb.append("无Dlp策略");
sb.append("\n");
} else {
try {
BaseGlobal.getInstance();
sb.append(BaseGlobal.getPerFormatString(new JSONObject(sandboxPermission)));
sb.append("\n");
} catch (JSONException e2) {
e2.printStackTrace();
}
sb.append(sandboxPermission);
sb.append("\n");
}
}
}
return sb.toString();
}
public static boolean isStartWithNumber(String str) {
Pattern compile = Pattern.compile("[0-9]*");
StringBuilder sb = new StringBuilder();
sb.append(str.charAt(0));
sb.append("");
return compile.matcher(sb.toString()).matches();
}
}