diff --git a/lib/certificate_detail.dart b/lib/certificate_detail.dart index b2394c5..72f4319 100644 --- a/lib/certificate_detail.dart +++ b/lib/certificate_detail.dart @@ -68,7 +68,12 @@ class CertificateDetail extends StatelessWidget { Text(data.subject[X509Utils.DN['countryName']] ?? ''), SizedBox(height: 10), Text('Serial number:'), - Text(data.serialNumber?.toString() ?? ''), + Text(StringUtils.addCharAtPosition( + data.serialNumber?.toRadixString(16)?.toUpperCase() ?? + '', + ' ', + 2, + repeat: true)), SizedBox(height: 20), Text('Issued by:', style: TextStyle(fontWeight: FontWeight.bold)), @@ -145,7 +150,7 @@ class CertificateDetail extends StatelessWidget { _launchAndroidIntent(); } else { var result = distruster.distrust(cert); - if (result.stderr.isEmpty) { + if (result.stderr.isEmpty && result.exitCode > 0) { Navigator.pop(ctx); } else { showDialog( @@ -153,8 +158,10 @@ class CertificateDetail extends StatelessWidget { builder: (_) => AlertDialog( title: Text('Failed to distrust ' + getTitle(cert.data) + '!'), - content: Text('Error: ' + + content: SelectableText('Error: ' + result.stderr + + ' ' + + result.stdout + '\n\n' + distruster.getManualInstruction(cert)), actions: [ diff --git a/lib/main.dart b/lib/main.dart index 52a2d1d..916c845 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -101,7 +101,7 @@ class _MyAppState extends State { void _showAboutDialog(BuildContext ctx) { showAboutDialog( context: ctx, - applicationVersion: '1.2.0+3', + applicationVersion: '1.3.0+4', applicationIcon: Image.asset('images/logo.png'), children: [ Text( diff --git a/lib/windows_certificate_manager.dart b/lib/windows_certificate_manager.dart index 05eda4d..83ba97c 100644 --- a/lib/windows_certificate_manager.dart +++ b/lib/windows_certificate_manager.dart @@ -168,7 +168,7 @@ class WindowsCertificateManager ProcessResult distrust(X509Certificate cert) { // Command doc: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/certutil#-revoke return Process.runSync( - 'CertUtil', ['-revoke', cert.data.serialNumber.toString()]); + 'CertUtil', ['-revoke', cert.data.serialNumber.toRadixString(16)]); } @override @@ -177,7 +177,7 @@ class WindowsCertificateManager '1. Close CertainTLS and re-run it as root or \n' '2. Execute the below command manually:\n\n' 'CertUtil -revoke ' + - cert.data.serialNumber.toString(); + cert.data.serialNumber.toRadixString(16); } } diff --git a/pubspec.yaml b/pubspec.yaml index 979fc24..e8990ec 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: A new Flutter project. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.2.0+3 +version: 1.3.0+4 environment: sdk: ">=2.2.0 <3.0.0"