初始化项目
@@ -5,40 +5,103 @@ plugins {
|
||||
id "dev.flutter.flutter-gradle-plugin"
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.vbvs_app"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
ndkVersion = flutter.ndkVersion
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file("local.properties")
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withReader("UTF-8") { reader ->
|
||||
localProperties.load(reader)
|
||||
}
|
||||
}
|
||||
|
||||
def keystoreProperties = new Properties()
|
||||
def keystorePropertiesFile = rootProject.file("key.properties")
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||
}
|
||||
|
||||
def versionProperties = new Properties()
|
||||
def versionPropertiesFile = rootProject.file("version.properties")
|
||||
if (versionPropertiesFile.exists()) {
|
||||
versionProperties.load(new FileInputStream(versionPropertiesFile))
|
||||
}
|
||||
|
||||
def flutterVersionCode = versionProperties.getProperty("flutter.android.versionCode")
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = "5"
|
||||
}
|
||||
|
||||
def flutterVersionName = versionProperties.getProperty("flutter.android.versionName")
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = "1.0.4"
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.taihe.vbvs_app"
|
||||
// compileSdk = flutter.compileSdkVersion
|
||||
compileSdk = localProperties.getProperty('flutter.compileSdkVersion').toInteger()
|
||||
// ndkVersion = flutter.ndkVersion
|
||||
ndkVersion = localProperties.getProperty('flutter.ndkVersion')
|
||||
|
||||
// 编译的jvm版本
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
// 指定Kotilin的jvm版本
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_1_8
|
||||
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId = "com.example.vbvs_app"
|
||||
applicationId "com.taihe.vbvs_app"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||
minSdk = flutter.minSdkVersion
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||
// minSdk = flutter.minSdkVersion
|
||||
// targetSdk = flutter.targetSdkVersion
|
||||
minSdk = localProperties.getProperty('flutter.minSdkVersion').toInteger()
|
||||
targetSdk = localProperties.getProperty('flutter.targetSdkVersion').toInteger()
|
||||
versionCode = flutterVersionCode.toInteger()
|
||||
versionName = flutterVersionName
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
keyAlias keystoreProperties['keyAlias']
|
||||
keyPassword keystoreProperties['keyPassword']
|
||||
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
||||
storePassword keystoreProperties['storePassword']
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
debuggable false
|
||||
minifyEnabled true//是否启动混淆 ture:打开 false:关闭
|
||||
shrinkResources true //删除无用资源(压缩)
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig = signingConfigs.debug
|
||||
// signingConfig = signingConfigs.debug
|
||||
signingConfig signingConfigs.release
|
||||
android.applicationVariants.all { variant ->
|
||||
variant.outputs.all {
|
||||
outputFileName = "ZHMHT_v${variant.versionName}-${releaseTime()}.apk"
|
||||
}
|
||||
}
|
||||
}
|
||||
debug {
|
||||
debuggable true
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static def releaseTime() {
|
||||
return new Date().format("yyyyMMdd", TimeZone.getTimeZone("UTC"))
|
||||
}
|
||||
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
|
||||
24
android/app/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
#Flutter Wrapper
|
||||
-ignorewarnings
|
||||
-keep class io.flutter.app.** { *; }
|
||||
-keep class io.flutter.plugin.** { *; }
|
||||
-keep class io.flutter.util.** { *; }
|
||||
-keep class io.flutter.view.** { *; }
|
||||
-keep class io.flutter.embedding.** { *; }
|
||||
-keep class io.flutter.embedding.engine.** { *; }
|
||||
-keep class io.flutter.embedding.android.** { *; }
|
||||
-keep class io.flutter.embedding.engine.plugins.** { *; }
|
||||
-keep class io.flutter.plugin.common.** { *; }
|
||||
-keep class io.flutter.plugin.platform.** { *; }
|
||||
#微信
|
||||
-keep class com.tencent.mm.opensdk.** { *; }
|
||||
-keep class com.tencent.wxop.** { *; }
|
||||
-keep class com.tencent.mm.sdk.** { *; }
|
||||
## XUpdate需要配置的内容(flutter_xupdate android app 更新)
|
||||
##gson
|
||||
#-keepattributes Signature
|
||||
#-keep class sun.misc.Unsafe { *; }
|
||||
#-keep class com.google.gson.** { *; }
|
||||
#-keep class com.google.gson.examples.android.model.** { *; }
|
||||
## xupdate
|
||||
#-keep class com.xuexiang.xupdate.entity.** { *; }
|
||||
@@ -1,28 +1,69 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
||||
|
||||
<!-- Tell Google Play Store that your app uses Bluetooth LE
|
||||
Set android:required="true" if bluetooth is necessary -->
|
||||
<uses-feature android:name="android.hardware.bluetooth_le" android:required="false" />
|
||||
|
||||
<!-- New Bluetooth permissions in Android 12
|
||||
https://developer.android.com/about/versions/12/features/bluetooth-permissions -->
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"/>
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
|
||||
|
||||
<!-- legacy for Android 11 or lower -->
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" />
|
||||
|
||||
<!-- legacy for Android 9 or lower -->
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
|
||||
<!--安装apk权限-->
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<!-- <!–写入外部存储权限–>-->
|
||||
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>-->
|
||||
<!-- <!–读取外部存储权限–>-->
|
||||
<!-- <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />-->
|
||||
<!--相机权限-->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<application
|
||||
android:label="vbvs_app"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="智慧眠花糖">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:screenOrientation="portrait"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:launchMode="singleTop"
|
||||
android:taskAffinity=""
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||
the Android process has started. This theme is visible to the user
|
||||
while the Flutter UI initializes. After that, this theme continues
|
||||
to determine the Window background behind the Flutter UI. -->
|
||||
<meta-data
|
||||
android:name="io.flutter.embedding.android.NormalTheme"
|
||||
android:resource="@style/NormalTheme"
|
||||
/>
|
||||
android:name="io.flutter.embedding.android.NormalTheme"
|
||||
android:resource="@style/NormalTheme" />
|
||||
<meta-data
|
||||
android:name="flutterEmbedding"
|
||||
android:value="2" />
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- Don't delete the meta-data below.
|
||||
@@ -38,8 +79,22 @@
|
||||
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.intent.action.PROCESS_TEXT"/>
|
||||
<data android:mimeType="text/plain"/>
|
||||
<action android:name="android.intent.action.PROCESS_TEXT" />
|
||||
<data android:mimeType="text/plain" />
|
||||
</intent>
|
||||
<intent>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="https" />
|
||||
</intent>
|
||||
<!-- If your app checks for call support -->
|
||||
<intent>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<data android:scheme="tel" />
|
||||
</intent>
|
||||
<!-- If your application checks for inAppBrowserView launch mode support -->
|
||||
<intent>
|
||||
<action android:name="android.support.customtabs.action.CustomTabsService" />
|
||||
</intent>
|
||||
</queries>
|
||||
</manifest>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.example.vbvs_app
|
||||
package com.taihe.vbvs_app
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
||||
BIN
android/app/src/main/res/drawable-hdpi/xupdate_bg_app_top.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 3.5 KiB |
BIN
android/app/src/main/res/mipmap-ldpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 442 B After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 721 B After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 11 KiB |