-
Notifications
You must be signed in to change notification settings - Fork 615
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
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d8ee928
Initial commit of App Check Play Integrity files.
rosalyntan d943639
Added skeleton code for PlayIntegrityAppCheckProviderFactory and Play…
rosalyntan e180bdf
Set version in gradle.properties to 16.0.0-beta01 for now.
rosalyntan c639f34
Updated wrong gradle.properties file in last commit.
rosalyntan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
appcheck/firebase-appcheck-playintegrity/firebase-appcheck-playintegrity.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
version=16.0.1 | ||
20 changes: 20 additions & 0 deletions
20
appcheck/firebase-appcheck-playintegrity/src/main/AndroidManifest.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
46 changes: 46 additions & 0 deletions
46
...java/com/google/firebase/appcheck/playintegrity/PlayIntegrityAppCheckProviderFactory.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | ||
rosalyntan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return new PlayIntegrityAppCheckProvider(); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...va/com/google/firebase/appcheck/playintegrity/internal/PlayIntegrityAppCheckProvider.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.