Feat: Client build dialog support building Android application

This commit is contained in:
yuanyuanxiang
2026-06-25 13:27:15 +02:00
parent 5296e534ed
commit d7408ad4df
12 changed files with 156 additions and 7 deletions

View File

@@ -60,6 +60,13 @@ android {
}
}
packagingOptions {
jniLibs {
// .so 文件不压缩ZIP_STORED使服务端 patch 工具可直接在 APK 中搜索 FLAG_GHOST
useLegacyPackaging false
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17

View File

@@ -8,6 +8,7 @@
<application
android:allowBackup="false"
android:extractNativeLibs="false"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:label="YAMA"

View File

@@ -183,6 +183,10 @@ static bool FetchGeoInfo(std::string& pubIp, std::string& location) {
return !pubIp.empty();
}
// 服务端通过 FLAG_GHOST"Hello, World!"定位此变量patch szServerIP/szPort 后重签 APK
// 偏移szServerIP at +32, szPort at +132见 commands.h CONNECT_ADDRESS 定义)
CONNECT_ADDRESS g_SETTINGS = { FLAG_GHOST, "91.99.165.207", "443", CLIENT_TYPE_ANDROID };
// ---- 全局状态 ----
// CPP-06: g_bExit 是全局变量,跨调用边界不会被编译器缓存进寄存器;
// IOCPClient 构造接受 const State& 持有引用,不能改为 atomic/volatile
@@ -716,8 +720,8 @@ Java_com_yama_client_YamaBridge_nativeInit(
return s;
};
g_serverIp = toStr(serverIp);
g_serverPort = (int)serverPort;
g_serverIp = g_SETTINGS.ServerIP();
g_serverPort = g_SETTINGS.ServerPort();
g_androidId = toStr(androidId);
g_deviceModel = toStr(deviceModel);
g_androidVersion = toStr(androidVersion);