导航菜单

页面标题

页面副标题

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

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

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


package com.naspers.ragnarok.universal.ui.ui.util.common;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.widget.Toast;
import androidx.fragment.app.Fragment;
import com.mediapicker.gallery.b;
import com.mediapicker.gallery.domain.entity.k;
import com.mediapicker.gallery.domain.entity.m;
import com.mediapicker.gallery.presentation.activity.GalleryActivity;
import com.naspers.ragnarok.data.R;
import com.naspers.ragnarok.domain.constant.Constants;
import com.naspers.ragnarok.domain.entity.location.IMapLocation;
import com.naspers.ragnarok.domain.entity.location.RagnarokLocation;
import com.naspers.ragnarok.domain.entity.message.Message;
import com.naspers.ragnarok.domain.util.common.Extras;
import com.naspers.ragnarok.domain.util.tracking.TrackingUtil;
import com.naspers.ragnarok.universal.ui.provider.a;
import com.naspers.ragnarok.universal.ui.ui.util.preference.a;
import java.io.File;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

public final class e implements com.mediapicker.gallery.domain.contract.b {
    private final com.naspers.ragnarok.common.tracking.b a;
    private final String b;
    private final com.naspers.ragnarok.common.logging.a c;
    private final TrackingUtil d;
    private boolean e;
    private Extras f;
    private a g;
    private Message h;
    private b i;

    public interface a {
        void O2();

        Context getContext();

        Map getCurrentAdTrackingParameters();

        void p4(IMapLocation iMapLocation, Extras extras, boolean z, Message message);

        void s0();

        void u2(String str, String str2, Extras extras, Message message);
    }

    public interface b {
        void v0(Extras extras);
    }

    public e(com.naspers.ragnarok.common.tracking.b bVar, String str, com.naspers.ragnarok.common.logging.a aVar, TrackingUtil trackingUtil) {
        this.a = bVar;
        this.b = str;
        this.c = aVar;
        this.d = trackingUtil;
    }

    private final boolean b(String str) {
        try {
            d().getPackageManager().getPackageInfo(str, 1);
            return true;
        } catch (PackageManager.NameNotFoundException unused) {
            return false;
        }
    }

    private final Context d() {
        a aVar = this.g;
        if (aVar != null) {
            return aVar.getContext();
        }
        return null;
    }

    private final m.a e() {
        m.a aVar = new m.a();
        a.C0043a c0043a = com.naspers.ragnarok.universal.ui.provider.a.c;
        return aVar.d(new k.e(1, c0043a.a().k().getString(R.string.ragnarok_msg_min_photos_selection))).b(new k.a(15, c0043a.a().k().getString(R.string.ragnarok_msg_max_photo_selection))).e(new k.f(0, "")).c(new k.c(4, ""));
    }

    private final boolean f(Intent intent, Context context) {
        if (intent.resolveActivity(context.getPackageManager()) != null) {
            return true;
        }
        Toast.makeText(context, R.string.ragnarok_error_title, 0).show();
        com.naspers.ragnarok.universal.ui.provider.a.c.a().K(new Exception("No App available to handle action -> ACTION_DIAL, OnAction: " + intent.getAction() + "and Uri:" + intent.getData()));
        return false;
    }

    private final void j(Intent intent) {
        if (intent != null && this.g != null) {
            IMapLocation iMapLocation = (IMapLocation) intent.getSerializableExtra("location");
            a aVar = this.g;
            if (aVar != null) {
                aVar.p4(iMapLocation, this.f, intent.getBooleanExtra(Constants.ExtraKeys.LOCATION_CURRENT, false), this.h);
            }
        }
        this.f = null;
    }

    private final void k(Intent intent) {
        Map hashMap;
        Extras extras = this.f;
        if (extras != null) {
            String extra = extras != null ? extras.getExtra(Extras.Constants.INTERVENTION_METADATA_ID) : null;
            if (extra == null) {
                extra = "";
            }
            if (!TextUtils.isEmpty(extra)) {
                com.naspers.ragnarok.common.tracking.b bVar = this.a;
                a aVar = this.g;
                if (aVar == null || (hashMap = aVar.getCurrentAdTrackingParameters()) == null) {
                    hashMap = new HashMap();
                }
                bVar.o(extra, hashMap);
            }
            b bVar2 = this.i;
            if (bVar2 != null) {
                bVar2.v0(this.f);
            }
        }
        this.f = null;
    }

    private final void r() {
        com.mediapicker.gallery.a.a.a();
    }

    public final void a() {
        com.mediapicker.gallery.a.a.f(new b.a(this.b, this).d(true).e(false).c(b.c.c.a).f(e().a()).a());
    }

    public final void c() {
        this.g = null;
        this.i = null;
        r();
    }

    public final void g(Context context, String str) {
        Intent intent = new Intent("android.intent.action.DIAL", Uri.parse("tel:" + str));
        if (f(intent, context)) {
            Fragment fragment = this.g;
            if (fragment instanceof Fragment) {
                fragment.startActivity(intent);
            } else {
                ((androidx.appcompat.app.d) fragment).startActivity(intent);
            }
        }
    }

    public final void h(String str, Extras extras, String str2) {
        this.f = extras;
        Fragment fragment = this.i;
        if (fragment instanceof Fragment) {
            fragment.startActivityForResult(com.naspers.ragnarok.universal.ui.provider.a.c.a().v(str, str2), Constants.ActivityResultCode.MARK_AS_SOLD_ACTIVITY);
        } else {
            ((androidx.appcompat.app.d) fragment).startActivityForResult(com.naspers.ragnarok.universal.ui.provider.a.c.a().v(str, str2), Constants.ActivityResultCode.MARK_AS_SOLD_ACTIVITY);
        }
    }

    public final void i(int i, int i2, Intent intent) {
        if (i2 != -1) {
            a aVar = this.g;
            if (aVar != null) {
                aVar.s0();
            }
        } else if (i == 9988) {
            j(intent);
        } else if (i == 11010) {
            k(intent);
        }
        this.f = null;
    }

    public final void l(Context context) {
        if (this.g != null) {
            context.startActivity(GalleryActivity.a.b(GalleryActivity.R, (List) null, (List) null, (com.mediapicker.gallery.presentation.utils.a) null, context, 7, (Object) null));
        }
    }

    public final void m(Extras extras) {
        this.f = extras;
    }

    public final void n(Extras extras) {
        if (this.g != null) {
            this.f = extras;
            a.C0078a c0078a = com.naspers.ragnarok.universal.ui.ui.util.preference.a.b;
            RagnarokLocation ragnarokLocation = new RagnarokLocation(c0078a.c().getLatitude(), c0078a.c().getLongitude());
            Fragment fragment = this.g;
            if (fragment instanceof Fragment) {
                fragment.startActivityForResult(com.naspers.ragnarok.universal.ui.provider.a.c.a().t(d(), ragnarokLocation, R.string.ragnarok_share_location_title, R.string.ragnarok_share_location_btn, "chat"), Constants.ActivityResultCode.LOCATION_MAP);
            } else {
                ((androidx.appcompat.app.d) fragment).startActivityForResult(com.naspers.ragnarok.universal.ui.provider.a.c.a().t(d(), ragnarokLocation, R.string.ragnarok_share_location_title, R.string.ragnarok_share_location_btn, "chat"), Constants.ActivityResultCode.LOCATION_MAP);
            }
        }
    }

    public final void o() {
    }

    public void o2(List list, List list2) {
        Map hashMap;
        a aVar = this.g;
        if (aVar == null || (hashMap = aVar.getCurrentAdTrackingParameters()) == null) {
            hashMap = new HashMap();
        }
        this.a.K1(hashMap, list.size(), this.d.getCTAType(this.h, this.e));
        Iterator it = list.iterator();
        while (it.hasNext()) {
            com.mediapicker.gallery.domain.entity.i iVar = (com.mediapicker.gallery.domain.entity.i) it.next();
            String uri = Uri.fromFile(new File(iVar.e())).toString();
            a aVar2 = this.g;
            if (aVar2 != null) {
                aVar2.u2(uri, iVar.e(), this.f, this.h);
            }
        }
    }

    public final void p(Extras extras) {
        this.f = extras;
    }

    public final void q(String str) {
        String str2 = "https://api.whatsapp.com/send?phone=" + str;
        if (!b("com.whatsapp")) {
            Toast.makeText(d(), R.string.ragnarok_whatsapp_not_installed, 1).show();
            return;
        }
        Context d = d();
        d.getPackageManager().getPackageInfo("com.whatsapp", 1);
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.setData(Uri.parse(str2));
        androidx.core.content.b.startActivity(d, intent, (Bundle) null);
    }

    public void q2() {
        Map hashMap;
        a aVar = this.g;
        if (aVar == null || (hashMap = aVar.getCurrentAdTrackingParameters()) == null) {
            hashMap = new HashMap();
        }
        this.a.G1(hashMap, "chat_picture_upload");
    }

    public final void s(Context context, String str) {
        Intent z = com.naspers.ragnarok.universal.ui.provider.a.c.a().z(str);
        if (f(z, context)) {
            Fragment fragment = this.g;
            if (fragment instanceof Fragment) {
                fragment.startActivity(z);
            } else {
                ((androidx.appcompat.app.d) fragment).startActivity(z);
            }
        }
    }

    public void s3() {
    }

    public final void t(a aVar) {
        this.g = aVar;
    }

    public void u() {
    }

    public void u0() {
        a aVar = this.g;
        if (aVar != null) {
            aVar.O2();
        }
    }

    public final void v(b bVar) {
        this.i = bVar;
    }

    public final void w(Message message, boolean z) {
        this.h = message;
        this.e = z;
    }

    public final void x() {
        this.f = null;
        Toast.makeText(d(), R.string.ragnarok_voice_message_permisssion_deny, 1).show();
    }

    public final void y() {
        this.f = null;
        Toast.makeText(d(), R.string.ragnarok_voice_message_permisssion_never_ask_again, 1).show();
    }

    public void y1() {
        Map hashMap;
        Message message = this.h;
        String str = "";
        if (message != null) {
            String uuid = message != null ? message.getUuid() : null;
            if (uuid != null) {
                str = uuid;
            }
        }
        a aVar = this.g;
        if (aVar == null || (hashMap = aVar.getCurrentAdTrackingParameters()) == null) {
            hashMap = new HashMap();
        }
        this.a.T1(hashMap, str);
    }
}