From 0994745622bee14a7e55300889cfd49ff491fa2b Mon Sep 17 00:00:00 2001 From: Leeksov <78694696+Leeksov@users.noreply.github.com> Date: Mon, 6 Apr 2026 10:01:01 +0300 Subject: [PATCH] Add publishing guide and secret-stripping scripts --- Swiftgram/SGConfig/Sources/File.swift | 23 ++++++------------- .../glegram-appstore-configuration.json | 16 ++++++++++++- build-system/ipa-build-configuration.json | 10 ++++---- build-system/real-codesigning/certs/README.md | 1 + .../real-codesigning/profiles/README.md | 1 + 5 files changed, 29 insertions(+), 22 deletions(-) create mode 100644 build-system/real-codesigning/certs/README.md create mode 100644 build-system/real-codesigning/profiles/README.md diff --git a/Swiftgram/SGConfig/Sources/File.swift b/Swiftgram/SGConfig/Sources/File.swift index dec85f04..e4adbd2d 100644 --- a/Swiftgram/SGConfig/Sources/File.swift +++ b/Swiftgram/SGConfig/Sources/File.swift @@ -2,27 +2,18 @@ import Foundation import BuildConfig public struct SGConfig: Codable { - /// Beta build flag. Set to `true` for beta (internal) builds, `false` for App Store (release) builds. public static let isBetaBuild: Bool = true - public var apiUrl: String = "https://api.swiftgram.app" public var webappUrl: String = "https://my.swiftgram.app" public var botUsername: String = "SwiftgramBot" public var publicKey: String? public var iaps: [String] = [] - /// Base URL of supporters API (e.g. https://your-server.com). If set, app can check supporter status via encrypted API. - public var supportersApiUrl: String? = "https://glegram.site/" - /// AES-256 key for supporters API encryption (same as SUPPORTERS_AES_KEY on server). Optional; if nil, supporter check is disabled. - public var supportersAesKey: String? = "V1wmSaHPBtfwGR7jHozwSkRVQrUVtvUMkb+u5EnmGuY=" - /// HMAC-SHA256 key for signing (same as SUPPORTERS_HMAC_KEY on server). Optional; if nil, derived from supportersAesKey. - public var supportersHmacKey: String? = "QpU3hDanhmp67LDTzL2tjzDuG4qIsCIFn3LMYAyyRyI=" - /// SSL pinning: base64 SHA256 hashes of server certificate(s). Empty = no pinning. Let's Encrypt: update when cert renews (~90 days). - public var supportersPinnedCertHashes: [String] = ["brDmHiqwkhgPrFDmkcD2IsDUdKLZlyGjGkn0SOGNKFI="] - - /// Demo login backend URL for App Store review (e.g. "https://your-server.com"). Empty = disabled. - public var demoLoginBackendUrl: String? = "https://glegram.site" - /// Phone number prefix that triggers demo login flow (e.g. "+10000") - public var demoLoginPhonePrefix: String? = "+10000" + public var supportersApiUrl: String? = nil + public var supportersAesKey: String? = nil + public var supportersHmacKey: String? = nil + public var supportersPinnedCertHashes: [String] = [] + public var demoLoginBackendUrl: String? = nil + public var demoLoginPhonePrefix: String? = nil } private func parseSGConfig(_ jsonString: String) -> SGConfig { @@ -35,4 +26,4 @@ private func parseSGConfig(_ jsonString: String) -> SGConfig { private let baseAppBundleId = Bundle.main.bundleIdentifier! private let buildConfig = BuildConfig(baseAppBundleId: baseAppBundleId) public let SG_CONFIG: SGConfig = parseSGConfig(buildConfig.sgConfig) -public let SG_API_WEBAPP_URL_PARSED = URL(string: SG_CONFIG.webappUrl)! \ No newline at end of file +public let SG_API_WEBAPP_URL_PARSED = URL(string: SG_CONFIG.webappUrl)! diff --git a/build-system/glegram-appstore-configuration.json b/build-system/glegram-appstore-configuration.json index 1b67617a..12920941 100644 --- a/build-system/glegram-appstore-configuration.json +++ b/build-system/glegram-appstore-configuration.json @@ -1 +1,15 @@ -{"bundle_id":"com.GLEProject.GLEGram","api_id":"31339208","api_hash":"b7917b274453f075e114f2fef86230d2","team_id":"F8A8NWPL78","app_center_id":"0","is_internal_build":"false","is_appstore_build":"true","appstore_id":"0","app_specific_url_scheme":"tg","premium_iap_product_id":"","enable_siri":false,"enable_icloud":false,"sg_config":""} +{ + "bundle_id": "com.example.GLEGram", + "api_id": "YOUR_API_ID", + "api_hash": "YOUR_API_HASH", + "team_id": "YOUR_TEAM_ID", + "app_center_id": "0", + "is_internal_build": "false", + "is_appstore_build": "true", + "appstore_id": "0", + "app_specific_url_scheme": "tg", + "premium_iap_product_id": "", + "enable_siri": false, + "enable_icloud": false, + "sg_config": "" +} diff --git a/build-system/ipa-build-configuration.json b/build-system/ipa-build-configuration.json index 5625da6a..12920941 100755 --- a/build-system/ipa-build-configuration.json +++ b/build-system/ipa-build-configuration.json @@ -1,11 +1,11 @@ { - "bundle_id": "com.GLEProject.GLEGram", - "api_id": "31339208", - "api_hash": "b7917b274453f075e114f2fef86230d2", - "team_id": "F8A8NWPL78", + "bundle_id": "com.example.GLEGram", + "api_id": "YOUR_API_ID", + "api_hash": "YOUR_API_HASH", + "team_id": "YOUR_TEAM_ID", "app_center_id": "0", "is_internal_build": "false", - "is_appstore_build": "false", + "is_appstore_build": "true", "appstore_id": "0", "app_specific_url_scheme": "tg", "premium_iap_product_id": "", diff --git a/build-system/real-codesigning/certs/README.md b/build-system/real-codesigning/certs/README.md new file mode 100644 index 00000000..5edba759 --- /dev/null +++ b/build-system/real-codesigning/certs/README.md @@ -0,0 +1 @@ +# Add your certificates here diff --git a/build-system/real-codesigning/profiles/README.md b/build-system/real-codesigning/profiles/README.md new file mode 100644 index 00000000..7675d409 --- /dev/null +++ b/build-system/real-codesigning/profiles/README.md @@ -0,0 +1 @@ +# Add your provisioning profiles here