百度手机卫士 v8.1.5版本的 MD5 值为:15af71eae74e2f2b5b9f845fe77a4804
以下内容为反编译后的 fpy.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 com.baidu.sapi2.c.R;
import com.dianxinos.optimizer.web.WebBrowserActivity;
import com.quickbird.sdk.internal.HttpsClient;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
public class fpy {
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) {
ayn c = ayo.a(context).c(str);
return c == null ? j : c.m();
}
public static String a(Context context, String str) {
ayn c;
if (str == null || (c = ayo.a(context).c(str)) == null) {
return null;
}
return c.g() + " | " + c.h();
}
private static Intent c(Context context, String str) {
PackageManager a2 = hly.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) {
bbj.c("PermissionUtils", "startActivity e:" + e);
}
return -1;
} catch (SecurityException e2) {
if (a) {
bbj.c("PermissionUtils", "startActivity e:" + e2);
}
return -2;
} catch (Exception e3) {
if (a) {
bbj.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", "http://m.shoujiweishi.baidu.com/appfaq/inbox");
intent.putExtra("extra_title", context.getResources().getString(R.string.jadx_deobf_0x00001406));
intent.putExtra("extra.has_anim", true);
int a2 = a(context, intent);
if (a2 != 1) {
if (a) {
bbj.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("http://m.shoujiweishi.baidu.com/appfaq/floatwindow"));
intent.putExtra("extra.has_anim", true);
int a2 = a(context, intent);
if (a2 != 1) {
if (a) {
bbj.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) {
bbj.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) {
bbj.c("PermissionUtils", "showGuideDialog-activity is null");
}
return null;
}
if (2 == i) {
return b(activity);
}
hfe hfeVar = new hfe(activity);
hfeVar.setTitle(R.string.app_name);
hfeVar.setContentView(activity.getLayoutInflater().inflate(R.layout.jadx_deobf_0x000008f7, (ViewGroup) null));
TextView textView = (TextView) hfeVar.findViewById(R.id.jadx_deobf_0x000016c8);
if (1 == i) {
if (str == null || str2 == null) {
textView.setText(cnd.a(activity.getString(R.string.jadx_deobf_0x00001bd3), activity.getString(R.string.jadx_deobf_0x00001bd2)));
} else {
textView.setText(Html.fromHtml(String.format(String.format(activity.getString(R.string.jadx_deobf_0x00001bd1), str, str2), str, str2)));
}
hfeVar.a(R.string.jadx_deobf_0x00001bcf, new fpz(activity, i, hfeVar));
hfeVar.c(R.string.jadx_deobf_0x00001bce, new fqa(i, activity, hfeVar));
hfeVar.setOnKeyListener(new fqb(i, activity, hfeVar));
hfeVar.show();
if (1 == i) {
cnc.aw(activity);
}
return hfeVar;
}
if (a) {
bbj.c("PermissionUtils", "showGuideDialog-permission type is not correct :" + i);
}
c(activity);
return null;
}
private static Dialog b(Activity activity) {
epk epkVar = new epk(activity);
epkVar.setTitle(R.string.jadx_deobf_0x000024fe);
epkVar.a(R.drawable.jadx_deobf_0x000004df, R.dimen.jadx_deobf_0x00000b04, R.dimen.jadx_deobf_0x00000b01);
View inflate = activity.getLayoutInflater().inflate(R.layout.jadx_deobf_0x000008f7, (ViewGroup) null);
((TextView) inflate.findViewById(R.id.jadx_deobf_0x000016c8)).setText(activity.getString(R.string.jadx_deobf_0x00001bd5));
((TextView) inflate.findViewById(R.id.jadx_deobf_0x000016ca)).setText(activity.getString(R.string.jadx_deobf_0x00001bd4));
((ImageView) inflate.findViewById(R.id.jadx_deobf_0x000016c9)).setImageResource(R.drawable.jadx_deobf_0x000005af);
epkVar.setContentView(inflate);
epkVar.a(R.string.jadx_deobf_0x00001bcf, new fqc(activity, epkVar));
epkVar.b(R.string.jadx_deobf_0x00001bce, new fqd(activity, epkVar));
epkVar.setOnKeyListener(new fqe(activity));
epkVar.show();
cnc.az(activity);
return epkVar;
}
public static void c(Activity activity) {
if (activity != null) {
String shortClassName = activity.getComponentName().getShortClassName();
if (shortClassName.contains("PermissionGuideActivity")) {
activity.finish();
}
if (a) {
bbj.a("PermissionUtils", "finishPermissionGuideActivity-activity name:" + shortClassName);
}
}
}
}