Add proxy speed measurement, connection logs and standalone Android packaging

This commit is contained in:
shen
2026-10-13 23:08:57 -07:00
parent f94dab0555
commit 72566b9a8a
22 changed files with 551 additions and 91 deletions
+25 -2
View File
@@ -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" } }
@@ -6,20 +6,20 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<application
android:allowBackup="false"
android:label="MeshPort"
android:label="${meshportAppLabel}"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<!-- Override ZXing's sensorLandscape default and respect user rotation. -->
<activity android:name="com.journeyapps.barcodescanner.CaptureActivity"
android:screenOrientation="fullUser"
tools:replace="android:screenOrientation" />
<service android:name=".MeshVpnService" android:exported="false"
<service android:name="com.example.meshport_lab.MeshVpnService" android:exported="false"
android:permission="android.permission.BIND_VPN_SERVICE" android:foregroundServiceType="specialUse">
<intent-filter><action android:name="android.net.VpnService" /></intent-filter>
<property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE" android:value="User initiated mesh networking VPN" />
</service>
<activity
android:name=".MainActivity"
android:name="com.example.meshport_lab.MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""