ModV2.0.4 v1.86526672844804版本的 MD5 值为:ab8437a2d03fc69805a8b4199bd7fecb

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


package com.joaomgcd.taskerm.google.drive;

import android.app.Activity;
import android.content.Context;
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
import com.joaomgcd.taskerm.google.drive.io.DriveCreationOptions;
import com.joaomgcd.taskerm.google.drive.io.DriveMetadataV2;
import com.joaomgcd.taskerm.google.drive.io.DriveMetadataV3;
import com.joaomgcd.taskerm.google.drive.io.DriveMetadatasV3;
import com.joaomgcd.taskerm.google.drive.io.DrivePermissionsV3Create;
import com.joaomgcd.taskerm.google.drive.io.DrivePermissionsV3CreateResponse;
import com.joaomgcd.taskerm.google.drive.io.ErrorPayloadGoogleDrive;
import com.joaomgcd.taskerm.util.al;
import com.joaomgcd.taskerm.util.cc;
import com.joaomgcd.taskerm.util.cd;
import net.danlew.android.joda.R;
public interface a {
    public static final C0166a f7190a = C0166a.f7191a;

    @f.c.o(a = "files")
    b.a.l<DriveMetadataV3> a(@f.c.a DriveCreationOptions driveCreationOptions);

    @f.c.f(a = "files/{fileId}?fields=id%2Ckind%2Cname%2CmimeType%2Csize%2Cmd5Checksum%2CmodifiedTime")
    b.a.l<DriveMetadataV3> a(@f.c.s(a = "fileId") String str);

    @f.c.n(a = "files/{fileId}")
    b.a.l<DriveMetadataV3> a(@f.c.s(a = "fileId") String str, @f.c.a DriveCreationOptions driveCreationOptions);

    @f.c.f(a = "files?fields=files(id%2Ckind%2Cname%2CmimeType%2Csize%2Cmd5Checksum%2CmodifiedTime)")
    b.a.l<DriveMetadatasV3> a(@f.c.t(a = "q") String str, @f.c.t(a = "spaces") String str2, @f.c.t(a = "pageSize") int i);

    @f.c.o(a = "files/{fileId}/permissions")
    b.a.l<DrivePermissionsV3CreateResponse> a(@f.c.s(a = "fileId") String str, @f.c.t(a = "sendNotificationEmail") boolean z, @f.c.a DrivePermissionsV3Create drivePermissionsV3Create);

    public static final class b {
        @f.c.f(a = "files?fields=files(id%2Ckind%2Cname%2CmimeType%2Csize%2Cmd5Checksum%2CmodifiedTime)")
        public static b.a.l a(a aVar, String str, String str2, int i, int i2, Object obj) {
            if (obj == null) {
                if ((i2 & 4) != 0) {
                    i = 1000;
                }
                return aVar.a(str, str2, i);
            }
            throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: list");
        }
    }

    public static final class C0166a {
        static final C0166a f7191a = new C0166a();

        public final String a() {
            return "appDataFolder";
        }

        public final String b() {
            return "drive";
        }

        private C0166a() {
        }

        public final String[] b(Context context) {
            return al.B(context) ? d() : c();
        }

        private final String[] c() {
            return new String[]{"https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.appfolder"};
        }

        public final String[] d() {
            return new String[]{"https://www.googleapis.com/auth/drive"};
        }

        private final com.joaomgcd.taskerm.signin.a a(Context context, String[] strArr, String str) {
            return new com.joaomgcd.taskerm.signin.a("Google Drive", null, false, strArr, str, false, 38, null);
        }

        static com.joaomgcd.taskerm.signin.a a(C0166a c0166a, Context context, String[] strArr, String str, int i, Object obj) {
            if ((i & 4) != 0) {
                str = null;
            }
            return c0166a.a(context, strArr, str);
        }

        public final b.a.l<GoogleSignInAccount> a(Context context, boolean z, boolean z2, String str) {
            c.f.b.k.b(context, "context");
            return com.joaomgcd.taskerm.signin.c.f8926a.a(context, z2, a(context, z ? d() : c(), str));
        }

        static final class b<T, R> implements b.a.d.g<T, R> {
            public static final b f7195a = new b();

            b() {
            }

            @Override
            public final String apply(GoogleSignInAccount googleSignInAccount) {
                c.f.b.k.b(googleSignInAccount, "it");
                String c2 = googleSignInAccount.c();
                if (c2 != null) {
                    return c2;
                }
                throw new RuntimeException("Could not get user email");
            }
        }

        public final b.a.l<String> a(Context context) {
            c.f.b.k.b(context, "context");
            C0166a c0166a = this;
            GoogleSignInAccount a2 = com.joaomgcd.taskerm.signin.c.f8926a.a(context);
            return c0166a.a(context, false, true, a2 != null ? a2.c() : null).c(b.f7195a);
        }

        public static b.a.l a(C0166a c0166a, Activity activity, boolean z, int i, Object obj) {
            if ((i & 2) != 0) {
                z = false;
            }
            return c0166a.a(activity, z);
        }

        public static final class C0167a extends c.f.b.l implements c.f.a.a<GoogleSignInAccount> {
            final Activity f7193b;
            final boolean f7194c;

            C0167a(Activity activity, boolean z) {
                super(0);
                this.f7193b = activity;
                this.f7194c = z;
            }

            @Override
            public final GoogleSignInAccount invoke() {
                GoogleSignInAccount b2 = com.joaomgcd.taskerm.signin.c.f8926a.a(this.f7193b, this.f7194c, C0166a.a(C0166a.this, this.f7193b, C0166a.this.b(this.f7193b), (String) null, 4, (Object) null)).b();
                c.f.b.k.a((Object) b2, "account");
                String c2 = b2.c();
                if (c2 != null) {
                    Boolean b3 = com.joaomgcd.taskerm.signin.c.f8926a.a(this.f7193b, c2, C0166a.this.d()).b();
                    c.f.b.k.a((Object) b3, "signedInFull");
                    if (!b3.booleanValue() && ((com.joaomgcd.taskerm.dialog.x) com.joaomgcd.taskerm.dialog.y.a(this.f7193b, (int) R.string.warning_dialog_title, (int) R.string.tip_google_drive_full_access, 0, 8, (Object) null).b()).d()) {
                        al.b((Context) this.f7193b, true);
                        return C0166a.this.a(this.f7193b, true).b();
                    }
                    return b2;
                }
                return b2;
            }
        }

        public final b.a.l<GoogleSignInAccount> a(Activity activity, boolean z) {
            c.f.b.k.b(activity, "context");
            return com.joaomgcd.taskerm.rx.h.b(new C0167a(activity, z));
        }

        public final a a(Context context, String str) {
            c.f.b.k.b(context, "context");
            c.f.b.k.b(str, "account");
            return (a) com.joaomgcd.taskerm.google.a.a(context, a.class, "https://www.googleapis.com/drive/v3/", str, b(context));
        }

        public final b.a.l<DriveMetadataV3> a(Context context, String str, com.joaomgcd.taskerm.net.v vVar, DriveCreationOptions driveCreationOptions, cc ccVar) {
            c.f.b.k.b(context, "context");
            c.f.b.k.b(str, "account");
            c.f.b.k.b(vVar, "content");
            c.f.b.k.b(driveCreationOptions, "options");
            c.f.b.k.b(ccVar, "progressReporter");
            return com.joaomgcd.taskerm.net.l.b(new com.joaomgcd.taskerm.net.p(new com.joaomgcd.taskerm.net.f(vVar, driveCreationOptions, "https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart", "POST", DriveMetadataV3.class, ErrorPayloadGoogleDrive.class, b(context, str), ccVar, null, 256, null)), null, 1, null);
        }

        public final b.a.l<DriveMetadataV2> a(Context context, String str, String str2, com.joaomgcd.taskerm.net.v vVar, DriveCreationOptions driveCreationOptions, cc ccVar) {
            c.f.b.k.b(context, "context");
            c.f.b.k.b(str, "account");
            c.f.b.k.b(str2, "existingFileId");
            c.f.b.k.b(vVar, "content");
            c.f.b.k.b(driveCreationOptions, "options");
            c.f.b.k.b(ccVar, "progressReporter");
            return com.joaomgcd.taskerm.net.l.b(new com.joaomgcd.taskerm.net.p(new com.joaomgcd.taskerm.net.f(vVar, driveCreationOptions, "https://www.googleapis.com/upload/drive/v2/files/" + str2 + "?uploadType=multipart", "PUT", DriveMetadataV2.class, ErrorPayloadGoogleDrive.class, b(context, str), ccVar, null, 256, null)), null, 1, null);
        }

        public final b.a.l<String> b(Context context, String str) {
            c.f.b.k.b(context, "context");
            c.f.b.k.b(str, "account");
            return com.joaomgcd.taskerm.signin.c.f8926a.a(context, str, true, b(context));
        }

        public final <T> b.a.l<T> a(Context context, String str, Class<T> cls, String str2, cd cdVar, T t) {
            c.f.b.k.b(context, "context");
            c.f.b.k.b(str, "account");
            c.f.b.k.b(cls, "resultClass");
            c.f.b.k.b(str2, "fileId");
            c.f.b.k.b(cdVar, "progressReporter");
            return com.joaomgcd.taskerm.net.l.b(new com.joaomgcd.taskerm.net.l(new com.joaomgcd.taskerm.net.c("https://www.googleapis.com/drive/v3/files/" + str2 + "?alt=media", "GET", cls, ErrorPayloadGoogleDrive.class, t, b(context, str), null, cdVar, null, null, false, false, 3904, null)), null, 1, null);
        }
    }
}