导航菜单

页面标题

页面副标题

CityMall v1.42.1 - n.java 源代码

正在查看: CityMall v1.42.1 应用的 n.java JAVA 源代码文件

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


package f0;

import android.app.Activity;
import android.content.ClipData;
import android.content.ClipDescription;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.text.TextUtils;
import com.adster.sdk.mediation.analytics.AnalyticsConstants;
import com.adsterreactnative.NativeAdButtonManager;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableMap;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;

public abstract class n {

    protected final ReactApplicationContext f20162a;

    protected Intent f20163b;

    protected String f20164c = "Share";

    protected e0.e f20165d;

    protected ReadableMap f20166e;

    public n(ReactApplicationContext reactApplicationContext) {
        this.f20162a = reactApplicationContext;
        n(new Intent("android.intent.action.SEND"));
        f().setType("text/plain");
    }

    private ComponentName[] c(ReadableArray readableArray) {
        if (readableArray == null) {
            return null;
        }
        Intent intent = new Intent(f().getAction());
        intent.setType(f().getType());
        ArrayList arrayList = new ArrayList();
        List<ResolveInfo> queryIntentActivities = this.f20162a.getPackageManager().queryIntentActivities(intent, 0);
        for (int i5 = 0; i5 < readableArray.size(); i5++) {
            String string = readableArray.getString(i5);
            for (ResolveInfo resolveInfo : queryIntentActivities) {
                if (resolveInfo.activityInfo.packageName.equals(string)) {
                    ActivityInfo activityInfo = resolveInfo.activityInfo;
                    arrayList.add(new ComponentName(activityInfo.packageName, activityInfo.name));
                }
            }
        }
        return (ComponentName[]) arrayList.toArray(new ComponentName[0]);
    }

    public static boolean j(String str, ReadableMap readableMap) {
        return (readableMap == null || !readableMap.hasKey(str) || readableMap.isNull(str)) ? false : true;
    }

    public static boolean k(String str, Context context) {
        try {
            context.getPackageManager().getPackageInfo(str, 1);
            return true;
        } catch (PackageManager.NameNotFoundException unused) {
            return false;
        }
    }

    protected static String o(String str) {
        try {
            return URLEncoder.encode(str, "UTF-8");
        } catch (UnsupportedEncodingException unused) {
            throw new RuntimeException("URLEncoder.encode() failed for " + str);
        }
    }

    protected String a() {
        return null;
    }

    protected abstract String b();

    protected e0.e d(ReadableMap readableMap) {
        String string = j("filename", readableMap) ? readableMap.getString("filename") : null;
        Boolean bool = Boolean.FALSE;
        if (j("useInternalStorage", readableMap)) {
            bool = Boolean.valueOf(readableMap.getBoolean("useInternalStorage"));
        }
        Boolean bool2 = bool;
        return j("type", readableMap) ? new e0.e(readableMap.getString("url"), readableMap.getString("type"), string, bool2, this.f20162a) : new e0.e(readableMap.getString("url"), string, bool2, this.f20162a);
    }

    protected e0.f e(ReadableMap readableMap) {
        ArrayList arrayList = new ArrayList();
        if (j("filenames", readableMap)) {
            ReadableArray array = readableMap.getArray("filenames");
            for (int i5 = 0; i5 < array.size(); i5++) {
                arrayList.add(array.getString(i5));
            }
        }
        Boolean bool = Boolean.FALSE;
        if (j("useInternalStorage", readableMap)) {
            bool = Boolean.valueOf(readableMap.getBoolean("useInternalStorage"));
        }
        Boolean bool2 = bool;
        return j("type", readableMap) ? new e0.f(readableMap.getArray("urls"), arrayList, readableMap.getString("type"), bool2, this.f20162a) : new e0.f(readableMap.getArray("urls"), arrayList, bool2, this.f20162a);
    }

    protected Intent f() {
        return this.f20163b;
    }

    protected Intent[] g(Intent intent, Uri uri) {
        List<ResolveInfo> queryIntentActivities = this.f20162a.getPackageManager().queryIntentActivities(intent, 0);
        Intent[] intentArr = new Intent[queryIntentActivities.size()];
        for (int i5 = 0; i5 < queryIntentActivities.size(); i5++) {
            ResolveInfo resolveInfo = queryIntentActivities.get(i5);
            String str = resolveInfo.activityInfo.packageName;
            Intent intent2 = new Intent();
            intent2.setComponent(new ComponentName(str, resolveInfo.activityInfo.name));
            intent2.setAction("android.intent.action.VIEW");
            intent2.setDataAndType(uri, intent.getType());
            intent2.addFlags(1);
            intentArr[i5] = new Intent(intent2);
        }
        return intentArr;
    }

    protected abstract String h();

    protected abstract String i();

    public void l(ReadableMap readableMap) {
        this.f20166e = readableMap;
        if (j("isNewTask", readableMap) && readableMap.getBoolean("isNewTask")) {
            f().addFlags(268468224);
        }
        if (j("subject", readableMap)) {
            f().putExtra("android.intent.extra.SUBJECT", readableMap.getString("subject"));
        }
        if (j("email", readableMap)) {
            f().putExtra("android.intent.extra.EMAIL", new String[]{readableMap.getString("email")});
        }
        if (j(NativeAdButtonManager.PROP_TITLE, readableMap)) {
            this.f20164c = readableMap.getString(NativeAdButtonManager.PROP_TITLE);
        }
        String string = j(AnalyticsConstants.PARAM_EXCEPTION_MESSAGE, readableMap) ? readableMap.getString(AnalyticsConstants.PARAM_EXCEPTION_MESSAGE) : "";
        String string2 = j("social", readableMap) ? readableMap.getString("social") : "";
        if (string2.equals("sms")) {
            String string3 = readableMap.getString("recipient");
            if (!string3.isEmpty()) {
                f().putExtra("address", string3);
            }
        }
        if (string2.equals("whatsapp") && readableMap.hasKey("whatsAppNumber")) {
            f().putExtra("jid", readableMap.getString("whatsAppNumber") + "@s.whatsapp.net");
        }
        if (string2.equals("whatsappbusiness") && readableMap.hasKey("whatsAppNumber")) {
            f().putExtra("jid", readableMap.getString("whatsAppNumber") + "@s.whatsapp.net");
        }
        if (j("urls", readableMap)) {
            e0.f e5 = e(readableMap);
            if (!e5.f()) {
                if (TextUtils.isEmpty(string)) {
                    f().putExtra("android.intent.extra.TEXT", readableMap.getArray("urls").getString(0));
                    return;
                }
                f().putExtra("android.intent.extra.TEXT", string + " " + readableMap.getArray("urls").getString(0));
                return;
            }
            ArrayList d5 = e5.d();
            ClipData clipData = new ClipData(new ClipDescription("Files", new String[]{e5.c()}), new ClipData.Item((Uri) d5.get(0)));
            for (int i5 = 1; i5 < d5.size(); i5++) {
                clipData.addItem(new ClipData.Item((Uri) d5.get(i5)));
            }
            f().setClipData(clipData);
            f().setAction("android.intent.action.SEND_MULTIPLE");
            f().setType(e5.c());
            f().putParcelableArrayListExtra("android.intent.extra.STREAM", d5);
            f().addFlags(1);
            if (TextUtils.isEmpty(string)) {
                return;
            }
            f().putExtra("android.intent.extra.TEXT", string);
            return;
        }
        if (!j("url", readableMap)) {
            if (TextUtils.isEmpty(string)) {
                return;
            }
            f().putExtra("android.intent.extra.TEXT", string);
            return;
        }
        e0.e d6 = d(readableMap);
        this.f20165d = d6;
        if (d6.f()) {
            Uri d7 = this.f20165d.d();
            ClipData newUri = ClipData.newUri(this.f20162a.getContentResolver(), "File", d7);
            f().setType(this.f20165d.c());
            f().setClipData(newUri);
            f().putExtra("android.intent.extra.STREAM", d7);
            f().addFlags(1);
            if (TextUtils.isEmpty(string)) {
                return;
            }
            f().putExtra("android.intent.extra.TEXT", string);
            return;
        }
        if (TextUtils.isEmpty(string)) {
            f().putExtra("android.intent.extra.TEXT", readableMap.getString("url"));
            return;
        }
        f().putExtra("android.intent.extra.TEXT", string + " " + readableMap.getString("url"));
    }

    protected void m() {
        Intent createChooser;
        IntentSender intentSender;
        Activity currentActivity = this.f20162a.getCurrentActivity();
        if (currentActivity == null) {
            r.a("Something went wrong");
            return;
        }
        if (r.d()) {
            intentSender = r.c(this.f20162a);
            createChooser = Intent.createChooser(f(), this.f20164c, intentSender);
        } else {
            createChooser = Intent.createChooser(f(), this.f20164c);
            intentSender = null;
        }
        createChooser.addFlags(1073741824);
        if (j("showAppsToView", this.f20166e) && j("url", this.f20166e)) {
            Intent intent = new Intent("android.intent.action.VIEW");
            intent.setType(this.f20165d.c());
            createChooser.putExtra("android.intent.extra.INITIAL_INTENTS", g(intent, this.f20165d.d()));
        }
        if (j("excludedActivityTypes", this.f20166e)) {
            createChooser.putExtra("android.intent.extra.EXCLUDE_COMPONENTS", c(this.f20166e.getArray("excludedActivityTypes")));
            currentActivity.startActivityForResult(createChooser, 16845);
        } else {
            currentActivity.startActivityForResult(createChooser, 16845);
        }
        if (intentSender == null) {
            WritableMap createMap = Arguments.createMap();
            createMap.putBoolean("success", true);
            createMap.putString(AnalyticsConstants.PARAM_EXCEPTION_MESSAGE, "OK");
            r.b(createMap);
        }
    }

    protected void n(Intent intent) {
        this.f20163b = intent;
    }
}