package com.ss.android.ugc.aweme.web.jsbridge;

import X.0CB;
import X.0CH;
import X.46i;
import X.6Is;
import X.C5971Hs4;
import X.FIu;
import X.KEn;
import X.KKi;
import android.app.Activity;
import android.content.Context;
import android.content.ContextWrapper;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.fe.base.BaseCommonJavaMethod;
import org.json.JSONObject;

public final class OpenPhoneAreaMethod extends BaseCommonJavaMethod implements 6Is {
    static {
        Covode.recordClassIndex(124454);
    }

    public OpenPhoneAreaMethod(byte b) {
        this();
    }

    public final void onStateChanged(0CH r1, 0CB r2) {
        OpenPhoneAreaMethod.super.onStateChanged(r1, r2);
    }

    public /* synthetic */ OpenPhoneAreaMethod() {
        this((KKi) null);
    }

    public OpenPhoneAreaMethod(KKi kKi) {
        super(kKi);
    }

    public final void handle(JSONObject jSONObject, FIu fIu) {
        C5971Hs4 hs4 = new C5971Hs4(fIu);
        if (this.mContextRef.get() != null) {
            KEn LIZIZ = 46i.LIZIZ();
            Context context = (Context) this.mContextRef.get();
            Activity activity = null;
            if (context != null) {
                while (true) {
                    if (!(context instanceof Activity)) {
                        if (context instanceof ContextWrapper) {
                            context = ((ContextWrapper) context).getBaseContext();
                            if (context == null) {
                                break;
                            }
                        } else {
                            break;
                        }
                    } else {
                        activity = (Activity) context;
                        break;
                    }
                }
            }
            LIZIZ.openCountryListActivity(activity, hs4);
        }
    }
}
