Fast Orange v3.5.3版本的 MD5 值为:33b91aba50c566533dfd683a85f79158

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


package com.github.shadowsocks.group;

import androidx.constraintlayout.widget.ConstraintLayout;
import com.free.vpn.proxy.hotspot.an1;
import com.free.vpn.proxy.hotspot.m70;
import com.free.vpn.proxy.hotspot.pl0;
import com.free.vpn.proxy.hotspot.t00;
import com.free.vpn.proxy.hotspot.x74;
import com.free.vpn.proxy.hotspot.y13;
import com.free.vpn.proxy.hotspot.zs4;
import com.github.shadowsocks.database.DataStore;
import com.github.shadowsocks.database.GroupManager;
import com.github.shadowsocks.database.ProxyGroup;
import com.github.shadowsocks.database.SubscriptionBean;
import com.github.shadowsocks.fmt.AbstractBean;
import com.github.shadowsocks.fmt.brook.BrookBean;
import com.github.shadowsocks.fmt.http.HttpBean;
import com.github.shadowsocks.fmt.hysteria.HysteriaBean;
import com.github.shadowsocks.fmt.naive.NaiveBean;
import com.github.shadowsocks.fmt.relaybaton.RelayBatonBean;
import com.github.shadowsocks.fmt.socks.SOCKSBean;
import com.github.shadowsocks.fmt.trojan.TrojanBean;
import com.github.shadowsocks.fmt.trojan_go.TrojanGoBean;
import com.github.shadowsocks.fmt.v2ray.StandardV2RayBean;
import com.github.shadowsocks.ktx.AsyncsKt;
import com.github.shadowsocks.ktx.Logs;
import com.github.shadowsocks.ktx.NetsKt;
import com.github.shadowsocks.ktx.UtilsKt;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
import kotlin.Metadata;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.reflect.KProperty;
import kotlinx.coroutines.AwaitKt;
import kotlinx.coroutines.BuildersKt__Builders_commonKt;
import kotlinx.coroutines.CoroutineScopeKt;
import kotlinx.coroutines.ExecutorCoroutineDispatcher;
import kotlinx.coroutines.GlobalScope;
import kotlinx.coroutines.Job;
import kotlinx.coroutines.ThreadPoolDispatcherKt;
import libcore.HTTPClient;
import libcore.Libcore;

@Metadata(d1 = {"\u0000F\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\b&\u0018\u0000 \u001a2\u00020\u0001:\u0002\u001a\u001bB\u0005¢\u0006\u0002\u0010\u0002J3\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\b2\b\u0010\t\u001a\u0004\u0018\u00010\n2\u0006\u0010\u000b\u001a\u00020\fH¦@ø\u0001\u0000¢\u0006\u0002\u0010\rJ)\u0010\u000e\u001a\u00020\u00042\f\u0010\u000f\u001a\b\u0012\u0004\u0012\u00020\u00110\u00102\b\u0010\u0012\u001a\u0004\u0018\u00010\u0013H\u0084@ø\u0001\u0000¢\u0006\u0002\u0010\u0014J&\u0010\u0015\u001a\u00020\u00042\u0006\u0010\u0016\u001a\u00020\u00112\f\u0010\u0017\u001a\b\u0012\u0004\u0012\u00020\u00180\u00102\u0006\u0010\u0019\u001a\u00020\fH\u0004\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\u001c"}, d2 = {"Lcom/github/shadowsocks/group/GroupUpdater;", "", "()V", "doUpdate", "", "proxyGroup", "Lcom/github/shadowsocks/database/ProxyGroup;", "subscription", "Lcom/github/shadowsocks/database/SubscriptionBean;", "userInterface", "Lcom/github/shadowsocks/database/GroupManager$Interface;", "byUser", "", "(Lcom/github/shadowsocks/database/ProxyGroup;Lcom/github/shadowsocks/database/SubscriptionBean;Lcom/github/shadowsocks/database/GroupManager$Interface;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;", "forceResolve", "profiles", "", "Lcom/github/shadowsocks/fmt/AbstractBean;", "groupId", "", "(Ljava/util/List;Ljava/lang/Long;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "rewriteAddress", "bean", "addresses", "Ljava/net/InetAddress;", "ipv6First", "Companion", "Progress", "shadowsocks_release"}, k = 1, mv = {1, 8, 0}, xi = ConstraintLayout.LayoutParams.Table.LAYOUT_CONSTRAINT_VERTICAL_CHAINSTYLE)
public abstract class GroupUpdater {

    public static final Companion INSTANCE = new Companion(null);
    private static final Set<Long> updating = Collections.synchronizedSet(new LinkedHashSet());
    private static final Map<Long, Progress> progress = Collections.synchronizedMap(new LinkedHashMap());

    @Metadata(d1 = {"\u0000<\n\u0000\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0005\n\u0002\u0010#\n\u0002\u0010\t\n\u0000\n\u0002\u0010\"\n\u0002\b\u0004\n\u0002\u0010%\n\u0002\u0018\u0002\n\u0002\u0010$\n\u0002\b\u0007\b\u0086\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u001b\u0010\u001cJ\u0016\u0010\u0007\u001a\u00020\u00062\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u0004J#\u0010\b\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u0004H\u0086@ø\u0001\u0000¢\u0006\u0004\b\b\u0010\tJ\u001b\u0010\n\u001a\u00020\u00062\u0006\u0010\u0003\u001a\u00020\u0002H\u0086@ø\u0001\u0000¢\u0006\u0004\b\n\u0010\u000bR;\u0010\u0010\u001a&\u0012\f\u0012\n \u000e*\u0004\u0018\u00010\r0\r \u000e*\u0012\u0012\f\u0012\n \u000e*\u0004\u0018\u00010\r0\r\u0018\u00010\u000f0\f8\u0006¢\u0006\f\n\u0004\b\u0010\u0010\u0011\u001a\u0004\b\u0012\u0010\u0013RW\u0010\u0017\u001aB\u0012\f\u0012\n \u000e*\u0004\u0018\u00010\r0\r\u0012\f\u0012\n \u000e*\u0004\u0018\u00010\u00150\u0015 \u000e* \u0012\f\u0012\n \u000e*\u0004\u0018\u00010\r0\r\u0012\f\u0012\n \u000e*\u0004\u0018\u00010\u00150\u0015\u0018\u00010\u00160\u00148\u0006¢\u0006\f\n\u0004\b\u0017\u0010\u0018\u001a\u0004\b\u0019\u0010\u001a\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\u001d"}, d2 = {"com/github/shadowsocks/group/GroupUpdater$Companion", "", "Lcom/github/shadowsocks/database/ProxyGroup;", "proxyGroup", "", "byUser", "", "startUpdate", "executeUpdate", "(Lcom/github/shadowsocks/database/ProxyGroup;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;", "finishUpdate", "(Lcom/github/shadowsocks/database/ProxyGroup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "", "", "kotlin.jvm.PlatformType", "", "updating", "Ljava/util/Set;", "getUpdating", "()Ljava/util/Set;", "", "Lcom/github/shadowsocks/group/GroupUpdater$Progress;", "", "progress", "Ljava/util/Map;", "getProgress", "()Ljava/util/Map;", "<init>", "()V", "shadowsocks_release"}, k = 1, mv = {1, 8, 0})
    public final class Companion {
        private Companion() {
        }

        public Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        public final Object executeUpdate(ProxyGroup proxyGroup, boolean z, Continuation<? super Boolean> continuation) {
            return CoroutineScopeKt.coroutineScope(new GroupUpdater$Companion$executeUpdate$2(proxyGroup, z, null), continuation);
        }

        public final Object finishUpdate(ProxyGroup proxyGroup, Continuation<? super Unit> continuation) {
            getUpdating().remove(new Long(proxyGroup.getId()));
            getProgress().remove(new Long(proxyGroup.getId()));
            Object postUpdate = GroupManager.INSTANCE.postUpdate(proxyGroup, continuation);
            if (postUpdate == m70.a) {
                return postUpdate;
            }
            return Unit.INSTANCE;
        }

        public final Map<Long, Progress> getProgress() {
            return GroupUpdater.progress;
        }

        public final Set<Long> getUpdating() {
            return GroupUpdater.updating;
        }

        public final void startUpdate(ProxyGroup proxyGroup, boolean byUser) {
            zs4.o(proxyGroup, "proxyGroup");
            AsyncsKt.runOnDefaultDispatcher(new GroupUpdater$Companion$startUpdate$1(proxyGroup, byUser, null));
        }
    }

    @Metadata(d1 = {"\u0000$\n\u0000\n\u0002\u0010\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u000e\b\u0086\b\u0018\u00002\u00020\u0001B\u000f\u0012\u0006\u0010\u0004\u001a\u00020\u0002¢\u0006\u0004\b\u0018\u0010\u0011J\t\u0010\u0003\u001a\u00020\u0002HÆ\u0003J\u0013\u0010\u0006\u001a\u00020\u00052\b\b\u0002\u0010\u0004\u001a\u00020\u0002HÆ\u0001J\t\u0010\b\u001a\u00020\u0007HÖ\u0001J\t\u0010\t\u001a\u00020\u0002HÖ\u0001J\u0013\u0010\f\u001a\u00020\u000b2\b\u0010\n\u001a\u0004\u0018\u00010\u0001HÖ\u0003R\"\u0010\u0004\u001a\u00020\u00028\u0006@\u0006X\u0086\u000e¢\u0006\u0012\n\u0004\b\u0004\u0010\r\u001a\u0004\b\u000e\u0010\u000f\"\u0004\b\u0010\u0010\u0011R+\u0010\u0017\u001a\u00020\u00022\u0006\u0010\u0012\u001a\u00020\u00028F@FX\u0086\u008e\u0002¢\u0006\u0012\n\u0004\b\u0013\u0010\u0014\u001a\u0004\b\u0015\u0010\u000f\"\u0004\b\u0016\u0010\u0011¨\u0006\u0019"}, d2 = {"com/github/shadowsocks/group/GroupUpdater$Progress", "", "", "component1", "max", "Lcom/github/shadowsocks/group/GroupUpdater$Progress;", "copy", "", "toString", "hashCode", "other", "", "equals", "I", "getMax", "()I", "setMax", "(I)V", "<set-?>", "progress$delegate", "Ljava/util/concurrent/atomic/AtomicInteger;", "getProgress", "setProgress", "progress", "<init>", "shadowsocks_release"}, k = 1, mv = {1, 8, 0})
    public final class Progress {
        static final KProperty[] $$delegatedProperties = {y13.h(Progress.class, "progress", "getProgress()I", 0)};
        private int max;

        private final AtomicInteger progress = new AtomicInteger();

        public Progress(int i) {
            this.max = i;
        }

        public static Progress copy$default(Progress progress, int i, int i2, Object obj) {
            if ((i2 & 1) != 0) {
                i = progress.max;
            }
            return progress.copy(i);
        }

        public final int getMax() {
            return this.max;
        }

        public final Progress copy(int max) {
            return new Progress(max);
        }

        public boolean equals(Object other) {
            if (this == other) {
                return true;
            }
            return (other instanceof Progress) && this.max == ((Progress) other).max;
        }

        public final int getMax() {
            return this.max;
        }

        public final int getProgress() {
            return UtilsKt.getValue(this.progress, this, $$delegatedProperties[0]);
        }

        public int hashCode() {
            return this.max;
        }

        public final void setMax(int i) {
            this.max = i;
        }

        public final void setProgress(int i) {
            UtilsKt.setValue(this.progress, this, $$delegatedProperties[0], i);
        }

        public String toString() {
            return pl0.m("Progress(max=", this.max, ")");
        }
    }

    public abstract Object doUpdate(ProxyGroup proxyGroup, SubscriptionBean subscriptionBean, GroupManager.Interface r3, boolean z, Continuation<? super Unit> continuation);

    public final Object forceResolve(List<? extends AbstractBean> list, Long l, Continuation<? super Unit> continuation) {
        GroupUpdater$forceResolve$1 groupUpdater$forceResolve$1;
        m70 m70Var;
        int i;
        boolean z;
        String directDns;
        String str;
        HTTPClient newHttpClient;
        int ipv6Mode;
        ExecutorCoroutineDispatcher newFixedThreadPoolContext;
        List arrayList;
        Progress progress2;
        GroupUpdater groupUpdater;
        Long l2;
        List<? extends AbstractBean> list2;
        int i2;
        String str2;
        ExecutorCoroutineDispatcher executorCoroutineDispatcher;
        boolean z2;
        boolean z3;
        String str3;
        Job launch$default;
        if (continuation instanceof GroupUpdater$forceResolve$1) {
            groupUpdater$forceResolve$1 = (GroupUpdater$forceResolve$1) continuation;
            int i3 = groupUpdater$forceResolve$1.label;
            if ((i3 & Integer.MIN_VALUE) != 0) {
                groupUpdater$forceResolve$1.label = i3 - Integer.MIN_VALUE;
                Object obj = groupUpdater$forceResolve$1.result;
                m70Var = m70.a;
                i = groupUpdater$forceResolve$1.label;
                if (i == 0) {
                    if (i != 1) {
                        if (i == 2) {
                            executorCoroutineDispatcher = (ExecutorCoroutineDispatcher) groupUpdater$forceResolve$1.L$0;
                            ResultKt.throwOnFailure(obj);
                            executorCoroutineDispatcher.close();
                            return Unit.INSTANCE;
                        }
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    i2 = groupUpdater$forceResolve$1.I$0;
                    progress2 = (Progress) groupUpdater$forceResolve$1.L$7;
                    arrayList = (List) groupUpdater$forceResolve$1.L$6;
                    newFixedThreadPoolContext = (ExecutorCoroutineDispatcher) groupUpdater$forceResolve$1.L$5;
                    newHttpClient = (HTTPClient) groupUpdater$forceResolve$1.L$4;
                    str = (String) groupUpdater$forceResolve$1.L$3;
                    l2 = (Long) groupUpdater$forceResolve$1.L$2;
                    list2 = (List) groupUpdater$forceResolve$1.L$1;
                    groupUpdater = (GroupUpdater) groupUpdater$forceResolve$1.L$0;
                    ResultKt.throwOnFailure(obj);
                } else {
                    ResultKt.throwOnFailure(obj);
                    DataStore dataStore = DataStore.INSTANCE;
                    if (dataStore.getStartedProfile() > 0) {
                        z = true;
                    } else {
                        z = false;
                    }
                    if (z) {
                        directDns = dataStore.getRemoteDns();
                        if (!x74.r1(directDns, "https+local://", false)) {
                        }
                        directDns = x74.l1(directDns, "https+local://", "https://");
                        if (directDns != null) {
                            if (z) {
                                str2 = "https://dns.google/dns-query";
                            } else {
                                str2 = "https://doh.pub/dns-query";
                            }
                            str = str2;
                        } else {
                            str = directDns;
                        }
                        newHttpClient = Libcore.newHttpClient();
                        newHttpClient.modernTLS();
                        newHttpClient.keepAlive();
                        newHttpClient.trySocks5(dataStore.getSocksPort());
                        Logs.INSTANCE.d("Using doh url ".concat(str));
                        ipv6Mode = dataStore.getIpv6Mode();
                        newFixedThreadPoolContext = ThreadPoolDispatcherKt.newFixedThreadPoolContext(5, "DNS Lookup");
                        arrayList = new ArrayList();
                        progress2 = new Progress(list.size());
                        if (l == null) {
                            Map<Long, Progress> map = progress;
                            zs4.n(map, "progress");
                            map.put(l, progress2);
                            GroupManager groupManager = GroupManager.INSTANCE;
                            long longValue = l.longValue();
                            groupUpdater$forceResolve$1.L$0 = this;
                            groupUpdater$forceResolve$1.L$1 = list;
                            groupUpdater$forceResolve$1.L$2 = l;
                            groupUpdater$forceResolve$1.L$3 = str;
                            groupUpdater$forceResolve$1.L$4 = newHttpClient;
                            groupUpdater$forceResolve$1.L$5 = newFixedThreadPoolContext;
                            groupUpdater$forceResolve$1.L$6 = arrayList;
                            groupUpdater$forceResolve$1.L$7 = progress2;
                            groupUpdater$forceResolve$1.I$0 = ipv6Mode;
                            groupUpdater$forceResolve$1.label = 1;
                            if (groupManager.postReload(longValue, groupUpdater$forceResolve$1) == m70Var) {
                                return m70Var;
                            }
                            groupUpdater = this;
                            l2 = l;
                            i2 = ipv6Mode;
                            list2 = list;
                        } else {
                            groupUpdater = this;
                            l2 = l;
                            list2 = list;
                            executorCoroutineDispatcher = newFixedThreadPoolContext;
                            if (ipv6Mode >= 2) {
                                z2 = true;
                            } else {
                                z2 = false;
                            }
                            for (AbstractBean abstractBean : list2) {
                                if (abstractBean instanceof BrookBean) {
                                    if (zs4.h(((BrookBean) abstractBean).getProtocol(), "wss")) {
                                    }
                                    str3 = abstractBean.serverAddress;
                                    zs4.n(str3, "profile.serverAddress");
                                    if (NetsKt.isIpAddress(str3)) {
                                        launch$default = BuildersKt__Builders_commonKt.launch$default(GlobalScope.INSTANCE, executorCoroutineDispatcher, null, new GroupUpdater$forceResolve$2(abstractBean, ipv6Mode, newHttpClient, groupUpdater, z2, l2, progress2, str, null), 2, null);
                                        arrayList.add(launch$default);
                                    }
                                } else {
                                    if (abstractBean instanceof NaiveBean) {
                                        z3 = true;
                                    } else {
                                        z3 = abstractBean instanceof RelayBatonBean;
                                    }
                                    if (z3) {
                                    }
                                    str3 = abstractBean.serverAddress;
                                    zs4.n(str3, "profile.serverAddress");
                                    if (NetsKt.isIpAddress(str3)) {
                                    }
                                }
                            }
                            newHttpClient.close();
                            groupUpdater$forceResolve$1.L$0 = executorCoroutineDispatcher;
                            groupUpdater$forceResolve$1.L$1 = null;
                            groupUpdater$forceResolve$1.L$2 = null;
                            groupUpdater$forceResolve$1.L$3 = null;
                            groupUpdater$forceResolve$1.L$4 = null;
                            groupUpdater$forceResolve$1.L$5 = null;
                            groupUpdater$forceResolve$1.L$6 = null;
                            groupUpdater$forceResolve$1.L$7 = null;
                            groupUpdater$forceResolve$1.label = 2;
                            if (AwaitKt.joinAll(arrayList, groupUpdater$forceResolve$1) == m70Var) {
                                return m70Var;
                            }
                        }
                    } else {
                        directDns = dataStore.getDirectDns();
                        if (!x74.r1(directDns, "https+local://", false)) {
                        }
                        directDns = x74.l1(directDns, "https+local://", "https://");
                        if (directDns != null) {
                        }
                        newHttpClient = Libcore.newHttpClient();
                        newHttpClient.modernTLS();
                        newHttpClient.keepAlive();
                        newHttpClient.trySocks5(dataStore.getSocksPort());
                        Logs.INSTANCE.d("Using doh url ".concat(str));
                        ipv6Mode = dataStore.getIpv6Mode();
                        newFixedThreadPoolContext = ThreadPoolDispatcherKt.newFixedThreadPoolContext(5, "DNS Lookup");
                        arrayList = new ArrayList();
                        progress2 = new Progress(list.size());
                        if (l == null) {
                        }
                    }
                    executorCoroutineDispatcher.close();
                    return Unit.INSTANCE;
                }
                ipv6Mode = i2;
                executorCoroutineDispatcher = newFixedThreadPoolContext;
                if (ipv6Mode >= 2) {
                }
                while (r11.hasNext()) {
                }
                newHttpClient.close();
                groupUpdater$forceResolve$1.L$0 = executorCoroutineDispatcher;
                groupUpdater$forceResolve$1.L$1 = null;
                groupUpdater$forceResolve$1.L$2 = null;
                groupUpdater$forceResolve$1.L$3 = null;
                groupUpdater$forceResolve$1.L$4 = null;
                groupUpdater$forceResolve$1.L$5 = null;
                groupUpdater$forceResolve$1.L$6 = null;
                groupUpdater$forceResolve$1.L$7 = null;
                groupUpdater$forceResolve$1.label = 2;
                if (AwaitKt.joinAll(arrayList, groupUpdater$forceResolve$1) == m70Var) {
                }
                executorCoroutineDispatcher.close();
                return Unit.INSTANCE;
            }
        }
        groupUpdater$forceResolve$1 = new GroupUpdater$forceResolve$1(this, continuation);
        Object obj2 = groupUpdater$forceResolve$1.result;
        m70Var = m70.a;
        i = groupUpdater$forceResolve$1.label;
        if (i == 0) {
        }
        ipv6Mode = i2;
        executorCoroutineDispatcher = newFixedThreadPoolContext;
        if (ipv6Mode >= 2) {
        }
        while (r11.hasNext()) {
        }
        newHttpClient.close();
        groupUpdater$forceResolve$1.L$0 = executorCoroutineDispatcher;
        groupUpdater$forceResolve$1.L$1 = null;
        groupUpdater$forceResolve$1.L$2 = null;
        groupUpdater$forceResolve$1.L$3 = null;
        groupUpdater$forceResolve$1.L$4 = null;
        groupUpdater$forceResolve$1.L$5 = null;
        groupUpdater$forceResolve$1.L$6 = null;
        groupUpdater$forceResolve$1.L$7 = null;
        groupUpdater$forceResolve$1.label = 2;
        if (AwaitKt.joinAll(arrayList, groupUpdater$forceResolve$1) == m70Var) {
        }
        executorCoroutineDispatcher.close();
        return Unit.INSTANCE;
    }

    public final void rewriteAddress(AbstractBean bean, List<? extends InetAddress> addresses, final boolean ipv6First) {
        zs4.o(bean, "bean");
        zs4.o(addresses, "addresses");
        String hostAddress = ((InetAddress) t00.A1(addresses, new Comparator() {
            @Override
            public final int compare(T t, T t2) {
                return an1.i(Boolean.valueOf((((InetAddress) t) instanceof Inet4Address) ^ ipv6First), Boolean.valueOf((((InetAddress) t2) instanceof Inet4Address) ^ ipv6First));
            }
        }).get(0)).getHostAddress();
        if (bean instanceof SOCKSBean) {
            SOCKSBean sOCKSBean = (SOCKSBean) bean;
            if (sOCKSBean.getTls() && x74.a1(sOCKSBean.getSni())) {
                String str = bean.serverAddress;
                zs4.n(str, "bean.serverAddress");
                sOCKSBean.setSni(str);
            }
        } else if (bean instanceof HttpBean) {
            HttpBean httpBean = (HttpBean) bean;
            if (httpBean.getTls() && x74.a1(httpBean.getSni())) {
                String str2 = bean.serverAddress;
                zs4.n(str2, "bean.serverAddress");
                httpBean.setSni(str2);
            }
        } else if (bean instanceof StandardV2RayBean) {
            StandardV2RayBean standardV2RayBean = (StandardV2RayBean) bean;
            if (zs4.h(standardV2RayBean.getSecurity(), StandardV2RayBean.SECURITY_TLS) && x74.a1(standardV2RayBean.getSni())) {
                String str3 = bean.serverAddress;
                zs4.n(str3, "bean.serverAddress");
                standardV2RayBean.setSni(str3);
            }
        } else if (bean instanceof TrojanBean) {
            TrojanBean trojanBean = (TrojanBean) bean;
            if (x74.a1(trojanBean.getSni())) {
                String str4 = bean.serverAddress;
                zs4.n(str4, "bean.serverAddress");
                trojanBean.setSni(str4);
            }
        } else if (bean instanceof TrojanGoBean) {
            TrojanGoBean trojanGoBean = (TrojanGoBean) bean;
            if (x74.a1(trojanGoBean.getSni())) {
                String str5 = bean.serverAddress;
                zs4.n(str5, "bean.serverAddress");
                trojanGoBean.setSni(str5);
            }
        } else if (bean instanceof HysteriaBean) {
            HysteriaBean hysteriaBean = (HysteriaBean) bean;
            if (x74.a1(hysteriaBean.getSni())) {
                String str6 = bean.serverAddress;
                zs4.n(str6, "bean.serverAddress");
                hysteriaBean.setSni(str6);
            }
        }
        bean.serverAddress = hostAddress;
    }
}