Skip to content

Initial App Check <> Play Integrity commit #3607

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright 2022 Google LLC
//
// 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.

plugins {
id 'firebase-library'
}

firebaseLibrary {
publishSources = true
}

android {
adbOptions {
timeOutInMs 60 * 1000
}

compileSdkVersion project.targetSdkVersion
defaultConfig {
targetSdkVersion project.targetSdkVersion
minSdkVersion project.minSdkVersion
versionName version
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

testOptions.unitTests.includeAndroidResources = false
}

dependencies {
implementation project(':firebase-common')
implementation project(':firebase-components')
implementation project(':appcheck:firebase-appcheck')
implementation 'com.google.android.gms:play-services-base:18.0.1'
implementation 'com.google.android.gms:play-services-tasks:18.0.1'

testImplementation 'junit:junit:4.13-beta-2'
}
1 change: 1 addition & 0 deletions appcheck/firebase-appcheck-playintegrity/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version=16.0.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2022 Google LLC -->
<!-- -->
<!-- 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. -->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.firebase.appcheck.playintegrity">
<!--Although the *SdkVersion is captured in gradle build files, this is required for non gradle builds-->
<!--<uses-sdk android:minSdkVersion="16"/>-->
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Copyright 2022 Google LLC
//
// 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.firebase.appcheck.playintegrity;

import androidx.annotation.NonNull;
import com.google.firebase.FirebaseApp;
import com.google.firebase.appcheck.AppCheckProvider;
import com.google.firebase.appcheck.AppCheckProviderFactory;
import com.google.firebase.appcheck.playintegrity.internal.PlayIntegrityAppCheckProvider;

/**
* Implementation of an {@link AppCheckProviderFactory} that builds {@link
* PlayIntegrityAppCheckProvider}s. This is the default implementation.
*/
public class PlayIntegrityAppCheckProviderFactory implements AppCheckProviderFactory {

private static final PlayIntegrityAppCheckProviderFactory instance =
new PlayIntegrityAppCheckProviderFactory();

/**
* Gets an instance of this class for installation into a {@link
* com.google.firebase.appcheck.FirebaseAppCheck} instance.
*/
@NonNull
public static PlayIntegrityAppCheckProviderFactory getInstance() {
return instance;
}

@NonNull
@Override
public AppCheckProvider create(@NonNull FirebaseApp firebaseApp) {
return new PlayIntegrityAppCheckProvider();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright 2022 Google LLC
//
// 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.firebase.appcheck.playintegrity.internal;

import androidx.annotation.NonNull;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.Tasks;
import com.google.firebase.FirebaseException;
import com.google.firebase.appcheck.AppCheckProvider;
import com.google.firebase.appcheck.AppCheckToken;

public class PlayIntegrityAppCheckProvider implements AppCheckProvider {

public PlayIntegrityAppCheckProvider() {}

@NonNull
@Override
public Task<AppCheckToken> getToken() {
// TODO(rosalyntan): Implement this.
return Tasks.forException(new FirebaseException("Unimplemented"));
}
}
1 change: 1 addition & 0 deletions subprojects.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ appcheck
appcheck:firebase-appcheck-debug-testing
appcheck:firebase-appcheck-debug
appcheck:firebase-appcheck-interop
appcheck:firebase-appcheck-playintegrity
appcheck:firebase-appcheck-safetynet
appcheck:firebase-appcheck
appcheck:firebase-appcheck:test-app
Expand Down