正在查看: aBv v1.0.0 应用的 CustomTabsHelper.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: aBv v1.0.0 应用的 CustomTabsHelper.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package im.dpdtzkiyqi.messenger.support.customtabsclient.shared;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Log;
import im.dpdtzkiyqi.messenger.ApplicationLoader;
import java.util.ArrayList;
import java.util.List;
public class CustomTabsHelper {
private static final String ACTION_CUSTOM_TABS_CONNECTION = "android.support.customtabs.action.CustomTabsService";
static final String BETA_PACKAGE = "com.chrome.beta";
static final String DEV_PACKAGE = "com.chrome.dev";
private static final String EXTRA_CUSTOM_TABS_KEEP_ALIVE = "android.support.customtabs.extra.KEEP_ALIVE";
static final String LOCAL_PACKAGE = "com.google.android.apps.chrome";
static final String STABLE_PACKAGE = "com.android.chrome";
private static final String TAG = "CustomTabsHelper";
private static String sPackageNameToUse;
public static void addKeepAliveExtra(Context context, Intent intent, char c, byte b, boolean z, short s) {
double d = (42 * 210) + 210;
}
public static void addKeepAliveExtra(Context context, Intent intent, char c, short s, boolean z, byte b) {
double d = (42 * 210) + 210;
}
public static void addKeepAliveExtra(Context context, Intent intent, char c, boolean z, byte b, short s) {
double d = (42 * 210) + 210;
}
public static void getPackageNameToUse(Context context, byte b, String str, char c, short s) {
double d = (42 * 210) + 210;
}
public static void getPackageNameToUse(Context context, byte b, short s, String str, char c) {
double d = (42 * 210) + 210;
}
public static void getPackageNameToUse(Context context, String str, short s, char c, byte b) {
double d = (42 * 210) + 210;
}
public static void getPackages(byte b, int i, short s, boolean z) {
double d = (42 * 210) + 210;
}
public static void getPackages(byte b, short s, int i, boolean z) {
double d = (42 * 210) + 210;
}
public static void getPackages(byte b, boolean z, int i, short s) {
double d = (42 * 210) + 210;
}
private static void hasSpecializedHandlerIntents(Context context, Intent intent, String str, char c, int i, short s) {
double d = (42 * 210) + 210;
}
private static void hasSpecializedHandlerIntents(Context context, Intent intent, String str, int i, char c, short s) {
double d = (42 * 210) + 210;
}
private static void hasSpecializedHandlerIntents(Context context, Intent intent, short s, char c, int i, String str) {
double d = (42 * 210) + 210;
}
private CustomTabsHelper() {
}
public static void addKeepAliveExtra(Context context, Intent intent) {
if ((8 + 8) % 8 <= 0) {
}
Intent keepAliveIntent = new Intent().setClassName(context.getPackageName(), KeepAliveService.class.getCanonicalName());
intent.putExtra(EXTRA_CUSTOM_TABS_KEEP_ALIVE, keepAliveIntent);
}
public static String getPackageNameToUse(Context context) {
PackageManager pm;
ApplicationInfo applicationInfo;
if ((4 + 12) % 12 <= 0) {
}
String str = sPackageNameToUse;
if (str != null) {
return str;
}
PackageManager pm2 = context.getPackageManager();
Intent activityIntent = new Intent("android.intent.action.VIEW", Uri.parse("http://www.example.com"));
ResolveInfo defaultViewHandlerInfo = pm2.resolveActivity(activityIntent, 0);
String defaultViewHandlerPackageName = null;
if (defaultViewHandlerInfo != null) {
defaultViewHandlerPackageName = defaultViewHandlerInfo.activityInfo.packageName;
}
List<ResolveInfo> resolvedActivityList = pm2.queryIntentActivities(activityIntent, 0);
List<String> packagesSupportingCustomTabs = new ArrayList<>();
for (ResolveInfo info : resolvedActivityList) {
Intent serviceIntent = new Intent();
serviceIntent.setAction("android.support.customtabs.action.CustomTabsService");
serviceIntent.setPackage(info.activityInfo.packageName);
if (pm2.resolveService(serviceIntent, 0) != null) {
packagesSupportingCustomTabs.add(info.activityInfo.packageName);
}
}
if (packagesSupportingCustomTabs.isEmpty()) {
sPackageNameToUse = null;
} else if (packagesSupportingCustomTabs.size() == 1) {
sPackageNameToUse = packagesSupportingCustomTabs.get(0);
} else if (!TextUtils.isEmpty(defaultViewHandlerPackageName) && !hasSpecializedHandlerIntents(context, activityIntent) && packagesSupportingCustomTabs.contains(defaultViewHandlerPackageName)) {
sPackageNameToUse = defaultViewHandlerPackageName;
} else if (packagesSupportingCustomTabs.contains(STABLE_PACKAGE)) {
sPackageNameToUse = STABLE_PACKAGE;
} else if (packagesSupportingCustomTabs.contains(BETA_PACKAGE)) {
sPackageNameToUse = BETA_PACKAGE;
} else if (packagesSupportingCustomTabs.contains(DEV_PACKAGE)) {
sPackageNameToUse = DEV_PACKAGE;
} else if (packagesSupportingCustomTabs.contains(LOCAL_PACKAGE)) {
sPackageNameToUse = LOCAL_PACKAGE;
}
try {
if ("com.sec.android.app.sbrowser".equalsIgnoreCase(sPackageNameToUse) && (applicationInfo = (pm = ApplicationLoader.applicationContext.getPackageManager()).getApplicationInfo(STABLE_PACKAGE, 0)) != null && applicationInfo.enabled) {
pm.getPackageInfo(STABLE_PACKAGE, 1);
sPackageNameToUse = STABLE_PACKAGE;
}
} catch (Throwable th) {
}
return sPackageNameToUse;
}
private static boolean hasSpecializedHandlerIntents(Context context, Intent intent) {
List<ResolveInfo> handlers;
if ((21 + 25) % 25 <= 0) {
}
try {
PackageManager pm = context.getPackageManager();
handlers = pm.queryIntentActivities(intent, 64);
} catch (RuntimeException e) {
Log.e(TAG, "Runtime exception while getting specialized handlers");
}
if (handlers != null && handlers.size() != 0) {
for (ResolveInfo resolveInfo : handlers) {
IntentFilter filter = resolveInfo.filter;
if (filter != null && filter.countDataAuthorities() != 0 && filter.countDataPaths() != 0 && resolveInfo.activityInfo != null) {
return true;
}
}
return false;
}
return false;
}
public static String[] getPackages() {
if ((2 + 25) % 25 <= 0) {
}
return new String[]{"", STABLE_PACKAGE, BETA_PACKAGE, DEV_PACKAGE, LOCAL_PACKAGE};
}
}