Skip to content
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
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ on:
env:
GOOGLE_OAUTH_CLIENT_ID_ANDROID: ${{ secrets.GOOGLE_OAUTH_CLIENT_ID_ANDROID }}
GOOGLE_OAUTH_CLIENT_ID_IOS: ${{ secrets.GOOGLE_OAUTH_CLIENT_ID_IOS }}
# AdMob App IDs (per-platform: Android manifest + iOS Info.plist) and per-format ad unit ids. All
# fall back to Google's public test ids when the secret is unset, so builds work without config.
ADMOB_APP_ID_ANDROID: ${{ secrets.ADMOB_APP_ID_ANDROID }}
ADMOB_APP_ID_IOS: ${{ secrets.ADMOB_APP_ID_IOS }}
ADMOB_BANNER_UNIT_ID_ANDROID: ${{ secrets.ADMOB_BANNER_UNIT_ID_ANDROID }}
ADMOB_BANNER_UNIT_ID_IOS: ${{ secrets.ADMOB_BANNER_UNIT_ID_IOS }}
ADMOB_REWARDED_UNIT_ID_ANDROID: ${{ secrets.ADMOB_REWARDED_UNIT_ID_ANDROID }}
ADMOB_REWARDED_UNIT_ID_IOS: ${{ secrets.ADMOB_REWARDED_UNIT_ID_IOS }}
ADMOB_INTERSTITIAL_UNIT_ID_ANDROID: ${{ secrets.ADMOB_INTERSTITIAL_UNIT_ID_ANDROID }}
ADMOB_INTERSTITIAL_UNIT_ID_IOS: ${{ secrets.ADMOB_INTERSTITIAL_UNIT_ID_IOS }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_KEY_CONTENT: ${{ secrets.APP_STORE_CONNECT_KEY_CONTENT }}
Expand Down
4 changes: 2 additions & 2 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ android {
// Must match OAUTH_REDIRECT_SCHEME so the manifest redirect intent-filter resolves.
manifestPlaceholders["oauthRedirectScheme"] = "com.oztechan.adtrack"

// AdMob App ID injected into the manifest meta-data; test App ID by default (see Key).
manifestPlaceholders["admobAppId"] = secret(Key.ADMOB_APP_ID)
// AdMob App ID injected into the manifest meta-data; Android test App ID by default (see Key).
manifestPlaceholders["admobAppId"] = secret(Key.ADMOB_APP_ID_ANDROID)
}

signingConfigs {
Expand Down
7 changes: 4 additions & 3 deletions buildSrc/src/main/kotlin/config/key/Key.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ enum class Key(
ANDROID_KEY_ALIAS,
ANDROID_KEY_PASSWORD,

// AdMob App ID for the Android manifest. Defaults to Google's public sample App ID so debug
// builds work without secrets; the real one comes from secret.properties / env.
ADMOB_APP_ID("ca-app-pub-3940256099942544~3347511713")
// AdMob App ID for the Android manifest (per-platform: the iOS app has its own App ID). Defaults
// to Google's public Android test App ID so debug builds work without secrets; the real one comes
// from secret.properties / env.
ADMOB_APP_ID_ANDROID("ca-app-pub-3940256099942544~3347511713")
}
4 changes: 3 additions & 1 deletion common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ val secretProps = Properties().apply {
if (file.exists()) file.inputStream().use { load(it) }
}

// A blank source (e.g. an unset GitHub secret expands to an empty env var) falls back to [default].
fun secret(key: String, default: String): String =
secretProps.getProperty(key) ?: project.findProperty(key)?.toString() ?: System.getenv(key) ?: default
(secretProps.getProperty(key) ?: project.findProperty(key)?.toString() ?: System.getenv(key))
?.ifBlank { null } ?: default

// Native OAuth clients are per-platform (separate Google Cloud client ids for Android & iOS).
val oauthClientIdAndroid = secret(
Expand Down
4 changes: 4 additions & 0 deletions iosApp/Configuration/Config.xcconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
TEAM_ID=
BUNDLE_ID=com.oztechan.adtrack
APP_NAME=AdTrack
// AdMob App ID injected into Info.plist as $(ADMOB_APP_ID). Google's public iOS test App ID by
// default; the real iOS App ID is passed as a build setting at release time from the
// ADMOB_APP_ID_IOS secret (see fastlane build_project xcargs).
ADMOB_APP_ID=ca-app-pub-3940256099942544~1458002511
6 changes: 5 additions & 1 deletion iosApp/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,16 @@ platform :ios do
update_project_provisioning(
profile: ENV["sigh_#{identifier}_#{match_type}_profile-path"]
)
# Override the AdMob App ID (Info.plist reads $(ADMOB_APP_ID)) with the real iOS one when
# provided; otherwise Config.xcconfig's test default is used. (The App ID is per-platform.)
admob_app_id = ENV["ADMOB_APP_ID_IOS"].to_s
admob_xcarg = admob_app_id.empty? ? "" : " ADMOB_APP_ID=#{admob_app_id}"
gym(
project: "iosApp.xcodeproj",
scheme: "iosApp",
configuration: options[:configuration],
output_name: "AdTrack",
xcargs: "-allowProvisioningUpdates CODE_SIGN_STYLE=Manual",
xcargs: "-allowProvisioningUpdates CODE_SIGN_STYLE=Manual#{admob_xcarg}",
codesigning_identity: "Apple Distribution: Mustafa Ozhan (Q5WB95G58X)",
export_method: method,
export_options: {
Expand Down
5 changes: 3 additions & 2 deletions iosApp/iosApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
<string>6.0</string>
<key>CFBundleName</key>
<string>AdTrack</string>
<!-- AdMob App ID. Google's public test App ID by default; replace with the real one for release. -->
<!-- AdMob App ID, injected from Config.xcconfig (ADMOB_APP_ID). Google's public test App ID by
default; the real one is passed as a build setting at release time. -->
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-3940256099942544~1458002511</string>
<string>$(ADMOB_APP_ID)</string>
<!-- Shown in the App Tracking Transparency prompt; required before requesting tracking authorization. -->
<key>NSUserTrackingUsageDescription</key>
<string>Allow tracking to see ads more relevant to you. You can still use AdTrack fully either way.</string>
Expand Down