Warkop v5.73.0版本的 MD5 值为:a4330ec2d6f5e146f59fc7622f3cdb45

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


package com.mapbox.mapboxsdk.maps;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Toast;
import androidx.annotation.NonNull;
import com.mapbox.mapboxsdk.Mapbox;
import com.mapbox.mapboxsdk.camera.CameraPosition;
import com.mapbox.mapboxsdk.style.sources.Source;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.Locale;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import ue.b;

public class d implements View.OnClickListener, DialogInterface.OnClickListener {

    @NonNull
    private final Context f32495c;

    @NonNull
    private final n f32496d;

    private Set<ue.a> f32497e;

    private AlertDialog f32498f;

    public static class a {

        private final n f32499a;

        @NonNull
        private final WeakReference<Context> f32500b;

        a(n nVar, Context context) {
            this.f32499a = nVar;
            this.f32500b = new WeakReference<>(context);
        }

        public Set<ue.a> b() {
            Context context = this.f32500b.get();
            if (context == null) {
                return Collections.emptySet();
            }
            ArrayList arrayList = new ArrayList();
            a0 D = this.f32499a.D();
            if (D != null) {
                Iterator<Source> it = D.m().iterator();
                while (it.hasNext()) {
                    String attribution = it.next().getAttribution();
                    if (!attribution.isEmpty()) {
                        arrayList.add(attribution);
                    }
                }
            }
            return new b.a(context).d(true).e(true).c((String[]) arrayList.toArray(new String[arrayList.size()])).a().b();
        }
    }

    public d(@NonNull Context context, @NonNull n nVar) {
        this.f32495c = context;
        this.f32496d = nVar;
    }

    private String[] b() {
        ArrayList arrayList = new ArrayList();
        Iterator<ue.a> it = this.f32497e.iterator();
        while (it.hasNext()) {
            arrayList.add(it.next().a());
        }
        return (String[]) arrayList.toArray(new String[arrayList.size()]);
    }

    private void e(int i15) {
        Set<ue.a> set = this.f32497e;
        String b15 = ((ue.a[]) set.toArray(new ue.a[set.size()]))[i15].b();
        if (b15.contains("https://www.mapbox.com/map-feedback") || b15.contains("https://apps.mapbox.com/feedback")) {
            b15 = a(Mapbox.getApiKey());
        }
        f(b15);
    }

    private void f(@NonNull String str) {
        try {
            Intent intent = new Intent("android.intent.action.VIEW");
            intent.setData(Uri.parse(str));
            this.f32495c.startActivity(intent);
        } catch (ActivityNotFoundException e15) {
            Toast.makeText(this.f32495c, com.mapbox.mapboxsdk.k.f32083a, 1).show();
            com.mapbox.mapboxsdk.c.d(e15);
        }
    }

    @NonNull
    String a(String str) {
        Uri.Builder buildUpon = Uri.parse("https://apps.mapbox.com/feedback").buildUpon();
        CameraPosition s15 = this.f32496d.s();
        if (s15 != null) {
            buildUpon.encodedFragment(String.format(Locale.getDefault(), "/%f/%f/%f/%f/%d", Double.valueOf(s15.target.getLongitude()), Double.valueOf(s15.target.getLatitude()), Double.valueOf(s15.zoom), Double.valueOf(s15.bearing), Integer.valueOf((int) s15.tilt)));
        }
        String packageName = this.f32495c.getApplicationContext().getPackageName();
        if (packageName != null) {
            buildUpon.appendQueryParameter("referrer", packageName);
        }
        if (str != null) {
            buildUpon.appendQueryParameter("access_token", str);
        }
        a0 D = this.f32496d.D();
        if (D != null) {
            Matcher matcher = Pattern.compile("^(.*://[^:^/]*)/(.*)/(.*)").matcher(D.n());
            if (matcher.find()) {
                String group = matcher.group(2);
                buildUpon.appendQueryParameter("owner", group).appendQueryParameter("id", matcher.group(3));
            }
        }
        return buildUpon.build().toString();
    }

    public void c() {
        AlertDialog alertDialog = this.f32498f;
        if (alertDialog != null && alertDialog.isShowing()) {
            this.f32498f.dismiss();
        }
    }

    protected void d(@NonNull String[] strArr) {
        AlertDialog.Builder builder = new AlertDialog.Builder(this.f32495c);
        builder.setTitle(com.mapbox.mapboxsdk.k.f32084b);
        builder.setAdapter(new ArrayAdapter(this.f32495c, com.mapbox.mapboxsdk.j.f32081a, strArr), this);
        this.f32498f = builder.show();
    }

    @Override
    public void onClick(@NonNull View view) {
        this.f32497e = new a(this.f32496d, view.getContext()).b();
        Context context = this.f32495c;
        if ((context instanceof Activity) && ((Activity) context).isFinishing()) {
            return;
        }
        d(b());
    }

    @Override
    public void onClick(DialogInterface dialogInterface, int i15) {
        e(i15);
    }
}