手机管家 v6.0.0版本的 MD5 值为:bf0bca2cb03f766137fe9ecf7383a634
以下内容为反编译后的 bvn.java 源代码,内容仅作参考
package tcs;
import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Handler;
import android.os.Message;
import android.provider.Settings;
import com.tencent.qqpimsecure.R;
import com.tencent.qqpimsecure.plugin.quickpanel.bg.PiQuickPanelUD;
import com.tencent.qqpimsecure.plugin.quickpanel.bg.floatview.NightView;
import com.tencent.tmassistantsdk.common.TMAssistantDownloadSDKContentType;
import java.util.Iterator;
import java.util.List;
public class bvn {
protected static volatile bvn gbS;
protected NightView gbT;
protected List<ResolveInfo> gbW;
protected Context mContext;
protected boolean gbU = false;
protected boolean gbV = false;
protected Handler mHandler = new Handler(PiQuickPanelUD.aDW().kI().getMainLooper()) {
@Override
public void handleMessage(Message message) {
switch (message.what) {
case 1:
if (bvn.this.gbT != null) {
bvn.this.gbT.close();
return;
}
return;
case 2:
int i = message.arg1;
if (bvn.this.gbT == null) {
bvn.this.gbT = new NightView(bvn.this.mContext);
}
if (bvn.this.gbT == null || bvn.this.gbV) {
return;
}
if (bvn.this.gbT.isNightModelVar() || i != bvn.this.gbT.getLayoutParamsType()) {
bvn.this.gbT.setLayoutParamsType(i);
bvn.this.gbT.show();
return;
}
return;
default:
return;
}
}
};
public static bvn aFw() {
if (gbS == null) {
gbS = new bvn(meri.pluginsdk.c.getApplicationContext());
}
return gbS;
}
public static void release() {
if (gbS != null) {
gbS.aFx();
}
gbS = null;
}
protected void aFx() {
aFz();
this.gbT = null;
}
public boolean aFy() {
return this.gbT != null && this.gbT.isShown() && this.gbT.isNightModelVar();
}
public void aFz() {
if (this.gbT != null) {
this.gbT.close();
}
}
public void aFA() {
if (!aFy()) {
aFz();
}
}
protected bvn(Context context) {
this.mContext = null;
this.mContext = context;
aFC();
}
public void aFB() {
if (this.gbT == null) {
this.gbT = new NightView(this.mContext);
}
this.gbT.show();
}
protected void aFC() {
aif aifVar = (aif) PiQuickPanelUD.aDW().kH().gf(12);
Intent intent = new Intent("android.intent.action.VIEW");
intent.setDataAndType(Uri.parse("file://xx.apk"), TMAssistantDownloadSDKContentType.CONTENT_TYPE_APK);
this.gbW = aifVar.queryIntentActivities(intent, 0);
}
public boolean aFD() {
return bvz.aFR().rR("android.hardware.sensor.light");
}
public boolean aFE() {
try {
return Settings.System.getInt(this.mContext.getContentResolver(), "screen_brightness_mode") == 1;
} catch (Exception e) {
return false;
}
}
public void to(int i) {
if (i >= 25) {
try {
Settings.System.putInt(this.mContext.getContentResolver(), "screen_brightness", i);
this.mContext.getContentResolver().notifyChange(Settings.System.getUriFor("screen_brightness"), null);
} catch (Exception e) {
}
}
}
public void setNightViewLightness(int i) {
if (this.gbT != null) {
boolean aFy = aFy();
this.gbT.setNightViewLightness(i);
if (!aFy && !this.gbV && i >= 0 && i < 100) {
yz.c(PiQuickPanelUD.aDW().kH(), 28330, 4);
}
}
}
public void tp(int i) {
if (i < 30) {
setNightViewLightness(tr(i));
} else {
setNightViewLightness(100);
to(tq(i));
}
}
protected int aFF() {
try {
int i = Settings.System.getInt(this.mContext.getContentResolver(), "screen_brightness", -1);
if (i <= 25) {
return 25;
}
return i;
} catch (Exception e) {
return 25;
}
}
protected int getNightViewLightness() {
if (this.gbT != null) {
return this.gbT.getNightViewLightness();
}
return -1;
}
public int aFG() {
float nightViewLightness = getNightViewLightness();
float aFF = aFF();
if (aFF <= 25.0f && nightViewLightness < 100.0f && nightViewLightness >= 0.0f) {
return (int) (nightViewLightness * 0.3f);
}
return ((int) ((aFF - 25.0f) * 0.4347826f * 0.7f)) + 30;
}
public static int tq(int i) {
return (((((i - 30) * 100) / 70) * 230) / 100) + 25;
}
public static int tr(int i) {
return (i * 100) / 30;
}
public void aFH() {
try {
Settings.System.putInt(this.mContext.getContentResolver(), "screen_brightness_mode", 0);
com.tencent.qqpimsecure.plugin.quickpanel.bg.f.aDn().rK(bvz.aFR().gh(R.string.vg) + bvz.aFR().gh(R.string.bg));
} catch (Exception e) {
}
}
public void aFI() {
try {
Settings.System.putInt(this.mContext.getContentResolver(), "screen_brightness_mode", 1);
com.tencent.qqpimsecure.plugin.quickpanel.bg.f.aDn().rK(bvz.aFR().gh(R.string.vg) + bvz.aFR().gh(R.string.v6));
} catch (Exception e) {
}
}
public void aFJ() {
ts(akv.cRs);
}
public void ts(int i) {
this.mHandler.sendMessage(this.mHandler.obtainMessage(1));
Message obtainMessage = this.mHandler.obtainMessage(2);
obtainMessage.arg1 = i;
this.mHandler.sendMessageDelayed(obtainMessage, 100L);
}
public void gX(boolean z) {
this.gbU = z;
}
public boolean aFK() {
return this.gbU;
}
public void c(ActivityManager.RunningTaskInfo runningTaskInfo) {
if (runningTaskInfo != null && runningTaskInfo.topActivity != null && this.gbW != null && aFK()) {
this.gbV = false;
Iterator<ResolveInfo> it = this.gbW.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
ResolveInfo next = it.next();
if (next.activityInfo != null && next.activityInfo.packageName != null && next.activityInfo.packageName.equals(runningTaskInfo.topActivity.getPackageName())) {
this.gbV = true;
break;
}
}
if (this.gbV) {
this.mHandler.sendEmptyMessage(1);
} else if (this.gbT != null && !this.gbT.isShown()) {
Message obtainMessage = this.mHandler.obtainMessage(2);
obtainMessage.arg1 = akv.cRs;
this.mHandler.sendMessage(obtainMessage);
}
}
}
}