百度手机卫士 v8.8.0版本的 MD5 值为:a85894a6923c8a39f0c3a3a686ad7443
以下内容为反编译后的 iry.java 源代码,内容仅作参考
package dxoptimizer;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.NinePatch;
import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.NinePatchDrawable;
import android.graphics.drawable.PaintDrawable;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.baidu.security.plugin.ICloudScanCallback;
import com.tencent.open.utils.HttpUtils;
import java.io.IOException;
import java.io.InputStream;
import java.lang.ref.WeakReference;
import java.net.URLDecoder;
import org.json.JSONException;
import org.json.JSONObject;
public class iry implements iwp {
iwp a;
final irv b;
private final String c = "sendinstall";
private final String d = "installwording";
private final String e = "http://appsupport.qq.com/cgi-bin/qzapps/mapp_addapp.cgi";
public iry(irv irvVar, iwp iwpVar) {
this.b = irvVar;
this.a = iwpVar;
}
@Override
public void onComplete(Object obj) {
JSONObject jSONObject;
boolean z;
String str;
if (obj != null && (jSONObject = (JSONObject) obj) != null) {
try {
r2 = jSONObject.getInt("sendinstall") == 1;
str = jSONObject.getString("installwording");
z = r2;
} catch (JSONException e) {
ius.d("openSDK_LOG.AuthAgent", "FeedConfirmListener onComplete There is no value for sendinstall.");
z = r2;
str = "";
}
String decode = URLDecoder.decode(str);
ius.a("openSDK_LOG.AuthAgent", " WORDING = " + decode + "xx");
if (z && !TextUtils.isEmpty(decode)) {
a(decode, this.a, obj);
} else if (this.a != null) {
this.a.onComplete(obj);
}
}
}
private void a(String str, iwp iwpVar, Object obj) {
WeakReference weakReference;
PackageInfo packageInfo;
weakReference = this.b.k;
Activity activity = (Activity) weakReference.get();
if (activity != null) {
Dialog dialog = new Dialog(activity);
dialog.requestWindowFeature(1);
PackageManager packageManager = activity.getPackageManager();
try {
packageInfo = packageManager.getPackageInfo(activity.getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
packageInfo = null;
}
Drawable loadIcon = packageInfo != null ? packageInfo.applicationInfo.loadIcon(packageManager) : null;
View.OnClickListener irzVar = new irz(this, dialog, iwpVar, obj);
View.OnClickListener isaVar = new isa(this, dialog, iwpVar, obj);
ColorDrawable colorDrawable = new ColorDrawable();
colorDrawable.setAlpha(0);
dialog.getWindow().setBackgroundDrawable(colorDrawable);
dialog.setContentView(a(activity, loadIcon, str, irzVar, isaVar));
dialog.setOnCancelListener(new isb(this, iwpVar, obj));
if (activity != null && !activity.isFinishing()) {
dialog.show();
}
}
}
private Drawable a(String str, Context context) {
Drawable drawable;
IOException e;
Bitmap bitmap;
try {
InputStream open = context.getApplicationContext().getAssets().open(str);
if (open == null) {
return null;
}
if (str.endsWith(".9.png")) {
try {
bitmap = BitmapFactory.decodeStream(open);
} catch (OutOfMemoryError e2) {
e2.printStackTrace();
bitmap = null;
}
if (bitmap == null) {
return null;
}
byte[] ninePatchChunk = bitmap.getNinePatchChunk();
NinePatch.isNinePatchChunk(ninePatchChunk);
return new NinePatchDrawable(bitmap, ninePatchChunk, new Rect(), null);
}
drawable = Drawable.createFromStream(open, str);
try {
open.close();
return drawable;
} catch (IOException e3) {
e = e3;
e.printStackTrace();
return drawable;
}
} catch (IOException e4) {
drawable = null;
e = e4;
}
}
private View a(Context context, Drawable drawable, String str, View.OnClickListener onClickListener, View.OnClickListener onClickListener2) {
DisplayMetrics displayMetrics = new DisplayMetrics();
((WindowManager) context.getSystemService("window")).getDefaultDisplay().getMetrics(displayMetrics);
float f = displayMetrics.density;
RelativeLayout relativeLayout = new RelativeLayout(context);
ImageView imageView = new ImageView(context);
imageView.setImageDrawable(drawable);
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
imageView.setId(1);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams((int) (60.0f * f), (int) (60.0f * f));
layoutParams.addRule(9);
layoutParams.setMargins(0, (int) (18.0f * f), (int) (6.0f * f), (int) (18.0f * f));
relativeLayout.addView(imageView, layoutParams);
TextView textView = new TextView(context);
textView.setText(str);
textView.setTextSize(14.0f);
textView.setGravity(3);
textView.setIncludeFontPadding(false);
textView.setPadding(0, 0, 0, 0);
textView.setLines(2);
textView.setId(5);
textView.setMinWidth((int) (185.0f * f));
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams2.addRule(1, 1);
layoutParams2.addRule(6, 1);
layoutParams2.setMargins(0, 0, (int) (5.0f * f), 0);
relativeLayout.addView(textView, layoutParams2);
View view = new View(context);
view.setBackgroundColor(Color.rgb(214, 214, 214));
view.setId(3);
RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(-2, 2);
layoutParams3.addRule(3, 1);
layoutParams3.addRule(5, 1);
layoutParams3.addRule(7, 5);
layoutParams3.setMargins(0, 0, 0, (int) (12.0f * f));
relativeLayout.addView(view, layoutParams3);
LinearLayout linearLayout = new LinearLayout(context);
RelativeLayout.LayoutParams layoutParams4 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams4.addRule(5, 1);
layoutParams4.addRule(7, 5);
layoutParams4.addRule(3, 3);
Button button = new Button(context);
button.setText("跳过");
button.setBackgroundDrawable(a("buttonNegt.png", context));
button.setTextColor(Color.rgb(36, 97, 131));
button.setTextSize(20.0f);
button.setOnClickListener(onClickListener2);
button.setId(4);
LinearLayout.LayoutParams layoutParams5 = new LinearLayout.LayoutParams(0, (int) (45.0f * f));
layoutParams5.rightMargin = (int) (14.0f * f);
layoutParams5.leftMargin = (int) (4.0f * f);
layoutParams5.weight = 1.0f;
linearLayout.addView(button, layoutParams5);
Button button2 = new Button(context);
button2.setText("确定");
button2.setTextSize(20.0f);
button2.setTextColor(Color.rgb(ICloudScanCallback.CLOUDSCAN_STOP, ICloudScanCallback.CLOUDSCAN_STOP, ICloudScanCallback.CLOUDSCAN_STOP));
button2.setBackgroundDrawable(a("buttonPost.png", context));
button2.setOnClickListener(onClickListener);
LinearLayout.LayoutParams layoutParams6 = new LinearLayout.LayoutParams(0, (int) (45.0f * f));
layoutParams6.weight = 1.0f;
layoutParams6.rightMargin = (int) (4.0f * f);
linearLayout.addView(button2, layoutParams6);
relativeLayout.addView(linearLayout, layoutParams4);
ViewGroup.LayoutParams layoutParams7 = new FrameLayout.LayoutParams((int) (279.0f * f), (int) (163.0f * f));
relativeLayout.setPadding((int) (14.0f * f), 0, (int) (12.0f * f), (int) (12.0f * f));
relativeLayout.setLayoutParams(layoutParams7);
relativeLayout.setBackgroundColor(Color.rgb(247, 251, 247));
PaintDrawable paintDrawable = new PaintDrawable(Color.rgb(247, 251, 247));
paintDrawable.setCornerRadius(f * 5.0f);
relativeLayout.setBackgroundDrawable(paintDrawable);
return relativeLayout;
}
public void a() {
Bundle c;
WeakReference weakReference;
isq isqVar;
c = this.b.c();
weakReference = this.b.k;
Activity activity = (Activity) weakReference.get();
if (activity != null) {
isqVar = this.b.d;
HttpUtils.a(isqVar, activity, "http://appsupport.qq.com/cgi-bin/qzapps/mapp_addapp.cgi", c, "POST", null);
}
}
@Override
public void onError(iwr iwrVar) {
if (this.a != null) {
this.a.onError(iwrVar);
}
}
@Override
public void onCancel() {
if (this.a != null) {
this.a.onCancel();
}
}
}