Mobile Generate new root certificate (#185)

This commit is contained in:
wanghongenpin
2024-07-23 19:57:23 +08:00
parent adcfc5eddc
commit 134d9efa89
14 changed files with 76 additions and 50 deletions

View File

@@ -20,7 +20,8 @@
国内下载地址: https://gitee.com/wanghongenpin/network-proxy-flutter/releases
AppStore下载地址 https://apps.apple.com/app/proxypin/id6450932949
AppStore下载地址 https://apps.apple.com/app/proxypin/id6450932949
iOS国内TF下载地址(有1万名额限制) https://testflight.apple.com/join/gURGH6B4
TG: https://t.me/proxypin_tg

View File

@@ -31,7 +31,8 @@ if (keystorePropertiesFile.exists()) {
android {
namespace "com.network.proxy"
compileSdk flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
// ndkVersion flutter.ndkVersion
ndkVersion "26.1.10909125"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
@@ -89,4 +90,4 @@ flutter {
dependencies {
implementation group: 'com.github.ben-manes.caffeine', name: 'guava', version: '3.1.8'
}
}

View File

@@ -5,4 +5,6 @@
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }
-keep class de.prosiebensat1digital.** { *; }
-keep class de.prosiebensat1digital.** { *; }
-dontwarn com.google.android.play.core.**

View File

@@ -3,6 +3,18 @@ allprojects {
google()
mavenCentral()
}
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace project.group
}
}
}
}
}
}
rootProject.buildDir = '../build'

View File

@@ -1,3 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx4G
android.useAndroidX=true
android.enableJetifier=true
android.enableJetifier=true
android.nonFinalResIds=false

View File

@@ -1,6 +1,6 @@
#Tue Nov 28 00:35:45 CST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@@ -19,7 +19,7 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version '7.4.2' apply false
id "com.android.application" version '8.4.1' apply false
id "org.jetbrains.kotlin.android" version "1.9.21" apply false
}

View File

@@ -1,12 +1,9 @@
import 'dart:io';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_code_editor/flutter_code_editor.dart';
import 'package:flutter_js/flutter_js.dart';
import 'package:flutter_js/javascript_runtime.dart';
import 'package:highlight/languages/javascript.dart';
import 'package:flutter_highlight/themes/monokai-sublime.dart';

View File

@@ -1,6 +1,5 @@
import 'dart:convert';
import 'dart:io';
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:network_proxy/utils/platform.dart';

View File

@@ -198,29 +198,26 @@ class _DesktopHomePagePageState extends State<DesktopHomePage> implements EventL
},
child: Text(localizations.cancel))
],
title: Text(isCN ? '更新内容V1.1.0' : "Update content V1.1.0", style: const TextStyle(fontSize: 18)),
title: Text(isCN ? '更新内容V1.1.1' : "Update content V1.1.1", style: const TextStyle(fontSize: 18)),
content: Text(
isCN
? '提示默认不会开启HTTPS抓包请安装证书后再开启HTTPS抓包。\n'
'点击HTTPS抓包(加锁图标),选择安装根证书,按照提示操作即可。\n\n'
'1. 更改应用程序图标\n'
'2. 桌面端记录调整窗口大小和位置\n'
'3. 工具箱Javascript代码运行调试\n'
'4. 支持生成python requests代码\n'
'5. 修复mac重写不能选择文件\n'
'6. 高级重放请求支持随机间隔\n'
'7. 修复配置外部代理互相转发问题;\n'
'8. 修复ssl握手包域名为空的导致请求失败问题\n'
'1. 支持自定义根证书\n'
'2. 支持重新生成根证书,以及重置默认跟证书\n'
'3. 支持导出根证书和私钥\n'
'4. 重放域名下请求\n'
'5. 修复请求重写列表换行问题\n'
'6. 脚本headers支持同名多个值情况\n'
: 'TipsBy default, HTTPS packet capture will not be enabled. Please install the certificate before enabling HTTPS packet capture。\n'
'Click HTTPS Capture packets(Lock icon)Choose to install the root certificate and follow the prompts to proceed。\n\n'
'1. Change app icon\n'
'2. Desktop record adjustment of window size and position\n'
'3. Toolbox add javascript code run\n'
'4. Support generating Python request code\n'
'5. Fix Mac rewrite unable to select files;\n'
'6. Custom repeat request support random interval\n'
'7. Fix external proxy to forward to each other issue\n'
'8. fix tls client hello data server_name is null bug',
'1. Support custom root certificates\n'
'2. Support generate new root certificates and resetting default root certificates\n'
'3. Support exporting root certificates and private keys\n'
'4. Replay domain name request\n'
'5. Fix request rewrite list word wrapping\n'
'6. Script headers support multiple values with the same name\n'
'',
style: const TextStyle(fontSize: 14)));
});
}

View File

@@ -105,7 +105,6 @@ class _SslState extends State<SslWidget> {
Widget item(String text, {VoidCallback? onPressed}) {
return MenuItemButton(
trailingIcon: const Icon(Icons.arrow_right),
onPressed: onPressed,
child: Padding(
padding: const EdgeInsets.only(left: 10, right: 5),

View File

@@ -219,25 +219,21 @@ class MobileHomeState extends State<MobileHomePage> implements EventListener, Li
String content = isCN
? '提示默认不会开启HTTPS抓包请安装证书后再开启HTTPS抓包。\n\n'
'1. 更改应用程序图标\n'
'2. 桌面端记录调整窗口大小和位置\n'
'3. 工具箱Javascript代码运行调试\n'
'4. 支持生成python requests代码\n'
'5. 修复mac重写不能选择文件\n'
'6. 高级重放请求支持随机间隔\n'
'7. 修复配置外部代理互相转发问题;\n'
'8. 修复ssl握手包域名为空的导致请求失败问题\n'
'1. 支持自定义根证书\n'
'2. 支持重新生成根证书,以及重置默认跟证书\n'
'3. 支持导出根证书和私钥\n'
'4. 重放域名下请求\n'
'5. 修复请求重写列表换行问题\n'
'6. 脚本headers支持同名多个值情况\n'
: 'TipsBy default, HTTPS packet capture will not be enabled. Please install the certificate before enabling HTTPS packet capture。\n\n'
'Click HTTPS Capture packets(Lock icon)Choose to install the root certificate and follow the prompts to proceed。\n\n'
'1. Change app icon\n'
'2. Desktop record adjustment of window size and position\n'
'3. Toolbox add javascript code run\n'
'4. Support generating Python request code\n'
'5. Fix Mac rewrite unable to select files;\n'
'6. Custom repeat request support random interval\n'
'7. Fix external proxy to forward to each other issue\n'
'8. fix tls client hello data server_name is null bug';
showAlertDialog(isCN ? '更新内容V1.1.0' : "Update content V1.1.0", content, () {
'1. Support custom root certificates\n'
'2. Support generate new root certificates and resetting default root certificates\n'
'3. Support exporting root certificates and private keys\n'
'4. Replay domain name request\n'
'5. Fix request rewrite list word wrapping\n'
'6. Script headers support multiple values with the same name\n';
showAlertDialog(isCN ? '更新内容V1.1.1' : "Update content V1.1.1", content, () {
widget.appConfiguration.upgradeNoticeV10 = false;
widget.appConfiguration.flushConfig();
});

View File

@@ -6,6 +6,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_toastr/flutter_toastr.dart';
import 'package:network_proxy/network/bin/server.dart';
import 'package:network_proxy/network/util/crts.dart';
import 'package:network_proxy/ui/component/utils.dart';
import 'package:network_proxy/utils/lang.dart';
import 'package:url_launcher/url_launcher.dart';
@@ -58,6 +59,7 @@ class _MobileSslState extends State<MobileSslWidget> {
Navigator.push(context,
MaterialPageRoute(builder: (context) => Platform.isIOS ? ios() : const AndroidCaInstall()));
}),
const Divider(indent: 0.2, height: 2),
ListTile(
title: Text(localizations.exportCA),
onTap: () async {
@@ -74,8 +76,27 @@ class _MobileSslState extends State<MobileSslWidget> {
var keyFile = await CertificateManager.privateKeyFile();
_exportFile("ProxyPinKey.pem", keyFile);
}),
// Expanded(child: Platform.isIOS ? ios() : const AndroidCaInstall()),
// const SizedBox(height: 20)
const Divider(indent: 0.2, height: 2),
ListTile(
title: Text(localizations.generateCA),
onTap: () async {
showConfirmDialog(context, title: localizations.generateCA, content: localizations.generateCADescribe,
onConfirm: () async {
await CertificateManager.generateNewRootCA();
if (context.mounted) FlutterToastr.show(localizations.success, context);
});
}),
const Divider(indent: 0.2, height: 2),
ListTile(
title: Text(localizations.resetDefaultCA),
onTap: () async {
showConfirmDialog(context,
title: localizations.resetDefaultCA,
content: localizations.resetDefaultCADescribe, onConfirm: () async {
await CertificateManager.resetDefaultRootCA();
if (context.mounted) FlutterToastr.show(localizations.success, context);
});
}),
]));
}

View File

@@ -36,7 +36,7 @@ dependencies:
file_selector: ^1.0.3
flutter_js: ^0.8.1
flutter_code_editor:
file_picker: ^8.0.0
file_picker: ^8.0.5
flutter_desktop_context_menu: ^0.2.0
win32audio: ^1.3.1
device_info_plus: ^10.1.0