百度手机卫士 v8.6.2版本的 MD5 值为:fa60cb367e40201705a2d9f9ce2cbfdf
以下内容为反编译后的 fxy.java 源代码,内容仅作参考
package dxoptimizer;
import android.app.Activity;
import android.app.Dialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Build;
import android.text.Html;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import cn.opda.a.phonoalbumshoushou.R;
import com.dianxinos.optimizer.web.WebBrowserActivity;
import com.quickbird.sdk.internal.HttpsClient;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
public class fxy {
private static boolean a = false;
public static boolean a() {
return "HUAWEI".equalsIgnoreCase(Build.MANUFACTURER);
}
public static boolean b() {
return "Xiaomi".equalsIgnoreCase(Build.MANUFACTURER);
}
public static long a(Context context, String str, long j) {
avi c = avj.a(context).c(str);
return c == null ? j : c.m();
}
public static String a(Context context, String str) {
avi c;
if (str == null || (c = avj.a(context).c(str)) == null) {
return null;
}
return c.g() + " | " + c.h();
}
private static Intent c(Context context, String str) {
PackageManager a2 = hxq.a(context);
if (a2 == null) {
return null;
}
return a2.getLaunchIntentForPackage(str);
}
public static int b(Context context, String str) {
Intent c = c(context, str);
if (c == null) {
return 0;
}
return a(context, c);
}
public static int a(Context context, Intent intent) {
if (intent == null) {
return 0;
}
try {
context.startActivity(intent);
return 1;
} catch (ActivityNotFoundException e) {
if (a) {
ayl.c("PermissionUtils", "startActivity e:" + e);
}
return -1;
} catch (SecurityException e2) {
if (a) {
ayl.c("PermissionUtils", "startActivity e:" + e2);
}
return -2;
} catch (Exception e3) {
if (a) {
ayl.c("PermissionUtils", "startActivity e:" + e3);
}
return -3;
}
}
public static boolean a(Context context) {
Intent intent = new Intent(context, (Class<?>) WebBrowserActivity.class);
intent.setFlags(268435456);
intent.putExtra("extra_url", "https://mshoujiweishi.baidu.com/appfaq/inbox");
intent.putExtra("extra_title", context.getResources().getString(R.string.jadx_deobf_0x00001638));
intent.putExtra("extra.has_anim", true);
int a2 = a(context, intent);
if (a2 != 1) {
if (a) {
ayl.c("PermissionUtils", "Start Sms Guide URL fail, Flag:" + a2);
}
return false;
}
if (!(context instanceof Activity)) {
return true;
}
((Activity) context).overridePendingTransition(R.anim.dx_enter_anim, R.anim.dx_exit_anim);
return true;
}
public static boolean b(Context context) {
Intent intent = new Intent(context, (Class<?>) WebBrowserActivity.class);
intent.putExtra("extra_url", a("https://mshoujiweishi.baidu.com/appfaq/floatwindow"));
intent.putExtra("extra.has_anim", true);
int a2 = a(context, intent);
if (a2 != 1) {
if (a) {
ayl.c("PermissionUtils", "Start float win Guide URL fail, Flag:" + a2);
}
return false;
}
if (!(context instanceof Activity)) {
return true;
}
((Activity) context).overridePendingTransition(R.anim.dx_enter_anim, R.anim.dx_exit_anim);
return true;
}
private static String a(String str) {
StringBuilder sb = new StringBuilder(str);
sb.append('?');
try {
sb.append("&vendor=").append(URLEncoder.encode(Build.MANUFACTURER, HttpsClient.HTTP_CHARSET));
sb.append("&model=").append(URLEncoder.encode(Build.MODEL, HttpsClient.HTTP_CHARSET));
} catch (UnsupportedEncodingException e) {
if (a) {
e.printStackTrace();
}
}
sb.append("&osversion=").append(Build.VERSION.SDK_INT);
if (a) {
ayl.a("PermissionUtils", "faq guide url: " + sb.toString());
}
return sb.toString();
}
public static Dialog a(Activity activity, int i) {
return a(activity, i, null, null);
}
public static Dialog a(Activity activity, int i, String str, String str2) {
if (activity == null) {
if (a) {
ayl.c("PermissionUtils", "showGuideDialog-activity is null");
}
return null;
}
if (2 == i) {
return b(activity);
}
hqu hquVar = new hqu(activity);
hquVar.setTitle(R.string.app_name);
hquVar.setContentView(activity.getLayoutInflater().inflate(R.layout.jadx_deobf_0x00000a19, (ViewGroup) null));
TextView textView = (TextView) hquVar.findViewById(R.id.jadx_deobf_0x00001951);
if (1 == i) {
if (str == null || str2 == null) {
textView.setText(cku.a(activity.getString(R.string.jadx_deobf_0x00001e58), activity.getString(R.string.jadx_deobf_0x00001e57)));
} else {
textView.setText(Html.fromHtml(String.format(String.format(activity.getString(R.string.jadx_deobf_0x00001e56), str, str2), str, str2)));
}
hquVar.a(R.string.jadx_deobf_0x00001e54, new fxz(activity, i, hquVar));
hquVar.c(R.string.jadx_deobf_0x00001e53, new fya(i, activity, hquVar));
hquVar.setOnKeyListener(new fyb(i, activity, hquVar));
hquVar.show();
if (1 == i) {
ckt.K(activity);
}
return hquVar;
}
if (a) {
ayl.c("PermissionUtils", "showGuideDialog-permission type is not correct :" + i);
}
c(activity);
return null;
}
private static Dialog b(Activity activity) {
eup eupVar = new eup(activity);
eupVar.setTitle(R.string.jadx_deobf_0x000028bb);
eupVar.a(R.drawable.jadx_deobf_0x000005a6, R.dimen.jadx_deobf_0x00000c4e, R.dimen.jadx_deobf_0x00000c4b);
View inflate = activity.getLayoutInflater().inflate(R.layout.jadx_deobf_0x00000a19, (ViewGroup) null);
((TextView) inflate.findViewById(R.id.jadx_deobf_0x00001951)).setText(activity.getString(R.string.jadx_deobf_0x00001e5a));
((TextView) inflate.findViewById(R.id.jadx_deobf_0x00001953)).setText(activity.getString(R.string.jadx_deobf_0x00001e59));
((ImageView) inflate.findViewById(R.id.jadx_deobf_0x00001952)).setImageResource(R.drawable.jadx_deobf_0x00000680);
eupVar.setContentView(inflate);
eupVar.a(R.string.jadx_deobf_0x00001e54, new fyc(activity, eupVar));
eupVar.b(R.string.jadx_deobf_0x00001e53, new fyd(activity, eupVar));
eupVar.setOnKeyListener(new fye(activity));
eupVar.show();
ckt.N(activity);
return eupVar;
}
public static void c(Activity activity) {
if (activity != null) {
String shortClassName = activity.getComponentName().getShortClassName();
if (shortClassName.contains("PermissionGuideActivity")) {
activity.finish();
}
if (a) {
ayl.a("PermissionUtils", "finishPermissionGuideActivity-activity name:" + shortClassName);
}
}
}
}