mirror of
https://github.com/wanghongenpin/proxypin.git
synced 2026-03-16 04:33:19 +08:00
mobile check app version update
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 54;
|
||||
objectVersion = 55;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
@@ -484,10 +484,14 @@
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
|
||||
@@ -539,10 +543,14 @@
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||
@@ -743,6 +751,7 @@
|
||||
DEVELOPMENT_TEAM = DM3F8VR243;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
@@ -926,6 +935,7 @@
|
||||
DEVELOPMENT_TEAM = DM3F8VR243;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
@@ -951,6 +961,7 @@
|
||||
DEVELOPMENT_TEAM = DM3F8VR243;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
|
||||
@@ -56,7 +56,7 @@ class AppUpdateRepository {
|
||||
} catch (e) {
|
||||
logger.e("Error checking for updates: $e");
|
||||
if (showToast) {
|
||||
AppAlertDialog(message: e.toString()).show(context);
|
||||
CustomToast.error(e.toString()).show(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,12 +113,12 @@ class CustomToast extends StatelessWidget {
|
||||
type: type._toastificationType,
|
||||
alignment: Alignment.bottomLeft,
|
||||
autoCloseDuration: duration,
|
||||
style: ToastificationStyle.fillColored,
|
||||
style: ToastificationStyle.flat,
|
||||
pauseOnHover: true,
|
||||
showProgressBar: false,
|
||||
dragToClose: true,
|
||||
closeOnClick: true,
|
||||
closeButtonShowType: CloseButtonShowType.onHover,
|
||||
closeButton: ToastCloseButton(showType: CloseButtonShowType.onHover),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ class ColorMapping {
|
||||
class ThemeModel {
|
||||
ThemeMode mode;
|
||||
bool useMaterial3;
|
||||
String color = "Blue";
|
||||
String color = "Pink";
|
||||
|
||||
ThemeModel({this.mode = ThemeMode.system, this.useMaterial3 = true});
|
||||
|
||||
|
||||
@@ -49,6 +49,8 @@ import 'package:proxypin/utils/lang.dart';
|
||||
import 'package:proxypin/utils/listenable_list.dart';
|
||||
import 'package:proxypin/utils/navigator.dart';
|
||||
|
||||
import '../app_update/app_update_repository.dart';
|
||||
|
||||
///移动端首页
|
||||
///@author wanghongen
|
||||
class MobileHomePage extends StatefulWidget {
|
||||
@@ -119,6 +121,8 @@ class MobileHomeState extends State<MobileHomePage> implements EventListener, Li
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
showUpgradeNotice();
|
||||
});
|
||||
} else if (Platform.isAndroid) {
|
||||
AppUpdateRepository.checkUpdate(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,13 +15,25 @@
|
||||
*/
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:proxypin/ui/configuration.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import '../../app_update/app_update_repository.dart';
|
||||
|
||||
/// 关于
|
||||
class About extends StatelessWidget {
|
||||
class About extends StatefulWidget {
|
||||
const About({super.key});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
return _AboutState();
|
||||
}
|
||||
}
|
||||
|
||||
class _AboutState extends State<About> {
|
||||
bool checkUpdating = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
AppLocalizations localizations = AppLocalizations.of(context)!;
|
||||
@@ -39,26 +51,41 @@ class About extends StatelessWidget {
|
||||
padding: const EdgeInsets.only(left: 10, right: 10),
|
||||
child: Text(isCN ? "全平台开源免费抓包软件" : "Full platform open source free capture HTTP(S) traffic software")),
|
||||
const SizedBox(height: 10),
|
||||
const Text("V1.1.7"),
|
||||
Text("v${AppConfiguration.version}"),
|
||||
ListTile(
|
||||
title: const Text("GitHub"),
|
||||
trailing: const Icon(Icons.arrow_right),
|
||||
trailing: const Icon(Icons.open_in_new, size: 22),
|
||||
onTap: () {
|
||||
launchUrl(Uri.parse(gitHub), mode: LaunchMode.externalApplication);
|
||||
}),
|
||||
ListTile(
|
||||
title: Text(localizations.feedback),
|
||||
trailing: const Icon(Icons.arrow_right),
|
||||
trailing: const Icon(Icons.open_in_new, size: 22),
|
||||
onTap: () {
|
||||
launchUrl(Uri.parse("$gitHub/issues"), mode: LaunchMode.externalApplication);
|
||||
}),
|
||||
ListTile(
|
||||
title: Text(localizations.appUpdateCheckVersion),
|
||||
trailing: checkUpdating
|
||||
? const SizedBox(width: 22, height: 22, child: CircularProgressIndicator())
|
||||
: const Icon(Icons.sync, size: 22),
|
||||
onTap: () async {
|
||||
if (checkUpdating) {
|
||||
return;
|
||||
}
|
||||
setState(() {
|
||||
checkUpdating = true;
|
||||
});
|
||||
await AppUpdateRepository.checkUpdate(context, canIgnore: false, showToast: true);
|
||||
setState(() {
|
||||
checkUpdating = false;
|
||||
});
|
||||
}),
|
||||
ListTile(
|
||||
title: Text(isCN ? "下载地址" : "Download"),
|
||||
trailing: const Icon(Icons.arrow_right),
|
||||
trailing: const Icon(Icons.open_in_new, size: 22),
|
||||
onTap: () {
|
||||
launchUrl(
|
||||
Uri.parse(
|
||||
isCN ? "https://gitee.com/wanghongenpin/proxypin/releases" : "$gitHub/releases"),
|
||||
launchUrl(Uri.parse(isCN ? "https://gitee.com/wanghongenpin/proxypin/releases" : "$gitHub/releases"),
|
||||
mode: LaunchMode.externalApplication);
|
||||
})
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user