百度手机卫士 v8.4.5版本的 MD5 值为:c65ef854a40bb6200c4d8c4603c58403
以下内容为反编译后的 ftg.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 ftg {
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) {
awv c = aww.a(context).c(str);
return c == null ? j : c.m();
}
public static String a(Context context, String str) {
awv c;
if (str == null || (c = aww.a(context).c(str)) == null) {
return null;
}
return c.g() + " | " + c.h();
}
private static Intent c(Context context, String str) {
PackageManager a2 = hsg.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) {
azy.c("PermissionUtils", "startActivity e:" + e);
}
return -1;
} catch (SecurityException e2) {
if (a) {
azy.c("PermissionUtils", "startActivity e:" + e2);
}
return -2;
} catch (Exception e3) {
if (a) {
azy.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_0x0000157d));
intent.putExtra("extra.has_anim", true);
int a2 = a(context, intent);
if (a2 != 1) {
if (a) {
azy.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) {
azy.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) {
azy.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) {
azy.c("PermissionUtils", "showGuideDialog-activity is null");
}
return null;
}
if (2 == i) {
return b(activity);
}
hll hllVar = new hll(activity);
hllVar.setTitle(R.string.app_name);
hllVar.setContentView(activity.getLayoutInflater().inflate(R.layout.jadx_deobf_0x0000098b, (ViewGroup) null));
TextView textView = (TextView) hllVar.findViewById(R.id.jadx_deobf_0x0000186a);
if (1 == i) {
if (str == null || str2 == null) {
textView.setText(cje.a(activity.getString(R.string.jadx_deobf_0x00001d60), activity.getString(R.string.jadx_deobf_0x00001d5f)));
} else {
textView.setText(Html.fromHtml(String.format(String.format(activity.getString(R.string.jadx_deobf_0x00001d5e), str, str2), str, str2)));
}
hllVar.a(R.string.jadx_deobf_0x00001d5c, new fth(activity, i, hllVar));
hllVar.c(R.string.jadx_deobf_0x00001d5b, new fti(i, activity, hllVar));
hllVar.setOnKeyListener(new ftj(i, activity, hllVar));
hllVar.show();
if (1 == i) {
cjd.K(activity);
}
return hllVar;
}
if (a) {
azy.c("PermissionUtils", "showGuideDialog-permission type is not correct :" + i);
}
c(activity);
return null;
}
private static Dialog b(Activity activity) {
erl erlVar = new erl(activity);
erlVar.setTitle(R.string.jadx_deobf_0x00002757);
erlVar.a(R.drawable.jadx_deobf_0x0000053d, R.dimen.jadx_deobf_0x00000bb1, R.dimen.jadx_deobf_0x00000bae);
View inflate = activity.getLayoutInflater().inflate(R.layout.jadx_deobf_0x0000098b, (ViewGroup) null);
((TextView) inflate.findViewById(R.id.jadx_deobf_0x0000186a)).setText(activity.getString(R.string.jadx_deobf_0x00001d62));
((TextView) inflate.findViewById(R.id.jadx_deobf_0x0000186c)).setText(activity.getString(R.string.jadx_deobf_0x00001d61));
((ImageView) inflate.findViewById(R.id.jadx_deobf_0x0000186b)).setImageResource(R.drawable.jadx_deobf_0x00000616);
erlVar.setContentView(inflate);
erlVar.a(R.string.jadx_deobf_0x00001d5c, new ftk(activity, erlVar));
erlVar.b(R.string.jadx_deobf_0x00001d5b, new ftl(activity, erlVar));
erlVar.setOnKeyListener(new ftm(activity));
erlVar.show();
cjd.N(activity);
return erlVar;
}
public static void c(Activity activity) {
if (activity != null) {
String shortClassName = activity.getComponentName().getShortClassName();
if (shortClassName.contains("PermissionGuideActivity")) {
activity.finish();
}
if (a) {
azy.a("PermissionUtils", "finishPermissionGuideActivity-activity name:" + shortClassName);
}
}
}
}