Browse Source

chore: update .gitignore and README for keystore security; configure release signing in build.gradle

pull/63/head
Ali Gopal Pour 4 days ago
parent
commit
c61bd5f4f9
  1. 5
      .gitignore
  2. 30
      README.md
  3. 21
      android/app/build.gradle.kts

5
.gitignore

@ -46,3 +46,8 @@ app.*.map.json
/android/app/debug /android/app/debug
/android/app/profile /android/app/profile
/android/app/release /android/app/release
# Keystore files (sensitive - keep secure)
/android/app/*.jks
/android/app/*.keystore
/android/keystore.properties

30
README.md

@ -1,3 +1,33 @@
# hadi_hoda_flutter # hadi_hoda_flutter
A new Flutter project. A new Flutter project.
## Building for Google Play Release
This project includes a keystore for signing release builds for Google Play Store.
### Security Setup
- **Keystore file**: `android/app/upload-keystore.jks` (excluded from git)
- **Properties file**: `android/keystore.properties` (excluded from git)
- **Key alias**: `upload`
### Important Security Notes
- 🔐 Keystore files and passwords are excluded from version control
- 🔐 Keep `upload-keystore.jks` and `keystore.properties` files secure
- 🔐 Backup these files in a safe location separate from your code
- 🔐 Never share passwords or keystore files with unauthorized parties
### Building Release APK
To build a release APK for Google Play:
```bash
flutter build apk --release
```
The APK will be generated in `build/app/outputs/flutter-apk/` with the name `Hadi & Hoda v{version}+{versionCode}.apk`.
### Important Security Notes
- Keep the keystore file (`upload-keystore.jks`) secure and don't commit it to version control
- Backup the keystore file in a safe location
- Never share the passwords with unauthorized parties

21
android/app/build.gradle.kts

@ -2,6 +2,8 @@ import kotlin.text.all
import kotlin.text.find import kotlin.text.find
import kotlin.text.isNotEmpty import kotlin.text.isNotEmpty
import kotlin.text.replace import kotlin.text.replace
import java.io.FileInputStream
import java.util.Properties
plugins { plugins {
id("com.android.application") id("com.android.application")
@ -10,6 +12,12 @@ plugins {
id("dev.flutter.flutter-gradle-plugin") id("dev.flutter.flutter-gradle-plugin")
} }
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('keystore.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android { android {
namespace = "com.example.hadi_hoda_flutter" namespace = "com.example.hadi_hoda_flutter"
compileSdk = 36 compileSdk = 36
@ -35,11 +43,18 @@ android {
versionName = flutter.versionName versionName = flutter.versionName
} }
signingConfigs {
create("release") {
keyAlias = keystoreProperties['keyAlias']
keyPassword = keystoreProperties['keyPassword']
storeFile = file(keystoreProperties['storeFile'])
storePassword = keystoreProperties['storePassword']
}
}
buildTypes { buildTypes {
release { release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.getByName("debug")
signingConfig = signingConfigs.getByName("release")
} }
} }

Loading…
Cancel
Save