Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2aec42fb authored by Marvin W.'s avatar Marvin W. 🐿️
Browse files

Add some new (incomplete) classes for Auth API

parent 18582ce0
Loading
Loading
Loading
Loading
+46 −0
Original line number Diff line number Diff line
/*
 * Copyright 2013-2016 microG Project Team
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.android.gms.auth.firstparty.dataservice;

import android.accounts.Account;

import org.microg.gms.auth.AuthConstants;
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;

public class AccountRecoveryGuidanceRequest extends AutoSafeParcelable {

    @SafeParceled(1)
    private int versionCode = 1;
    @SafeParceled(2)
    @Deprecated
    public final String accountName;
    @SafeParceled(3)
    public final Account account;

    public AccountRecoveryGuidanceRequest(String accountName) {
        this.accountName = accountName;
        this.account = new Account(accountName, AuthConstants.DEFAULT_ACCOUNT_TYPE);
    }

    public AccountRecoveryGuidanceRequest(Account account) {
        this.accountName = account.name;
        this.account = account;
    }

    public static final Creator<AccountRecoveryGuidanceRequest> CREATOR = new AutoCreator<AccountRecoveryGuidanceRequest>(AccountRecoveryGuidanceRequest.class);
}
+46 −0
Original line number Diff line number Diff line
/*
 * Copyright 2013-2016 microG Project Team
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.android.gms.auth.firstparty.dataservice;

import android.accounts.Account;

import org.microg.gms.auth.AuthConstants;
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;

public class AccountRemovalRequest extends AutoSafeParcelable {

    @SafeParceled(1)
    private int versionCode = 1;
    @SafeParceled(2)
    @Deprecated
    public final String accountName;
    @SafeParceled(3)
    public final Account account;

    public AccountRemovalRequest(String accountName) {
        this.accountName = accountName;
        this.account = new Account(accountName, AuthConstants.DEFAULT_ACCOUNT_TYPE);
    }

    public AccountRemovalRequest(Account account) {
        this.accountName = account.name;
        this.account = account;
    }

    public static final Creator<AccountRemovalRequest> CREATOR = new AutoCreator<AccountRemovalRequest>(AccountRemovalRequest.class);
}
+34 −0
Original line number Diff line number Diff line
/*
 * Copyright 2013-2016 microG Project Team
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.android.gms.auth.firstparty.dataservice;

import com.google.android.gms.auth.firstparty.shared.AccountCredentials;
import com.google.android.gms.auth.firstparty.shared.CaptchaSolution;

import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;

public class ConfirmCredentialsRequest extends AutoSafeParcelable {
    @SafeParceled(1)
    private int versionCode = 1;
    @SafeParceled(2)
    public AccountCredentials accountCredentials;
    @SafeParceled(3)
    public CaptchaSolution captchaSolution;

    public static final Creator<ConfirmCredentialsRequest> CREATOR = new AutoCreator<ConfirmCredentialsRequest>(ConfirmCredentialsRequest.class);
}
+25 −1
Original line number Diff line number Diff line
@@ -16,5 +16,29 @@

package com.google.android.gms.auth.firstparty.dataservice;

public class TokenRequest {
import android.accounts.Account;
import android.os.Bundle;

import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;

// TODO
public class TokenRequest extends AutoSafeParcelable{

    @SafeParceled(1)
    private int versionCode = 4;
    @SafeParceled(3)
    public String accountName;
    @SafeParceled(4)
    public Bundle extras;
    @SafeParceled(9)
    public String consent;
    @SafeParceled(15)
    public String accountType;

    public Account getAccount() {
        return new Account(accountName, accountType);
    }

    public static final Creator<TokenRequest> CREATOR = new AutoCreator<TokenRequest>(TokenRequest.class);
}
+43 −0
Original line number Diff line number Diff line
/*
 * Copyright 2013-2016 microG Project Team
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.android.gms.auth.firstparty.delegate;

import android.accounts.Account;
import android.accounts.AccountAuthenticatorResponse;
import android.os.Bundle;

import com.google.android.gms.auth.firstparty.shared.AppDescription;

import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;

public class ConfirmCredentialsWorkflowRequest extends AutoSafeParcelable {
    @SafeParceled(1)
    private int versionCode = 3;
    @SafeParceled(2)
    public String accountName;
    @SafeParceled(3)
    public AppDescription appDescription;
    @SafeParceled(4)
    public Bundle extras;
    @SafeParceled(5)
    public Account account;
    @SafeParceled(6)
    public AccountAuthenticatorResponse accountAuthenticatorResponse;

    public static final Creator<ConfirmCredentialsWorkflowRequest> CREATOR = new AutoCreator<ConfirmCredentialsWorkflowRequest>(ConfirmCredentialsWorkflowRequest.class);
}
Loading