Skip to content

Commit 1dfa16a

Browse files
authored
Use String.format in cases where firebase-vendor plugin transforms hardcoded strings (#8155)
Starting with `16.0.0-beta18`, the vendor plugin is renaming strings in the app distro SDK: ``` > Task :firebase-appdistribution:releaseVendorTransform ... Changed ".FirebaseAppDistributionFileProvider" -> "com.google.firebase.appdistribution.impl..FirebaseAppDistributionFileProvider" Changed ".apk" -> "com.google.firebase.appdistribution.impl..apk" ... ``` This is causing the SDK functionality to fail due to malformed strings: #8136 I don't know the root cause, but this does fix the issue.
1 parent 0807bfb commit 1dfa16a

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

firebase-appdistribution/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Unreleased
22

3+
- [fixed] Fixed failing APK downloads due to an invalid file provider authority [#8136]
4+
35
# 16.0.0-beta18
46

57
- [changed] Bump internal dependencies.

firebase-appdistribution/src/main/java/com/google/firebase/appdistribution/impl/ApkUpdater.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ private String getApkFileName() {
227227
try {
228228
String applicationName =
229229
context.getApplicationInfo().loadLabel(context.getPackageManager()).toString();
230-
return applicationName + ".apk";
230+
return String.format("%s.%s", applicationName, "apk");
231231
} catch (Exception e) {
232232
LogWrapper.w(
233233
TAG,

firebase-appdistribution/src/main/java/com/google/firebase/appdistribution/impl/InstallActivity.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ private void startAndroidPackageInstallerIntent() {
148148
Uri apkUri =
149149
FileProvider.getUriForFile(
150150
getApplicationContext(),
151-
getApplicationContext().getPackageName() + ".FirebaseAppDistributionFileProvider",
151+
String.format(
152+
"%s.%s",
153+
getApplicationContext().getPackageName(), "FirebaseAppDistributionFileProvider"),
152154
apkFile);
153155
intent.setDataAndType(apkUri, APK_MIME_TYPE);
154156
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

0 commit comments

Comments
 (0)