fix: 支持明文网络请求,增强安装脚本自动卸载冲突签名,优化设置页AI配置响应

This commit is contained in:
shen
2026-09-15 21:30:56 +08:00
parent 524788291b
commit 24930ca9ec
3 changed files with 19 additions and 12 deletions
@@ -2,6 +2,7 @@
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.RECORD_AUDIO" />
<application <application
android:usesCleartextTraffic="true"
android:label="kouyu_english" android:label="kouyu_english"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"> android:icon="@mipmap/ic_launcher">
+5 -1
View File
@@ -23,9 +23,13 @@ if [ ! -f "$APK_PATH" ]; then
fi fi
echo "🚀 正在安装 APK 到手机..." echo "🚀 正在安装 APK 到手机..."
if ! adb install -r "$APK_PATH"; then
echo "⚠️ 覆盖安装失败(签名不一致或版本冲突),正在卸载旧版本并重新安装..."
adb uninstall com.shen.kouyu_english || true
adb install -r "$APK_PATH" adb install -r "$APK_PATH"
fi
echo "▶️ 正在手机上启动 口英语 App..." echo "▶️ 正在手机上启动 口英语 App..."
adb shell monkey -p com.shen.kouyu_english -c android.intent.category.LAUNCHER 1 > /dev/null 2>&1 || true adb shell monkey -p com.shen.kouyu_english -c android.intent.category.LAUNCHER 1 > /dev/null 2>&1 || true
echo "✅ 安装并启动成功!" echo "✅ 安装并启动成功!"
@@ -288,7 +288,7 @@ class _SettingsPageState extends State<SettingsPage> {
style: TextStyle(fontSize: 12, color: AppColors.muted), style: TextStyle(fontSize: 12, color: AppColors.muted),
), ),
DropdownButtonFormField<AiProviderType>( DropdownButtonFormField<AiProviderType>(
initialValue: widget.state.aiProvider, value: widget.state.aiProvider,
decoration: const InputDecoration( decoration: const InputDecoration(
labelText: '服务类型', labelText: '服务类型',
border: OutlineInputBorder(), border: OutlineInputBorder(),
@@ -313,6 +313,7 @@ class _SettingsPageState extends State<SettingsPage> {
], ],
onChanged: (value) { onChanged: (value) {
if (value == null) return; if (value == null) return;
setState(() {
widget.state.setAiProvider(value); widget.state.setAiProvider(value);
if (value == AiProviderType.gemini && if (value == AiProviderType.gemini &&
endpoint.text.trim().isEmpty) { endpoint.text.trim().isEmpty) {
@@ -322,6 +323,7 @@ class _SettingsPageState extends State<SettingsPage> {
? 'gemini-2.5-flash' ? 'gemini-2.5-flash'
: model.text; : model.text;
} }
});
}, },
), ),
TextField( TextField(