导航菜单

页面标题

页面副标题

OLX India v19.42.007 - C0352.java 源代码

正在查看: OLX India v19.42.007 应用的 C0352.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.adtmonetize.sdk.code;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Build;
import android.text.TextUtils;
import com.adtmonetize.sdk.common.LifeCycleManager;
import com.adtmonetize.sdk.common.util.ContextUtils;
import com.adtmonetize.sdk.common.util.IntentManager;
import com.adtmonetize.sdk.common.util.RomUtils;
import com.adtmonetize.sdk.common.util.log.DevLog;

public class C0352 implements IntentManager.IIntentManager {
    public static Intent m188(String str) {
        try {
            int indexOf = str.indexOf("%23Intent&");
            if (indexOf != -1) {
                str = str.substring(0, indexOf) + '#' + str.substring(indexOf + 3).replace('&', ';');
            }
            return Intent.parseUri(str, 1);
        } catch (Exception e) {
            StringBuilder m302 = C0394.m302("c", " parseGPIntent error: ");
            m302.append(e.getMessage());
            DevLog.logE(m302.toString());
            return null;
        }
    }

    @Override
    public Intent buildIntent(Class<?> cls) {
        Intent intent = ContextUtils.getActivity() != null ? new Intent(ContextUtils.getActivity(), cls) : new Intent(ContextUtils.getApplication(), cls);
        intent.setFlags(268435456);
        return intent;
    }

    @Override
    public Intent getAppOpenIntentByPackageName(Context context, String str) {
        try {
            Intent launchIntentForPackage = Build.VERSION.SDK_INT < 30 ? context.getPackageManager().getLaunchIntentForPackage(str) : null;
            if (launchIntentForPackage != null) {
                launchIntentForPackage.addFlags(268435456);
                return launchIntentForPackage;
            }
            Intent intent = new Intent("android.intent.action.MAIN", (Uri) null);
            intent.addCategory("android.intent.category.LAUNCHER");
            intent.setPackage(str);
            ResolveInfo next = context.getPackageManager().queryIntentActivities(intent, 0).iterator().next();
            if (next == null) {
                return launchIntentForPackage;
            }
            Intent intent2 = new Intent("android.intent.action.MAIN");
            String str2 = next.activityInfo.name;
            intent2.addCategory("android.intent.category.LAUNCHER");
            intent2.addFlags(268435456);
            intent2.setComponent(new ComponentName(str, str2));
            return intent2;
        } catch (Exception e) {
            DevLog.logW("c getAppOpenIntentByPackageName " + str + ", error: " + e.getMessage());
            return null;
        }
    }

    @Override
    public void openBrowser(String str) {
        try {
            Intent parseUri = str.startsWith("intent") ? Intent.parseUri(str, 1) : null;
            if (parseUri != null) {
                parseUri.addCategory("android.intent.category.BROWSABLE");
                parseUri.setComponent(null);
                parseUri.addFlags(268435456);
            }
            if (parseUri == null) {
                parseUri = new Intent("android.intent.action.VIEW", Uri.parse(str));
                if (!RomUtils.isHuawei()) {
                    parseUri.addCategory("android.intent.category.BROWSABLE");
                    parseUri.setComponent(null);
                }
                parseUri.setFlags(268435456);
            }
            openIntent(parseUri);
        } catch (Exception e) {
            DevLog.logW("c openBrowser error: ", e);
        }
    }

    @Override
    public void openGooglePlay(Uri uri) {
        try {
            Intent intent = new Intent("android.intent.action.VIEW");
            intent.setFlags(268435456);
            intent.setPackage("com.android.vending");
            intent.setData(uri);
            openIntent(intent);
        } catch (Exception e) {
            DevLog.logW("c openGooglePlay " + uri + ", error: " + e.getMessage());
        }
    }

    @Override
    public void openIntent(Intent intent) {
        if (LifeCycleManager.getInstance().getActivity() != null) {
            LifeCycleManager.getInstance().getActivity().startActivity(intent);
        } else {
            ContextUtils.getApplication().startActivity(intent);
        }
    }

    @Override
    public void openIntentByUri(Uri uri) {
        Intent intent;
        try {
            String uri2 = uri.toString();
            if (Build.VERSION.SDK_INT >= 22) {
                intent = uri2.startsWith("android-app://") ? Intent.parseUri(uri2, 2) : m188(uri2);
                if (intent == null) {
                    return;
                }
            } else {
                intent = new Intent("android.intent.action.VIEW");
                intent.setData(uri);
            }
            intent.setComponent(null);
            intent.addFlags(268435456);
            String scheme = uri.getScheme();
            if (!TextUtils.isEmpty(scheme) && scheme.equalsIgnoreCase("market")) {
                intent.setPackage("com.android.vending");
            }
            openIntent(intent);
        } catch (Exception e) {
            StringBuilder m302 = C0394.m302("c", " openIntentByUri error: ");
            m302.append(e.getMessage());
            DevLog.logW(m302.toString());
        }
    }

    @Override
    public void openWebView(Class<?> cls, String str) {
        Intent intent = ContextUtils.getActivity() != null ? new Intent(ContextUtils.getActivity(), cls) : new Intent(ContextUtils.getApplication(), cls);
        intent.setFlags(268435456);
        intent.putExtra("Url", str);
        if (ContextUtils.getActivity() != null) {
            ContextUtils.getActivity().startActivity(intent);
        } else {
            ContextUtils.getApplication().startActivity(intent);
        }
    }
}