正版风暴黑马 v5.0版本的 MD5 值为:01425d13106471265483ee3782390bf1

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


package p0000oO008.p001ooo8o088.p002Oo0oo80;

import com.android.launcher3.StringFog;
import com.netty.sdk.protobuf.MessageData;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.codec.protobuf.ProtobufDecoder;
import io.netty.handler.codec.protobuf.ProtobufEncoder;
import io.netty.handler.codec.protobuf.ProtobufVarint32FrameDecoder;
import io.netty.handler.codec.protobuf.ProtobufVarint32LengthFieldPrepender;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class O8OO8 implements Runnable {

    protected static O8OO8 f1277Li;
    protected Channel LLI1lI1;

    private C8O0oo0 f1279lIlilLL;

    protected ChannelFuture f1281lll = null;

    protected Thread f1280Lil1l = null;

    protected boolean f1278lILLLIL = false;
    private O0ooooOoo il = null;
    private Map<String, Oo8O0> IIiL1 = new ConcurrentHashMap();

    public static synchronized O8OO8 LLI1lI1() {
        O8OO8 o8oo8;
        synchronized (O8OO8.class) {
            if (f1277Li == null) {
                f1277Li = new O8OO8();
            }
            o8oo8 = f1277Li;
        }
        return o8oo8;
    }

    protected void IIiL1() {
        Bootstrap bootstrap = new Bootstrap();
        NioEventLoopGroup nioEventLoopGroup = new NioEventLoopGroup();
        bootstrap.group(nioEventLoopGroup);
        bootstrap.channel(NioSocketChannel.class);
        bootstrap.handler(new ChannelInitializer<Channel>() {
            @Override
            protected void initChannel(Channel channel) throws Exception {
                o08000.m4521lll("start netty client ->initChannel " + O8OO8.this, new Object[0]);
                ChannelPipeline pipeline = channel.pipeline();
                pipeline.addLast(new ProtobufVarint32FrameDecoder());
                pipeline.addLast(new ProtobufDecoder(MessageData.Message.getDefaultInstance()));
                pipeline.addLast(new ProtobufVarint32LengthFieldPrepender());
                pipeline.addLast(new ProtobufEncoder());
                pipeline.addLast(new C8O880());
            }
        });
        try {
            try {
                ?? addListener = bootstrap.connect("127.0.0.1", RunnableC0891oo0Oo0.f2629lll).addListener((GenericFutureListener<? extends Future<? super Void>>) new GenericFutureListener<ChannelFuture>() {
                    @Override
                    public void operationComplete(ChannelFuture channelFuture) throws Exception {
                        O8OO8.this.f1278lILLLIL = channelFuture.isSuccess();
                        o08000.m4521lll("Netty client init over,result: " + channelFuture.isSuccess() + "  " + O8OO8.this, new Object[0]);
                    }
                });
                this.f1281lll = addListener;
                Channel channel = addListener.channel();
                this.LLI1lI1 = channel;
                if (channel != null) {
                    channel.closeFuture().sync();
                }
                nioEventLoopGroup.shutdownGracefully();
                o08000.m4521lll(StringFog.decrypt("fQ0ZW11WQFYSURQVGRIIWH0OGQ==") + this.f1281lll, new Object[0]);
            } catch (Exception e) {
                e.printStackTrace();
                nioEventLoopGroup.shutdownGracefully();
                o08000.m4521lll(StringFog.decrypt("fQ0ZW11WQFYSURQVGRIIWH0OGQ==") + this.f1281lll, new Object[0]);
            }
            this.f1281lll = null;
        } catch (Throwable th) {
            nioEventLoopGroup.shutdownGracefully();
            o08000.m4521lll(StringFog.decrypt("fQ0ZW11WQFYSURQVGRIIWH0OGQ==") + this.f1281lll, new Object[0]);
            this.f1281lll = null;
            throw th;
        }
    }

    public void m1918Li() {
        if (this.f1280Lil1l == null || this.f1281lll == null) {
            il();
            Thread thread = new Thread(this);
            this.f1280Lil1l = thread;
            thread.start();
        }
        if (this.il == null) {
            O0ooooOoo o0ooooOoo = new O0ooooOoo();
            this.il = o0ooooOoo;
            o0ooooOoo.setName("daemonNettyClient");
            this.il.start();
        }
    }

    protected void il() {
        m1923lll(new C8O0oo0() {
            @Override
            public void LLI1lI1(ChannelHandlerContext channelHandlerContext) {
                o08000.LLI1lI1("失去了链接...", new Object[0]);
                O8OO8.this.f1280Lil1l = null;
            }

            @Override
            public void mo1925lll(ChannelHandlerContext channelHandlerContext) {
                o08000.LLI1lI1("链接到了远程...", new Object[0]);
            }

            @Override
            public void mo1926lll(ChannelHandlerContext channelHandlerContext, Object obj) {
                try {
                    MessageData.Message message = (MessageData.Message) obj;
                    Oo8O0 oo8O0 = (Oo8O0) O8OO8.this.IIiL1.get(message.getRequestAction());
                    if (oo8O0 != null) {
                        oo8O0.onObserveMessage(message);
                    } else {
                        oOO880o00.m4056lll().m4057lll(message.getRequestId(), message);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }

    public boolean m1919lILLLIL() {
        O0ooooOoo o0ooooOoo = this.il;
        if (o0ooooOoo != null) {
            o0ooooOoo.interrupt();
            this.il = null;
        }
        f1277Li = null;
        try {
            if (this.LLI1lI1 != null) {
                try {
                    this.LLI1lI1.closeFuture().sync();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            this.f1280Lil1l = null;
            this.f1281lll = null;
            this.LLI1lI1 = null;
            return true;
        } catch (Exception unused) {
            return true;
        }
    }

    @Override
    public void run() {
        try {
            IIiL1();
        } catch (Exception e) {
            e.printStackTrace();
        }
        this.f1280Lil1l = null;
    }

    public boolean m1920Lil1l() {
        return (this.f1280Lil1l == null || this.f1281lll == null || !this.f1278lILLLIL) ? false : true;
    }

    public C8O0oo0 m1921lll() {
        return this.f1279lIlilLL;
    }

    public void m1922lll(String str, Oo8O0 oo8O0) {
        this.IIiL1.put(str, oo8O0);
    }

    public void m1923lll(C8O0oo0 c8O0oo0) {
        this.f1279lIlilLL = c8O0oo0;
    }

    public boolean m1924lll(MessageData.Message message) {
        if (message == null) {
            return false;
        }
        try {
            if (this.LLI1lI1 != null) {
                this.LLI1lI1.writeAndFlush(message);
                return true;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }
}