refactor(android): improve android app build config

This commit is contained in:
isra el
2025-08-24 07:39:12 +03:00
parent cf80be9611
commit 3c511a0f53
13 changed files with 164 additions and 49 deletions

2
.gitignore vendored
View File

@@ -1,3 +1,5 @@
.vercel
.DS_Store
*-monitor
.cursor

9
android/.gitignore vendored
View File

@@ -13,4 +13,11 @@
.externalNativeBuild
.cxx
local.properties
/app/release/*
/app/release/*
*.apk
# Firebase configuration files
/app/src/dev/google-services.json
/app/src/prod/google-services.json
/app/google-services.json

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="11" />
<bytecodeTargetLevel target="17" />
</component>
</project>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<value>
<entry key="app">
<State>
<runningDeviceTargetSelectedWithDropDown>
<Target>
<type value="RUNNING_DEVICE_TARGET" />
<deviceKey>
<Key>
<type value="SERIAL_NUMBER" />
<value value="adb-RFCX417HC5V-ZWjtU2._adb-tls-connect._tcp." />
</Key>
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2025-08-09T15:50:54.600783Z" />
</State>
</entry>
</value>
</component>
</project>

View File

@@ -4,15 +4,15 @@
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="jbr-17" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveExternalAnnotations" value="false" />
</GradleProjectSettings>
</option>
</component>

10
android/.idea/migrations.xml generated Normal file
View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>

View File

@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DesignSurface">
<option name="filePathToZoomLevelMap">
@@ -7,7 +6,7 @@
</map>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@@ -1,6 +1,5 @@
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
}
@@ -8,7 +7,6 @@ android {
compileSdk 32
defaultConfig {
applicationId "com.vernu.sms"
minSdk 24
targetSdk 32
versionCode 15
@@ -22,13 +20,50 @@ android {
// }
// }
}
signingConfigs {
debug {
storeFile file("${System.getenv("HOME")}/.android/debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// TODO: Change to release signing config
signingConfig signingConfigs.debug
}
debug {
minifyEnabled false
debuggable true
signingConfig signingConfigs.debug
}
}
flavorDimensions "environment"
productFlavors {
dev {
dimension "environment"
applicationId "com.vernu.sms.dev"
versionNameSuffix "-dev"
buildConfigField "String", "API_BASE_URL", '"https://api.dev.textbee.dev/api/v1/"'
buildConfigField "String", "ENVIRONMENT", '"development"'
resValue "string", "app_name", "textbee.dev (Dev)"
}
prod {
dimension "environment"
applicationId "com.vernu.sms"
buildConfigField "String", "API_BASE_URL", '"https://api.textbee.dev/api/v1/"'
buildConfigField "String", "ENVIRONMENT", '"production"'
resValue "string", "app_name", "textbee.dev"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
@@ -62,3 +97,4 @@ dependencies {
// annotationProcessor "androidx.room:room-compiler:$room_version"
}
apply plugin: 'com.google.gms.google-services'

View File

@@ -1,39 +0,0 @@
{
"project_info": {
"project_number": "14326313838",
"project_id": "vernu-sms",
"storage_bucket": "vernu-sms.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:14326313838:android:4ea4380d88b057e9eb877f",
"android_client_info": {
"package_name": "com.vernu.sms"
}
},
"oauth_client": [
{
"client_id": "14326313838-0kmpefogqk8h5ntf2mth4e9cht9pbfai.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDNZP2HeVPZ6_V9oq2UTYWmJ4FfenrRBIQ"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "14326313838-0kmpefogqk8h5ntf2mth4e9cht9pbfai.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}

View File

@@ -0,0 +1,39 @@
{
"project_info": {
"project_number": "YOUR_DEV_PROJECT_NUMBER",
"project_id": "your-dev-project-id",
"storage_bucket": "your-dev-project-id.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:YOUR_DEV_PROJECT_NUMBER:android:YOUR_DEV_APP_ID",
"android_client_info": {
"package_name": "com.vernu.sms.dev"
}
},
"oauth_client": [
{
"client_id": "YOUR_DEV_CLIENT_ID",
"client_type": 3
}
],
"api_key": [
{
"current_key": "YOUR_DEV_API_KEY"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "YOUR_DEV_CLIENT_ID",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}

View File

@@ -3,7 +3,7 @@ package com.vernu.sms;
import android.Manifest;
public class AppConstants {
public static final String API_BASE_URL = "https://api.textbee.dev/api/v1/";
public static final String API_BASE_URL = BuildConfig.API_BASE_URL;
public static final String[] requiredPermissions = new String[]{
Manifest.permission.SEND_SMS,
Manifest.permission.READ_SMS,

View File

@@ -1,3 +1,2 @@
<resources>
<string name="app_name">textbee.dev</string>
</resources>

View File

@@ -0,0 +1,39 @@
{
"project_info": {
"project_number": "YOUR_DEV_PROJECT_NUMBER",
"project_id": "your-dev-project-id",
"storage_bucket": "your-dev-project-id.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:YOUR_DEV_PROJECT_NUMBER:android:YOUR_DEV_APP_ID",
"android_client_info": {
"package_name": "com.vernu.sms.dev"
}
},
"oauth_client": [
{
"client_id": "YOUR_DEV_CLIENT_ID",
"client_type": 3
}
],
"api_key": [
{
"current_key": "YOUR_DEV_API_KEY"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "YOUR_DEV_CLIENT_ID",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}