Skip to content

Merge changes from master into fad/next #4199

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 1 commit into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
41 changes: 41 additions & 0 deletions appcheck/firebase-appcheck-debug-testing/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Unreleased

# 16.1.0
* [unchanged] Updated to accommodate the release of the updated
[app_check] Kotlin extensions library.

# 16.0.1
* [changed] Updated dependency of `play-services-basement` to its latest
version (v18.1.0).

# 16.0.0
* [changed] [app_check] has exited beta and is now generally available for
use.

# 16.0.0-beta06
* [fixed] Fixed a bug in the [app_check] token refresh flow when using a
custom provider.

# 16.0.0-beta05
* [changed] Internal improvements.

# 16.0.0-beta04
* [changed] Improved error handling logic by minimizing the amount of requests
that are unlikely to succeed.

* [fixed] Fixed heartbeat reporting.

# 16.0.0-beta03
* [changed] Added `X-Android-Package` and `X-Android-Cert` request headers to
[app_check] network calls.

# 16.0.0-beta02
* [feature] Added [`getAppCheckToken()`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck#getAppCheckToken(boolean)),
[`AppCheckTokenListener`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck.AppCheckListener),
and associated setters and removers for developers to request and observe
changes to the [app_check] token.

# 16.0.0-beta01
* [feature] Initial beta release of the [app_check] Debug Testing SDK with
abuse reduction features.

4 changes: 2 additions & 2 deletions appcheck/firebase-appcheck-debug-testing/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=16.0.2
latestReleasedVersion=16.0.1
version=16.0.3
latestReleasedVersion=16.0.2
41 changes: 41 additions & 0 deletions appcheck/firebase-appcheck-debug/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Unreleased

# 16.1.0
* [unchanged] Updated to accommodate the release of the updated
[app_check] Kotlin extensions library.

# 16.0.1
* [changed] Updated dependency of `play-services-basement` to its latest
version (v18.1.0).

# 16.0.0
* [changed] [app_check] has exited beta and is now generally available for
use.

# 16.0.0-beta06
* [fixed] Fixed a bug in the [app_check] token refresh flow when using a
custom provider.

# 16.0.0-beta05
* [changed] Internal improvements.

# 16.0.0-beta04
* [changed] Improved error handling logic by minimizing the amount of requests
that are unlikely to succeed.

* [fixed] Fixed heartbeat reporting.

# 16.0.0-beta03
* [changed] Added `X-Android-Package` and `X-Android-Cert` request headers to
[app_check] network calls.

# 16.0.0-beta02
* [feature] Added [`getAppCheckToken()`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck#getAppCheckToken(boolean)),
[`AppCheckTokenListener`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck.AppCheckListener),
and associated setters and removers for developers to request and observe
changes to the [app_check] token.

# 16.0.0-beta01
* [feature] Initial beta release of the [app_check] Debug SDK with abuse
reduction features.

4 changes: 2 additions & 2 deletions appcheck/firebase-appcheck-debug/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=16.0.2
latestReleasedVersion=16.0.1
version=16.0.3
latestReleasedVersion=16.0.2
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
*/
@KeepForSdk
public class FirebaseAppCheckDebugRegistrar implements ComponentRegistrar {
private static final String LIBRARY_NAME = "fire-app-check-debug";

@Override
public List<Component<?>> getComponents() {
return Arrays.asList(
LibraryVersionComponent.create("fire-app-check-debug", BuildConfig.VERSION_NAME));
return Arrays.asList(LibraryVersionComponent.create(LIBRARY_NAME, BuildConfig.VERSION_NAME));
}
}
4 changes: 2 additions & 2 deletions appcheck/firebase-appcheck-interop/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=16.0.2
latestReleasedVersion=16.0.1
version=16.0.3
latestReleasedVersion=16.0.2
15 changes: 15 additions & 0 deletions appcheck/firebase-appcheck-playintegrity/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Unreleased

# 16.1.0
* [unchanged] Updated to accommodate the release of the updated
[app_check] Kotlin extensions library.

# 16.0.1
* [changed] Updated dependency of `play-services-basement` to its latest
version (v18.1.0).

# 16.0.0
* [feature] Added support for
[Play Integrity](https://developer.android.com/google/play/integrity) as an
attestation provider.

4 changes: 2 additions & 2 deletions appcheck/firebase-appcheck-playintegrity/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=16.0.2
latestReleasedVersion=16.0.1
version=16.0.3
latestReleasedVersion=16.0.2
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
*/
@KeepForSdk
public class FirebaseAppCheckPlayIntegrityRegistrar implements ComponentRegistrar {
private static final String LIBRARY_NAME = "fire-app-check-play-integrity";

@Override
public List<Component<?>> getComponents() {
return Arrays.asList(
LibraryVersionComponent.create("fire-app-check-play-integrity", BuildConfig.VERSION_NAME));
return Arrays.asList(LibraryVersionComponent.create(LIBRARY_NAME, BuildConfig.VERSION_NAME));
}
}
41 changes: 41 additions & 0 deletions appcheck/firebase-appcheck-safetynet/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Unreleased

# 16.1.0
* [unchanged] Updated to accommodate the release of the updated
[app_check] Kotlin extensions library.

# 16.0.1
* [changed] Updated dependency of `play-services-basement` to its latest
version (v18.1.0).

# 16.0.0
* [changed] [app_check] has exited beta and is now generally available for
use.

# 16.0.0-beta06
* [fixed] Fixed a bug in the [app_check] token refresh flow when using a
custom provider.

# 16.0.0-beta05
* [changed] Internal improvements.

# 16.0.0-beta04
* [changed] Improved error handling logic by minimizing the amount of requests
that are unlikely to succeed.

* [fixed] Fixed heartbeat reporting.

# 16.0.0-beta03
* [changed] Added `X-Android-Package` and `X-Android-Cert` request headers to
[app_check] network calls.

# 16.0.0-beta02
* [feature] Added [`getAppCheckToken()`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck#getAppCheckToken(boolean)),
[`AppCheckTokenListener`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck.AppCheckListener),
and associated setters and removers for developers to request and observe
changes to the [app_check] token.

# 16.0.0-beta01
* [feature] Initial beta release of the [app_check] SafetyNet SDK with abuse
reduction features.

3 changes: 2 additions & 1 deletion appcheck/firebase-appcheck-safetynet/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
version=16.0.2
version=16.0.3
latestReleasedVersion=16.0.2
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
*/
@KeepForSdk
public class FirebaseAppCheckSafetyNetRegistrar implements ComponentRegistrar {
private static final String LIBRARY_NAME = "fire-app-check-safety-net";

@Override
public List<Component<?>> getComponents() {
return Arrays.asList(
LibraryVersionComponent.create("fire-app-check-safety-net", BuildConfig.VERSION_NAME));
return Arrays.asList(LibraryVersionComponent.create(LIBRARY_NAME, BuildConfig.VERSION_NAME));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
/**
* Implementation of an {@link AppCheckProviderFactory} that builds {@link
* SafetyNetAppCheckProvider}s. This is the default implementation.
*
* @deprecated Use {@code PlayIntegrityAppCheckProviderFactory} instead.
*/
@Deprecated
public class SafetyNetAppCheckProviderFactory implements AppCheckProviderFactory {

private static final SafetyNetAppCheckProviderFactory instance =
Expand All @@ -34,7 +37,10 @@ private SafetyNetAppCheckProviderFactory() {}
/**
* Gets an instance of this class for installation into a {@link
* com.google.firebase.appcheck.FirebaseAppCheck} instance.
*
* @deprecated Use {@code PlayIntegrityAppCheckProviderFactory#getInstance} instead.
*/
@Deprecated
@NonNull
public static SafetyNetAppCheckProviderFactory getInstance() {
return instance;
Expand Down
59 changes: 59 additions & 0 deletions appcheck/firebase-appcheck/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Unreleased

# 16.1.0
* [unchanged] Updated to accommodate the release of the updated
[app_check] Kotlin extensions library.


## Kotlin
The Kotlin extensions library transitively includes the updated
`firebase-appcheck` library. The Kotlin extensions library has the following
additional updates:

* [feature] Firebase now supports Kotlin coroutines.
With this release, we added
[`kotlinx-coroutines-play-services`](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-play-services/){: .external}
to `firebase-appcheck-ktx` as a transitive dependency, which exposes the
`Task<T>.await()` suspend function to convert a
[`Task`](https://developers.google.com/android/guides/tasks) into a Kotlin
coroutine.

# 16.0.1
* [changed] Updated dependency of `play-services-basement` to its latest
version (v18.1.0).

# 16.0.0
* [changed] [app_check] has exited beta and is now generally available for
use.

* [feature] Added support for
[Play Integrity](https://developer.android.com/google/play/integrity) as an
attestation provider.

# 16.0.0-beta06
* [fixed] Fixed a bug in the [app_check] token refresh flow when using a
custom provider.

# 16.0.0-beta05
* [changed] Internal improvements.

# 16.0.0-beta04
* [changed] Improved error handling logic by minimizing the amount of requests
that are unlikely to succeed.

* [fixed] Fixed heartbeat reporting.

# 16.0.0-beta03
* [changed] Added `X-Android-Package` and `X-Android-Cert` request headers to
[app_check] network calls.

# 16.0.0-beta02
* [feature] Added [`getAppCheckToken()`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck#getAppCheckToken(boolean)),
[`AppCheckTokenListener`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck.AppCheckListener),
and associated setters and removers for developers to request and observe
changes to the [app_check] token.

# 16.0.0-beta01
* [feature] Initial beta release of the [app_check] SDK with abuse reduction
features.

10 changes: 10 additions & 0 deletions appcheck/firebase-appcheck/firebase-appcheck.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,14 @@ dependencies {
testImplementation "com.google.truth:truth:$googleTruthVersion"
testImplementation 'androidx.test:core:1.2.0'
testImplementation 'androidx.test:rules:1.2.0'

androidTestImplementation project(':appcheck:firebase-appcheck')
androidTestImplementation project(':integ-testing')
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation "com.google.truth:truth:$googleTruthVersion"
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation "androidx.annotation:annotation:1.0.0"
androidTestImplementation 'org.mockito:mockito-core:2.25.0'
androidTestImplementation 'org.mockito:mockito-inline:2.25.0'
}
4 changes: 2 additions & 2 deletions appcheck/firebase-appcheck/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=16.0.2
latestReleasedVersion=16.0.1
version=16.0.3
latestReleasedVersion=16.0.2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2021 Google LLC -->
<!-- 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. -->
Expand All @@ -14,11 +14,13 @@
<!-- limitations under the License. -->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.google.firebase.benchmark.test">
package="com.google.firebase.appcheck">

<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />
<application>
<uses-library android:name="android.test.runner"/>
</application>

<instrumentation
android:name="androidx.test.runner.AndroidJUnitRunner"
android:targetPackage="com.google.firebase.appcheck" />
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// 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;

import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.firebase.FirebaseApp;
import com.google.firebase.FirebaseOptions;
import com.google.firebase.appcheck.interop.InternalAppCheckTokenProvider;
import com.google.firebase.testing.integ.StrictModeRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(AndroidJUnit4.class)
public class StrictModeTest {

@Rule public StrictModeRule strictMode = new StrictModeRule();

@Test
public void initializingFirebaseAppcheck_shouldNotViolateStrictMode() {
strictMode.runOnMainThread(
() -> {
FirebaseApp app =
FirebaseApp.initializeApp(
ApplicationProvider.getApplicationContext(),
new FirebaseOptions.Builder()
.setApiKey("api")
.setProjectId("123")
.setApplicationId("appId")
.build(),
"hello");
app.get(FirebaseAppCheck.class);
app.get(InternalAppCheckTokenProvider.class);
});
}
}
Loading