Add proxy speed measurement, connection logs and standalone Android packaging
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("kotlin-android")
|
||||
@@ -5,6 +7,16 @@ plugins {
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
val standalone = System.getenv("MESHPORT_ANDROID_STANDALONE") == "1"
|
||||
val standaloneSigning = Properties().apply {
|
||||
if (standalone) {
|
||||
val path = requireNotNull(System.getenv("MESHPORT_ANDROID_SIGNING_PROPERTIES")) {
|
||||
"Use scripts/package-lab-android.sh --standalone to prepare signing"
|
||||
}
|
||||
file(path).inputStream().use { load(it) }
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
buildFeatures { buildConfig = true }
|
||||
namespace = "com.example.meshport_lab"
|
||||
@@ -22,7 +34,8 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId = "com.example.meshport_lab"
|
||||
applicationId = if (standalone) "com.meshport.client.standalone" else "com.example.meshport_lab"
|
||||
manifestPlaceholders["meshportAppLabel"] = if (standalone) "MeshPort 独立版" else "MeshPort"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||
minSdk = 26
|
||||
@@ -36,13 +49,23 @@ android {
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
if (standalone) {
|
||||
create("standalone") {
|
||||
storeFile = file(standaloneSigning.getProperty("storeFile"))
|
||||
storePassword = standaloneSigning.getProperty("storePassword")
|
||||
keyAlias = standaloneSigning.getProperty("keyAlias")
|
||||
keyPassword = standaloneSigning.getProperty("keyPassword")
|
||||
}
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
debug { ndk { abiFilters.clear(); abiFilters += "arm64-v8a" } }
|
||||
release {
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.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.getByName("debug")
|
||||
signingConfig = signingConfigs.getByName(if (standalone) "standalone" else "debug")
|
||||
}
|
||||
}
|
||||
externalNativeBuild { cmake { path = file("src/main/cpp/CMakeLists.txt"); version = "3.22.1" } }
|
||||
|
||||
Reference in New Issue
Block a user