Skip to content

Commit cf98935

Browse files
authored
Initial App Check <> Play Integrity commit (#3607)
* Initial commit of App Check Play Integrity files. * Added skeleton code for PlayIntegrityAppCheckProviderFactory and PlayIntegrityAppCheckProvider. * Set version in gradle.properties to 16.0.0-beta01 for now. * Updated wrong gradle.properties file in last commit.
1 parent 0472f6f commit cf98935

File tree

6 files changed

+153
-0
lines changed

6 files changed

+153
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Copyright 2022 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
plugins {
16+
id 'firebase-library'
17+
}
18+
19+
firebaseLibrary {
20+
publishSources = true
21+
}
22+
23+
android {
24+
adbOptions {
25+
timeOutInMs 60 * 1000
26+
}
27+
28+
compileSdkVersion project.targetSdkVersion
29+
defaultConfig {
30+
targetSdkVersion project.targetSdkVersion
31+
minSdkVersion project.minSdkVersion
32+
versionName version
33+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
34+
}
35+
compileOptions {
36+
sourceCompatibility JavaVersion.VERSION_1_8
37+
targetCompatibility JavaVersion.VERSION_1_8
38+
}
39+
40+
testOptions.unitTests.includeAndroidResources = false
41+
}
42+
43+
dependencies {
44+
implementation project(':firebase-common')
45+
implementation project(':firebase-components')
46+
implementation project(':appcheck:firebase-appcheck')
47+
implementation 'com.google.android.gms:play-services-base:18.0.1'
48+
implementation 'com.google.android.gms:play-services-tasks:18.0.1'
49+
50+
testImplementation 'junit:junit:4.13-beta-2'
51+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version=16.0.0-beta01
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright 2022 Google LLC -->
3+
<!-- -->
4+
<!-- Licensed under the Apache License, Version 2.0 (the "License"); -->
5+
<!-- you may not use this file except in compliance with the License. -->
6+
<!-- You may obtain a copy of the License at -->
7+
<!-- -->
8+
<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
9+
<!-- -->
10+
<!-- Unless required by applicable law or agreed to in writing, software -->
11+
<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
12+
<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
13+
<!-- See the License for the specific language governing permissions and -->
14+
<!-- limitations under the License. -->
15+
16+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
17+
package="com.google.firebase.appcheck.playintegrity">
18+
<!--Although the *SdkVersion is captured in gradle build files, this is required for non gradle builds-->
19+
<!--<uses-sdk android:minSdkVersion="16"/>-->
20+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright 2022 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package com.google.firebase.appcheck.playintegrity;
16+
17+
import androidx.annotation.NonNull;
18+
import com.google.firebase.FirebaseApp;
19+
import com.google.firebase.appcheck.AppCheckProvider;
20+
import com.google.firebase.appcheck.AppCheckProviderFactory;
21+
import com.google.firebase.appcheck.playintegrity.internal.PlayIntegrityAppCheckProvider;
22+
23+
/**
24+
* Implementation of an {@link AppCheckProviderFactory} that builds {@link
25+
* PlayIntegrityAppCheckProvider}s. This is the default implementation.
26+
*/
27+
public class PlayIntegrityAppCheckProviderFactory implements AppCheckProviderFactory {
28+
29+
private static final PlayIntegrityAppCheckProviderFactory instance =
30+
new PlayIntegrityAppCheckProviderFactory();
31+
32+
/**
33+
* Gets an instance of this class for installation into a {@link
34+
* com.google.firebase.appcheck.FirebaseAppCheck} instance.
35+
*/
36+
@NonNull
37+
public static PlayIntegrityAppCheckProviderFactory getInstance() {
38+
return instance;
39+
}
40+
41+
@NonNull
42+
@Override
43+
public AppCheckProvider create(@NonNull FirebaseApp firebaseApp) {
44+
return new PlayIntegrityAppCheckProvider();
45+
}
46+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright 2022 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package com.google.firebase.appcheck.playintegrity.internal;
16+
17+
import androidx.annotation.NonNull;
18+
import com.google.android.gms.tasks.Task;
19+
import com.google.android.gms.tasks.Tasks;
20+
import com.google.firebase.FirebaseException;
21+
import com.google.firebase.appcheck.AppCheckProvider;
22+
import com.google.firebase.appcheck.AppCheckToken;
23+
24+
public class PlayIntegrityAppCheckProvider implements AppCheckProvider {
25+
26+
public PlayIntegrityAppCheckProvider() {}
27+
28+
@NonNull
29+
@Override
30+
public Task<AppCheckToken> getToken() {
31+
// TODO(rosalyntan): Implement this.
32+
return Tasks.forException(new FirebaseException("Unimplemented"));
33+
}
34+
}

subprojects.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ appcheck
22
appcheck:firebase-appcheck-debug-testing
33
appcheck:firebase-appcheck-debug
44
appcheck:firebase-appcheck-interop
5+
appcheck:firebase-appcheck-playintegrity
56
appcheck:firebase-appcheck-safetynet
67
appcheck:firebase-appcheck
78
appcheck:firebase-appcheck:test-app

0 commit comments

Comments
 (0)