feat(android): 增加独立Android原生离线工程与GitHub Actions自动化构建
- 原生工程物理隔离:新建 android/ 独立工程,零侵入 Web 端现有源码 - 自动化资产同步:通过 android/copy-web-assets.sh 在构建时复制 Web 静态资产 - 原生体验调优:沉浸式状态栏适配、明文HTTP与DOM存储支持、返回键防误退 - 高清图标生成:基于 icon-512.png 自动生成全套 mipmap 分辨率桌面图标 - 云端CI构建:添加 .github/workflows/build-apk.yml 支持一键/Tag打包输出 APK
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'top.ouaone.workhours'
|
||||
compileSdk 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId "top.ouaone.workhours"
|
||||
minSdk 23
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0.0"
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
def keyFilePath = System.getenv("SIGNING_KEY_FILE")
|
||||
if (keyFilePath && file(keyFilePath).exists()) {
|
||||
storeFile file(keyFilePath)
|
||||
storePassword System.getenv("KEY_STORE_PASSWORD") ?: "workhours123"
|
||||
keyAlias System.getenv("ALIAS") ?: "workhours"
|
||||
keyPassword System.getenv("KEY_PASSWORD") ?: "workhours123"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
def keyFilePath = System.getenv("SIGNING_KEY_FILE")
|
||||
if (keyFilePath && file(keyFilePath).exists()) {
|
||||
signingConfig signingConfigs.release
|
||||
} else {
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'androidx.activity:activity:1.8.2'
|
||||
}
|
||||
Reference in New Issue
Block a user