From 0a45ad03fe1ca96a712dccfb10fb698801b7a448 Mon Sep 17 00:00:00 2001
From: Jafeng <2998840497@qq.com>
Date: Thu, 27 Nov 2025 15:08:44 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=9D=E5=A7=8B=E5=8C=96=20Android?=
=?UTF-8?q?=20=E9=A1=B9=E7=9B=AE=E7=BB=93=E6=9E=84=E5=8F=8A=E9=85=8D?=
=?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitignore | 6 +-
android/app/build.gradle | 44 +++++++++++++++
android/app/proguard-rules.pro | 0
android/app/src/main/AndroidManifest.xml | 55 +++++++++++++++++++
android/app/src/main/res/values/strings.xml | 4 ++
android/app/src/main/res/values/styles.xml | 10 ++++
android/app/src/main/res/xml/file_paths.xml | 6 ++
android/build.gradle | 28 ++++++++++
android/gradle.properties | 12 ++++
.../gradle/wrapper/gradle-wrapper.properties | 5 ++
android/settings.gradle | 8 +++
android/variables.gradle | 16 ++++++
12 files changed, 193 insertions(+), 1 deletion(-)
create mode 100644 android/app/build.gradle
create mode 100644 android/app/proguard-rules.pro
create mode 100644 android/app/src/main/AndroidManifest.xml
create mode 100644 android/app/src/main/res/values/strings.xml
create mode 100644 android/app/src/main/res/values/styles.xml
create mode 100644 android/app/src/main/res/xml/file_paths.xml
create mode 100644 android/build.gradle
create mode 100644 android/gradle.properties
create mode 100644 android/gradle/wrapper/gradle-wrapper.properties
create mode 100644 android/settings.gradle
create mode 100644 android/variables.gradle
diff --git a/.gitignore b/.gitignore
index 2463ace..a94902d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,7 +19,11 @@ android/capacitor-cordova-android-plugins/**
android/app/src/main/assets/public/**
android/app/src/main/assets/capacitor.config.json
capacitor.config.json
-
+android/.gradle/
+android/build/
+android/app/build/
+android/local.properties
+.gradle/
# Editor directories and files
design/*
.vscode/*
diff --git a/android/app/build.gradle b/android/app/build.gradle
new file mode 100644
index 0000000..4cdcdb7
--- /dev/null
+++ b/android/app/build.gradle
@@ -0,0 +1,44 @@
+apply plugin: 'com.android.application'
+apply plugin: 'kotlin-android'
+
+android {
+ namespace "com.echo.app"
+ compileSdkVersion rootProject.ext.compileSdkVersion
+ defaultConfig {
+ applicationId "com.echo.app"
+ minSdkVersion rootProject.ext.minSdkVersion
+ targetSdkVersion rootProject.ext.targetSdkVersion
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ aaptOptions {
+ // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
+ // Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
+ ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
+ }
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+repositories {
+ flatDir{
+ dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
+ }
+}
+
+dependencies {
+ implementation fileTree(include: ['*.jar'], dir: 'libs')
+ implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
+ implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
+ implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
+ implementation project(':capacitor-android')
+ implementation project(':capacitor-cordova-android-plugins')
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
+}
+
+apply from: 'capacitor.build.gradle'
diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro
new file mode 100644
index 0000000..e69de29
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..16c965a
--- /dev/null
+++ b/android/app/src/main/AndroidManifest.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..88bb1e6
--- /dev/null
+++ b/android/app/src/main/res/values/strings.xml
@@ -0,0 +1,4 @@
+
+ Echo
+ Echo
+
diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..c1b0f2b
--- /dev/null
+++ b/android/app/src/main/res/values/styles.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
diff --git a/android/app/src/main/res/xml/file_paths.xml b/android/app/src/main/res/xml/file_paths.xml
new file mode 100644
index 0000000..a4d6a37
--- /dev/null
+++ b/android/app/src/main/res/xml/file_paths.xml
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/android/build.gradle b/android/build.gradle
new file mode 100644
index 0000000..78efa05
--- /dev/null
+++ b/android/build.gradle
@@ -0,0 +1,28 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+ ext.kotlin_version = '1.8.22'
+ repositories {
+ google()
+ mavenCentral()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:8.0.0'
+ classpath 'com.google.gms:google-services:4.3.15'
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+apply from: "variables.gradle"
+
+allprojects {
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/android/gradle.properties b/android/gradle.properties
new file mode 100644
index 0000000..a3ad437
--- /dev/null
+++ b/android/gradle.properties
@@ -0,0 +1,12 @@
+# Project-wide Gradle settings.
+# Generated by Codex helper.
+
+# 使用 AndroidX 支持库
+android.useAndroidX=true
+android.enableJetifier=true
+
+# Gradle JVM 内存
+org.gradle.jvmargs=-Xmx1536m
+
+# 可以按需开启并行构建
+# org.gradle.parallel=true
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..4518132
--- /dev/null
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
diff --git a/android/settings.gradle b/android/settings.gradle
new file mode 100644
index 0000000..efcd901
--- /dev/null
+++ b/android/settings.gradle
@@ -0,0 +1,8 @@
+include ':app'
+
+// Cordova / Capacitor 鎻掍欢鑱氬悎妯″潡
+include ':capacitor-cordova-android-plugins'
+project(':capacitor-cordova-android-plugins').projectDir = new File('capacitor-cordova-android-plugins')
+
+// Capacitor 鑷姩鐢熸垚鐨勬牳蹇冧笌鎻掍欢妯″潡
+apply from: "capacitor.settings.gradle"
diff --git a/android/variables.gradle b/android/variables.gradle
new file mode 100644
index 0000000..232bd9d
--- /dev/null
+++ b/android/variables.gradle
@@ -0,0 +1,16 @@
+ext {
+ minSdkVersion = 22
+ compileSdkVersion = 33
+ targetSdkVersion = 33
+ androidxActivityVersion = '1.7.0'
+ androidxAppCompatVersion = '1.6.1'
+ androidxCoordinatorLayoutVersion = '1.2.0'
+ androidxCoreVersion = '1.10.0'
+ androidxFragmentVersion = '1.5.6'
+ coreSplashScreenVersion = '1.0.0'
+ androidxWebkitVersion = '1.6.1'
+ junitVersion = '4.13.2'
+ androidxJunitVersion = '1.1.5'
+ androidxEspressoCoreVersion = '3.5.1'
+ cordovaAndroidVersion = '10.1.1'
+}