CarrotChat v2.8.80.240429版本的 MD5 值为:fdf98761f01e715a89df24b85b0d206e

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


package ak.im.ui.activity;

import ak.application.AKApplication;
import ak.im.BuildConfig;
import ak.im.loginDB.AppLoginDBHelper;
import ak.im.module.ServerListBean;
import ak.im.module.User;
import ak.im.sdk.manager.AKeyManager;
import ak.im.utils.AkeyChatUtils;
import ak.im.utils.FileUtil;
import ak.im.utils.HttpURLTools;
import ak.im.utils.Log;
import ak.view.CircleImageView;
import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.media.MediaScannerConnection;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import androidx.cardview.widget.CardView;
import androidx.fragment.app.FragmentActivity;
import com.asim.protobuf.Akeychat;
import com.contrarywind.view.WheelView;
import com.huawei.hms.support.api.entity.core.CommonCode;
import com.meizu.cloud.pushsdk.notification.model.NotifyType;
import com.mobile.auth.gatewayauth.Constant;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import kotlin.Metadata;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.jvm.internal.Ref$ObjectRef;
import kotlin.text.StringsKt__StringsKt;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.jetbrains.anko.AsyncKt;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jivesoftware.smackx.xhtmlim.XHTMLText;
import retrofit2.k;
import u0.a0;

@Metadata(bv = {}, d1 = {"\u0000}\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\t\n\u0002\b\u0004\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\r\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\u000b\n\u0002\b\u000b*\u00013\u0018\u0000 X2\u00020\u0001:\u0001+B\u0007¢\u0006\u0004\bV\u0010WJ\b\u0010\u0003\u001a\u00020\u0002H\u0002J\b\u0010\u0004\u001a\u00020\u0002H\u0002J\b\u0010\u0005\u001a\u00020\u0002H\u0002J\u0010\u0010\b\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\u0006H\u0002J\b\u0010\t\u001a\u00020\u0002H\u0002J\b\u0010\n\u001a\u00020\u0006H\u0002J\b\u0010\u000b\u001a\u00020\u0002H\u0002J\b\u0010\f\u001a\u00020\u0002H\u0002J\b\u0010\r\u001a\u00020\u0002H\u0003J\u0012\u0010\u0011\u001a\u0004\u0018\u00010\u00102\u0006\u0010\u000f\u001a\u00020\u000eH\u0002J\b\u0010\u0012\u001a\u00020\u0002H\u0002J\b\u0010\u0013\u001a\u00020\u0002H\u0002J\b\u0010\u0014\u001a\u00020\u0002H\u0003J\u0012\u0010\u0017\u001a\u00020\u00022\b\u0010\u0016\u001a\u0004\u0018\u00010\u0015H\u0014J\u0010\u0010\u0018\u001a\u00020\u00022\u0006\u0010\u0016\u001a\u00020\u0015H\u0014J\f\u0010\u001b\u001a\b\u0012\u0004\u0012\u00020\u001a0\u0019J\b\u0010\u001c\u001a\u00020\u0002H\u0016J\b\u0010\u001d\u001a\u00020\u0002H\u0016J\b\u0010\u001e\u001a\u00020\u0002H\u0016J\"\u0010$\u001a\u00020\u00022\u0006\u0010 \u001a\u00020\u001f2\u0006\u0010!\u001a\u00020\u001f2\b\u0010#\u001a\u0004\u0018\u00010\"H\u0014J\b\u0010%\u001a\u00020\u0002H\u0014J\u0010\u0010'\u001a\u00020\u00022\u0006\u0010&\u001a\u00020\"H\u0014J\u0010\u0010*\u001a\u00020\u00022\u0006\u0010)\u001a\u00020(H\u0007R\u0018\u0010-\u001a\u0004\u0018\u00010\u00108\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b+\u0010,R\u0014\u00100\u001a\u00020.8\u0002X\u0082D¢\u0006\u0006\n\u0004\b/\u0010\rR\u0016\u00102\u001a\u00020.8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b1\u0010\rR\u0014\u00106\u001a\u0002038\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b4\u00105R\u001f\u0010=\u001a\n 8*\u0004\u0018\u000107078\u0006¢\u0006\f\n\u0004\b9\u0010:\u001a\u0004\b;\u0010<R*\u0010D\u001a\n 8*\u0004\u0018\u00010\u00060\u00068\u0006@\u0006X\u0086\u000e¢\u0006\u0012\n\u0004\b>\u0010?\u001a\u0004\b@\u0010A\"\u0004\bB\u0010CR2\u0010M\u001a\u0012\u0012\u0004\u0012\u00020\u00060Ej\b\u0012\u0004\u0012\u00020\u0006`F8\u0006@\u0006X\u0086\u000e¢\u0006\u0012\n\u0004\bG\u0010H\u001a\u0004\bI\u0010J\"\u0004\bK\u0010LR\"\u0010U\u001a\u00020N8\u0006@\u0006X\u0086\u000e¢\u0006\u0012\n\u0004\bO\u0010P\u001a\u0004\bQ\u0010R\"\u0004\bS\u0010T¨\u0006Y"}, d2 = {"Lak/im/ui/activity/InviteCodeActivity;", "Lak/im/ui/activity/SwipeBackActivity;", "Lkd/s;", "init", "I", "startGenerateQRCode", "", "publishUrl", "t", "refreshView", "x", "H", "C", "J", "Landroid/view/View;", "view", "Landroid/graphics/Bitmap;", NotifyType.SOUND, "N", "K", User.NAME_PREFIX, "Landroid/os/Bundle;", "savedInstanceState", "onCreate", "onRestoreInstanceState", "Lfc/z;", "Lu0/a0$b;", "queryPublishUrlTest", "onResume", "onPause", "onDestroy", "", Constant.LOGIN_ACTIVITY_REQUEST_CODE, "resultCode", "Landroid/content/Intent;", "data", "onActivityResult", "onStop", CommonCode.Resolution.HAS_RESOLUTION_FROM_APK, "onNewIntent", "Lg/a2;", "event", "onEventMainThread", "a", "Landroid/graphics/Bitmap;", "mBitmap", "", "b", "defaultExpiredTimeSpan", "c", "expiredTimestamp", "ak/im/ui/activity/InviteCodeActivity$receiver$1", "d", "Lak/im/ui/activity/InviteCodeActivity$receiver$1;", "receiver", "Lak/im/loginDB/AppLoginDBHelper;", "kotlin.jvm.PlatformType", "e", "Lak/im/loginDB/AppLoginDBHelper;", "getMmkv", "()Lak/im/loginDB/AppLoginDBHelper;", "mmkv", "f", "Ljava/lang/String;", "getCurrentId", "()Ljava/lang/String;", "setCurrentId", "(Ljava/lang/String;)V", "currentId", "Ljava/util/ArrayList;", "Lkotlin/collections/ArrayList;", "g", "Ljava/util/ArrayList;", "getServerList", "()Ljava/util/ArrayList;", "setServerList", "(Ljava/util/ArrayList;)V", "serverList", "", XHTMLText.H, "Z", "getNeedShowChange", "()Z", "setNeedShowChange", "(Z)V", "needShowChange", "<init>", "()V", "j", "ak-im_carrotArmV7Release"}, k = 1, mv = {1, 6, 0})
public final class InviteCodeActivity extends SwipeBackActivity {

    @NotNull
    public static final Companion INSTANCE = new Companion(null);

    @NotNull
    private static final String f4112k = "InviteCodeActivity";

    @NotNull
    private static final String f4113l = "InviteCodeActivity" + ak.im.sdk.manager.f1.getInstance().getUsername();

    @Nullable
    private Bitmap mBitmap;

    private final AppLoginDBHelper mmkv;

    private String currentId;

    @NotNull
    private ArrayList<String> serverList;

    private boolean needShowChange;

    @NotNull
    public Map<Integer, View> f4122i = new LinkedHashMap();

    private final long defaultExpiredTimeSpan = 1800000;

    private long expiredTimestamp = -1;

    @NotNull
    private final InviteCodeActivity$receiver$1 receiver = new BroadcastReceiver() {
        @Override
        public void onReceive(@NotNull Context context, @NotNull Intent intent) {
            kotlin.jvm.internal.r.checkNotNullParameter(context, "context");
            kotlin.jvm.internal.r.checkNotNullParameter(intent, "intent");
            if (kotlin.jvm.internal.r.areEqual(intent.getAction(), j.u0.A)) {
                InviteCodeActivity.this.H();
            }
        }
    };

    @Metadata(bv = {}, d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u000e\n\u0002\b\t\b\u0086\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\t\u0010\nR\u001a\u0010\u0003\u001a\u00020\u00028\u0006X\u0086D¢\u0006\f\n\u0004\b\u0003\u0010\u0004\u001a\u0004\b\u0005\u0010\u0006R\u0017\u0010\u0007\u001a\u00020\u00028\u0006¢\u0006\f\n\u0004\b\u0007\u0010\u0004\u001a\u0004\b\b\u0010\u0006¨\u0006\u000b"}, d2 = {"Lak/im/ui/activity/InviteCodeActivity$a;", "", "", "TAG", "Ljava/lang/String;", "getTAG", "()Ljava/lang/String;", "key", "getKey", "<init>", "()V", "ak-im_carrotArmV7Release"}, k = 1, mv = {1, 6, 0})
    public static final class Companion {
        private Companion() {
        }

        public Companion(kotlin.jvm.internal.o oVar) {
            this();
        }

        @NotNull
        public final String getKey() {
            return InviteCodeActivity.f4113l;
        }

        @NotNull
        public final String getTAG() {
            return InviteCodeActivity.f4112k;
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000)\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J0\u0010\u000b\u001a\u00020\n2\f\u0010\u0003\u001a\b\u0012\u0002\b\u0003\u0018\u00010\u00022\b\u0010\u0005\u001a\u0004\u0018\u00010\u00042\u0006\u0010\u0007\u001a\u00020\u00062\u0006\u0010\t\u001a\u00020\bH\u0016¨\u0006\f"}, d2 = {"ak/im/ui/activity/InviteCodeActivity$b", "Landroid/widget/AdapterView$OnItemClickListener;", "Landroid/widget/AdapterView;", "parent", "Landroid/view/View;", "view", "", "position", "", "id", "Lkd/s;", "onItemClick", "ak-im_carrotArmV7Release"}, k = 1, mv = {1, 6, 0})
    public static final class b implements AdapterView.OnItemClickListener {
        b() {
        }

        @Override
        public void onItemClick(@Nullable AdapterView<?> adapterView, @Nullable View view, int i10, long j10) {
            Object obj;
            if (view != null) {
                obj = view.getTag();
            } else {
                obj = null;
            }
            String valueOf = String.valueOf(obj);
            Companion companion = InviteCodeActivity.INSTANCE;
            Log.i(companion.getTAG(), "view tag is " + valueOf);
            InviteCodeActivity.this.getMmkv().put(companion.getKey(), valueOf, 0);
            InviteCodeActivity.this.getMDelegateIBaseActivity().dismissFullWindowDialog();
            InviteCodeActivity.this.setCurrentId(valueOf);
            ((TextView) InviteCodeActivity.this._$_findCachedViewById(j.t1.current_server_id)).setText(InviteCodeActivity.this.getCurrentId());
            InviteCodeActivity.this.startGenerateQRCode();
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000#\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0003\n\u0002\b\u0004*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001J\u0010\u0010\u0006\u001a\u00020\u00052\u0006\u0010\u0004\u001a\u00020\u0003H\u0016J\u0010\u0010\b\u001a\u00020\u00052\u0006\u0010\u0007\u001a\u00020\u0002H\u0016J\u0010\u0010\u000b\u001a\u00020\u00052\u0006\u0010\n\u001a\u00020\tH\u0016J\b\u0010\f\u001a\u00020\u0005H\u0016¨\u0006\r"}, d2 = {"ak/im/ui/activity/InviteCodeActivity$c", "Lv0/a;", "Landroid/graphics/Bitmap;", "Ljc/b;", "d", "Lkd/s;", "onSubscribe", "bitmap", "onNext", "", "e", "onError", "onComplete", "ak-im_carrotArmV7Release"}, k = 1, mv = {1, 6, 0})
    public static final class c extends v0.a<Bitmap> {
        c() {
        }

        @Override
        public void onComplete() {
        }

        @Override
        public void onError(@NotNull Throwable e10) {
            kotlin.jvm.internal.r.checkNotNullParameter(e10, "e");
            InviteCodeActivity.this.getMDelegateIBaseActivity().dismissPGDialog();
            e10.printStackTrace();
            Log.w(InviteCodeActivity.INSTANCE.getTAG(), "onError " + e10.getMessage());
            ak.im.utils.s3.sendEvent(g.o7.newToastEvent(ak.im.utils.q5.getStrByResId(j.y1.internet_bad)));
        }

        @Override
        public void onSubscribe(@NotNull jc.b d10) {
            kotlin.jvm.internal.r.checkNotNullParameter(d10, "d");
            super.onSubscribe(d10);
            InviteCodeActivity.this.getMDelegateIBaseActivity().showPGDialog(null, InviteCodeActivity.this.getString(j.y1.please_wait), true);
        }

        @Override
        public void onNext(@NotNull Bitmap bitmap) {
            kotlin.jvm.internal.r.checkNotNullParameter(bitmap, "bitmap");
            InviteCodeActivity.this.getMDelegateIBaseActivity().dismissPGDialog();
            InviteCodeActivity.this.mBitmap = bitmap;
            if (InviteCodeActivity.this.mBitmap != null) {
                EventBus.getDefault().post(new g.a2());
            } else {
                Log.w(InviteCodeActivity.INSTANCE.getTAG(), "bitmap is null ");
                ak.im.utils.s3.sendEvent(g.o7.newToastEvent(ak.im.utils.q5.getStrByResId(j.y1.internet_bad)));
            }
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u0017\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\b\n\u0002\b\u0005*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001J\u0012\u0010\u0005\u001a\u00020\u00042\b\u0010\u0003\u001a\u0004\u0018\u00010\u0002H\u0016J\b\u0010\u0006\u001a\u00020\u0004H\u0016J\u0010\u0010\b\u001a\u00020\u00022\u0006\u0010\u0007\u001a\u00020\u0004H\u0016¨\u0006\t"}, d2 = {"ak/im/ui/activity/InviteCodeActivity$d", "Li2/a;", "", "o", "", "indexOf", "getItemsCount", "index", "getItem", "ak-im_carrotArmV7Release"}, k = 1, mv = {1, 6, 0})
    public static final class d implements i2.a<String> {

        final ArrayList<String> f4125a;

        d(ArrayList<String> arrayList) {
            this.f4125a = arrayList;
        }

        @Override
        public int getItemsCount() {
            return this.f4125a.size();
        }

        @Override
        @NotNull
        public String getItem(int index) {
            String str = this.f4125a.get(index);
            kotlin.jvm.internal.r.checkNotNullExpressionValue(str, "wheel1[index]");
            return str;
        }

        @Override
        public int indexOf(@Nullable String o10) {
            int indexOf;
            indexOf = CollectionsKt___CollectionsKt.indexOf((List<? extends String>) ((List<? extends Object>) this.f4125a), o10);
            return indexOf;
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u0017\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\b\n\u0002\b\u0005*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001J\u0012\u0010\u0005\u001a\u00020\u00042\b\u0010\u0003\u001a\u0004\u0018\u00010\u0002H\u0016J\b\u0010\u0006\u001a\u00020\u0004H\u0016J\u0010\u0010\b\u001a\u00020\u00022\u0006\u0010\u0007\u001a\u00020\u0004H\u0016¨\u0006\t"}, d2 = {"ak/im/ui/activity/InviteCodeActivity$e", "Li2/a;", "", "o", "", "indexOf", "getItemsCount", "index", "getItem", "ak-im_carrotArmV7Release"}, k = 1, mv = {1, 6, 0})
    public static final class e implements i2.a<String> {

        final ArrayList<String> f4126a;

        e(ArrayList<String> arrayList) {
            this.f4126a = arrayList;
        }

        @Override
        public int getItemsCount() {
            return this.f4126a.size();
        }

        @Override
        @NotNull
        public String getItem(int index) {
            String str = this.f4126a.get(index);
            kotlin.jvm.internal.r.checkNotNullExpressionValue(str, "wheel2[index]");
            return str;
        }

        @Override
        public int indexOf(@Nullable String o10) {
            int indexOf;
            indexOf = CollectionsKt___CollectionsKt.indexOf((List<? extends String>) ((List<? extends Object>) this.f4126a), o10);
            return indexOf;
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u0017\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\b\n\u0002\b\u0005*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001J\u0012\u0010\u0005\u001a\u00020\u00042\b\u0010\u0003\u001a\u0004\u0018\u00010\u0002H\u0016J\b\u0010\u0006\u001a\u00020\u0004H\u0016J\u0010\u0010\b\u001a\u00020\u00022\u0006\u0010\u0007\u001a\u00020\u0004H\u0016¨\u0006\t"}, d2 = {"ak/im/ui/activity/InviteCodeActivity$f", "Li2/a;", "", "o", "", "indexOf", "getItemsCount", "index", "getItem", "ak-im_carrotArmV7Release"}, k = 1, mv = {1, 6, 0})
    public static final class f implements i2.a<String> {

        final ArrayList<String> f4127a;

        f(ArrayList<String> arrayList) {
            this.f4127a = arrayList;
        }

        @Override
        public int getItemsCount() {
            return this.f4127a.size();
        }

        @Override
        @NotNull
        public String getItem(int index) {
            String str = this.f4127a.get(index);
            kotlin.jvm.internal.r.checkNotNullExpressionValue(str, "wheel3[index]");
            return str;
        }

        @Override
        public int indexOf(@Nullable String o10) {
            int indexOf;
            indexOf = CollectionsKt___CollectionsKt.indexOf((List<? extends String>) ((List<? extends Object>) this.f4127a), o10);
            return indexOf;
        }
    }

    public InviteCodeActivity() {
        boolean z10;
        String str;
        AppLoginDBHelper mmkv = ak.im.sdk.manager.f1.getInstance().getMMKV();
        this.mmkv = mmkv;
        String str2 = f4113l;
        String str3 = mmkv.get(str2);
        if (str3 != null && str3.length() != 0) {
            z10 = false;
        } else {
            z10 = true;
        }
        if (z10) {
            str = ak.im.sdk.manager.n3.getInstance().getCurrentEnterpriseInfo().enterpriseID;
        } else {
            str = mmkv.get(str2);
        }
        this.currentId = str;
        this.serverList = new ArrayList<>();
    }

    public static final void A(InviteCodeActivity this$0, View view) {
        kotlin.jvm.internal.r.checkNotNullParameter(this$0, "this$0");
        ((CheckBox) this$0._$_findCachedViewById(j.t1.check)).setChecked(!((CheckBox) this$0._$_findCachedViewById(r2)).isChecked());
        ((TextView) this$0._$_findCachedViewById(j.t1.tv_invite_code_suggest)).setText(this$0.x());
        this$0.startGenerateQRCode();
    }

    public static final void B(InviteCodeActivity this$0, View view) {
        kotlin.jvm.internal.r.checkNotNullParameter(this$0, "this$0");
        this$0.K();
    }

    private final void C() {
        ((Button) _$_findCachedViewById(j.t1.btn_save)).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                InviteCodeActivity.D(InviteCodeActivity.this, view);
            }
        });
        ((Button) _$_findCachedViewById(j.t1.btn_save_bp)).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                InviteCodeActivity.E(InviteCodeActivity.this, view);
            }
        });
        ((Button) _$_findCachedViewById(j.t1.btn_share)).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                InviteCodeActivity.F(InviteCodeActivity.this, view);
            }
        });
        ((ImageView) _$_findCachedViewById(j.t1.iv_set_time)).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                InviteCodeActivity.G(InviteCodeActivity.this, view);
            }
        });
        ((LinearLayout) _$_findCachedViewById(j.t1.ll_save_transmit)).setVisibility(8);
        ((LinearLayout) _$_findCachedViewById(j.t1.ll_save_transmit_bp)).setVisibility(0);
    }

    public static final void D(InviteCodeActivity this$0, View view) {
        kotlin.jvm.internal.r.checkNotNullParameter(this$0, "this$0");
        this$0.I();
    }

    public static final void E(InviteCodeActivity this$0, View view) {
        kotlin.jvm.internal.r.checkNotNullParameter(this$0, "this$0");
        this$0.I();
    }

    public static final void F(InviteCodeActivity this$0, View view) {
        kotlin.jvm.internal.r.checkNotNullParameter(this$0, "this$0");
        this$0.J();
    }

    public static final void G(InviteCodeActivity this$0, View view) {
        kotlin.jvm.internal.r.checkNotNullParameter(this$0, "this$0");
        this$0.N();
    }

    public final void H() {
        View findViewById = findViewById(j.t1.main_head);
        if (AKeyManager.isSecurity()) {
            kotlin.jvm.internal.r.checkNotNull(findViewById);
            findViewById.setBackgroundColor(getResources().getColor(j.q1.sec_title_unpress));
            TextView textView = (TextView) _$_findCachedViewById(j.t1.tv_title_back);
            kotlin.jvm.internal.r.checkNotNull(textView);
            textView.setBackgroundResource(j.s1.sec_title_selector);
            return;
        }
        kotlin.jvm.internal.r.checkNotNull(findViewById);
        findViewById.setBackgroundColor(getResources().getColor(j.q1.unsec_title_unpress));
        TextView textView2 = (TextView) _$_findCachedViewById(j.t1.tv_title_back);
        kotlin.jvm.internal.r.checkNotNull(textView2);
        textView2.setBackgroundResource(j.s1.unsec_title_selector);
    }

    private final void I() {
        try {
            if (this.mBitmap != null) {
                CardView cv_invite_code = (CardView) _$_findCachedViewById(j.t1.cv_invite_code);
                kotlin.jvm.internal.r.checkNotNullExpressionValue(cv_invite_code, "cv_invite_code");
                Bitmap s10 = s(cv_invite_code);
                File file = new File(FileUtil.getSaveAttachImagePath());
                if (!file.exists()) {
                    file.mkdirs();
                }
                String str = file + '/' + e.j.MD5Encode(ak.im.sdk.manager.bf.getInstance().getUserMe().getName()) + "-invitecode-" + ak.im.utils.o3.getCurDateStr("yyyy-MM-dd-HH-mm-ss") + ".png";
                ak.im.utils.h4.saveImage(s10, str, false);
                MediaScannerConnection.scanFile(this.context, new String[]{str}, null, null);
                jr mDelegateIBaseActivity = getMDelegateIBaseActivity();
                String string = getString(j.y1.image_save_success);
                kotlin.jvm.internal.r.checkNotNullExpressionValue(string, "getString(R.string.image_save_success)");
                String substring = string.substring(2);
                kotlin.jvm.internal.r.checkNotNullExpressionValue(substring, "this as java.lang.String).substring(startIndex)");
                mDelegateIBaseActivity.showToast(substring);
            }
        } catch (Exception e10) {
            AkeyChatUtils.logException(e10);
            getMDelegateIBaseActivity().showToast(getString(j.y1.qr_code_save_fail));
        }
    }

    @SuppressLint({"CheckResult"})
    private final void J() {
        Ref$ObjectRef ref$ObjectRef = new Ref$ObjectRef();
        CardView cv_invite_code = (CardView) _$_findCachedViewById(j.t1.cv_invite_code);
        kotlin.jvm.internal.r.checkNotNullExpressionValue(cv_invite_code, "cv_invite_code");
        ref$ObjectRef.element = s(cv_invite_code);
        if (s.a.f45916a.isFlavor("pro")) {
            AsyncKt.doAsync$default(this, null, new InviteCodeActivity$shareQRCode$1(this, ref$ObjectRef), 1, null);
        } else {
            new ak.im.utils.n5(this, this.context, 1, (Bitmap) ref$ObjectRef.element).startShare(true, "");
        }
    }

    private final void K() {
        boolean z10;
        String str = this.currentId;
        ViewGroup viewGroup = null;
        View inflate = getLayoutInflater().inflate(j.u1.change_server_dialog, (ViewGroup) null);
        LinearLayout linearLayout = (LinearLayout) inflate.findViewById(j.t1.parentLayout);
        ListView listView = (ListView) linearLayout.findViewById(j.t1.listView);
        if (this.serverList.size() <= 3) {
            h.a.gone(listView);
            int size = this.serverList.size() - 1;
            if (size >= 0) {
                int i10 = 0;
                z10 = false;
                while (true) {
                    View inflate2 = getLayoutInflater().inflate(j.u1.change_server_dialog_item, viewGroup);
                    ImageView imageView = (ImageView) inflate2.findViewById(j.t1.server_img);
                    ImageView imageView2 = (ImageView) inflate2.findViewById(j.t1.choose);
                    TextView textView = (TextView) inflate2.findViewById(j.t1.server_name);
                    ak.im.sdk.manager.x3.getInstance().displayImage(ak.im.sdk.manager.n3.getInstance().getCurrentEnterpriseInfo().enterpriseLogoUrl, j.s1.beep_server, imageView);
                    textView.setText(this.serverList.get(i10));
                    inflate2.setTag(textView.getText().toString());
                    if (kotlin.jvm.internal.r.areEqual(str, textView.getText())) {
                        h.a.visible(imageView2);
                        z10 = true;
                    } else {
                        h.a.gone(imageView2);
                    }
                    inflate2.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public final void onClick(View view) {
                            InviteCodeActivity.L(InviteCodeActivity.this, view);
                        }
                    });
                    linearLayout.addView(inflate2);
                    if (i10 == size) {
                        break;
                    }
                    i10++;
                    viewGroup = null;
                }
            } else {
                z10 = false;
            }
        } else {
            h.a.visible(listView);
            ak.im.ui.view.c1 c1Var = new ak.im.ui.view.c1(this, this.serverList, str);
            listView.setAdapter((ListAdapter) c1Var);
            listView.setOnItemClickListener(new b());
            z10 = c1Var.f8494d;
        }
        if (!z10) {
            try {
                Log.i(f4112k, "history " + this.currentId + " is lost,change to login server");
                View childAt = linearLayout.getChildAt(0);
                h.a.visible(childAt.findViewById(j.t1.choose));
                this.currentId = ak.im.sdk.manager.n3.getInstance().getCurrentEnterpriseInfo().enterpriseID;
                ((TextView) childAt.findViewById(j.t1.server_name)).setText(this.currentId);
                this.mmkv.put(f4113l, this.currentId, 0);
            } catch (Exception e10) {
                e10.printStackTrace();
            }
        }
        getMDelegateIBaseActivity().showFullWindowDialog(inflate);
    }

    public static final void L(InviteCodeActivity this$0, View view) {
        kotlin.jvm.internal.r.checkNotNullParameter(this$0, "this$0");
        String obj = view.getTag().toString();
        Log.i(f4112k, "view tag is " + obj);
        this$0.mmkv.put(f4113l, obj, 0);
        this$0.getMDelegateIBaseActivity().dismissFullWindowDialog();
        this$0.currentId = obj;
        ((TextView) this$0._$_findCachedViewById(j.t1.current_server_id)).setText(this$0.currentId);
        this$0.startGenerateQRCode();
    }

    public static final fc.e0 M(InviteCodeActivity this$0, a0.b it) {
        kotlin.jvm.internal.r.checkNotNullParameter(this$0, "this$0");
        kotlin.jvm.internal.r.checkNotNullParameter(it, "it");
        if (it.f46800a == 0) {
            String str = it.f46802c.f46799a;
            kotlin.jvm.internal.r.checkNotNullExpressionValue(str, "it.publishinfo.publishurl");
            return ak.im.utils.h5.getQRCode(this$0.t(str));
        }
        return fc.z.error(new Throwable());
    }

    private final void N() {
        View inflate = getLayoutInflater().inflate(j.u1.date_pick_view, (ViewGroup) null);
        inflate.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                InviteCodeActivity.R(InviteCodeActivity.this, view);
            }
        });
        getMDelegateIBaseActivity().showFullWindowDialog(inflate);
        ViewGroup viewGroup = (ViewGroup) inflate;
        ArrayList arrayList = new ArrayList();
        for (int i10 = 0; i10 < 31; i10++) {
            kotlin.jvm.internal.w wVar = kotlin.jvm.internal.w.f41176a;
            String string = getString(j.y1.invite_code_expired_time_day);
            kotlin.jvm.internal.r.checkNotNullExpressionValue(string, "getString(R.string.invite_code_expired_time_day)");
            String format = String.format(string, Arrays.copyOf(new Object[]{Integer.valueOf(i10)}, 1));
            kotlin.jvm.internal.r.checkNotNullExpressionValue(format, "format(format, *args)");
            arrayList.add(format);
        }
        arrayList.add(getString(j.y1.invite_code_expired_time_forever));
        d dVar = new d(arrayList);
        ArrayList arrayList2 = new ArrayList();
        for (int i11 = 0; i11 < 24; i11++) {
            kotlin.jvm.internal.w wVar2 = kotlin.jvm.internal.w.f41176a;
            String string2 = getString(j.y1.invite_code_expired_time_hour);
            kotlin.jvm.internal.r.checkNotNullExpressionValue(string2, "getString(R.string.invite_code_expired_time_hour)");
            String format2 = String.format(string2, Arrays.copyOf(new Object[]{Integer.valueOf(i11)}, 1));
            kotlin.jvm.internal.r.checkNotNullExpressionValue(format2, "format(format, *args)");
            arrayList2.add(format2);
        }
        e eVar = new e(arrayList2);
        ArrayList arrayList3 = new ArrayList();
        for (int i12 = 0; i12 < 60; i12++) {
            kotlin.jvm.internal.w wVar3 = kotlin.jvm.internal.w.f41176a;
            String string3 = getString(j.y1.invite_code_expired_time_minute);
            kotlin.jvm.internal.r.checkNotNullExpressionValue(string3, "getString(R.string.invit…code_expired_time_minute)");
            String format3 = String.format(string3, Arrays.copyOf(new Object[]{Integer.valueOf(i12)}, 1));
            kotlin.jvm.internal.r.checkNotNullExpressionValue(format3, "format(format, *args)");
            arrayList3.add(format3);
        }
        f fVar = new f(arrayList3);
        final WheelView wheelView = (WheelView) viewGroup.findViewById(j.t1.f40382w1);
        wheelView.setAdapter(dVar);
        int i13 = j.q1.blue_3c;
        wheelView.setTextColorCenter(i13);
        wheelView.setTextSize(15.0f);
        wheelView.setCurrentItem(0);
        wheelView.setLineSpacingMultiplier(2.4f);
        wheelView.setItemsVisible(5);
        final WheelView wheelView2 = (WheelView) viewGroup.findViewById(j.t1.f40383w2);
        wheelView2.setTextColorCenter(i13);
        wheelView2.setTextSize(15.0f);
        wheelView2.setAdapter(eVar);
        wheelView2.setCurrentItem(0);
        wheelView2.setItemsVisible(5);
        wheelView2.setLineSpacingMultiplier(2.4f);
        final WheelView wheelView3 = (WheelView) viewGroup.findViewById(j.t1.f40384w3);
        wheelView3.setTextColorCenter(i13);
        wheelView3.setTextSize(15.0f);
        wheelView3.setItemsVisible(5);
        wheelView3.setLineSpacingMultiplier(2.4f);
        wheelView3.setAdapter(fVar);
        wheelView3.setCurrentItem(30);
        viewGroup.findViewById(j.t1.empty_area).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                InviteCodeActivity.O(InviteCodeActivity.this, view);
            }
        });
        viewGroup.findViewById(j.t1.tv_cancel).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                InviteCodeActivity.P(InviteCodeActivity.this, view);
            }
        });
        viewGroup.findViewById(j.t1.tv_ensure).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                InviteCodeActivity.Q(WheelView.this, wheelView2, wheelView3, this, view);
            }
        });
    }

    public static final void O(InviteCodeActivity this$0, View view) {
        kotlin.jvm.internal.r.checkNotNullParameter(this$0, "this$0");
        this$0.getMDelegateIBaseActivity().dismissFullWindowDialog();
    }

    public static final void P(InviteCodeActivity this$0, View view) {
        kotlin.jvm.internal.r.checkNotNullParameter(this$0, "this$0");
        this$0.getMDelegateIBaseActivity().dismissFullWindowDialog();
    }

    public static final void Q(WheelView wheelView, WheelView wheelView2, WheelView wheelView3, InviteCodeActivity this$0, View view) {
        kotlin.jvm.internal.r.checkNotNullParameter(this$0, "this$0");
        if (wheelView.getCurrentItem() == 0 && wheelView2.getCurrentItem() == 0 && wheelView3.getCurrentItem() == 0) {
            this$0.getMDelegateIBaseActivity().showToast(this$0.getString(j.y1.invalid_expired_time));
            return;
        }
        this$0.getMDelegateIBaseActivity().dismissFullWindowDialog();
        if (wheelView.getCurrentItem() == 31) {
            this$0.expiredTimestamp = -1L;
        } else {
            this$0.expiredTimestamp = ak.im.utils.o3.getRightTime() + (wheelView.getCurrentItem() * 86400000) + (wheelView2.getCurrentItem() * 3600000) + (wheelView3.getCurrentItem() * 60000);
        }
        this$0.startGenerateQRCode();
    }

    public static final void R(InviteCodeActivity this$0, View view) {
        kotlin.jvm.internal.r.checkNotNullParameter(this$0, "this$0");
        this$0.getMDelegateIBaseActivity().dismissFullWindowDialog();
    }

    private final void init() {
        TextView textView = (TextView) _$_findCachedViewById(j.t1.tv_title_back);
        if (textView != null) {
            textView.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    InviteCodeActivity.y(InviteCodeActivity.this, view);
                }
            });
        }
        ImageView imageView = (ImageView) _$_findCachedViewById(j.t1.qr_code_img);
        if (imageView != null) {
            imageView.setOnLongClickListener(new View.OnLongClickListener() {
                @Override
                public final boolean onLongClick(View view) {
                    boolean z10;
                    z10 = InviteCodeActivity.z(InviteCodeActivity.this, view);
                    return z10;
                }
            });
        }
        ((LinearLayout) _$_findCachedViewById(j.t1.is_add_auto)).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                InviteCodeActivity.A(InviteCodeActivity.this, view);
            }
        });
        this.expiredTimestamp = ak.im.utils.o3.getRightTime() + this.defaultExpiredTimeSpan;
        C();
        ((TextView) _$_findCachedViewById(j.t1.current_server_id)).setText(this.currentId);
        ((TextView) _$_findCachedViewById(j.t1.change_server)).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                InviteCodeActivity.B(InviteCodeActivity.this, view);
            }
        });
    }

    private final void refreshView() {
        User userMe = ak.im.sdk.manager.bf.getInstance().getUserMe();
        if (userMe == null) {
            Log.w(f4112k, "user me is null");
            return;
        }
        String nickName = userMe.getNickName();
        if (nickName != null) {
            TextView textView = (TextView) _$_findCachedViewById(j.t1.nick_name_txt);
            kotlin.jvm.internal.r.checkNotNull(textView);
            textView.setText(nickName);
        }
        TextView textView2 = (TextView) _$_findCachedViewById(j.t1.tv_invite_code_suggest);
        if (textView2 != null) {
            textView2.setText(x());
        }
        H();
    }

    private final Bitmap s(View view) {
        Bitmap createBitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888);
        kotlin.jvm.internal.r.checkNotNullExpressionValue(createBitmap, "createBitmap(view.getWid… Bitmap.Config.ARGB_8888)");
        Canvas canvas = new Canvas(createBitmap);
        Drawable background = view.getBackground();
        kotlin.jvm.internal.r.checkNotNullExpressionValue(background, "view.getBackground()");
        background.draw(canvas);
        view.draw(canvas);
        return createBitmap;
    }

    public final void startGenerateQRCode() {
        String str;
        int i10 = j.s1.ic_default_male;
        User userMe = ak.im.sdk.manager.bf.getInstance().getUserMe();
        if (userMe != null) {
            str = userMe.getHeadImgThumb();
            if (kotlin.jvm.internal.r.areEqual(User.FEMALE, userMe.getGender())) {
                i10 = j.s1.ic_default_female;
            }
        } else {
            str = null;
        }
        if (!TextUtils.isEmpty(str)) {
            String downloadUrl = AkeyChatUtils.getDownloadUrl(str);
            c2.f fVar = new c2.f();
            fVar.error(i10);
            h1.c.with((FragmentActivity) this).asBitmap().load(downloadUrl).apply(fVar).into((CircleImageView) _$_findCachedViewById(j.t1.avatar_img));
        }
        StringBuilder sb2 = new StringBuilder();
        sb2.append("https://");
        sb2.append(ak.im.sdk.manager.f1.getInstance().getOssCenterHost());
        try {
            u0.a0 a0Var = (u0.a0) new k.b().baseUrl(sb2.toString()).client(HttpURLTools.getOkHttpClientBuilder(sb2.toString(), ak.im.sdk.manager.f1.getInstance().getAccessToken(), false).build()).addCallAdapterFactory(mf.g.create()).addConverterFactory(nf.a.create()).build().create(u0.a0.class);
            HashMap hashMap = new HashMap();
            hashMap.put("device_type", User.ANDROID_PLATFORM);
            hashMap.put("module", "");
            hashMap.put("product_type", BuildConfig.PRODUCT_TYPE);
            hashMap.put("device_type", User.ANDROID_PLATFORM);
            hashMap.put("language", e.c.f35031a.getLanguage());
            String bigVersion = ak.im.sdk.manager.f1.getInstance().getBigVersion();
            kotlin.jvm.internal.r.checkNotNullExpressionValue(bigVersion, "getInstance().bigVersion");
            hashMap.put("version", bigVersion);
            String enterpriseId = ak.im.sdk.manager.f1.getInstance().getServer().getEnterpriseId();
            kotlin.jvm.internal.r.checkNotNullExpressionValue(enterpriseId, "getInstance().server.enterpriseId");
            hashMap.put("server_id", enterpriseId);
            a0Var.getPublishUrl(hashMap).observeOn(gd.b.io()).flatMap(new mc.o() {
                @Override
                public final Object apply(Object obj) {
                    fc.e0 M;
                    M = InviteCodeActivity.M(InviteCodeActivity.this, (a0.b) obj);
                    return M;
                }
            }).subscribeOn(gd.b.io()).observeOn(ic.a.mainThread()).subscribe(new c());
        } catch (Exception e10) {
            Log.e(f4112k, "startGenerateQRCode exception");
            AkeyChatUtils.logException(e10);
        }
    }

    private final String t(String publishUrl) {
        int indexOf$default;
        String str;
        Akeychat.QRCodeShareInfo.b newBuilder = Akeychat.QRCodeShareInfo.newBuilder();
        newBuilder.setDiscoverId(this.currentId);
        newBuilder.setDiscoverhost(this.currentId);
        newBuilder.setExpiredtime(this.expiredTimestamp);
        newBuilder.setShareuser(ak.im.sdk.manager.bf.getInstance().getUserMe().getJID());
        newBuilder.setAutoAddFriend(((CheckBox) _$_findCachedViewById(j.t1.check)).isChecked());
        String encodeBytes = e.e.encodeBytes(newBuilder.build().toByteArray());
        boolean z10 = false;
        try {
            String query = Uri.parse(publishUrl).getQuery();
            if (query != null) {
            }
            z10 = true;
            z10 = !z10;
        } catch (Throwable unused) {
            indexOf$default = StringsKt__StringsKt.indexOf$default((CharSequence) publishUrl, '?', 0, false, 6, (Object) null);
            if (indexOf$default > 0) {
                z10 = true;
            }
        }
        if (z10) {
            str = publishUrl + "&shareinfo=" + encodeBytes;
        } else {
            str = publishUrl + "?shareinfo=" + encodeBytes;
        }
        Log.d(f4112k, "The invite code content is1 " + str + " \n " + newBuilder);
        return str;
    }

    @SuppressLint({"CheckResult"})
    private final void u() {
        getMDelegateIBaseActivity().showPGDialog(j.y1.waiting);
        ((u0.g) AkeyChatUtils.baseApi(true).create(u0.g.class)).getServerList(this.currentId).subscribeOn(gd.b.io()).observeOn(ic.a.mainThread()).subscribe(new mc.g() {
            @Override
            public final void accept(Object obj) {
                InviteCodeActivity.v(InviteCodeActivity.this, (ServerListBean) obj);
            }
        }, new mc.g() {
            @Override
            public final void accept(Object obj) {
                InviteCodeActivity.w(InviteCodeActivity.this, (Throwable) obj);
            }
        });
    }

    public static final void v(InviteCodeActivity this$0, ServerListBean serverListBean) {
        boolean z10;
        kotlin.jvm.internal.r.checkNotNullParameter(this$0, "this$0");
        this$0.getMDelegateIBaseActivity().dismissPGDialog();
        if (serverListBean.getReturn_code() == 0) {
            if (kotlin.jvm.internal.r.areEqual("main_server", serverListBean.getCurrent_server()) && kotlin.jvm.internal.r.areEqual(ak.im.sdk.manager.n3.getInstance().getCurrentEnterpriseInfo().enterpriseID, this$0.currentId)) {
                h.a.gone((TextView) this$0._$_findCachedViewById(j.t1.change_server));
                h.a.gone(this$0._$_findCachedViewById(j.t1.deliver));
            } else {
                h.a.visible((TextView) this$0._$_findCachedViewById(j.t1.change_server));
                h.a.visible(this$0._$_findCachedViewById(j.t1.deliver));
                String main = serverListBean.getMain();
                boolean z11 = false;
                if (main != null && main.length() != 0) {
                    z10 = false;
                } else {
                    z10 = true;
                }
                if (!z10) {
                    String str = this$0.mmkv.get(f4113l);
                    if (str == null || str.length() == 0) {
                        z11 = true;
                    }
                    if (z11) {
                        this$0.currentId = serverListBean.getMain();
                        ((TextView) this$0._$_findCachedViewById(j.t1.current_server_id)).setText(this$0.currentId);
                    }
                }
            }
            this$0.serverList.clear();
            this$0.serverList.add(serverListBean.getMain());
            if (serverListBean.getAcceleration_server().size() > 0) {
                this$0.serverList.addAll(serverListBean.getAcceleration_server());
            }
        } else {
            h.a.gone((TextView) this$0._$_findCachedViewById(j.t1.change_server));
            h.a.gone(this$0._$_findCachedViewById(j.t1.deliver));
        }
        this$0.startGenerateQRCode();
    }

    public static final void w(InviteCodeActivity this$0, Throwable th) {
        kotlin.jvm.internal.r.checkNotNullParameter(this$0, "this$0");
        this$0.getMDelegateIBaseActivity().dismissPGDialog();
        Log.e(f4112k, "getServerListData failed,error is " + th.getMessage());
        th.printStackTrace();
        h.a.gone((TextView) this$0._$_findCachedViewById(j.t1.change_server));
        h.a.gone(this$0._$_findCachedViewById(j.t1.deliver));
        this$0.startGenerateQRCode();
    }

    private final String x() {
        String nickName;
        User userMe = ak.im.sdk.manager.bf.getInstance().getUserMe();
        if (userMe == null) {
            Log.w(f4112k, "user me is null");
            nickName = "";
        } else {
            nickName = userMe.getNickName();
            kotlin.jvm.internal.r.checkNotNullExpressionValue(nickName, "user.nickName");
        }
        if (((CheckBox) _$_findCachedViewById(j.t1.check)).isChecked()) {
            kotlin.jvm.internal.w wVar = kotlin.jvm.internal.w.f41176a;
            String string = getString(j.y1.invite_code_suggest);
            kotlin.jvm.internal.r.checkNotNullExpressionValue(string, "getString(R.string.invite_code_suggest)");
            String format = String.format(string, Arrays.copyOf(new Object[]{nickName, AKApplication.getAppName(), AKApplication.getAppName(), nickName}, 4));
            kotlin.jvm.internal.r.checkNotNullExpressionValue(format, "format(format, *args)");
            return format;
        }
        kotlin.jvm.internal.w wVar2 = kotlin.jvm.internal.w.f41176a;
        String string2 = getString(j.y1.invite_code_suggest_with_add_friend);
        kotlin.jvm.internal.r.checkNotNullExpressionValue(string2, "getString(R.string.invit…_suggest_with_add_friend)");
        String format2 = String.format(string2, Arrays.copyOf(new Object[]{nickName, AKApplication.getAppName(), AKApplication.getAppName()}, 3));
        kotlin.jvm.internal.r.checkNotNullExpressionValue(format2, "format(format, *args)");
        return format2;
    }

    public static final void y(InviteCodeActivity this$0, View view) {
        kotlin.jvm.internal.r.checkNotNullParameter(this$0, "this$0");
        this$0.finish();
    }

    public static final boolean z(InviteCodeActivity this$0, View view) {
        kotlin.jvm.internal.r.checkNotNullParameter(this$0, "this$0");
        kotlin.jvm.internal.r.checkNotNullParameter(view, "<anonymous parameter 0>");
        this$0.I();
        return true;
    }

    public void _$_clearFindViewByIdCache() {
        this.f4122i.clear();
    }

    @Nullable
    public View _$_findCachedViewById(int i10) {
        Map<Integer, View> map = this.f4122i;
        View view = map.get(Integer.valueOf(i10));
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i10);
        if (findViewById == null) {
            return null;
        }
        map.put(Integer.valueOf(i10), findViewById);
        return findViewById;
    }

    public final String getCurrentId() {
        return this.currentId;
    }

    public final AppLoginDBHelper getMmkv() {
        return this.mmkv;
    }

    public final boolean getNeedShowChange() {
        return this.needShowChange;
    }

    @NotNull
    public final ArrayList<String> getServerList() {
        return this.serverList;
    }

    @Override
    public void onActivityResult(int i10, int i11, @Nullable Intent intent) {
    }

    @Override
    public void onCreate(@Nullable Bundle bundle) {
        requestWindowFeature(1);
        super.onCreate(bundle);
        setContentView(j.u1.invitecode_layout);
        IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction(j.u0.A);
        registerReceiver(this.receiver, intentFilter);
        EventBus.getDefault().register(this);
        init();
        u();
    }

    @Override
    public void onDestroy() {
        EventBus.getDefault().unregister(this);
        unregisterReceiver(this.receiver);
        Bitmap bitmap = this.mBitmap;
        if (bitmap != null) {
            bitmap.recycle();
        }
        super.onDestroy();
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public final void onEventMainThread(@NotNull g.a2 event) {
        kotlin.jvm.internal.r.checkNotNullParameter(event, "event");
        if (this.mBitmap != null) {
            ((ImageView) _$_findCachedViewById(j.t1.qr_code_img)).setImageBitmap(this.mBitmap);
            String string = getString(j.y1.invite_code_expired_time_forever);
            kotlin.jvm.internal.r.checkNotNullExpressionValue(string, "getString(R.string.invit…ode_expired_time_forever)");
            long j10 = this.expiredTimestamp;
            if (j10 != -1) {
                string = ak.im.utils.o3.getDate(j10, getString(j.y1.yyyy_mm_dd_hh_mm2));
                kotlin.jvm.internal.r.checkNotNullExpressionValue(string, "getDate(expiredTimestamp…tring.yyyy_mm_dd_hh_mm2))");
            }
            TextView textView = (TextView) _$_findCachedViewById(j.t1.tv_invite_code_expired_time);
            if (textView != null) {
                kotlin.jvm.internal.w wVar = kotlin.jvm.internal.w.f41176a;
                String string2 = getString(j.y1.invite_code_expired_time);
                kotlin.jvm.internal.r.checkNotNullExpressionValue(string2, "getString(R.string.invite_code_expired_time)");
                String format = String.format(string2, Arrays.copyOf(new Object[]{string}, 1));
                kotlin.jvm.internal.r.checkNotNullExpressionValue(format, "format(format, *args)");
                textView.setText(format);
                return;
            }
            return;
        }
        Log.w(f4112k, "bitmap is null ,not set qrcode");
    }

    @Override
    public void onNewIntent(@NotNull Intent intent) {
        kotlin.jvm.internal.r.checkNotNullParameter(intent, "intent");
        super.onNewIntent(intent);
        setIntent(intent);
        init();
    }

    @Override
    public void onPause() {
        super.onPause();
    }

    @Override
    protected void onRestoreInstanceState(@NotNull Bundle savedInstanceState) {
        kotlin.jvm.internal.r.checkNotNullParameter(savedInstanceState, "savedInstanceState");
        super.onRestoreInstanceState(savedInstanceState);
        finish();
    }

    @Override
    public void onResume() {
        super.onResume();
        refreshView();
    }

    @Override
    public void onStop() {
        super.onStop();
    }

    @NotNull
    public final fc.z<a0.b> queryPublishUrlTest() {
        a0.b bVar = new a0.b();
        bVar.f46800a = 0;
        bVar.f46801b = "success";
        a0.a aVar = new a0.a();
        bVar.f46802c = aVar;
        aVar.f46799a = "http://download.weigongju.org/79816567444";
        fc.z<a0.b> just = fc.z.just(bVar);
        kotlin.jvm.internal.r.checkNotNullExpressionValue(just, "just(result)");
        return just;
    }

    public final void setCurrentId(String str) {
        this.currentId = str;
    }

    public final void setNeedShowChange(boolean z10) {
        this.needShowChange = z10;
    }

    public final void setServerList(@NotNull ArrayList<String> arrayList) {
        kotlin.jvm.internal.r.checkNotNullParameter(arrayList, "<set-?>");
        this.serverList = arrayList;
    }
}