导航菜单

页面标题

页面副标题

All File Recovery v1.0.2 - t0.java 源代码

正在查看: All File Recovery v1.0.2 应用的 t0.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package d2;

import X1.C0561b0;
import android.net.Uri;
import androidx.annotation.Nullable;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.MulticastSocket;
import java.net.SocketTimeoutException;

@a2.i0
public final class t0 extends AbstractC0985e {

    public static final int f23752o = 2000;

    public static final int f23753p = 8000;

    public static final int f23754q = -1;

    public final int f23755f;

    public final byte[] f23756g;

    public final DatagramPacket f23757h;

    @Nullable
    public Uri f23758i;

    @Nullable
    public DatagramSocket f23759j;

    @Nullable
    public MulticastSocket f23760k;

    @Nullable
    public InetAddress f23761l;

    public boolean f23762m;

    public int f23763n;

    public static final class a extends C1000u {
        public a(Throwable th, int i4) {
            super(th, i4);
        }
    }

    public t0() {
        this(2000);
    }

    @Override
    public long a(C1003x c1003x) throws a {
        Uri uri = c1003x.f23779a;
        this.f23758i = uri;
        String host = uri.getHost();
        host.getClass();
        int port = this.f23758i.getPort();
        h(c1003x);
        try {
            this.f23761l = InetAddress.getByName(host);
            InetSocketAddress inetSocketAddress = new InetSocketAddress(this.f23761l, port);
            if (this.f23761l.isMulticastAddress()) {
                MulticastSocket multicastSocket = new MulticastSocket(inetSocketAddress);
                this.f23760k = multicastSocket;
                multicastSocket.joinGroup(this.f23761l);
                this.f23759j = this.f23760k;
            } else {
                this.f23759j = new DatagramSocket(inetSocketAddress);
            }
            this.f23759j.setSoTimeout(this.f23755f);
            this.f23762m = true;
            i(c1003x);
            return -1L;
        } catch (IOException e4) {
            throw new a(e4, C0561b0.f8841x);
        } catch (SecurityException e5) {
            throw new a(e5, C0561b0.f8785C);
        }
    }

    @Override
    public void close() {
        this.f23758i = null;
        MulticastSocket multicastSocket = this.f23760k;
        if (multicastSocket != null) {
            try {
                InetAddress inetAddress = this.f23761l;
                inetAddress.getClass();
                multicastSocket.leaveGroup(inetAddress);
            } catch (IOException unused) {
            }
            this.f23760k = null;
        }
        DatagramSocket datagramSocket = this.f23759j;
        if (datagramSocket != null) {
            datagramSocket.close();
            this.f23759j = null;
        }
        this.f23761l = null;
        this.f23763n = 0;
        if (this.f23762m) {
            this.f23762m = false;
            g();
        }
    }

    @Override
    @Nullable
    public Uri getUri() {
        return this.f23758i;
    }

    public int j() {
        DatagramSocket datagramSocket = this.f23759j;
        if (datagramSocket == null) {
            return -1;
        }
        return datagramSocket.getLocalPort();
    }

    @Override
    public int read(byte[] bArr, int i4, int i5) throws a {
        if (i5 == 0) {
            return 0;
        }
        if (this.f23763n == 0) {
            try {
                DatagramSocket datagramSocket = this.f23759j;
                datagramSocket.getClass();
                datagramSocket.receive(this.f23757h);
                int length = this.f23757h.getLength();
                this.f23763n = length;
                f(length);
            } catch (SocketTimeoutException e4) {
                throw new a(e4, C0561b0.f8842y);
            } catch (IOException e5) {
                throw new a(e5, C0561b0.f8841x);
            }
        }
        int length2 = this.f23757h.getLength();
        int i7 = this.f23763n;
        int min = Math.min(i7, i5);
        System.arraycopy(this.f23756g, length2 - i7, bArr, i4, min);
        this.f23763n -= min;
        return min;
    }

    public t0(int i4) {
        this(i4, 8000);
    }

    public t0(int i4, int i5) {
        super(true);
        this.f23755f = i5;
        byte[] bArr = new byte[i4];
        this.f23756g = bArr;
        this.f23757h = new DatagramPacket(bArr, 0, i4);
    }
}