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

Unverified Commit 3a8cdceb authored by DaVinci9196's avatar DaVinci9196 Committed by GitHub
Browse files

Add PoToken service (#2129)

parent c1042118
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
/*
 * SPDX-FileCopyrightText: 2023 microG Project Team
 * SPDX-License-Identifier: Apache-2.0
 */

package com.google.android.gms.potokens;

parcelable PoToken;
 No newline at end of file
+14 −0
Original line number Diff line number Diff line
/*
 * SPDX-FileCopyrightText: 2023 microG Project Team
 * SPDX-License-Identifier: Apache-2.0
 */

package com.google.android.gms.potokens.internal;

import com.google.android.gms.common.api.internal.IStatusCallback;
import com.google.android.gms.potokens.internal.ITokenCallbacks;

interface IPoTokensService {
    void responseStatus(IStatusCallback call, int code) = 1;
    void responseStatusToken(ITokenCallbacks call, int i, in byte[] bArr) = 2;
}
 No newline at end of file
+13 −0
Original line number Diff line number Diff line
/*
 * SPDX-FileCopyrightText: 2023 microG Project Team
 * SPDX-License-Identifier: Apache-2.0
 */

package com.google.android.gms.potokens.internal;

import com.google.android.gms.common.api.Status;
import com.google.android.gms.potokens.PoToken;

interface ITokenCallbacks {
    void responseToken(in Status status, in PoToken token) = 1;
}
 No newline at end of file
+20 −0
Original line number Diff line number Diff line
/*
 * SPDX-FileCopyrightText: 2023 microG Project Team
 * SPDX-License-Identifier: Apache-2.0
 */

package com.google.android.gms.potokens;

import org.microg.safeparcel.AutoSafeParcelable;

public class PoToken extends AutoSafeParcelable {

    @Field(1)
    public byte[] data;

    public PoToken(byte[] data) {
        this.data = data;
    }

    public static Creator<PoToken> CREATOR = findCreator(PoToken.class);
}
+63 −0
Original line number Diff line number Diff line
/*
 * SPDX-FileCopyrightText: 2023 microG Project Team
 * SPDX-License-Identifier: Apache-2.0
 */

option java_package = "com.google.android.gms.potokens";

option java_multiple_files = true;

message CipherKey {
  optional int32 key = 1;
  optional bytes value = 3;
}

message KeyData {
  optional string typeUrl = 1;
  optional CipherKey value = 2;
  optional int32 keyMaterialType = 3;
}

message Key {
  optional KeyData data = 1;
  optional int32 status = 2;
  optional int32 keyId = 3;
  optional int32 outputPrefixType = 4;
}

message KeySet {
  optional int32 keyId = 1;
  repeated Key keyList = 2;
}

message PoTokenInfo {
  optional int32 key = 6;
  optional int32 time = 1;
  optional bytes inputData = 2;
  optional string pkgName = 3;
  optional bytes pkgSignSha256 = 4;
  optional bytes tokenData = 5;
}

message GetPoIntegrityTokenRequest {
  optional int32 mode = 1;
  optional bytes dgResult = 2;
  optional bytes dgRandKey = 3;
}

message GetPoIntegrityTokenResponse {
  optional bytes desc = 1;
  optional int32 code = 2;
  optional bytes backup = 3;
//  optional bytes d = 4;
//  optional bytes e = 5;
}

message PoTokenResult {
  optional bytes encryptData = 1;
  optional bytes tokenData = 2;
}

message PoTokenResultWrap {
  optional PoTokenResult data = 1;
}
Loading