QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 QBMethodTestAssist.java 源代码,内容仅作参考
package com.tencent.mtt.compliance;
import android.app.PendingIntent;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.net.Uri;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.provider.ContactsContract;
import android.provider.Settings;
import android.telephony.CellIdentityCdma;
import android.telephony.CellIdentityGsm;
import android.telephony.CellIdentityLte;
import android.telephony.CellIdentityNr;
import android.telephony.CellIdentityTdscdma;
import android.telephony.CellIdentityWcdma;
import android.telephony.CellInfo;
import android.telephony.CellInfoCdma;
import android.telephony.CellInfoGsm;
import android.telephony.CellInfoLte;
import android.telephony.CellInfoNr;
import android.telephony.CellInfoTdscdma;
import android.telephony.CellInfoWcdma;
import android.telephony.CellLocation;
import android.telephony.TelephonyManager;
import android.telephony.cdma.CdmaCellLocation;
import android.telephony.gsm.GsmCellLocation;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import com.tencent.common.manifest.annotation.CreateMethod;
import com.tencent.common.manifest.annotation.ExtensionImpl;
import com.tencent.common.utils.UrlUtils;
import com.tencent.mm.opensdk.modelmsg.WXVideoFileObject;
import com.tencent.mtt.ContextHolder;
import com.tencent.mtt.apkplugin.impl.IAPInjectService;
import com.tencent.mtt.base.lbs.cellwifimac.CellCompat;
import com.tencent.mtt.businesscenter.facade.IUrlDispatherExtension;
import com.tencent.mtt.compliance.delegate.AbsStringConstGetter;
import com.tencent.mtt.compliance.utils.Callable;
import com.tencent.mtt.operation.event.EventLog;
import com.xiaomi.mipush.sdk.Constants;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
@ExtensionImpl(createMethod = CreateMethod.NEW, extension = IUrlDispatherExtension.class, filters = {"qb://debug/method/*"})
public class QBMethodTestAssist implements IUrlDispatherExtension {
static final Class<? extends Callable<String[]>>[] f47910a = {BuildModel.class, GetDeviceId.class, GetDeviceId2.class, GetImei.class, GetImei2.class, GetImsi.class, GetMeid.class, GetMeid2.class, GetHardwareAddress.class, GetMacAddress.class, GetBSSID.class, GetAndroidId.class, GetICCID.class, GetSerialConstant.class, GetSerialMethod.class, ClearPrimaryClip.class, ClipboardSetText.class, ClipboardGetText.class, ClipboardHasText.class, GetPrimaryClip.class, GetPrimaryClipDescription.class, HasPrimaryClip.class, SetPrimaryClip.class, GetContact.class, GetIPAddress.class, GetHostAddress.class, GetInstalledApplications.class, GetInstalledPackages.class, QueryIntentActivities.class, GetAllCellInfo.class, GetCellLocation.class, GetGsmCid.class, GetServiceState.class, GetLastKnownLocation.class, RequestLocationUpdates.class, RequestSingleUpdate.class};
static abstract class AbsCallable implements Callable<String[]> {
protected Context f47915a = ContextHolder.getAppContext();
AbsCallable() {
}
static String a(String str) {
return Character.toLowerCase(str.charAt(0)) + str.substring(1);
}
protected TelephonyManager a() {
return (TelephonyManager) ContextHolder.getAppContext().getSystemService("phone");
}
String b() {
return a(getClass().getSimpleName());
}
abstract String c() throws Throwable;
@Override
public String[] j() {
String th;
try {
th = c();
} catch (Throwable th2) {
th = th2.toString();
}
return new String[]{b(), th};
}
protected WifiManager e() {
return (WifiManager) ContextHolder.getAppContext().getSystemService("wifi");
}
protected ClipboardManager f() {
return (ClipboardManager) this.f47915a.getSystemService("clipboard");
}
protected android.text.ClipboardManager g() {
return (android.text.ClipboardManager) this.f47915a.getSystemService("clipboard");
}
protected PackageManager h() {
return this.f47915a.getPackageManager();
}
protected LocationManager i() {
return (LocationManager) this.f47915a.getSystemService("location");
}
}
static class BuildModel implements Callable<String[]> {
BuildModel() {
}
@Override
public String[] j() {
return new String[]{"Build.MODEL", MethodDelegate.getModel()};
}
}
static class ClearPrimaryClip extends AbsCallable {
ClearPrimaryClip() {
}
@Override
String c() {
if (Build.VERSION.SDK_INT < 28) {
return "api low";
}
MethodDelegate.clearPrimaryClip(f());
return "done";
}
}
static class ClipboardGetText extends AbsCallable {
ClipboardGetText() {
}
@Override
String c() {
return Arrays.deepToString(new CharSequence[]{MethodDelegate.getText(f()), MethodDelegate.getText(g())});
}
}
static class ClipboardHasText extends AbsCallable {
ClipboardHasText() {
}
@Override
String c() {
return Arrays.deepToString(new Boolean[]{Boolean.valueOf(MethodDelegate.hasText(f())), Boolean.valueOf(MethodDelegate.hasText(g()))});
}
}
static class ClipboardSetText extends AbsCallable {
ClipboardSetText() {
}
@Override
String c() {
ArrayList arrayList = new ArrayList();
f().setText("phantomqi-1");
arrayList.add(MethodDelegate.getText(f()));
g().setText("phantomqi-2");
arrayList.add(MethodDelegate.getText(g()));
return arrayList.toString();
}
}
static class GetAllCellInfo extends AbsCallable {
GetAllCellInfo() {
}
@Override
String c() throws Throwable {
return String.valueOf(MethodDelegate.getAllCellInfo(a()));
}
}
static class GetAndroidId extends AbsCallable {
GetAndroidId() {
}
@Override
String c() {
ArrayList arrayList = new ArrayList();
arrayList.add(MethodDelegate.getSecureString(this.f47915a.getContentResolver(), "android_id"));
arrayList.add(MethodDelegate.getSecureStringWithSystem(this.f47915a.getContentResolver(), "android_id"));
try {
arrayList.add("" + MethodDelegate.getSecureLong(this.f47915a.getContentResolver(), "android_id"));
} catch (Settings.SettingNotFoundException e) {
arrayList.add(e.toString());
}
return arrayList.toString();
}
}
static class GetBSSID extends AbsCallable {
GetBSSID() {
}
@Override
String c() {
return MethodDelegate.getConnectionInfo(e()).getBSSID();
}
}
static class GetCellLocation extends AbsCallable {
GetCellLocation() {
}
@Override
String c() throws Throwable {
return String.valueOf(MethodDelegate.getCellLocation(a()));
}
}
static class GetContact extends AbsCallable {
GetContact() {
}
@Override
String c() {
StringBuilder sb = new StringBuilder();
Cursor query = MethodDelegate.query(this.f47915a.getContentResolver(), ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
while (query.moveToNext()) {
String string = query.getString(query.getColumnIndex("_id"));
String string2 = query.getString(query.getColumnIndex("display_name"));
sb.append(string);
sb.append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR);
sb.append(string2);
sb.append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR);
Cursor query2 = MethodDelegate.query(this.f47915a.getContentResolver(), ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, "contact_id=" + string, null, null);
while (query2.moveToNext()) {
sb.append(query2.getString(query2.getColumnIndex("data1")).replace(Constants.ACCEPT_TIME_SEPARATOR_SERVER, "").replace(" ", ""));
sb.append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR);
}
query2.close();
sb.append("\n");
}
query.close();
return sb.toString();
}
}
static class GetDeviceId extends AbsCallable {
GetDeviceId() {
}
@Override
String c() {
return MethodDelegate.getImei(a());
}
}
static class GetDeviceId2 extends AbsCallable {
GetDeviceId2() {
}
@Override
String c() {
return Build.VERSION.SDK_INT >= 23 ? MethodDelegate.getImei(a(), 0) : "";
}
}
static class GetGsmCid extends AbsCallable {
GetGsmCid() {
}
@Override
String c() throws Throwable {
int cellIdentityCid;
CellLocation cellLocation;
int gsmCid;
StringBuilder sb = new StringBuilder();
sb.append("new GsmCellLocation().getCid()=");
sb.append(MethodDelegate.getGsmCid(new GsmCellLocation()));
try {
sb.append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR);
cellLocation = MethodDelegate.getCellLocation(a());
} catch (SecurityException e) {
sb.append("getCellLocation=");
sb.append(e);
}
if (cellLocation instanceof GsmCellLocation) {
sb.append("GsmCellLocation.getCid=");
gsmCid = MethodDelegate.getGsmCid((GsmCellLocation) cellLocation);
} else {
if (!(cellLocation instanceof CdmaCellLocation)) {
sb.append("getCellLocation=");
sb.append(cellLocation);
sb.append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR);
sb.append("CellCompat.getAllCellInfo=");
sb.append(CellCompat.a(a()));
sb.append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR);
sb.append("getAllCellInfo=");
for (CellInfo cellInfo : MethodDelegate.getAllCellInfo(a())) {
sb.append("[");
if (cellInfo instanceof CellInfoGsm) {
CellIdentityGsm cellIdentity = ((CellInfoGsm) cellInfo).getCellIdentity();
sb.append("gsm,");
sb.append(MethodDelegate.getCellIdentityCid(cellIdentity));
sb.append(',');
cellIdentityCid = MethodDelegate.getCellIdentityCid(cellIdentity);
} else if (cellInfo instanceof CellInfoCdma) {
CellIdentityCdma cellIdentity2 = ((CellInfoCdma) cellInfo).getCellIdentity();
sb.append("cdma,");
sb.append(MethodDelegate.getCellIdentityCid(cellIdentity2));
sb.append(',');
cellIdentityCid = MethodDelegate.getCellIdentityCid(cellIdentity2);
} else if (cellInfo instanceof CellInfoLte) {
CellIdentityLte cellIdentity3 = ((CellInfoLte) cellInfo).getCellIdentity();
sb.append("lte,");
sb.append(MethodDelegate.getCellIdentityCid(cellIdentity3));
sb.append(',');
cellIdentityCid = MethodDelegate.getCellIdentityCid(cellIdentity3);
} else if (cellInfo instanceof CellInfoWcdma) {
CellIdentityWcdma cellIdentity4 = ((CellInfoWcdma) cellInfo).getCellIdentity();
sb.append("wcdma,");
sb.append(MethodDelegate.getCellIdentityCid(cellIdentity4));
sb.append(',');
cellIdentityCid = MethodDelegate.getCellIdentityCid(cellIdentity4);
} else if (Build.VERSION.SDK_INT < 29 || !(cellInfo instanceof CellInfoTdscdma)) {
if (Build.VERSION.SDK_INT >= 29 && (cellInfo instanceof CellInfoNr)) {
CellIdentityNr cellIdentityNr = (CellIdentityNr) ((CellInfoNr) cellInfo).getCellIdentity();
sb.append("nr,");
sb.append(cellIdentityNr.getPci());
sb.append(Constants.ACCEPT_TIME_SEPARATOR_SP);
sb.append(cellIdentityNr.getNci());
}
sb.append("]");
} else {
CellIdentityTdscdma cellIdentity5 = ((CellInfoTdscdma) cellInfo).getCellIdentity();
sb.append("tdscdma,");
sb.append(MethodDelegate.getCellIdentityCid(cellIdentity5));
sb.append(',');
cellIdentityCid = MethodDelegate.getCellIdentityCid(cellIdentity5);
}
sb.append(cellIdentityCid);
sb.append("]");
}
return sb.toString();
}
sb.append("CdmaCellLocation.getBaseStationId=");
gsmCid = MethodDelegate.getGsmCid((CdmaCellLocation) cellLocation);
}
sb.append(gsmCid);
sb.append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR);
sb.append("CellCompat.getAllCellInfo=");
sb.append(CellCompat.a(a()));
sb.append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR);
sb.append("getAllCellInfo=");
while (r0.hasNext()) {
}
return sb.toString();
}
}
static class GetHardwareAddress extends AbsCallable {
GetHardwareAddress() {
}
@Override
String c() throws Throwable {
StringBuilder sb = new StringBuilder();
Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
while (networkInterfaces.hasMoreElements()) {
byte[] hardwareAddress = MethodDelegate.getHardwareAddress(networkInterfaces.nextElement());
if (hardwareAddress == null) {
sb.append(IAPInjectService.EP_NULL);
} else {
int length = hardwareAddress.length;
String str = "";
int i = 0;
while (i < length) {
byte b2 = hardwareAddress[i];
sb.append(str);
sb.append(String.format("%02d", Integer.valueOf(b2)));
i++;
str = Constants.COLON_SEPARATOR;
}
}
sb.append("\n");
}
return sb.toString();
}
}
static class GetHostAddress extends AbsCallable {
GetHostAddress() {
}
@Override
String c() throws Throwable {
StringBuilder sb = new StringBuilder();
Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
while (networkInterfaces.hasMoreElements()) {
Enumeration<InetAddress> inetAddresses = networkInterfaces.nextElement().getInetAddresses();
while (inetAddresses.hasMoreElements()) {
sb.append(MethodDelegate.getHostAddress(inetAddresses.nextElement()));
sb.append("\n");
}
}
return sb.toString();
}
}
static class GetICCID extends AbsCallable {
GetICCID() {
}
@Override
String c() {
return MethodDelegate.getSimSerialNumber(a());
}
}
static class GetIPAddress extends AbsCallable {
GetIPAddress() {
}
@Override
String c() {
int ipAddress = MethodDelegate.getIpAddress(MethodDelegate.getConnectionInfo(e()));
return (ipAddress & 255) + "." + ((ipAddress >> 8) & 255) + "." + ((ipAddress >> 16) & 255) + "." + ((ipAddress >> 24) & 255);
}
}
static class GetImei extends AbsCallable {
GetImei() {
}
@Override
String c() {
return Build.VERSION.SDK_INT >= 26 ? MethodDelegate.getImei(a()) : "";
}
}
static class GetImei2 extends AbsCallable {
GetImei2() {
}
@Override
String c() {
return Build.VERSION.SDK_INT >= 26 ? MethodDelegate.getImei(a(), 0) : "";
}
}
static class GetImsi extends AbsCallable {
GetImsi() {
}
@Override
String c() {
return MethodDelegate.getImsi(a());
}
}
static class GetInstalledApplications extends AbsCallable {
GetInstalledApplications() {
}
@Override
String c() {
return String.valueOf(MethodDelegate.getInstalledApplications(h(), 128));
}
}
static class GetInstalledPackages extends AbsCallable {
GetInstalledPackages() {
}
@Override
String c() {
return String.valueOf(MethodDelegate.getInstalledPackages(h(), 128));
}
}
static class GetLastKnownLocation extends AbsCallable {
GetLastKnownLocation() {
}
@Override
String c() throws Throwable {
return MethodDelegate.getLastKnownLocation(i(), "network") + "\n" + MethodDelegate.getLastKnownLocation(i(), "gps");
}
}
static class GetMacAddress extends AbsCallable {
GetMacAddress() {
}
@Override
String c() {
return MethodDelegate.getMacAddress(MethodDelegate.getConnectionInfo(e()));
}
}
static class GetMeid extends AbsCallable {
GetMeid() {
}
@Override
String c() {
return Build.VERSION.SDK_INT >= 26 ? MethodDelegate.getMeid(a()) : "";
}
}
static class GetMeid2 extends AbsCallable {
GetMeid2() {
}
@Override
String c() {
return Build.VERSION.SDK_INT >= 26 ? MethodDelegate.getMeid(a(), 0) : "";
}
}
static class GetPrimaryClip extends AbsCallable {
GetPrimaryClip() {
}
@Override
String c() {
return MethodDelegate.getPrimaryClip(f()).toString();
}
}
static class GetPrimaryClipDescription extends AbsCallable {
GetPrimaryClipDescription() {
}
@Override
String c() {
return MethodDelegate.getPrimaryClipDescription(f()).toString();
}
}
static class GetSerialConstant extends AbsCallable {
GetSerialConstant() {
}
@Override
String c() throws Throwable {
return MethodDelegate.getSerialConstant();
}
}
static class GetSerialMethod extends AbsCallable {
GetSerialMethod() {
}
@Override
String c() throws Throwable {
return Build.VERSION.SDK_INT >= 26 ? MethodDelegate.callGetSerial() : "unknown";
}
}
static class GetServiceState extends AbsCallable {
GetServiceState() {
}
@Override
String c() throws Throwable {
return Build.VERSION.SDK_INT >= 26 ? String.valueOf(MethodDelegate.getServiceState(a())) : "api low";
}
}
static class HasPrimaryClip extends AbsCallable {
HasPrimaryClip() {
}
@Override
String c() {
return String.valueOf(MethodDelegate.hasPrimaryClip(f()));
}
}
static class QueryIntentActivities extends AbsCallable {
QueryIntentActivities() {
}
@Override
String c() throws Throwable {
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(Uri.parse("https://www.qq.com"));
return String.valueOf(MethodDelegate.queryIntentActivities(h(), intent, 0));
}
}
static class RequestLocationUpdates extends AbsCallable {
RequestLocationUpdates() {
}
@Override
String c() throws Throwable {
PendingIntent activity = PendingIntent.getActivity(this.f47915a, 65535, new Intent(), WXVideoFileObject.FILE_SIZE_LIMIT);
Criteria criteria = new Criteria();
TestLocationListener testLocationListener = new TestLocationListener();
Looper mainLooper = Looper.getMainLooper();
MethodDelegate.requestLocationUpdates(i(), "network", Constants.ASSEMBLE_PUSH_NETWORK_INTERVAL, 0.0f, activity);
MethodDelegate.requestLocationUpdates(i(), "network", Constants.ASSEMBLE_PUSH_NETWORK_INTERVAL, 0.0f, testLocationListener);
MethodDelegate.requestLocationUpdates(i(), "network", Constants.ASSEMBLE_PUSH_NETWORK_INTERVAL, 0.0f, testLocationListener, mainLooper);
MethodDelegate.requestLocationUpdates(i(), Constants.ASSEMBLE_PUSH_NETWORK_INTERVAL, 0.0f, criteria, activity);
MethodDelegate.requestLocationUpdates(i(), Constants.ASSEMBLE_PUSH_NETWORK_INTERVAL, 0.0f, criteria, testLocationListener, mainLooper);
return "done";
}
}
static class RequestSingleUpdate extends AbsCallable {
RequestSingleUpdate() {
}
@Override
String c() throws Throwable {
PendingIntent activity = PendingIntent.getActivity(this.f47915a, 65535, new Intent(), WXVideoFileObject.FILE_SIZE_LIMIT);
Criteria criteria = new Criteria();
TestLocationListener testLocationListener = new TestLocationListener();
Looper mainLooper = Looper.getMainLooper();
MethodDelegate.requestSingleUpdate(i(), "network", activity);
MethodDelegate.requestSingleUpdate(i(), "network", testLocationListener, mainLooper);
MethodDelegate.requestSingleUpdate(i(), criteria, activity);
MethodDelegate.requestSingleUpdate(i(), criteria, testLocationListener, mainLooper);
return "done";
}
}
static class SetPrimaryClip extends AbsCallable {
SetPrimaryClip() {
}
@Override
String c() {
MethodDelegate.setPrimaryClip(f(), ClipData.newPlainText("label: phantomqi", "text: phantomqi"));
return MethodDelegate.getPrimaryClip(f()).toString();
}
}
static class TestForeground extends AbsCallable {
TestGetter f47916b = new TestGetter();
TestForeground() {
}
@Override
String c() throws Throwable {
return this.f47916b.c(null);
}
}
static class TestGetter extends AbsStringConstGetter<Object> {
TestGetter() {
}
@Override
public String a() {
return "TestGetter";
}
@Override
public String b(Object obj) {
return "RealValueForTest";
}
@Override
public String b(Object obj, Object... objArr) {
return "RealValueForTest";
}
@Override
public String b() {
return "";
}
@Override
public String d() {
return "DefaultValueForTest";
}
}
static class TestLocationListener implements LocationListener {
TestLocationListener() {
}
@Override
public void onLocationChanged(Location location) {
}
@Override
public void onProviderDisabled(String str) {
}
@Override
public void onProviderEnabled(String str) {
}
@Override
public void onStatusChanged(String str, int i, Bundle bundle) {
}
}
void a() {
final Handler handler = new Handler(Looper.getMainLooper());
handler.postDelayed(new Runnable() {
int f47911a = 30;
TestForeground f47912b = new TestForeground();
@Override
public void run() {
this.f47912b.j();
int i = this.f47911a - 1;
this.f47911a = i;
if (i > 0) {
handler.postDelayed(this, 1000L);
}
}
}, 15000L);
}
@Override
public boolean lunchCustomUrl(String str, boolean z, Bundle bundle) {
String[] strArr;
String path = UrlUtils.getPath(str);
if (path == null) {
return true;
}
String substring = path.substring(path.indexOf(47) + 1);
UrlUtils.getUrlParam(str);
if ("all".equals(substring)) {
for (Class<? extends Callable<String[]>> cls : f47910a) {
try {
strArr = cls.newInstance().j();
} catch (IllegalAccessException | InstantiationException e) {
strArr = new String[]{AbsCallable.a(cls.getSimpleName()), e.toString()};
}
EventLog.a("合规", "MethodTest", strArr[0], strArr[1], "phantomqi");
}
}
if ("foreground".equals(substring)) {
a();
}
return true;
}
}