安全中心 v4.9.2版本的 MD5 值为:d64c0ec7920c532fa6e6d9bb001cf9bf
以下内容为反编译后的 b.java 源代码,内容仅作参考
package meri.service.usespermission;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.SparseArray;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.WindowManager;
import android.view.animation.AnticipateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.widget.ImageView;
import android.widget.TextView;
import com.tencent.qqpimsecure.dao.h;
import com.tencent.server.base.QQSecureApplication;
import com.tencent.server.base.f;
import java.io.File;
import java.util.ArrayList;
import meri.pluginsdk.d;
import meri.pluginsdk.k;
import meri.util.BaseReceiver;
import tcs.ako;
import tcs.akv;
import tcs.ami;
import tcs.amy;
import tcs.ang;
import tcs.bdh;
import tcs.bgh;
import tcs.bgm;
import tcs.ub;
import tcs.yz;
import tcs.za;
import uilib.pages.viewpager.ViewPager;
public class b {
private static int dkD = ako.a(QQSecureApplication.getContext(), 10.0f);
private static b eNu;
private int aLa;
private int cPa;
private int cPb;
private int cmS;
private Runnable cmY;
private int csS;
private ami dMJ;
private boolean eHM;
private int eNA;
private boolean eNB;
private View eNv;
private View eNw;
private ViewPager eNx;
private SparseArray<ImageView> eNy;
private int eNz;
private boolean eOi;
private Runnable eOj;
private Handler mHandler = new amy(Looper.getMainLooper());
private BaseReceiver bvi = new BaseReceiver() {
@Override
public void p(Context context, Intent intent) {
if (intent.getAction().equals("android.intent.action.CLOSE_SYSTEM_DIALOGS") && TextUtils.equals("homekey", intent.getStringExtra("reason"))) {
b.this.mHandler.post(new Runnable() {
@Override
public void run() {
b.this.Fd();
}
});
}
}
};
private Context mContext = QQSecureApplication.getContext();
private WindowManager anA = (WindowManager) this.mContext.getSystemService("window");
private b() {
}
public static void a(int i, String str, String str2, ArrayList<String> arrayList, boolean z, String str3, boolean z2) {
if (eNu != null) {
eNu.close();
}
eNu = new b();
eNu.csS = i;
switch (i) {
case 1:
eNu.a(arrayList, z, z2);
return;
case 2:
eNu.gC(str2);
return;
case 3:
default:
return;
case 4:
eNu.a(str, str2, str3, z2);
return;
}
}
public static void Fc() {
if (eNu != null) {
eNu.close();
}
if (f.getPiManager().eo(257)) {
Bundle bundle = new Bundle();
bundle.putInt(meri.pluginsdk.d.bss, 16842771);
bgh.PQ().b(257, bundle, (d.z) null);
}
}
@TargetApi(11)
private void a(final ArrayList<String> arrayList, final boolean z, final boolean z2) {
if (Build.VERSION.SDK_INT >= 11) {
this.dMJ = new ami.a(this.mContext).xT();
final WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(-2, -2, akv.cRk, 8, -3);
final WindowManager.LayoutParams layoutParams2 = new WindowManager.LayoutParams(-2, -2, akv.cRk, 8, -3);
Rect aS = ub.aS(this.mContext);
this.eNv = LayoutInflater.from(this.mContext).inflate(bdh.g.fiT, (ViewGroup) null);
this.eNw = LayoutInflater.from(this.mContext).inflate(bdh.g.fiU, (ViewGroup) null);
this.eNx = (ViewPager) this.eNv.findViewById(bdh.f.fha);
this.cPa = aS.right;
this.cPb = aS.bottom;
this.aLa = ako.a(this.mContext, 140.0f);
this.cmS = ako.a(this.mContext, 60.0f);
layoutParams.gravity = 80;
layoutParams2.x = this.cPa - this.aLa;
layoutParams2.y = (this.cPb - this.cmS) - ako.a(this.mContext, 60.0f);
layoutParams2.gravity = 51;
if (arrayList != null && !arrayList.isEmpty()) {
this.eNz = arrayList.size();
if (this.eNz == 2) {
this.eNz *= 2;
}
this.eNA = 1000;
this.eNy = new SparseArray<>(this.eNz);
this.eNx.setBequickEnable(false);
this.eNx.setScrollDuration(300);
this.eNx.setAdapter(new uilib.pages.viewpager.c() {
@Override
public void a(View view, int i, Object obj) {
}
@Override
public void m(View view) {
}
@Override
public int getCount() {
return b.this.eNz == 1 ? 1 : Integer.MAX_VALUE;
}
@Override
public Object d(View view, int i) {
ImageView imageView;
if (view == null || i < 0) {
return null;
}
int i2 = i < 1000 ? (b.this.eNz + ((i - 1000) % b.this.eNz)) % b.this.eNz : (i - 1000) % b.this.eNz;
ImageView imageView2 = (ImageView) b.this.eNy.get(i2);
if (imageView2 == null) {
ImageView imageView3 = new ImageView(b.this.mContext);
String str = (String) arrayList.get(i2 % arrayList.size());
if (!z) {
b.this.dMJ.e(Uri.fromFile(new File(str))).ax(-1, -1).d(imageView3);
} else {
try {
imageView3.setImageResource(Integer.parseInt(str));
} catch (Throwable th) {
com.tencent.server.base.d.n(th);
}
}
b.this.eNy.put(i2, imageView3);
imageView = imageView3;
} else {
imageView = imageView2;
}
ViewParent parent = imageView.getParent();
if (parent != null) {
((ViewGroup) parent).removeView(imageView);
}
((ViewGroup) view).addView(imageView);
return imageView;
}
@Override
public boolean a(View view, Object obj) {
return view == obj;
}
@Override
public void a(Parcelable parcelable, ClassLoader classLoader) {
}
@Override
public Parcelable ZG() {
return null;
}
@Override
public void n(View view) {
}
});
this.eNx.setCurrentItem(this.eNA);
if (this.eNz > 1) {
this.eNx.setOnPageChangeListener(new ViewPager.c() {
@Override
public void a(int i, float f, int i2) {
}
@Override
public void mQ(int i) {
b.this.eNA = i;
}
@Override
public void mR(int i) {
}
@Override
public void d(float f) {
}
});
}
} else {
this.eNx.setVisibility(8);
}
this.eNv.findViewById(bdh.f.fgY).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
b.this.mHandler.removeCallbacks(b.this.cmY);
b.this.Fd();
}
});
final TextView textView = (TextView) this.eNv.findViewById(bdh.f.fgP);
if (z2) {
textView.getPaint().setFlags(8);
textView.getPaint().setAntiAlias(true);
textView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
h.mu().bo(true);
za.b(b.this.mContext, "http://feedback.qq.com/?productId=1#!/detail/qid/140430", null);
yz.c(bgh.PQ().kH(), c.aKS, 4);
}
});
}
textView.setVisibility(8);
TextView textView2 = (TextView) this.eNw.findViewById(bdh.f.fit);
textView2.setOnClickListener(new View.OnClickListener() {
@Override
@TargetApi(11)
public void onClick(View view) {
if (Build.VERSION.SDK_INT >= 11) {
b.this.eNw.setVisibility(8);
b.this.eNv.setAlpha(1.0f);
b.this.eNv.setScaleX(1.0f);
b.this.eNv.setScaleY(1.0f);
b.this.eNv.setTranslationX(0.0f);
b.this.eNv.setTranslationY(0.0f);
b.this.eNv.setVisibility(0);
if (z2) {
textView.setVisibility(0);
}
b.this.eNB = true;
}
}
});
textView2.setOnTouchListener(new View.OnTouchListener() {
private boolean aKM;
private float aKN;
private float eOK;
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
switch (motionEvent.getAction()) {
case 0:
this.aKM = false;
this.aKN = motionEvent.getX();
this.eOK = motionEvent.getY();
break;
case 2:
int abs = (int) Math.abs(motionEvent.getX() - this.aKN);
int abs2 = (int) Math.abs(motionEvent.getY() - this.eOK);
if (abs > b.dkD || abs2 > b.dkD) {
if (!this.aKM) {
this.aKM = true;
}
layoutParams2.x = ((int) motionEvent.getRawX()) - ((int) this.aKN);
layoutParams2.y = ((int) motionEvent.getRawY()) - ((int) this.eOK);
b.this.anA.updateViewLayout(b.this.eNw, layoutParams2);
break;
}
break;
}
return this.aKM;
}
});
((ImageView) this.eNw.findViewById(bdh.f.fis)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
b.this.close();
}
});
this.eNv.setFocusableInTouchMode(true);
this.eNv.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View view, int i, KeyEvent keyEvent) {
if (i != 4) {
return false;
}
b.this.Fd();
return true;
}
});
this.eOj = new Runnable() {
@Override
public void run() {
b.this.anA.addView(b.this.eNv, layoutParams);
b.this.anA.addView(b.this.eNw, layoutParams2);
b.this.eNw.setVisibility(8);
b.this.eOi = true;
b.this.eNB = true;
b.this.mContext.registerReceiver(b.this.bvi, new IntentFilter("android.intent.action.CLOSE_SYSTEM_DIALOGS"));
b.this.mHandler.postDelayed(b.this.cmY, 8000L);
}
};
this.cmY = new Runnable() {
@Override
public void run() {
b.this.Fd();
}
};
this.mHandler.postDelayed(this.eOj, 800L);
}
}
private void gC(String str) {
WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(-1, -2, akv.cRk, 8, -3);
layoutParams.gravity = 83;
layoutParams.screenOrientation = 1;
this.eNv = LayoutInflater.from(QQSecureApplication.getContext()).inflate(bdh.g.fiI, (ViewGroup) null);
((ImageView) this.eNv.findViewById(bdh.f.fgO)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
b.this.close();
}
});
((TextView) this.eNv.findViewById(bdh.f.fgU)).setText(str);
this.anA.addView(this.eNv, layoutParams);
com.tencent.server.base.d.ajU().postDelayed(new Runnable() {
@Override
public void run() {
b.this.close();
}
}, 12000L);
}
private void a(final String str, final String str2, final String str3, final boolean z) {
if (!f.getPiManager().eo(257)) {
((meri.service.optimus.a) bgm.nL(24)).a(257, (String) null, (byte) 9, new k() {
@Override
public boolean handleMessage(Message message) {
Bundle bundle = new Bundle();
bundle.putInt(meri.pluginsdk.d.bss, 16842770);
bundle.putString(ang.a.bxF, str3);
bundle.putString(ang.a.bxG, str);
bundle.putString(ang.a.bxH, str2);
bundle.putBoolean(ang.a.aqr, z);
bgh.PQ().b(257, bundle, (d.z) null);
return super.handleMessage(message);
}
});
return;
}
Bundle bundle = new Bundle();
bundle.putInt(meri.pluginsdk.d.bss, 16842770);
bundle.putString(ang.a.bxF, str3);
bundle.putString(ang.a.bxG, str);
bundle.putString(ang.a.bxH, str2);
bundle.putBoolean(ang.a.aqr, z);
bgh.PQ().b(257, bundle, (d.z) null);
}
public void close() {
if (!this.eHM) {
this.eHM = true;
switch (this.csS) {
case 1:
if (this.eOi) {
this.eOi = false;
this.anA.removeView(this.eNv);
this.anA.removeView(this.eNw);
this.mContext.unregisterReceiver(this.bvi);
} else {
this.mHandler.removeCallbacks(this.eOj);
}
this.dMJ.shutdown();
break;
case 2:
this.anA.removeView(this.eNv);
break;
}
eNu = null;
}
}
@TargetApi(14)
public void Fd() {
if (Build.VERSION.SDK_INT >= 14 && this.eNB) {
this.eNB = false;
this.eNv.getLocationOnScreen(new int[2]);
this.eNw.getLocationOnScreen(new int[2]);
this.eNv.animate().alpha(0.0f).scaleX(0.1f).scaleY(0.1f).translationX((r1[0] - r0[0]) - ((this.eNv.getWidth() - this.aLa) / 2)).translationY((r1[1] - r0[1]) - ((this.eNv.getHeight() - this.cmS) / 2)).setDuration(500L).setInterpolator(new AnticipateInterpolator(1.0f)).setListener(new AnimatorListenerAdapter() {
@Override
@TargetApi(14)
public void onAnimationEnd(Animator animator) {
if (Build.VERSION.SDK_INT >= 14) {
b.this.eNv.setVisibility(8);
b.this.eNw.setVisibility(0);
b.this.eNw.setAlpha(0.0f);
b.this.eNw.animate().alpha(1.0f).setDuration(500L).setInterpolator(new DecelerateInterpolator()).start();
}
}
}).start();
}
}
}