百度手机卫士 v8.8.0版本的 MD5 值为:a85894a6923c8a39f0c3a3a686ad7443
以下内容为反编译后的 fzp.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 fzp {
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) {
avn c = avo.a(context).c(str);
return c == null ? j : c.m();
}
public static String a(Context context, String str) {
avn c;
if (str == null || (c = avo.a(context).c(str)) == null) {
return null;
}
return c.g() + " | " + c.h();
}
private static Intent c(Context context, String str) {
PackageManager a2 = ibk.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) {
aym.c("PermissionUtils", "startActivity e:" + e);
}
return -1;
} catch (SecurityException e2) {
if (a) {
aym.c("PermissionUtils", "startActivity e:" + e2);
}
return -2;
} catch (Exception e3) {
if (a) {
aym.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_0x000016a0));
intent.putExtra("extra.has_anim", true);
int a2 = a(context, intent);
if (a2 != 1) {
if (a) {
aym.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) {
aym.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) {
aym.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) {
aym.c("PermissionUtils", "showGuideDialog-activity is null");
}
return null;
}
if (2 == i) {
return b(activity);
}
hug hugVar = new hug(activity);
hugVar.setTitle(R.string.app_name);
hugVar.setContentView(activity.getLayoutInflater().inflate(R.layout.jadx_deobf_0x00000a30, (ViewGroup) null));
TextView textView = (TextView) hugVar.findViewById(R.id.jadx_deobf_0x0000198c);
if (1 == i) {
if (str == null || str2 == null) {
textView.setText(cma.a(activity.getString(R.string.jadx_deobf_0x00001e8d), activity.getString(R.string.jadx_deobf_0x00001e8c)));
} else {
textView.setText(Html.fromHtml(String.format(String.format(activity.getString(R.string.jadx_deobf_0x00001e8b), str, str2), str, str2)));
}
hugVar.a(R.string.jadx_deobf_0x00001e89, new fzq(activity, i, hugVar));
hugVar.c(R.string.jadx_deobf_0x00001e88, new fzr(i, activity, hugVar));
hugVar.setOnKeyListener(new fzs(i, activity, hugVar));
hugVar.show();
if (1 == i) {
clz.J(activity);
}
return hugVar;
}
if (a) {
aym.c("PermissionUtils", "showGuideDialog-permission type is not correct :" + i);
}
c(activity);
return null;
}
private static Dialog b(Activity activity) {
ewf ewfVar = new ewf(activity);
ewfVar.setTitle(R.string.jadx_deobf_0x00002932);
ewfVar.a(R.drawable.jadx_deobf_0x000005a8, R.dimen.jadx_deobf_0x00000c6c, R.dimen.jadx_deobf_0x00000c69);
View inflate = activity.getLayoutInflater().inflate(R.layout.jadx_deobf_0x00000a30, (ViewGroup) null);
((TextView) inflate.findViewById(R.id.jadx_deobf_0x0000198c)).setText(activity.getString(R.string.jadx_deobf_0x00001e8f));
((TextView) inflate.findViewById(R.id.jadx_deobf_0x0000198e)).setText(activity.getString(R.string.jadx_deobf_0x00001e8e));
((ImageView) inflate.findViewById(R.id.jadx_deobf_0x0000198d)).setImageResource(R.drawable.jadx_deobf_0x00000689);
ewfVar.setContentView(inflate);
ewfVar.a(R.string.jadx_deobf_0x00001e89, new fzt(activity, ewfVar));
ewfVar.b(R.string.jadx_deobf_0x00001e88, new fzu(activity, ewfVar));
ewfVar.setOnKeyListener(new fzv(activity));
ewfVar.show();
clz.M(activity);
return ewfVar;
}
public static void c(Activity activity) {
if (activity != null) {
String shortClassName = activity.getComponentName().getShortClassName();
if (shortClassName.contains("PermissionGuideActivity")) {
activity.finish();
}
if (a) {
aym.a("PermissionUtils", "finishPermissionGuideActivity-activity name:" + shortClassName);
}
}
}
}