From 99f2a2e6943d60ad70cfd1d8f0fab9ae368ab97e Mon Sep 17 00:00:00 2001 From: CertainTLS Date: Tue, 25 Aug 2020 13:16:23 +0800 Subject: [PATCH] Make 1.4.1 release to disable data collection by default. --- lib/certs_model.dart | 4 ++-- lib/main.dart | 24 ++++++++++++------------ pubspec.yaml | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/certs_model.dart b/lib/certs_model.dart index ed010c2..6ec8c89 100644 --- a/lib/certs_model.dart +++ b/lib/certs_model.dart @@ -84,8 +84,8 @@ class CertsModel extends ChangeNotifier { SharedPreferences prefs = await SharedPreferences.getInstance(); String userUuid = prefs.getString('user_id'); String userName = prefs.getString('user_name'); - bool disableReporting = prefs.getBool('disable_reporting') ?? false; - if (!disableReporting) { + bool allowReporting = prefs.getBool('allow_reporting') ?? false; + if (allowReporting) { // 1. Check existing user with UUID from sharedpreference if (userUuid == null || userUuid.isEmpty) { // 2. Create a new user if UUID empty, and store in sharedpreference diff --git a/lib/main.dart b/lib/main.dart index 24d57c6..bde0a50 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -19,7 +19,7 @@ class MyApp extends StatefulWidget { class _MyAppState extends State { int _selectedIndex = 0; - bool _disableReporting = false; + bool _allowReporting = false; @override void initState() { @@ -101,33 +101,33 @@ class _MyAppState extends State { void _showAboutDialog(BuildContext ctx) async { SharedPreferences prefs = await SharedPreferences.getInstance(); - String userName = prefs.getString('user_name'); showDialog( context: ctx, builder: (BuildContext context) { - bool disableReporting = - prefs.getBool('disable_reporting') ?? _disableReporting; + bool allowReporting = + prefs.getBool('allow_reporting') ?? _allowReporting; return StatefulBuilder(builder: (context, setState) { + String userName = prefs.getString('user_name'); return AboutDialog( - applicationVersion: '1.4.0', + applicationVersion: '1.4.1', applicationIcon: Image.asset('images/logo.png'), children: [ Text( - 'By default, CertainTLS will collect device OS meta data and certificates fingerprints for analysis. You can optionally provide your name below:'), + "Please help make CertainTLS better by allowing us to collect device operating system metadata and certificates' fingerprints for analysis. None of the above is personally identifying information. You can optionally provide your name below:"), TextField( decoration: InputDecoration(hintText: 'Your name'), controller: TextEditingController()..text = userName, onChanged: _onNameUpdate), SizedBox(height: 20), Row(children: [ - Text('Or disable data collection:'), + Text('Allow data collection?'), Switch( - value: disableReporting, + value: allowReporting, onChanged: (changed) { setState(() { - disableReporting = changed; - _saveDisableReportingPreference(changed); + allowReporting = changed; + _saveAllowReportingPreference(changed); }); }) ]), @@ -143,9 +143,9 @@ class _MyAppState extends State { prefs.setString('user_name', name); } - void _saveDisableReportingPreference(bool isDisabled) async { + void _saveAllowReportingPreference(bool isAllowed) async { SharedPreferences prefs = await SharedPreferences.getInstance(); - prefs.setBool('disable_reporting', isDisabled); + prefs.setBool('allow_reporting', isAllowed); } } diff --git a/pubspec.yaml b/pubspec.yaml index c962439..0047ea5 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.4.0+6 +version: 1.4.1+7 environment: sdk: ">=2.2.0 <3.0.0"