Snaptube v4.40.0.4401610版本的 MD5 值为:ca2b95dcff63007195db02a6c93091b9

以下内容为反编译后的 aoy.java 源代码,内容仅作参考


package o;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import com.avocarrot.androidsdk.RedirectActivity;
import com.mobvista.msdk.base.utils.CommonSDKUtil;
import com.mopub.common.MoPubBrowser;
import com.mopub.common.UrlAction;
import com.mopub.exceptions.IntentNotResolvableException;
import com.mopub.exceptions.UrlParseException;
import o.aos;
public class aoy {
    public static void m14911(Context context, Intent intent) throws IntentNotResolvableException {
        aos.m14869(context);
        aos.m14869(intent);
        if (!(context instanceof Activity)) {
            intent.addFlags(268435456);
        }
        try {
            context.startActivity(intent);
        } catch (ActivityNotFoundException e) {
            throw new IntentNotResolvableException(e);
        }
    }

    public static Intent m14908(Context context, Class cls, Bundle bundle) {
        Intent intent = new Intent(context, cls);
        if (!(context instanceof Activity)) {
            intent.addFlags(268435456);
        }
        if (bundle != null) {
            intent.putExtras(bundle);
        }
        return intent;
    }

    public static boolean m14917(Context context, Intent intent) {
        try {
            return !context.getPackageManager().queryIntentActivities(intent, 0).isEmpty();
        } catch (NullPointerException e) {
            return false;
        }
    }

    public static Intent m14909(Uri uri) throws UrlParseException {
        aos.m14869(uri);
        if (!UrlAction.OPEN_NATIVE_BROWSER.shouldTryHandlingUrl(uri)) {
            throw new UrlParseException("URL does not have mopubnativebrowser:// scheme.");
        }
        if (!"navigate".equals(uri.getHost())) {
            throw new UrlParseException("URL missing 'navigate' host parameter.");
        }
        try {
            String queryParameter = uri.getQueryParameter("url");
            if (queryParameter == null) {
                throw new UrlParseException("URL missing 'url' query parameter.");
            }
            return new Intent("android.intent.action.VIEW", Uri.parse(queryParameter));
        } catch (UnsupportedOperationException e) {
            aov.m14902("Could not handle url: " + uri);
            throw new UrlParseException("Passed-in URL did not create a hierarchical URI.");
        }
    }

    public static Intent m14915(Uri uri) throws UrlParseException {
        if (!UrlAction.HANDLE_SHARE_TWEET.shouldTryHandlingUrl(uri)) {
            throw new UrlParseException("URL does not have mopubshare://tweet? format.");
        }
        try {
            String queryParameter = uri.getQueryParameter("screen_name");
            String queryParameter2 = uri.getQueryParameter("tweet_id");
            if (TextUtils.isEmpty(queryParameter)) {
                throw new UrlParseException("URL missing non-empty 'screen_name' query parameter.");
            }
            if (TextUtils.isEmpty(queryParameter2)) {
                throw new UrlParseException("URL missing non-empty 'tweet_id' query parameter.");
            }
            String format = String.format("Check out @%s's Tweet: %s", queryParameter, String.format("https://twitter.com/%s/status/%s", queryParameter, queryParameter2));
            Intent intent = new Intent("android.intent.action.SEND");
            intent.setType("text/plain");
            intent.putExtra("android.intent.extra.SUBJECT", format);
            intent.putExtra("android.intent.extra.TEXT", format);
            return intent;
        } catch (UnsupportedOperationException e) {
            aov.m14902("Could not handle url: " + uri);
            throw new UrlParseException("Passed-in URL did not create a hierarchical URI.");
        }
    }

    public static void m14914(Context context, Uri uri, String str) throws IntentNotResolvableException {
        aos.m14869(context);
        aos.m14869(uri);
        aov.m14901("Final URI to show in browser: " + uri);
        Bundle bundle = new Bundle();
        bundle.putString(RedirectActivity.EXTRA_URL, uri.toString());
        if (!TextUtils.isEmpty(str)) {
            bundle.putString("mopub-dsp-creative-id", str);
        }
        m14912(context, m14908(context, MoPubBrowser.class, bundle), "Could not show MoPubBrowser for url: " + uri + "\n\tPerhaps you forgot to declare com.mopub.common.MoPubBrowser in your Android manifest file.");
    }

    public static void m14912(Context context, Intent intent, String str) throws IntentNotResolvableException {
        aos.Cif.m14875(context);
        aos.Cif.m14875(intent);
        try {
            m14911(context, intent);
        } catch (IntentNotResolvableException e) {
            throw new IntentNotResolvableException(str + "\n" + e.getMessage());
        }
    }

    public static void m14913(Context context, Uri uri) throws IntentNotResolvableException {
        Intent intent = new Intent("android.intent.action.VIEW", uri);
        aos.m14869(context);
        aos.m14869(uri);
        if (m14917(context, intent)) {
            m14918(context, intent);
            return;
        }
        throw new IntentNotResolvableException("Could not handle application specific action: " + uri + "\n\tYou may be running in the emulator or another device which does not have the required application.");
    }

    public static void m14918(Context context, Intent intent) throws IntentNotResolvableException {
        aos.m14869(context);
        aos.m14869(intent);
        if (m14917(context, intent)) {
            String str = "Unable to open intent: " + intent;
            if (!(context instanceof Activity)) {
                intent.addFlags(268435456);
            }
            m14912(context, intent, str);
            return;
        }
        String stringExtra = intent.getStringExtra("browser_fallback_url");
        if (TextUtils.isEmpty(stringExtra)) {
            if (!CommonSDKUtil.AppStoreUtils.SCHEME_MARKET.equalsIgnoreCase(intent.getScheme())) {
                m14913(context, m14910(intent));
                return;
            }
            throw new IntentNotResolvableException("Device could not handle neither intent nor market url.\nIntent: " + intent.toString());
        }
        Uri parse = Uri.parse(stringExtra);
        String scheme = parse.getScheme();
        if ("http".equalsIgnoreCase(scheme) || "https".equalsIgnoreCase(scheme)) {
            m14914(context, parse, (String) null);
        } else {
            m14913(context, parse);
        }
    }

    public static Uri m14910(Intent intent) {
        aos.m14869(intent);
        return Uri.parse("market://details?id=" + intent.getPackage());
    }

    public static void m14916(Context context, Uri uri, String str) throws IntentNotResolvableException {
        aos.m14869(context);
        aos.m14869(uri);
        Intent intent = new Intent("android.intent.action.VIEW", uri);
        if (!(context instanceof Activity)) {
            intent.addFlags(268435456);
        }
        m14912(context, intent, str);
    }
}