Skip to content

Commit d14f023

Browse files
authored
Merge changes from master into fad/next (#4199)
1 parent 6a1ce60 commit d14f023

File tree

185 files changed

+6831
-1647
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+6831
-1647
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Unreleased
2+
3+
# 16.1.0
4+
* [unchanged] Updated to accommodate the release of the updated
5+
[app_check] Kotlin extensions library.
6+
7+
# 16.0.1
8+
* [changed] Updated dependency of `play-services-basement` to its latest
9+
version (v18.1.0).
10+
11+
# 16.0.0
12+
* [changed] [app_check] has exited beta and is now generally available for
13+
use.
14+
15+
# 16.0.0-beta06
16+
* [fixed] Fixed a bug in the [app_check] token refresh flow when using a
17+
custom provider.
18+
19+
# 16.0.0-beta05
20+
* [changed] Internal improvements.
21+
22+
# 16.0.0-beta04
23+
* [changed] Improved error handling logic by minimizing the amount of requests
24+
that are unlikely to succeed.
25+
26+
* [fixed] Fixed heartbeat reporting.
27+
28+
# 16.0.0-beta03
29+
* [changed] Added `X-Android-Package` and `X-Android-Cert` request headers to
30+
[app_check] network calls.
31+
32+
# 16.0.0-beta02
33+
* [feature] Added [`getAppCheckToken()`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck#getAppCheckToken(boolean)),
34+
[`AppCheckTokenListener`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck.AppCheckListener),
35+
and associated setters and removers for developers to request and observe
36+
changes to the [app_check] token.
37+
38+
# 16.0.0-beta01
39+
* [feature] Initial beta release of the [app_check] Debug Testing SDK with
40+
abuse reduction features.
41+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=16.0.2
2-
latestReleasedVersion=16.0.1
1+
version=16.0.3
2+
latestReleasedVersion=16.0.2
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Unreleased
2+
3+
# 16.1.0
4+
* [unchanged] Updated to accommodate the release of the updated
5+
[app_check] Kotlin extensions library.
6+
7+
# 16.0.1
8+
* [changed] Updated dependency of `play-services-basement` to its latest
9+
version (v18.1.0).
10+
11+
# 16.0.0
12+
* [changed] [app_check] has exited beta and is now generally available for
13+
use.
14+
15+
# 16.0.0-beta06
16+
* [fixed] Fixed a bug in the [app_check] token refresh flow when using a
17+
custom provider.
18+
19+
# 16.0.0-beta05
20+
* [changed] Internal improvements.
21+
22+
# 16.0.0-beta04
23+
* [changed] Improved error handling logic by minimizing the amount of requests
24+
that are unlikely to succeed.
25+
26+
* [fixed] Fixed heartbeat reporting.
27+
28+
# 16.0.0-beta03
29+
* [changed] Added `X-Android-Package` and `X-Android-Cert` request headers to
30+
[app_check] network calls.
31+
32+
# 16.0.0-beta02
33+
* [feature] Added [`getAppCheckToken()`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck#getAppCheckToken(boolean)),
34+
[`AppCheckTokenListener`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck.AppCheckListener),
35+
and associated setters and removers for developers to request and observe
36+
changes to the [app_check] token.
37+
38+
# 16.0.0-beta01
39+
* [feature] Initial beta release of the [app_check] Debug SDK with abuse
40+
reduction features.
41+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=16.0.2
2-
latestReleasedVersion=16.0.1
1+
version=16.0.3
2+
latestReleasedVersion=16.0.2

appcheck/firebase-appcheck-debug/src/main/java/com/google/firebase/appcheck/debug/FirebaseAppCheckDebugRegistrar.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
*/
3030
@KeepForSdk
3131
public class FirebaseAppCheckDebugRegistrar implements ComponentRegistrar {
32+
private static final String LIBRARY_NAME = "fire-app-check-debug";
3233

3334
@Override
3435
public List<Component<?>> getComponents() {
35-
return Arrays.asList(
36-
LibraryVersionComponent.create("fire-app-check-debug", BuildConfig.VERSION_NAME));
36+
return Arrays.asList(LibraryVersionComponent.create(LIBRARY_NAME, BuildConfig.VERSION_NAME));
3737
}
3838
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=16.0.2
2-
latestReleasedVersion=16.0.1
1+
version=16.0.3
2+
latestReleasedVersion=16.0.2
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Unreleased
2+
3+
# 16.1.0
4+
* [unchanged] Updated to accommodate the release of the updated
5+
[app_check] Kotlin extensions library.
6+
7+
# 16.0.1
8+
* [changed] Updated dependency of `play-services-basement` to its latest
9+
version (v18.1.0).
10+
11+
# 16.0.0
12+
* [feature] Added support for
13+
[Play Integrity](https://developer.android.com/google/play/integrity) as an
14+
attestation provider.
15+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=16.0.2
2-
latestReleasedVersion=16.0.1
1+
version=16.0.3
2+
latestReleasedVersion=16.0.2

appcheck/firebase-appcheck-playintegrity/src/main/java/com/google/firebase/appcheck/playintegrity/FirebaseAppCheckPlayIntegrityRegistrar.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
*/
3030
@KeepForSdk
3131
public class FirebaseAppCheckPlayIntegrityRegistrar implements ComponentRegistrar {
32+
private static final String LIBRARY_NAME = "fire-app-check-play-integrity";
3233

3334
@Override
3435
public List<Component<?>> getComponents() {
35-
return Arrays.asList(
36-
LibraryVersionComponent.create("fire-app-check-play-integrity", BuildConfig.VERSION_NAME));
36+
return Arrays.asList(LibraryVersionComponent.create(LIBRARY_NAME, BuildConfig.VERSION_NAME));
3737
}
3838
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Unreleased
2+
3+
# 16.1.0
4+
* [unchanged] Updated to accommodate the release of the updated
5+
[app_check] Kotlin extensions library.
6+
7+
# 16.0.1
8+
* [changed] Updated dependency of `play-services-basement` to its latest
9+
version (v18.1.0).
10+
11+
# 16.0.0
12+
* [changed] [app_check] has exited beta and is now generally available for
13+
use.
14+
15+
# 16.0.0-beta06
16+
* [fixed] Fixed a bug in the [app_check] token refresh flow when using a
17+
custom provider.
18+
19+
# 16.0.0-beta05
20+
* [changed] Internal improvements.
21+
22+
# 16.0.0-beta04
23+
* [changed] Improved error handling logic by minimizing the amount of requests
24+
that are unlikely to succeed.
25+
26+
* [fixed] Fixed heartbeat reporting.
27+
28+
# 16.0.0-beta03
29+
* [changed] Added `X-Android-Package` and `X-Android-Cert` request headers to
30+
[app_check] network calls.
31+
32+
# 16.0.0-beta02
33+
* [feature] Added [`getAppCheckToken()`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck#getAppCheckToken(boolean)),
34+
[`AppCheckTokenListener`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck.AppCheckListener),
35+
and associated setters and removers for developers to request and observe
36+
changes to the [app_check] token.
37+
38+
# 16.0.0-beta01
39+
* [feature] Initial beta release of the [app_check] SafetyNet SDK with abuse
40+
reduction features.
41+
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
version=16.0.2
1+
version=16.0.3
2+
latestReleasedVersion=16.0.2

appcheck/firebase-appcheck-safetynet/src/main/java/com/google/firebase/appcheck/safetynet/FirebaseAppCheckSafetyNetRegistrar.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
*/
3030
@KeepForSdk
3131
public class FirebaseAppCheckSafetyNetRegistrar implements ComponentRegistrar {
32+
private static final String LIBRARY_NAME = "fire-app-check-safety-net";
3233

3334
@Override
3435
public List<Component<?>> getComponents() {
35-
return Arrays.asList(
36-
LibraryVersionComponent.create("fire-app-check-safety-net", BuildConfig.VERSION_NAME));
36+
return Arrays.asList(LibraryVersionComponent.create(LIBRARY_NAME, BuildConfig.VERSION_NAME));
3737
}
3838
}

appcheck/firebase-appcheck-safetynet/src/main/java/com/google/firebase/appcheck/safetynet/SafetyNetAppCheckProviderFactory.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
/**
2424
* Implementation of an {@link AppCheckProviderFactory} that builds {@link
2525
* SafetyNetAppCheckProvider}s. This is the default implementation.
26+
*
27+
* @deprecated Use {@code PlayIntegrityAppCheckProviderFactory} instead.
2628
*/
29+
@Deprecated
2730
public class SafetyNetAppCheckProviderFactory implements AppCheckProviderFactory {
2831

2932
private static final SafetyNetAppCheckProviderFactory instance =
@@ -34,7 +37,10 @@ private SafetyNetAppCheckProviderFactory() {}
3437
/**
3538
* Gets an instance of this class for installation into a {@link
3639
* com.google.firebase.appcheck.FirebaseAppCheck} instance.
40+
*
41+
* @deprecated Use {@code PlayIntegrityAppCheckProviderFactory#getInstance} instead.
3742
*/
43+
@Deprecated
3844
@NonNull
3945
public static SafetyNetAppCheckProviderFactory getInstance() {
4046
return instance;
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Unreleased
2+
3+
# 16.1.0
4+
* [unchanged] Updated to accommodate the release of the updated
5+
[app_check] Kotlin extensions library.
6+
7+
8+
## Kotlin
9+
The Kotlin extensions library transitively includes the updated
10+
`firebase-appcheck` library. The Kotlin extensions library has the following
11+
additional updates:
12+
13+
* [feature] Firebase now supports Kotlin coroutines.
14+
With this release, we added
15+
[`kotlinx-coroutines-play-services`](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-play-services/){: .external}
16+
to `firebase-appcheck-ktx` as a transitive dependency, which exposes the
17+
`Task<T>.await()` suspend function to convert a
18+
[`Task`](https://developers.google.com/android/guides/tasks) into a Kotlin
19+
coroutine.
20+
21+
# 16.0.1
22+
* [changed] Updated dependency of `play-services-basement` to its latest
23+
version (v18.1.0).
24+
25+
# 16.0.0
26+
* [changed] [app_check] has exited beta and is now generally available for
27+
use.
28+
29+
* [feature] Added support for
30+
[Play Integrity](https://developer.android.com/google/play/integrity) as an
31+
attestation provider.
32+
33+
# 16.0.0-beta06
34+
* [fixed] Fixed a bug in the [app_check] token refresh flow when using a
35+
custom provider.
36+
37+
# 16.0.0-beta05
38+
* [changed] Internal improvements.
39+
40+
# 16.0.0-beta04
41+
* [changed] Improved error handling logic by minimizing the amount of requests
42+
that are unlikely to succeed.
43+
44+
* [fixed] Fixed heartbeat reporting.
45+
46+
# 16.0.0-beta03
47+
* [changed] Added `X-Android-Package` and `X-Android-Cert` request headers to
48+
[app_check] network calls.
49+
50+
# 16.0.0-beta02
51+
* [feature] Added [`getAppCheckToken()`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck#getAppCheckToken(boolean)),
52+
[`AppCheckTokenListener`](/docs/reference/android/com/google/firebase/appcheck/FirebaseAppCheck.AppCheckListener),
53+
and associated setters and removers for developers to request and observe
54+
changes to the [app_check] token.
55+
56+
# 16.0.0-beta01
57+
* [feature] Initial beta release of the [app_check] SDK with abuse reduction
58+
features.
59+

appcheck/firebase-appcheck/firebase-appcheck.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,14 @@ dependencies {
5656
testImplementation "com.google.truth:truth:$googleTruthVersion"
5757
testImplementation 'androidx.test:core:1.2.0'
5858
testImplementation 'androidx.test:rules:1.2.0'
59+
60+
androidTestImplementation project(':appcheck:firebase-appcheck')
61+
androidTestImplementation project(':integ-testing')
62+
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
63+
androidTestImplementation 'androidx.test:runner:1.2.0'
64+
androidTestImplementation "com.google.truth:truth:$googleTruthVersion"
65+
androidTestImplementation 'junit:junit:4.12'
66+
androidTestImplementation "androidx.annotation:annotation:1.0.0"
67+
androidTestImplementation 'org.mockito:mockito-core:2.25.0'
68+
androidTestImplementation 'org.mockito:mockito-inline:2.25.0'
5969
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=16.0.2
2-
latestReleasedVersion=16.0.1
1+
version=16.0.3
2+
latestReleasedVersion=16.0.2
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- Copyright 2021 Google LLC -->
2+
<!-- Copyright 2022 Google LLC -->
33
<!-- -->
44
<!-- Licensed under the Apache License, Version 2.0 (the "License"); -->
55
<!-- you may not use this file except in compliance with the License. -->
@@ -14,11 +14,13 @@
1414
<!-- limitations under the License. -->
1515

1616
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
17-
xmlns:tools="http://schemas.android.com/tools"
18-
package="com.google.firebase.benchmark.test">
17+
package="com.google.firebase.appcheck">
1918

20-
<uses-permission
21-
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
22-
tools:ignore="ScopedStorage" />
19+
<application>
20+
<uses-library android:name="android.test.runner"/>
21+
</application>
2322

23+
<instrumentation
24+
android:name="androidx.test.runner.AndroidJUnitRunner"
25+
android:targetPackage="com.google.firebase.appcheck" />
2426
</manifest>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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;
16+
17+
import androidx.test.core.app.ApplicationProvider;
18+
import androidx.test.ext.junit.runners.AndroidJUnit4;
19+
import com.google.firebase.FirebaseApp;
20+
import com.google.firebase.FirebaseOptions;
21+
import com.google.firebase.appcheck.interop.InternalAppCheckTokenProvider;
22+
import com.google.firebase.testing.integ.StrictModeRule;
23+
import org.junit.Rule;
24+
import org.junit.Test;
25+
import org.junit.runner.RunWith;
26+
27+
@RunWith(AndroidJUnit4.class)
28+
public class StrictModeTest {
29+
30+
@Rule public StrictModeRule strictMode = new StrictModeRule();
31+
32+
@Test
33+
public void initializingFirebaseAppcheck_shouldNotViolateStrictMode() {
34+
strictMode.runOnMainThread(
35+
() -> {
36+
FirebaseApp app =
37+
FirebaseApp.initializeApp(
38+
ApplicationProvider.getApplicationContext(),
39+
new FirebaseOptions.Builder()
40+
.setApiKey("api")
41+
.setProjectId("123")
42+
.setApplicationId("appId")
43+
.build(),
44+
"hello");
45+
app.get(FirebaseAppCheck.class);
46+
app.get(InternalAppCheckTokenProvider.class);
47+
});
48+
}
49+
}

0 commit comments

Comments
 (0)