X-plore v4.37.09版本的 MD5 值为:1ac588cd7c13e9578c2d4266387e2f4f
以下内容为反编译后的 n.java 源代码,内容仅作参考
package M6;
import F6.AbstractC1142k;
import F6.AbstractC1143l;
import F6.C;
import F6.C1141j;
import F6.C1148q;
import F6.F;
import F7.w;
import F7.x;
import F7.z;
import P.AbstractC1363o;
import P.F0;
import P.InterfaceC1357l;
import P.P0;
import android.net.Uri;
import c8.HV.eTehUBU;
import com.amazon.device.iap.cAyg.GQUCMaaITmmx;
import com.lonelycatgames.Xplore.FileSystem.h;
import h7.AbstractC6736y;
import h7.C6709J;
import h7.C6728q;
import h7.C6730s;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.text.SimpleDateFormat;
import java.util.Locale;
import org.json.JSONArray;
import org.json.JSONObject;
import t4.KPI.Rzzbdfw;
import u6.AbstractC7556B;
import w7.AbstractC7771k;
import w7.AbstractC7777q;
import w7.AbstractC7780t;
import w7.AbstractC7781u;
import z.InterfaceC7946a;
import z6.AbstractC7990b;
import z6.AbstractC7992d;
import z6.C7989a;
public final class n extends K6.b {
private static final SimpleDateFormat f7531A0;
public static final b f7532w0 = new b(null);
private static final AbstractC7990b.C0993b f7533x0 = new AbstractC7990b.C0993b(AbstractC7556B.f55734g1, "OneDrive", a.f7536I, true);
private static final String[] f7534y0 = {"User.Read", "Files.ReadWrite.All"};
private static final SimpleDateFormat f7535z0;
class a extends AbstractC7777q implements v7.p {
public static final a f7536I = new a();
a() {
super(2, n.class, "<init>", "<init>(Lcom/lonelycatgames/Xplore/FileSystem/net/CloudFileSystem;Landroid/net/Uri;)V", 0);
}
@Override
public final n r(C7989a c7989a, Uri uri) {
AbstractC7780t.f(c7989a, "p0");
AbstractC7780t.f(uri, "p1");
return new n(c7989a, uri, null);
}
}
public static final class b {
private b() {
}
public b(AbstractC7771k abstractC7771k) {
this();
}
public final String d(C c9) {
if (c9 instanceof AbstractC7992d.j) {
return new c(((AbstractC7992d.j) c9).a()).a();
}
if (c9 instanceof n) {
return "https://graph.microsoft.com/v1.0/me/drive/root";
}
throw new IllegalStateException(("Unknow entry: " + c9).toString());
}
public final c e(C c9) {
if (c9 instanceof AbstractC7992d.j) {
return new c(((AbstractC7992d.j) c9).a());
}
if (c9 instanceof n) {
return null;
}
throw new IllegalStateException("Check failed.".toString());
}
public final boolean h(HttpURLConnection httpURLConnection) {
return httpURLConnection.getResponseCode() < 300;
}
public final String[] f() {
return n.f7534y0;
}
public final AbstractC7990b.C0993b g() {
return n.f7533x0;
}
}
public static final class c {
private final String f7537a;
private final String f7538b;
public c(String str) {
int U8;
String b12;
AbstractC7780t.f(str, "s");
U8 = x.U(str, '\n', 0, false, 6, null);
if (U8 == -1) {
this.f7537a = str;
this.f7538b = null;
return;
}
b12 = z.b1(str, U8);
this.f7537a = b12;
String substring = str.substring(U8 + 1);
AbstractC7780t.e(substring, "substring(...)");
this.f7538b = substring;
}
public c(String str, String str2) {
AbstractC7780t.f(str, "id");
this.f7537a = str;
this.f7538b = str2;
}
public c(JSONObject jSONObject) {
String optString;
AbstractC7780t.f(jSONObject, "js");
String string = jSONObject.getString("id");
AbstractC7780t.e(string, "getString(...)");
this.f7537a = string;
JSONObject optJSONObject = jSONObject.optJSONObject("parentReference");
String str = null;
if (optJSONObject != null && (optString = optJSONObject.optString("driveId")) != null && optString.length() > 0) {
str = optString;
}
this.f7538b = str;
}
public final String a() {
if (this.f7538b == null) {
return "https://graph.microsoft.com/v1.0/me/drive/items/" + this.f7537a;
}
return "https://graph.microsoft.com/v1.0/drives/" + this.f7538b + "/items/" + this.f7537a;
}
public final String b() {
return this.f7537a;
}
public String toString() {
if (this.f7538b == null) {
return this.f7537a;
}
return this.f7537a + '\n' + this.f7538b;
}
}
public static final class d extends AbstractC7992d.b {
private final String f7539j0;
public static final class a extends AbstractC7781u implements v7.p {
final InterfaceC7946a f7541c;
final b0.g f7542d;
final int f7543e;
a(InterfaceC7946a interfaceC7946a, b0.g gVar, int i9) {
super(2);
this.f7541c = interfaceC7946a;
this.f7542d = gVar;
this.f7543e = i9;
}
public final void a(InterfaceC1357l interfaceC1357l, int i9) {
d.this.k1(this.f7541c, this.f7542d, interfaceC1357l, F0.a(this.f7543e | 1));
}
@Override
public Object r(Object obj, Object obj2) {
a((InterfaceC1357l) obj, ((Number) obj2).intValue());
return C6709J.f49946a;
}
}
public d(AbstractC7990b abstractC7990b, String str, String str2) {
super(abstractC7990b, str, 0L, null, 12, null);
AbstractC7780t.f(abstractC7990b, "se");
AbstractC7780t.f(str, "id");
this.f7539j0 = str2;
}
@Override
public void H(F f9) {
AbstractC7780t.f(f9, "vh");
super.I(f9, this.f7539j0);
}
@Override
public Object clone() {
return super.clone();
}
@Override
public void k1(InterfaceC7946a interfaceC7946a, b0.g gVar, InterfaceC1357l interfaceC1357l, int i9) {
int i10;
AbstractC7780t.f(interfaceC7946a, "<this>");
AbstractC7780t.f(gVar, "modifier");
InterfaceC1357l p9 = interfaceC1357l.p(-1228219345);
if ((i9 & 14) == 0) {
i10 = (p9.P(interfaceC7946a) ? 4 : 2) | i9;
} else {
i10 = i9;
}
if ((i9 & 112) == 0) {
i10 |= p9.P(gVar) ? 32 : 16;
}
if ((i10 & 91) == 18 && p9.s()) {
p9.z();
} else {
if (AbstractC1363o.G()) {
AbstractC1363o.S(-1228219345, i10, -1, "com.lonelycatgames.Xplore.clouds.one_drive.OneDriveServerV2.OneDriveSharedDirEntry.DrawIconOverlay (OneDriveServerV2.kt:144)");
}
AbstractC1142k.f(interfaceC7946a, gVar, p9, (i10 & 14) | (i10 & 112));
if (AbstractC1363o.G()) {
AbstractC1363o.R();
}
}
P0 v8 = p9.v();
if (v8 != null) {
v8.a(new a(interfaceC7946a, gVar, i9));
}
}
}
public static final class e extends AbstractC7992d.b {
private final int f7544j0;
public static final class a extends AbstractC7781u implements v7.p {
final InterfaceC7946a f7546c;
final b0.g f7547d;
final int f7548e;
a(InterfaceC7946a interfaceC7946a, b0.g gVar, int i9) {
super(2);
this.f7546c = interfaceC7946a;
this.f7547d = gVar;
this.f7548e = i9;
}
public final void a(InterfaceC1357l interfaceC1357l, int i9) {
e.this.k1(this.f7546c, this.f7547d, interfaceC1357l, F0.a(this.f7548e | 1));
}
@Override
public Object r(Object obj, Object obj2) {
a((InterfaceC1357l) obj, ((Number) obj2).intValue());
return C6709J.f49946a;
}
}
public e(AbstractC7990b abstractC7990b, String str) {
super(abstractC7990b, Rzzbdfw.ftZnFJzUKZ, 0L, null, 12, null);
AbstractC7780t.f(abstractC7990b, "se");
AbstractC7780t.f(str, "name");
this.f7544j0 = super.y0() - 2;
c1(str);
}
@Override
public Object clone() {
return super.clone();
}
@Override
public void k1(InterfaceC7946a interfaceC7946a, b0.g gVar, InterfaceC1357l interfaceC1357l, int i9) {
int i10;
AbstractC7780t.f(interfaceC7946a, "<this>");
AbstractC7780t.f(gVar, "modifier");
InterfaceC1357l p9 = interfaceC1357l.p(-1210497135);
if ((i9 & 14) == 0) {
i10 = (p9.P(interfaceC7946a) ? 4 : 2) | i9;
} else {
i10 = i9;
}
if ((i9 & 112) == 0) {
i10 |= p9.P(gVar) ? 32 : 16;
}
if ((i10 & 91) == 18 && p9.s()) {
p9.z();
} else {
if (AbstractC1363o.G()) {
AbstractC1363o.S(-1210497135, i10, -1, "com.lonelycatgames.Xplore.clouds.one_drive.OneDriveServerV2.OneDriveSharedWithMeDirEntry.DrawIconOverlay (OneDriveServerV2.kt:157)");
}
AbstractC1142k.c(interfaceC7946a, gVar, p9, (i10 & 14) | (i10 & 112));
if (AbstractC1363o.G()) {
AbstractC1363o.R();
}
}
P0 v8 = p9.v();
if (v8 != null) {
v8.a(new a(interfaceC7946a, gVar, i9));
}
}
@Override
public int y0() {
return this.f7544j0;
}
}
private final class f extends OutputStream {
private OutputStream f7549E;
final n f7550F;
private final long f7551a;
private final String f7552b;
private long f7553c;
private int f7554d;
private HttpURLConnection f7555e;
public f(n nVar, String str, String str2, long j9, JSONObject jSONObject) {
AbstractC7780t.f(str, "fileUrl");
AbstractC7780t.f(str2, "fileName");
this.f7550F = nVar;
this.f7551a = j9;
String str3 = str + "/createUploadSession";
C6730s[] c6730sArr = new C6730s[1];
JSONObject c02 = t6.k.c0(AbstractC6736y.a(GQUCMaaITmmx.HEZ, "replace"));
if (jSONObject != null) {
c02.put("fileSystemInfo", jSONObject);
}
c02.put("name", str2);
C6709J c6709j = C6709J.f49946a;
c6730sArr[0] = AbstractC6736y.a("item", c02);
String string = AbstractC7990b.f60542s0.g(nVar.C3("POST", str3, t6.k.c0(c6730sArr))).getString("uploadUrl");
AbstractC7780t.e(string, "getString(...)");
this.f7552b = string;
d();
}
private final void b() {
OutputStream outputStream = this.f7549E;
HttpURLConnection httpURLConnection = null;
if (outputStream == null) {
AbstractC7780t.r("os");
outputStream = null;
}
outputStream.close();
b bVar = n.f7532w0;
HttpURLConnection httpURLConnection2 = this.f7555e;
if (httpURLConnection2 == null) {
AbstractC7780t.r("con");
httpURLConnection2 = null;
}
if (bVar.h(httpURLConnection2)) {
return;
}
n nVar = this.f7550F;
HttpURLConnection httpURLConnection3 = this.f7555e;
if (httpURLConnection3 == null) {
AbstractC7780t.r("con");
} else {
httpURLConnection = httpURLConnection3;
}
throw new IOException(nVar.X1(httpURLConnection));
}
private final void d() {
HttpURLConnection Q22 = this.f7550F.Q2("PUT", this.f7552b);
int min = (int) Math.min(62914560L, this.f7551a - this.f7553c);
this.f7554d = min;
Q22.setRequestProperty("Content-Length", String.valueOf(min));
Q22.setRequestProperty("Content-Range", "bytes " + this.f7553c + '-' + ((this.f7553c + this.f7554d) - 1) + '/' + this.f7551a);
Q22.setFixedLengthStreamingMode(this.f7554d);
this.f7553c = this.f7553c + ((long) this.f7554d);
this.f7555e = Q22;
OutputStream outputStream = Q22.getOutputStream();
AbstractC7780t.e(outputStream, "getOutputStream(...)");
this.f7549E = outputStream;
}
@Override
public void close() {
b();
}
@Override
public Void write(int i9) {
throw new IllegalArgumentException();
}
@Override
public void write(byte[] bArr, int i9, int i10) {
AbstractC7780t.f(bArr, "b");
int min = Math.min(this.f7554d, i10);
if (min > 0) {
this.f7554d -= min;
OutputStream outputStream = this.f7549E;
if (outputStream == null) {
AbstractC7780t.r("os");
outputStream = null;
}
outputStream.write(bArr, i9, min);
}
int i11 = i10 - min;
if (i11 > 0) {
b();
d();
write(bArr, i9 + min, i11);
}
}
}
public static final class g extends x5.t {
final HttpURLConnection f7556a;
final n f7557b;
final JSONObject f7558c;
g(HttpURLConnection httpURLConnection, n nVar, JSONObject jSONObject, OutputStream outputStream) {
super(outputStream);
this.f7556a = httpURLConnection;
this.f7557b = nVar;
this.f7558c = jSONObject;
AbstractC7780t.c(outputStream);
}
@Override
public void close() {
super.close();
if (!n.f7532w0.h(this.f7556a)) {
throw new IOException(this.f7557b.X1(this.f7556a));
}
if (this.f7558c != null) {
try {
this.f7557b.C3("PATCH", new c(AbstractC7990b.f60542s0.g(this.f7556a)).a(), t6.k.c0(AbstractC6736y.a("fileSystemInfo", this.f7558c)));
} catch (Exception e9) {
e9.printStackTrace();
}
}
this.f7557b.o3(true);
}
}
static {
Locale locale = Locale.US;
f7535z0 = new SimpleDateFormat("y-M-d'T'H:m:s", locale);
f7531A0 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", locale);
}
private n(C7989a c7989a, Uri uri) {
super(c7989a, uri, AbstractC7556B.f55734g1, null, 8, null);
t2(uri);
}
public n(C7989a c7989a, Uri uri, AbstractC7771k abstractC7771k) {
this(c7989a, uri);
}
private final void B3(h.f fVar, JSONObject jSONObject) {
String str;
boolean z8;
long j9;
JSONObject optJSONObject;
AbstractC7992d.b bVar;
String optString;
String str2;
JSONObject optJSONObject2;
JSONObject optJSONObject3;
JSONObject jSONObject2 = jSONObject;
String string = jSONObject2.getString("name");
JSONObject optJSONObject4 = jSONObject2.optJSONObject("remoteItem");
C c9 = null;
if (optJSONObject4 != null) {
JSONObject optJSONObject5 = optJSONObject4.optJSONObject("shared");
if (optJSONObject5 == null || (optJSONObject2 = optJSONObject5.optJSONObject("owner")) == null || (optJSONObject3 = optJSONObject2.optJSONObject("user")) == null) {
str2 = null;
} else {
AbstractC7780t.c(optJSONObject3);
str2 = optJSONObject3.getString("displayName");
}
z8 = true;
str = str2;
jSONObject2 = optJSONObject4;
} else {
str = null;
z8 = false;
}
String cVar = new c(jSONObject2).toString();
JSONObject optJSONObject6 = jSONObject2.optJSONObject("fileSystemInfo");
if (optJSONObject6 != null && (optString = optJSONObject6.optString("lastModifiedDateTime")) != null) {
if (optString.length() <= 0) {
optString = null;
}
if (optString != null) {
j9 = AbstractC7990b.f60542s0.e(optString, f7535z0, true);
optJSONObject = jSONObject2.optJSONObject("folder");
if (optJSONObject == null) {
if (z8) {
bVar = new d(this, cVar, str);
} else {
AbstractC7992d.b bVar2 = new AbstractC7992d.b(this, cVar, 0L, null, 12, null);
bVar = bVar2;
if (optJSONObject.optInt("childCount") == 0) {
bVar2.I1(false);
bVar = bVar2;
}
}
c9 = bVar;
} else if (jSONObject2.optJSONObject("file") != null) {
AbstractC7780t.c(string);
c9 = AbstractC7992d.R1(this, fVar, string, j9, jSONObject2.optLong("size", -1L), cVar, null, 32, null);
}
if (c9 == null) {
AbstractC7780t.c(string);
fVar.c(c9, string);
return;
}
return;
}
}
j9 = 0;
optJSONObject = jSONObject2.optJSONObject("folder");
if (optJSONObject == null) {
}
if (c9 == null) {
}
}
public final HttpURLConnection C3(String str, String str2, JSONObject jSONObject) {
HttpURLConnection Q22 = Q2(str, str2);
Q22.setDoOutput(true);
Q22.setRequestProperty("Content-Type", "application/json");
OutputStream outputStream = Q22.getOutputStream();
AbstractC7780t.e(outputStream, "getOutputStream(...)");
String jSONObject2 = jSONObject.toString();
AbstractC7780t.e(jSONObject2, "toString(...)");
t6.k.N0(outputStream, jSONObject2);
if (Q22.getResponseCode() < 300) {
return Q22;
}
throw new IOException(X1(Q22));
}
@Override
public boolean F2(C1141j c1141j) {
AbstractC7780t.f(c1141j, "de");
return !(c1141j instanceof e);
}
@Override
public boolean H2(C c9) {
AbstractC7780t.f(c9, "le");
return !(c9 instanceof e);
}
@Override
public C1141j P2(C1141j c1141j, String str) {
AbstractC7780t.f(c1141j, "parent");
AbstractC7780t.f(str, "name");
return new AbstractC7992d.b(this, new c(AbstractC7990b.f60542s0.g(C3("POST", f7532w0.d(c1141j) + "/children", t6.k.c0(AbstractC6736y.a("name", str), AbstractC6736y.a("folder", new JSONObject()))))).toString(), 0L, null, 12, null);
}
@Override
public void R2(C c9) {
AbstractC7780t.f(c9, "le");
AbstractC7990b.O2(this, "DELETE", f7532w0.d(c9), null, 4, null);
}
@Override
public OutputStream S1(C c9, String str, long j9, Long l9) {
AbstractC7780t.f(c9, "le");
try {
String d9 = f7532w0.d(c9);
if (str != null) {
d9 = d9 + ":/" + Uri.encode(str) + ':';
}
String str2 = d9;
JSONObject c02 = l9 != null ? t6.k.c0(AbstractC6736y.a("lastModifiedDateTime", AbstractC7990b.f60542s0.c(l9.longValue(), f7531A0, true))) : null;
if (j9 > 0) {
if (str == null) {
str = c9.p0();
}
return new f(this, str2, str, j9, c02);
}
HttpURLConnection Q22 = Q2("PUT", str2 + "/content");
return new g(Q22, this, c02, Q22.getOutputStream());
} catch (h.j e9) {
throw new IOException(e9.getMessage());
}
}
@Override
public AbstractC7990b.C0993b U2() {
return f7533x0;
}
@Override
public String V1(String str, String str2) {
boolean D8;
AbstractC7780t.f(str, "content");
if (str2 != null) {
D8 = w.D(str2, "application/json", false, 2, null);
if (D8) {
str = new JSONObject(str).getJSONObject("error").getString("message");
AbstractC7780t.e(str, "getString(...)");
}
}
return super.V1(str, str2);
}
@Override
public Object clone() {
return super.clone();
}
@Override
public void d3(C c9, C1141j c1141j, String str) {
String b9;
AbstractC7780t.f(c9, "le");
AbstractC7780t.f(c1141j, "newParent");
if (c1141j instanceof n) {
b9 = S2(f7532w0.d(c1141j) + "?$select=id").getString("id");
} else {
c e9 = f7532w0.e(c1141j);
b9 = e9 != null ? e9.b() : null;
}
JSONObject c02 = t6.k.c0(AbstractC6736y.a("parentReference", t6.k.c0(AbstractC6736y.a("id", b9))));
if (str != null) {
c02.put("name", str);
}
b bVar = f7532w0;
if (!bVar.h(C3("PATCH", bVar.d(c9), c02))) {
throw new IOException("Failed to move");
}
}
@Override
public boolean e3() {
return false;
}
@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);
return;
}
b bVar = f7532w0;
if (!bVar.h(C3("PATCH", bVar.d(c9), t6.k.c0(AbstractC6736y.a("name", str))))) {
throw new IOException("Failed to rename");
}
}
@Override
public void j2(h.f fVar) {
AbstractC7780t.f(fVar, "lister");
super.j2(fVar);
StringBuilder sb = new StringBuilder();
C1141j m9 = fVar.m();
sb.append(m9 instanceof e ? "https://graph.microsoft.com/v1.0/me/drive/sharedWithMe" : f7532w0.d(m9) + "/children");
sb.append("?$select=id,name,size,folder,file,photo,fileSystemInfo,remoteItem,parentReference");
String sb2 = sb.toString();
do {
JSONObject S22 = S2(sb2);
JSONArray jSONArray = S22.getJSONArray("value");
AbstractC7780t.e(jSONArray, "getJSONArray(...)");
int length = jSONArray.length();
for (int i9 = 0; i9 < length; i9++) {
JSONObject jSONObject = (JSONObject) jSONArray.get(i9);
if (!fVar.r()) {
B3(fVar, jSONObject);
}
}
sb2 = S22.optString("@odata.nextLink");
if (sb2.length() <= 0) {
sb2 = null;
}
} while (sb2 != null);
if (!(fVar.m() instanceof n) || S2("https://graph.microsoft.com/v1.0/me/drive/sharedWithMe?$select=id,name,size,folder,file,photo,fileSystemInfo,remoteItem,parentReference").getJSONArray("value").length() <= 0) {
return;
}
String string = V().getString(u6.F.f56471r2);
AbstractC7780t.e(string, "getString(...)");
fVar.d(new e(this, string));
}
@Override
public InputStream k2(C c9, int i9, long j9) {
AbstractC7780t.f(c9, "le");
String d9 = f7532w0.d(c9);
if (c9 instanceof C1148q) {
try {
int b9 = i9 != 1 ? i9 != 2 ? 0 : com.lonelycatgames.Xplore.a.f45553S.b() : com.lonelycatgames.Xplore.a.f45553S.a();
if (b9 > 0) {
StringBuilder sb = new StringBuilder();
sb.append('c');
sb.append(b9);
sb.append('x');
sb.append(b9);
String sb2 = sb.toString();
JSONArray jSONArray = S2(d9 + "/thumbnails?select=" + sb2).getJSONArray("value");
if (jSONArray.length() > 0) {
return AbstractC7990b.h3(this, jSONArray.getJSONObject(0).getJSONObject(sb2).getString("url"), 0L, false, 2, null);
}
}
} catch (Exception e9) {
e9.printStackTrace();
}
}
return AbstractC7990b.h3(this, d9 + "/content", j9, false, 4, null);
}
@Override
public C1141j o2(C c9) {
AbstractC7780t.f(c9, "le");
JSONObject jSONObject = S2(f7532w0.d(c9) + eTehUBU.EuZEh).getJSONObject("parentReference");
String string = jSONObject.getString("id");
AbstractC7780t.e(string, "getString(...)");
return new AbstractC7992d.b(this, new c(string, jSONObject.optString("driveId")).toString(), 0L, null, 12, null);
}
@Override
protected void r3() {
JSONObject optJSONObject = S2("https://graph.microsoft.com/v1.0/me/drive").optJSONObject("quota");
if (optJSONObject != null) {
m3(new AbstractC1143l.b(optJSONObject.optLong("used"), optJSONObject.optLong("total")));
}
Uri a22 = a2();
String str = null;
if ((a22 != null ? a22.getFragment() : null) == null) {
JSONObject S22 = S2(GQUCMaaITmmx.rBZYn);
String optString = S22.optString("displayName");
if (optString.length() <= 0) {
optString = null;
}
if (optString == null) {
String optString2 = S22.optString("userPrincipalName");
if (optString2.length() > 0) {
str = optString2;
}
} else {
str = optString;
}
if (str != null) {
i3(this, str);
}
}
}
@Override
protected C6730s t3(String str) {
AbstractC7780t.f(str, "refreshToken");
r e9 = new M6.f(GQUCMaaITmmx.qcgZWJpii, "629d9648-1b77-4354-b97d-f308c2211d43").e(str);
if (e9 instanceof p) {
throw new h.j(t6.k.Q(((p) e9).c()));
}
if (!(e9 instanceof q)) {
throw new C6728q();
}
q qVar = (q) e9;
return AbstractC6736y.a(qVar.c(), qVar.d());
}
}