From 10a2c30e6886832da79aa730514478ed99c1a24e Mon Sep 17 00:00:00 2001 From: lcy Date: Sat, 17 Oct 2026 01:06:41 +0800 Subject: [PATCH 1/4] chore: change applicationId to com.doublepi123.andcode --- app/build.gradle.kts | 2 +- app/google-services.json | 19 +++++++++++++++++++ benchmark/src/main/AndroidManifest.xml | 4 ++-- .../benchmark/BaselineProfileGenerator.kt | 2 +- .../benchmark/StartupProfileGenerator.kt | 2 +- 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 2921183bc..eae749587 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -130,7 +130,7 @@ android { } defaultConfig { - applicationId = "com.yugahashimoto.andcode" + applicationId = "com.doublepi123.andcode" minSdk = 26 targetSdk = 35 versionCode = 66 diff --git a/app/google-services.json b/app/google-services.json index 3928c73c2..9d2bfc78c 100644 --- a/app/google-services.json +++ b/app/google-services.json @@ -23,6 +23,25 @@ "other_platform_oauth_client": [] } } + }, + { + "client_info": { + "mobilesdk_app_id": "1:1077322463853:android:0748cdbd40b1f032569d64", + "android_client_info": { + "package_name": "com.doublepi123.andcode" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDJqOJeefjubyYfDDia4Nd69hQpl5YJPr0" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } } ], "configuration_version": "1" diff --git a/benchmark/src/main/AndroidManifest.xml b/benchmark/src/main/AndroidManifest.xml index e35ea96b7..400a97889 100644 --- a/benchmark/src/main/AndroidManifest.xml +++ b/benchmark/src/main/AndroidManifest.xml @@ -2,10 +2,10 @@ - + + android:targetPackage="com.doublepi123.andcode" /> diff --git a/benchmark/src/main/java/com/yugahashimoto/andcode/benchmark/BaselineProfileGenerator.kt b/benchmark/src/main/java/com/yugahashimoto/andcode/benchmark/BaselineProfileGenerator.kt index 7cb9745bb..776e393f3 100644 --- a/benchmark/src/main/java/com/yugahashimoto/andcode/benchmark/BaselineProfileGenerator.kt +++ b/benchmark/src/main/java/com/yugahashimoto/andcode/benchmark/BaselineProfileGenerator.kt @@ -22,7 +22,7 @@ class BaselineProfileGenerator { rule.collect( packageName = InstrumentationRegistry.getArguments().getString("targetAppId") - ?: "com.yugahashimoto.andcode", + ?: "com.doublepi123.andcode", includeInStartupProfile = true, ) { pressHome() diff --git a/benchmark/src/main/java/com/yugahashimoto/andcode/benchmark/StartupProfileGenerator.kt b/benchmark/src/main/java/com/yugahashimoto/andcode/benchmark/StartupProfileGenerator.kt index 26c9195e6..a5d7ce9ee 100644 --- a/benchmark/src/main/java/com/yugahashimoto/andcode/benchmark/StartupProfileGenerator.kt +++ b/benchmark/src/main/java/com/yugahashimoto/andcode/benchmark/StartupProfileGenerator.kt @@ -22,7 +22,7 @@ class StartupProfileGenerator { @Test fun startupAndChatNavigation() { rule.measureRepeated( - packageName = "com.yugahashimoto.andcode", + packageName = "com.doublepi123.andcode", metrics = listOf(StartupTimingMetric()), iterations = 5, startupMode = StartupMode.COLD, From 1c7bcca39413f2d3c26b4a66b22216cdddd50523 Mon Sep 17 00:00:00 2001 From: lcy Date: Sat, 17 Oct 2026 01:13:07 +0800 Subject: [PATCH 2/4] ci(release): warn instead of fail without GitHub client ID; release v1.2.27-dp1 --- .github/workflows/release.yml | 3 +-- .release-version | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2bda9be19..6f7f8db09 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,8 +78,7 @@ jobs: GITHUB_CLIENT_ID: ${{ vars.AND_CODE_GITHUB_CLIENT_ID }} run: | if [ -z "$GITHUB_CLIENT_ID" ]; then - echo "AND_CODE_GITHUB_CLIENT_ID repo variable is not set - the published APK would have no GitHub sign-in" >&2 - exit 1 + echo "::warning::AND_CODE_GITHUB_CLIENT_ID repo variable is not set - the published APK will have no GitHub sign-in" fi ./gradlew detekt spotlessCheck :app:lintGithubDebug :app:testGithubDebugUnitTest assembleGithubDebug assembleGithubRelease # Separate invocation, deliberately without GITHUB_CLIENT_ID: this is the same flavor and diff --git a/.release-version b/.release-version index 37a16fb03..5f67c69ea 100644 --- a/.release-version +++ b/.release-version @@ -1 +1 @@ -v1.2.27 +v1.2.27-dp1 From 9f88e597f680638a5dd3613df0976731cce50ace Mon Sep 17 00:00:00 2001 From: lcy Date: Sat, 17 Oct 2026 01:33:20 +0800 Subject: [PATCH 3/4] fix(fork): keep fork builds off upstream Firebase and align versionName - google-services.json: the com.doublepi123.andcode client uses a placeholder app id/API key instead of upstream's, so nothing reaches upstream's project - disable Crashlytics mapping-file upload tasks - versionName 1.2.27-dp1 to match .release-version (ReleaseMetadataTest) - only publish the F-Droid repository from the upstream repository --- .github/workflows/fdroid-repository.yml | 2 ++ app/build.gradle.kts | 8 +++++++- app/google-services.json | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fdroid-repository.yml b/.github/workflows/fdroid-repository.yml index 2e822ad42..006f893d7 100644 --- a/.github/workflows/fdroid-repository.yml +++ b/.github/workflows/fdroid-repository.yml @@ -22,6 +22,8 @@ concurrency: jobs: publish: + # The F-Droid repository metadata and Pages URL belong to the upstream project. + if: github.repository == 'yuga-hashimoto/and-code' runs-on: ubuntu-latest environment: name: github-pages diff --git a/app/build.gradle.kts b/app/build.gradle.kts index eae749587..9d05bfc27 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -24,6 +24,12 @@ if (!isFdroidBuild) { apply(plugin = "com.google.firebase.crashlytics") } +// Fork build (com.doublepi123.andcode): there is no Firebase app registered for this package, +// so never upload Crashlytics mapping files to the placeholder app in google-services.json. +tasks.matching { it.name.startsWith("uploadCrashlyticsMappingFile") }.configureEach { + enabled = false +} + // When set, the native runtime payload (proot, libtalloc, libandroid-shmem) is built from // source by scripts/build_android_runtime_native_debs.sh before Gradle runs, and this build // extracts those .deb files instead of downloading them from the Termux mirror. F-Droid's @@ -134,7 +140,7 @@ android { minSdk = 26 targetSdk = 35 versionCode = 66 - versionName = "1.2.27" + versionName = "1.2.27-dp1" buildConfigField("String", "GITHUB_CLIENT_ID", "\"$githubClientId\"") // The on-device runtime (see ANDROID_ABIS in scripts/prepare_android_runtime_native_libs.py) diff --git a/app/google-services.json b/app/google-services.json index 9d2bfc78c..a4b8b3ce6 100644 --- a/app/google-services.json +++ b/app/google-services.json @@ -26,7 +26,7 @@ }, { "client_info": { - "mobilesdk_app_id": "1:1077322463853:android:0748cdbd40b1f032569d64", + "mobilesdk_app_id": "1:000000000000:android:0000000000000000", "android_client_info": { "package_name": "com.doublepi123.andcode" } @@ -34,7 +34,7 @@ "oauth_client": [], "api_key": [ { - "current_key": "AIzaSyDJqOJeefjubyYfDDia4Nd69hQpl5YJPr0" + "current_key": "fork-build-without-firebase" } ], "services": { From ad5879eb5f9ce4ce0cd799a4d17781d8820b81fd Mon Sep 17 00:00:00 2001 From: lcy Date: Sat, 17 Oct 2026 01:39:49 +0800 Subject: [PATCH 4/4] fix(fork): drop Firebase from all builds The fork has no Firebase project of its own, so it must not send crash or analytics data to upstream's. Remove the Firebase dependencies, never apply the google-services/crashlytics plugins, restore upstream's google-services.json untouched, and build the github flavor with the fdroid no-op diagnostics reporters. --- app/build.gradle.kts | 35 +++++++---------------------------- app/google-services.json | 19 ------------------- 2 files changed, 7 insertions(+), 47 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 9d05bfc27..714ac06fa 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -12,23 +12,9 @@ plugins { id("com.google.firebase.crashlytics") apply false } -// The fdroid flavor's dependencies already exclude Firebase (see the "githubImplementation" -// entries below), but the google-services/crashlytics Gradle plugins process google-services.json -// project-wide regardless of flavor, so they must be skipped outright rather than merely left off -// a flavor's classpath. F-Droid's own build server builds with -Pandcode.fdroidBuild=true (see the -// `gradleprops` field this project's future fdroiddata metadata will declare) to produce a build -// with no Firebase/Google Play services code at all. -val isFdroidBuild = providers.gradleProperty("andcode.fdroidBuild").orNull.toBoolean() -if (!isFdroidBuild) { - apply(plugin = "com.google.gms.google-services") - apply(plugin = "com.google.firebase.crashlytics") -} - -// Fork build (com.doublepi123.andcode): there is no Firebase app registered for this package, -// so never upload Crashlytics mapping files to the placeholder app in google-services.json. -tasks.matching { it.name.startsWith("uploadCrashlyticsMappingFile") }.configureEach { - enabled = false -} +// Fork build (com.doublepi123.andcode): the google-services/crashlytics plugins are never applied +// and no Firebase dependency is declared, so no flavor sends anything to Firebase. The github +// flavor compiles the fdroid no-op diagnostics reporters (see sourceSets below). // When set, the native runtime payload (proot, libtalloc, libandroid-shmem) is built from // source by scripts/build_android_runtime_native_debs.sh before Gradle runs, and this build @@ -159,13 +145,12 @@ android { flavorDimensions += "distribution" productFlavors { // Distributed via GitHub Releases (and the self-hosted F-Droid repo built from those - // release APKs). Includes Firebase Analytics/Crashlytics. + // release APKs). In this fork it ships without Firebase, like the fdroid flavor. create("github") { dimension = "distribution" } // Built from source by F-Droid's own build server for the official F-Droid catalog. - // Firebase is excluded entirely; see the isFdroidBuild guard above and the - // "githubImplementation" dependencies below. + // Firebase is excluded entirely. create("fdroid") { dimension = "distribution" } @@ -239,6 +224,8 @@ android { } sourceSets { getByName("main").jniLibs.srcDir(generatedRuntimeJni) + // Fork: no Firebase, so the github flavor uses the fdroid no-op diagnostics reporters. + getByName("github").java.setSrcDirs(listOf("src/fdroid/java")) } packaging { resources { @@ -261,14 +248,6 @@ dependencies { // Core Android implementation("androidx.core:core-ktx:1.15.0") - // Firebase (github flavor only - the fdroid flavor ships with no Firebase/Google Play - // services code so it can be built from source by F-Droid's own build server). - // 34.17.0 pulls Play Services Measurement compiled with Kotlin 2.2 metadata, while this - // project is currently on Kotlin 2.0/KSP 2.0. Keep the Firebase stack on the compatible - // 33.6 line until the Android build toolchain is upgraded together. - "githubImplementation"(platform("com.google.firebase:firebase-bom:33.6.0")) - "githubImplementation"("com.google.firebase:firebase-analytics") - "githubImplementation"("com.google.firebase:firebase-crashlytics") implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7") implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7") implementation("androidx.lifecycle:lifecycle-process:2.8.7") diff --git a/app/google-services.json b/app/google-services.json index a4b8b3ce6..3928c73c2 100644 --- a/app/google-services.json +++ b/app/google-services.json @@ -23,25 +23,6 @@ "other_platform_oauth_client": [] } } - }, - { - "client_info": { - "mobilesdk_app_id": "1:000000000000:android:0000000000000000", - "android_client_info": { - "package_name": "com.doublepi123.andcode" - } - }, - "oauth_client": [], - "api_key": [ - { - "current_key": "fork-build-without-firebase" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [] - } - } } ], "configuration_version": "1"