Skip to content
This repository was archived by the owner on Mar 6, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2dde87d
Rename app package to authenticator
SaintPatrck Dec 17, 2024
0dad6f2
Workflows: renamed with -bwa prefix
vvolkgang Feb 6, 2025
49a2eab
Fastlane: Add -bwa prefix and set check lane Gradle project
vvolkgang Feb 6, 2025
71985cd
Revert "Workflows: renamed with -bwa prefix"
vvolkgang Feb 6, 2025
9bf6635
Revert "Fastlane: Add -bwa prefix and set check lane Gradle project"
vvolkgang Feb 6, 2025
b95f528
Revert "Revert "Fastlane: Add -bwa prefix and set check lane Gradle pโ€ฆ
vvolkgang Feb 6, 2025
fc6e987
Remove project from gradle task
vvolkgang Feb 6, 2025
3e185cb
Rename suffix
vvolkgang Feb 6, 2025
47cfe8d
Rename CI workflows for Authenticator
SaintPatrck Dec 17, 2024
a53f0f8
Rename Fastfile lanes to be Authenticator-specific
SaintPatrck Dec 17, 2024
2388f49
Update output filenames
SaintPatrck Dec 17, 2024
4a2cbf1
Replaced `check-bwa` with `checkAuthenticator` in workflow
SaintPatrck Feb 6, 2025
785e089
Revert renaming of `check` lane
SaintPatrck Feb 6, 2025
c064f52
Missed some renaming....
SaintPatrck Feb 6, 2025
d75f962
Merge branch 'repo-migration/rename-app-module' into repo-migration/rโ€ฆ
SaintPatrck Feb 6, 2025
8b99d46
Merge branch 'repo-migration/rename-workflow-files' into repo-migratiโ€ฆ
SaintPatrck Feb 6, 2025
a3ad3ce
Merge branch 'repo-migration/update-fastfile' into repo-migration/conโ€ฆ
SaintPatrck Feb 6, 2025
4a22c8f
Revert build.yml / Fastfile changes
vvolkgang Feb 12, 2025
4ce2680
Merge remote-tracking branch 'origin/main' into repo-migration/renameโ€ฆ
SaintPatrck Feb 12, 2025
a58836f
Revert workflow name changes
vvolkgang Feb 12, 2025
b34693a
Merge branch 'repo-migration/rename-app-module' into repo-migration/uโ€ฆ
vvolkgang Feb 12, 2025
7af9604
Merge branch 'repo-migration/update-fastfile' into repo-migration/conโ€ฆ
vvolkgang Feb 12, 2025
d1811d3
Merge branch 'repo-migration/rename-app-module' into repo-migration/uโ€ฆ
vvolkgang Feb 12, 2025
5b65155
Merge branch 'repo-migration/update-fastfile' into repo-migration/conโ€ฆ
vvolkgang Feb 12, 2025
9e537cc
Merge branch 'main' into repo-migration/consistent-output-filenames
vvolkgang Feb 12, 2025
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
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,27 +221,27 @@ jobs:
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: com.bitwarden.authenticator.aab
path: authenticator/build/outputs/bundle/release/com.bitwarden.authenticator-release.aab
path: authenticator/build/outputs/bundle/release/com.bitwarden.authenticator.aab
if-no-files-found: error

- name: Upload release .apk artifact
if: ${{ matrix.variant == 'apk' }}
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: com.bitwarden.authenticator.apk
path: authenticator/build/outputs/apk/release/com.bitwarden.authenticator-release.apk
path: authenticator/build/outputs/apk/release/com.bitwarden.authenticator.apk
if-no-files-found: error

- name: Create checksum file for Release AAB
if: ${{ matrix.variant == 'aab' }}
run: |
sha256sum "authenticator/build/outputs/bundle/release/com.bitwarden.authenticator-release.aab" \
sha256sum "authenticator/build/outputs/bundle/release/com.bitwarden.authenticator.aab" \
> ./authenticator-android-aab-sha256.txt

- name: Create checksum for release .apk artifact
if: ${{ matrix.variant == 'apk' }}
run: |
sha256sum "authenticator/build/outputs/apk/release/com.bitwarden.authenticator-release.apk" \
sha256sum "authenticator/build/outputs/apk/release/com.bitwarden.authenticator.apk" \
> ./authenticator-android-apk-sha256.txt

- name: Upload .apk SHA file for release
Expand Down
44 changes: 44 additions & 0 deletions authenticator/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import com.android.build.gradle.internal.api.BaseVariantOutputImpl
import com.google.protobuf.gradle.proto
import dagger.hilt.android.plugin.util.capitalize
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
Expand Down Expand Up @@ -54,6 +56,7 @@ android {

buildTypes {
debug {
applicationIdSuffix = ".dev"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this package name change, do we know if the sync feature will still function properly with the dev builds.

I am unsure if they look for specific package names or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see anything in Bitwarden that's looking for Authenticator's appId. Authenticator is what needs knowledge of the correct Bitwarden appId to query for.

manifestPlaceholders["targetBitwardenAppId"] = "com.x8bit.bitwarden.dev"
buildConfigField(
type = "com.bitwarden.authenticatorbridge.manager.model.AuthenticatorBridgeConnectionType",
Expand Down Expand Up @@ -81,6 +84,32 @@ android {
buildConfigField(type = "boolean", name = "HAS_DEBUG_MENU", value = "false")
}
}
applicationVariants.all {
val bundlesDir = "${layout.buildDirectory.get()}/outputs/bundle"
outputs
.mapNotNull { it as? BaseVariantOutputImpl }
.forEach { output ->
// Set the APK output filename.
output.outputFileName = "$applicationId.apk"

val variantName = name
val renameTaskName = "rename${variantName.capitalize()}AabFiles"
tasks.register(renameTaskName) {
group = "build"
description = "Renames the bundle files for $variantName variant"
doLast {
renameFile(
"$bundlesDir/$variantName/$namespace-${buildType.name}.aab",
"$applicationId.aab",
)
}
}
// Force renaming task to execute after the variant is built.
tasks
.getByName("bundle${variantName.capitalize()}")
.finalizedBy(renameTaskName)
}
}
compileOptions {
sourceCompatibility(libs.versions.jvmTarget.get())
targetCompatibility(libs.versions.jvmTarget.get())
Expand Down Expand Up @@ -285,3 +314,18 @@ tasks {
dependsOn("check")
}
}

private fun renameFile(path: String, newName: String) {
val originalFile = File(path)
if (!originalFile.exists()) {
println("File $originalFile does not exist!")
return
}

val newFile = File(originalFile.parentFile, newName)
if (originalFile.renameTo(newFile)) {
println("Renamed $originalFile to $newFile")
} else {
throw RuntimeException("Failed to rename $originalFile to $newFile")
}
}
29 changes: 29 additions & 0 deletions authenticator/src/debug/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "867301491091",
"project_id": "bitwarden-authenticator",
"storage_bucket": "bitwarden-authenticator.firebasestorage.app"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:867301491091:android:3ee369dedcd20f6551e866",
"android_client_info": {
"package_name": "com.bitwarden.authenticator.dev"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDDXnnBuWzuh8rlihiMWRPif_sqkGk3fxw"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
4 changes: 2 additions & 2 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ platform :android do
firebase_app_distribution(
app: "1:867301491091:android:50b626dba42a361651e866",
android_artifact_type: "AAB",
android_artifact_path: "authenticator/build/outputs/bundle/release/com.bitwarden.authenticator-release.aab",
android_artifact_path: "authenticator/build/outputs/bundle/release/com.bitwarden.authenticator.aab",
service_credentials_file: options[:serviceCredentialsFile],
groups: "internal-prod-group, livefront",
release_notes: release_notes,
Expand All @@ -136,7 +136,7 @@ platform :android do
package_name: "com.bitwarden.authenticator",
json_key: options[:serviceCredentialsFile],
track: "internal",
aab: "authenticator/build/outputs/bundle/release/com.bitwarden.authenticator-release.aab",
aab: "authenticator/build/outputs/bundle/release/com.bitwarden.authenticator.aab",
mapping: "authenticator/build/outputs/mapping/release/mapping.txt",
)
end
Expand Down