Luno v7.28.0版本的 MD5 值为:08d81b3b88ef7df48c89cb5d56dc11a2

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


package mdi.sdk;

import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Build;
import android.os.Parcelable;
import android.widget.Toast;
import androidx.fragment.app.Fragment;
import co.bitx.android.walleu.R;
import com.mparticle.identity.IdentityHttpResponse;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

public final class n32 {
    public static final n32 a = new n32();

    private n32() {
    }

    public static final int d(HashMap hashMap, HashMap hashMap2) {
        String str;
        String str2;
        if (hashMap == null || (str = (String) hashMap.get("simpleName")) == null) {
            return -1;
        }
        String str3 = "";
        if (hashMap2 != null && (str2 = (String) hashMap2.get("simpleName")) != null) {
            str3 = str2;
        }
        return str.compareTo(str3);
    }

    @fg2
    public static final void i(Context context, String str) {
        boolean z;
        boolean z2;
        if (context == null) {
            return;
        }
        if (str != null) {
            z2 = t55.z(str);
            if (!z2) {
                z = false;
                if (z) {
                    try {
                        context.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(w32.q("market://details?id=", str))));
                        return;
                    } catch (ActivityNotFoundException unused) {
                        context.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(w32.q("http://play.google.com/store/apps/details?id=", str))));
                        return;
                    }
                }
                return;
            }
        }
        z = true;
        if (z) {
        }
    }

    public static void j(Context context, String str, int i, Object obj) {
        if ((i & 2) != 0) {
            str = context == null ? null : context.getPackageName();
        }
        i(context, str);
    }

    @fg2
    public static final void k(Context context, String str) {
        Intent intent = new Intent("android.intent.action.VIEW");
        if (str != null) {
            intent.setData(Uri.parse(str));
        }
        if (context == null) {
            return;
        }
        try {
            context.startActivity(intent);
        } catch (ActivityNotFoundException unused) {
            Toast.makeText(context, R.string.all_error_web_browser, 1).show();
        }
    }

    public final Intent b(String str) {
        w32.h(str, "url");
        Intent intent = new Intent("android.intent.action.SEND");
        intent.setType("text/plain");
        intent.putExtra("android.intent.extra.TEXT", str);
        return intent;
    }

    public final Intent c(Context context, String str) {
        int u;
        List<HashMap> R0;
        w32.h(str, "title");
        if (context == null || context.getPackageManager() == null) {
            return null;
        }
        PackageManager packageManager = context.getPackageManager();
        List<ResolveInfo> queryIntentActivities = packageManager.queryIntentActivities(new Intent("android.intent.action.SENDTO", Uri.fromParts("mailto", "user@example.com", null)), 0);
        w32.g(queryIntentActivities, "pm.queryIntentActivities(dummy, 0)");
        u = iy.u(queryIntentActivities, 10);
        ArrayList arrayList = new ArrayList(u);
        Iterator<T> it = queryIntentActivities.iterator();
        while (it.hasNext()) {
            ActivityInfo activityInfo = ((ResolveInfo) it.next()).activityInfo;
            arrayList.add(activityInfo == null ? null : my2.k(gn5.a("packageName", activityInfo.packageName), gn5.a("simpleName", activityInfo.loadLabel(packageManager).toString())));
        }
        R0 = py.R0(arrayList);
        if (!(!R0.isEmpty())) {
            return null;
        }
        ly.y(R0, new Comparator() {
            @Override
            public final int compare(Object obj, Object obj2) {
                int d;
                d = n32.d((HashMap) obj, (HashMap) obj2);
                return d;
            }
        });
        ArrayList arrayList2 = new ArrayList();
        for (HashMap hashMap : R0) {
            if (hashMap != null) {
                try {
                    String str2 = (String) hashMap.get("packageName");
                    if (str2 != null) {
                        arrayList2.add(packageManager.getLaunchIntentForPackage(str2));
                    }
                } catch (Exception unused) {
                }
            }
        }
        if (!(!arrayList2.isEmpty())) {
            return null;
        }
        try {
            Intent createChooser = Intent.createChooser((Intent) arrayList2.remove(arrayList2.size() - 1), str);
            Object[] array = arrayList2.toArray(new Parcelable[0]);
            if (array != null) {
                createChooser.putExtra("android.intent.extra.INITIAL_INTENTS", (Parcelable[]) array);
                return createChooser;
            }
            throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<T of kotlin.collections.ArraysKt__ArraysJVMKt.toTypedArray>");
        } catch (NullPointerException unused2) {
            return null;
        }
    }

    public final Intent e(Context context, String str) {
        PackageManager packageManager;
        w32.h(str, "packageName");
        if (context == null || (packageManager = context.getPackageManager()) == null) {
            return null;
        }
        return packageManager.getLaunchIntentForPackage(str);
    }

    public final boolean f(Fragment fragment, int i) {
        w32.h(fragment, "fragment");
        Intent intent = new Intent("android.intent.action.GET_CONTENT");
        intent.addCategory("android.intent.category.OPENABLE");
        intent.setType("*/*");
        try {
            String string = fragment.getString(R.string.all_file_picker_title);
            w32.g(string, "fragment.getString(R.string.all_file_picker_title)");
            fragment.startActivityForResult(Intent.createChooser(intent, string), i);
            return true;
        } catch (ActivityNotFoundException unused) {
            return false;
        }
    }

    public final void g(Context context) {
        w32.h(context, IdentityHttpResponse.CONTEXT);
        try {
            context.startActivity(new Intent("android.settings.LOCATION_SOURCE_SETTINGS"));
        } catch (ActivityNotFoundException e) {
            b60.c(e);
        }
    }

    public final void h(Context context) {
        w32.h(context, IdentityHttpResponse.CONTEXT);
        Intent intent = new Intent();
        if (Build.VERSION.SDK_INT >= 26) {
            intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS");
            intent.putExtra("android.provider.extra.APP_PACKAGE", context.getPackageName());
            intent.addFlags(268435456);
        } else {
            intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS");
            intent.putExtra("app_package", context.getPackageName());
            intent.putExtra("app_uid", context.getApplicationInfo().uid);
        }
        try {
            context.startActivity(intent);
        } catch (ActivityNotFoundException e) {
            b60.c(e);
        }
    }
}