工作空间 v3.6.5.2版本的 MD5 值为:58e65af156c65a63bf64ed2e64960853
以下内容为反编译后的 CommUtils.java 源代码,内容仅作参考
package com.uusafe.commbase.utils;
import android.content.Context;
import android.text.TextUtils;
import com.uusafe.common.device.env.impl.ImplCache;
import com.uusafe.mbs.base.R;
import com.uusafe.utils.common.ZZLog;
import com.zhizhangyi.platform.common.reflect.ReflectUtils;
import com.zhizhangyi.platform.network.download.internal.Constants;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
public class CommUtils {
static final String[] image = {"bmp", "jpg", "jpeg", "png", "tiff", "gif", "pcx", "tga", "exif", "fpx", "svg", "psd", "cdr", "pcd", "dxf", "ufo", "eps", "ai", "raw", "wmf", "ico", "icon"};
static final String[] video = {"mp4", "avi", "mov", "wmv", "asf", "navi", "3gp", "mkv", "f4v", "rmvb", "webm"};
static final String[] music = {"mp3", "wma", "wav", "mod", "ra", "cd", ImplCache.KEY_OS_MODEL, "asf", "aac", "vqf", "ape", "mid", "ogg", "m4a", "vqf"};
private static final String[] IMAGES = {"bmp", "jpg", "jpeg", "png", "tiff", "gif", "pcx", "tga", "exif", "fpx", "svg", "psd", "cdr", "pcd", "dxf", "ufo", "eps", "ai", "raw", "wmf"};
private static final String[] VIDEOS = {"mp4", "avi", "mov", "wmv", "asf", "navi", "3gp", "mkv", "f4v", "rmvb", "webm"};
private static final String[] AUDIOS = {"mp3", "wma", "wav", "mod", "ra", "cd", ImplCache.KEY_OS_MODEL, "asf", "aac", "vqf", "ape", "mid", "ogg", "m4a", "vqf"};
public static int getFileIconRes(String str) {
String[] strArr;
if (TextUtils.isEmpty(str)) {
return R.drawable.uu_ic_file_unknown;
}
String trim = str.trim();
if (!trim.endsWith(".doc") && !trim.endsWith(".docx")) {
if (!trim.endsWith(".xls") && !trim.endsWith(".xlsx")) {
if (!trim.endsWith(".htm") && !trim.endsWith(Constants.DEFAULT_DL_HTML_EXTENSION)) {
if (trim.endsWith(".pdf")) {
return R.drawable.uu_ic_file_pdf;
}
if (!trim.endsWith(".ppt") && !trim.endsWith(".pptx")) {
if (trim.endsWith(Constants.DEFAULT_DL_TEXT_EXTENSION)) {
return R.drawable.uu_ic_file_txt;
}
if (!trim.endsWith(com.uusafe.emm.android.Constants.ZIP_SUFFIX) && !trim.endsWith(".rar")) {
for (String str2 : IMAGES) {
if (trim.endsWith("." + str2)) {
return R.drawable.uu_ic_file_image;
}
}
for (String str3 : VIDEOS) {
if (trim.endsWith("." + str3)) {
return R.drawable.uu_ic_file_video;
}
}
for (String str4 : AUDIOS) {
if (trim.endsWith("." + str4)) {
return R.drawable.uu_ic_file_audio;
}
}
return R.drawable.uu_ic_file_unknown;
}
return R.drawable.uu_ic_file_zip;
}
return R.drawable.uu_ic_file_ppt;
}
return R.drawable.uu_ic_file_html;
}
return R.drawable.uu_ic_file_excel;
}
return R.drawable.uu_ic_file_doc;
}
public static int getFileResourceByName(String str) {
String lowerCase = str.toLowerCase();
if (!lowerCase.endsWith(".doc") && !lowerCase.endsWith(".docx")) {
if (!lowerCase.endsWith(".xls") && !lowerCase.endsWith(".xlsx")) {
if (!lowerCase.endsWith(".htm") && !lowerCase.endsWith(Constants.DEFAULT_DL_HTML_EXTENSION)) {
if (lowerCase.endsWith(".pdf")) {
return R.drawable.uu_ic_icon_file_pdf;
}
if (!lowerCase.endsWith(".ppt") && !lowerCase.endsWith(".pptx")) {
if (lowerCase.endsWith(Constants.DEFAULT_DL_TEXT_EXTENSION)) {
return R.drawable.uu_ic_icon_file_txt;
}
if (lowerCase.endsWith(".wps")) {
return R.drawable.uu_ic_icon_file_wps;
}
if (!lowerCase.endsWith(com.uusafe.emm.android.Constants.ZIP_SUFFIX) && !lowerCase.endsWith(".rar")) {
for (int i = 0; i < image.length; i++) {
if (lowerCase.endsWith("." + image[i])) {
return R.drawable.uu_ic_icon_file_image;
}
}
for (int i2 = 0; i2 < video.length; i2++) {
if (lowerCase.endsWith("." + video[i2])) {
return R.drawable.uu_ic_icon_file_video;
}
}
for (int i3 = 0; i3 < music.length; i3++) {
if (lowerCase.endsWith("." + music[i3])) {
return R.drawable.uu_ic_icon_file_mp3;
}
}
return R.drawable.uu_ic_icon_file_none;
}
return R.drawable.uu_ic_icon_file_zip;
}
return R.drawable.uu_ic_icon_file_ppt;
}
return R.drawable.uu_ic_icon_file_html;
}
return R.drawable.uu_ic_icon_file_excel;
}
return R.drawable.uu_ic_icon_file_doc;
}
public static void loadHWConfig(Context context) {
try {
ZZLog.i("MbsApplicationModuleImpl", "loadHWConfig=", new Object[0]);
ArrayList arrayList = new ArrayList();
arrayList.add("https://grs.dbankcloud.com");
arrayList.add("https://grs.dbankcloud.cn");
arrayList.add("https://grs.dbankcloud.eu");
arrayList.add("https://grs.dbankcloud.asia");
Object callConstructor = ReflectUtils.callConstructor(Class.forName("com.huawei.hms.framework.network.grs.b.b.c"), new Object[0]);
ReflectUtils.invokeObjectMethod(callConstructor, "a", null, new Class[]{List.class}, arrayList);
ReflectUtils.invokeObjectMethod(callConstructor, "a", null, new Class[]{String.class}, "/grs/1.0/%1$s/router");
ReflectUtils.invokeObjectMethod(callConstructor, "a", null, new Class[]{Integer.TYPE}, 2);
Field declaredField = Class.forName("com.huawei.hms.framework.network.grs.b.a.a").getDeclaredField("f2480b");
declaredField.setAccessible(true);
declaredField.set(null, callConstructor);
} catch (Throwable th) {
ZZLog.i("MbsApplicationModuleImpl", "loadHWConfig Throwable=" + th.getMessage(), new Object[0]);
th.printStackTrace();
}
}
}