新浪彩票 v0.96.37版本的 MD5 值为:0c7ddce345383506e2959f5d75bdceab
以下内容为反编译后的 l.java 源代码,内容仅作参考
package com.netease.nrtc.utility;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.os.PowerManager;
import com.android.internal.http.multipart.Part;
import com.netease.yunxin.base.trace.Trace;
import com.netease.yunxin.base.utils.Checker;
import com.netease.yunxin.base.utils.Compatibility;
import com.netease.yunxin.base.utils.StringUtils;
import com.netease.yunxin.base.utils.SystemPermissionUtils;
import java.io.File;
import java.util.List;
import java.util.Locale;
public class l {
public static boolean a() {
return false;
}
public static boolean a(Context context) {
Checker.checkNotNull(context);
return (context.getApplicationInfo().flags & 2) != 0;
}
public static boolean b(Context context) {
Checker.checkNotNull(context);
return (context.getApplicationInfo().flags & 1048576) != 0;
}
public static boolean c(Context context) {
return g(context) || h(context);
}
public static String d(Context context) {
File externalFilesDir = context.getExternalFilesDir("log");
if (externalFilesDir == null || -1 == context.getPackageManager().checkPermission("android.permission.WRITE_EXTERNAL_STORAGE", context.getPackageName())) {
externalFilesDir = context.getDir("log", 0);
}
return externalFilesDir.getAbsolutePath();
}
public static void e(Context context) {
Checker.checkNotNull(context);
PowerManager powerManager = (PowerManager) context.getSystemService("power");
if (!Compatibility.runningOnMarshmallowOrHigher() || powerManager == null) {
return;
}
if (!powerManager.isIgnoringBatteryOptimizations(context.getPackageName())) {
Trace.w("NRTC", "app is not on the device's power whitelist, please refer to https://goo.gl/FE5SeB");
} else {
Trace.i("NRTC", "app is on the device's power whitelist");
}
}
public static void f(Context context) {
List<String> checkPermission = SystemPermissionUtils.checkPermission(context);
if (checkPermission.isEmpty()) {
Trace.i("NRTC", "Permission is OK");
return;
}
for (String str : checkPermission) {
if (!StringUtils.isEmpty(str)) {
Trace.e("NRTC", "Permission miss : " + str);
}
}
}
private static boolean g(Context context) {
return context.getPackageName().startsWith("com.netease.nim");
}
private static boolean h(Context context) {
return context.getPackageName().startsWith("com.netease.nrtc");
}
public static String c() {
Intent a = b.a(com.netease.nrtc.engine.impl.a.b, null, new IntentFilter("android.intent.action.BATTERY_CHANGED"));
if (a != null) {
int intExtra = a.getIntExtra("level", -1);
int intExtra2 = a.getIntExtra("scale", -1);
return intExtra2 != -1 ? String.format(Locale.US, "%d %%", Integer.valueOf((intExtra * 100) / intExtra2)) : Part.EXTRA;
}
return Part.EXTRA;
}
public static boolean b() {
boolean d = d();
String str = Build.TAGS;
if ((d || str == null || !str.contains("test-keys")) && !new File("/system/app/Superuser.apk").exists()) {
return !d && new File("/system/xbin/su").exists();
}
return true;
}
private static boolean d() {
String str = Build.MODEL;
if (StringUtils.isNotEmpty(str) && str.toLowerCase().contains("sdk")) {
return true;
}
String str2 = Build.MANUFACTURER;
if (StringUtils.isNotEmpty(str2) && str2.toLowerCase().contains("unknown")) {
return true;
}
String str3 = Build.DEVICE;
return StringUtils.isNotEmpty(str3) && str3.toLowerCase().contains("generic");
}
}