X-plore v4.37.09版本的 MD5 值为:1ac588cd7c13e9578c2d4266387e2f4f

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


package K6;

import B.hRCx.IaBiDJU;
import F6.AbstractC1143l;
import F6.C;
import F6.C1141j;
import F6.C1148q;
import F7.w;
import android.net.Uri;
import b7.K;
import com.lonelycatgames.Xplore.App;
import com.lonelycatgames.Xplore.FileSystem.h;
import d2.CZrr.MvebcixEr;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.text.SimpleDateFormat;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import t6.k;
import u6.AbstractC7556B;
import v7.p;
import w7.AbstractC7771k;
import w7.AbstractC7777q;
import w7.AbstractC7780t;
import x5.C7868B;
import z6.AbstractC7990b;
import z6.AbstractC7992d;
import z6.C7989a;

public final class f extends K6.c {

    private String f6796x0;

    public static final c f6794y0 = new c(null);

    public static final int f6795z0 = 8;

    private static final AbstractC7990b.C0993b f6792A0 = new a(AbstractC7556B.f55691X0, b.f6797I);

    private static final SimpleDateFormat f6793B0 = new SimpleDateFormat("yyyy/mm/dd kk:mm:ss", Locale.US);

    public static final class a extends AbstractC7990b.C0993b {
        a(int i9, b bVar) {
            super(i9, "IDrive", bVar, false, 8, null);
        }

        @Override
        public boolean a(App app) {
            AbstractC7780t.f(app, "app");
            return false;
        }
    }

    class b extends AbstractC7777q implements p {

        public static final b f6797I = new b();

        b() {
            super(2, f.class, "<init>", IaBiDJU.EXuwiqEBrluIF, 0);
        }

        @Override
        public final f r(C7989a c7989a, Uri uri) {
            AbstractC7780t.f(c7989a, "p0");
            AbstractC7780t.f(uri, "p1");
            return new f(c7989a, uri, null);
        }
    }

    public static final class c {
        private c() {
        }

        public c(AbstractC7771k abstractC7771k) {
            this();
        }

        public final K.c c(HttpURLConnection httpURLConnection) {
            try {
                K.c c9 = AbstractC7990b.f60542s0.i(httpURLConnection).c();
                AbstractC7780t.c(c9);
                if (!AbstractC7780t.a(c9.i(), "tree")) {
                    throw new IOException("XML tree tag not found");
                }
                String g9 = c9.g("message");
                if (AbstractC7780t.a(g9, "SUCCESS")) {
                    return c9;
                }
                throw new IOException(g9 + ": " + c9.a("desc"));
            } catch (K.b e9) {
                throw new IOException(e9.getMessage());
            }
        }

        public final AbstractC7990b.C0993b b() {
            return f.f6792A0;
        }
    }

    public static final class d extends AbstractC7990b.d {

        final HttpURLConnection f6798G;

        d(f fVar, HttpURLConnection httpURLConnection, AbstractC7990b.g gVar, String str) {
            super(fVar, httpURLConnection, "definition", str, gVar, 0L, null, false, 0, 240, null);
            this.f6798G = httpURLConnection;
        }

        @Override
        public void f(int i9) {
            super.f(i9);
            f.f6794y0.c(this.f6798G);
        }
    }

    private f(C7989a c7989a, Uri uri) {
        super(c7989a, AbstractC7556B.f55691X0);
        t2(uri);
    }

    public f(C7989a c7989a, Uri uri, AbstractC7771k abstractC7771k) {
        this(c7989a, uri);
    }

    private final String A3(C c9) {
        return c9 instanceof AbstractC7990b ? "/" : AbstractC7992d.f60582j0.d(c9.i0());
    }

    private final synchronized String B3() {
        String str;
        try {
            str = this.f6796x0;
            if (str == null) {
                if (w3() == null) {
                    boolean z8 = false;
                    throw new h.j(null, 1, null);
                }
                try {
                    str = "https://" + f6794y0.c(AbstractC7990b.O2(this, "POST", "https://evs.idrivesync.com/evs/getServerAddress", null, 4, null)).g("webApiServer") + "/evs/";
                    this.f6796x0 = str;
                } catch (K.b unused) {
                    throw new IOException("Can't determine server address");
                }
            }
        } catch (Throwable th) {
            throw th;
        }
        return str;
    }

    private final K.c C3(String str, AbstractC7990b.g gVar) {
        return f6794y0.c(y3(str, gVar));
    }

    static K.c D3(f fVar, String str, AbstractC7990b.g gVar, int i9, Object obj) {
        if ((i9 & 2) != 0) {
            gVar = null;
        }
        return fVar.C3(str, gVar);
    }

    private final Uri.Builder E3(String str) {
        return Uri.parse(str).buildUpon().appendQueryParameter("uid", w3()).appendQueryParameter("pwd", v3());
    }

    private final HttpURLConnection y3(String str, AbstractC7990b.g gVar) {
        return Q2("POST", z3(str, gVar));
    }

    private final String z3(String str, AbstractC7990b.g gVar) {
        Uri.Builder buildUpon = Uri.parse(B3() + str).buildUpon();
        if (gVar != null) {
            Iterator<E> it = gVar.iterator();
            while (it.hasNext()) {
                AbstractC7990b.f fVar = (AbstractC7990b.f) it.next();
                buildUpon.appendQueryParameter(fVar.a(), fVar.b());
            }
        }
        String builder = buildUpon.toString();
        AbstractC7780t.e(builder, "toString(...)");
        return builder;
    }

    @Override
    public C1141j P2(C1141j c1141j, String str) {
        AbstractC7780t.f(c1141j, "parent");
        AbstractC7780t.f(str, "name");
        C3("createFolder", new AbstractC7990b.g("p", A3(c1141j), "foldername", str));
        return new AbstractC7992d.a(this, 0L, 2, null);
    }

    @Override
    public HttpURLConnection Q2(String str, String str2) {
        AbstractC7780t.f(str2, "uri");
        String builder = E3(str2).toString();
        AbstractC7780t.e(builder, "toString(...)");
        return super.Q2(str, builder);
    }

    @Override
    public void R2(C c9) {
        AbstractC7780t.f(c9, "le");
        if (!AbstractC7780t.a(C3("deleteFile", new AbstractC7990b.g("p", A3(c9))).j("item").g("result"), "SUCCESS")) {
            throw new IOException("Failed to delete");
        }
    }

    @Override
    public OutputStream S1(C c9, String str, long j9, Long l9) {
        boolean s9;
        AbstractC7780t.f(c9, "le");
        if (j9 == 0) {
            return new C7868B(0);
        }
        String A32 = A3(c9);
        if (str == null && (A32 = k.R(A32)) == null) {
            A32 = "/";
        }
        s9 = w.s(A32, "/", false, 2, null);
        if (!s9) {
            A32 = A32 + '/';
        }
        AbstractC7990b.g gVar = new AbstractC7990b.g("p", A32);
        String w32 = w3();
        AbstractC7780t.c(w32);
        gVar.e("uid", w32);
        String v32 = v3();
        AbstractC7780t.c(v32);
        gVar.e("pwd", v32);
        try {
            HttpURLConnection y32 = y3("uploadFile", null);
            if (str == null) {
                str = c9.p0();
            }
            return new d(this, y32, gVar, str);
        } catch (IOException e9) {
            throw e9;
        } catch (Exception e10) {
            throw new IOException(e10.getMessage());
        }
    }

    @Override
    public AbstractC7990b.C0993b U2() {
        return f6792A0;
    }

    @Override
    public Object clone() {
        return super.clone();
    }

    @Override
    public boolean e3() {
        return false;
    }

    @Override
    public boolean i2() {
        return true;
    }

    @Override
    public void i3(C c9, String str) {
        AbstractC7780t.f(c9, "le");
        AbstractC7780t.f(str, "newName");
        if (AbstractC7780t.a(c9, this)) {
            super.i3(c9, str);
        } else {
            String A32 = A3(c9);
            C3("renameFileFolder", new AbstractC7990b.g("oldpath", A32, "newpath", k.R(A32) + '/' + str));
        }
    }

    @Override
    public void j2(h.f fVar) {
        AbstractC7780t.f(fVar, "lister");
        super.j2(fVar);
        List<K.c> e9 = C3("browseFolder", new AbstractC7990b.g("p", A3(fVar.m()))).e("item");
        if (e9 == null) {
            return;
        }
        try {
            for (K.c cVar : e9) {
                String g9 = cVar.g("restype");
                String g10 = cVar.g("resname");
                C aVar = AbstractC7780t.a(g9, "0") ? new AbstractC7992d.a(this, 0L, 2, null) : AbstractC7780t.a(g9, "1") ? AbstractC7992d.R1(this, fVar, g10, AbstractC7990b.f60542s0.e(cVar.g("lmd"), f6793B0, false), Long.parseLong(cVar.g("size")), null, null, 48, null) : null;
                if (aVar != null) {
                    fVar.c(aVar, g10);
                }
            }
        } catch (Exception e10) {
            IOException iOException = e10 instanceof IOException ? (IOException) e10 : null;
            if (iOException == null) {
                throw new IOException(k.Q(e10));
            }
        }
    }

    @Override
    public InputStream k2(C c9, int i9, long j9) {
        AbstractC7780t.f(c9, "le");
        AbstractC7990b.g gVar = new AbstractC7990b.g("p", A3(c9));
        if (i9 != 0 && (c9 instanceof C1148q)) {
            String str = (i9 == 1 || i9 == 2) ? "I" : null;
            if (str != null) {
                gVar.e("thumbnail_type", str);
            }
        }
        int i10 = 0 << 0;
        return AbstractC7990b.h3(this, z3("downloadFile", gVar), 0L, false, 6, null);
    }

    @Override
    protected void r3() {
        int i9 = 5 | 2;
        K.c D32 = D3(this, MvebcixEr.EIirCD, null, 2, null);
        try {
            m3(new AbstractC1143l.b(Long.parseLong(D32.g("usedquota")), Long.parseLong(D32.g("totalquota"))));
        } catch (Exception e9) {
            throw new IOException("Can't get quota\n" + k.Q(e9));
        }
    }

    @Override
    public boolean y2() {
        return false;
    }
}