Skip to content

Commit

Permalink
prepare 2.0.1 release
Browse files Browse the repository at this point in the history
Signed-off-by: Keshav Priyadarshi <[email protected]>
  • Loading branch information
keshav-space committed Nov 2, 2022
1 parent 1fb70de commit 6dd8f5a
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 30 deletions.
4 changes: 2 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.trisven.safenotes"
android:versionCode="5"
android:versionName="2.0.0" >
android:versionCode="6"
android:versionName="2.0.1" >
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/6.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Bugfix for automated backup
22 changes: 14 additions & 8 deletions fastlane/metadata/android/en-US/full_description.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
★ Safe Notes is an open-source project that aims to provide an encrypted, private, anonymous experience for local note storage.
★ Write colorful notes and they will be automatically encrypted.
★ It employs rigorously tested AES-256 encryption standards to encrypt your notes.
★ Comes with both Dark and Light themes.
★ Seamless migration to new device. Use the encrypted export option to move your data from one device to another device.
★ Safe Notes is an open-source project that aims to provide an encrypted, private note manager.
★ Employs rigorously tested AES-256 encryption standards to encrypt your notes.
★ Incognito Keyboard
★ Brute-force protection
★ Protection against data snooping via adb
★ Android background snapshot protection
★ Inactivity guard
★ Automated encrypted backup
★ Arctic Nord style dark and light theme
★ Customization for colorful notes
★ Seamless migration to new device. Use the backup to move your data from one device to another device.
★ Safe Notes provides ultimate security - you don't have to trust us, or any other third party because everything is done locally on your phone.
★ Contrary to the ongoing frenzy of "move everything to cloud" we believe in "localization of user data" giving you the control of your data and not some third-party cloud service provider.
★ Completely anonymous no inbound and outbound requests.
★ Completely anonymous, no inbound and outbound requests.


--- How it works ---

★ Safe Notes encrypt each note with a unique AES-256 symmetric key derived from your passphrase and randomly generated salt.
★ If an attacker tries to brute-force your encrypted notes it will take "Trillions Upon Trillions years" in contrast, the universe has only existed for 15 billion years. (You must use strong and long passphrase).
★ AES-256 is symmetric key encryption that is quantum-resistant, i.e it isn't vulnerable to quantum computers.
★ AES-256 is symmetric key encryption that is quantum-resistant, i.e. it isn't vulnerable to quantum computers.
★ Everything is stored locally on the user's device.
★ Your passphrase is never stored on the device it gets purged as soon as you exit the app.
★ Your passphrase is never stored on the device, it gets purged as soon as you exit the app.
★ We can't decrypt your notes even if we wanted to. That gives you the ultimate security, but it also means that a lost passphrase can never be recovered.
★ Safe Notes is an open-source, not-for-profit project.
10 changes: 10 additions & 0 deletions lib/data/preference_and_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class PreferencesStorage {
static const _keyIsFlagSecure = 'isFlagSecure';
static const _keyBackupRedundancyCounter = 'backupRedundancyCounter';
static const _keyMaxBackupRetryAttempts = 'maxBackupRetryAttempts';
static const _keyAppVersionCode = 'appVersionCode';

static Future init() async =>
_preferences = await SharedPreferences.getInstance();
Expand All @@ -38,6 +39,13 @@ class PreferencesStorage {
static String getPassPhraseHash() =>
_preferences?.getString(_keyPassPhraseHash) ?? '';

// appVersionCode controls the one time code excution on version change
static int getAppVersionCode() =>
_preferences?.getInt(_keyAppVersionCode) ?? 1;

static Future<void> setAppVersionCodeToCurrent() async => await _preferences
?.setInt(_keyAppVersionCode, SafeNotesConfig.appVersionCode);

static int getColorfulNotesColorIndex() =>
_preferences?.getInt(_keyColorfulNotesColorIndex) ?? 0;

Expand Down Expand Up @@ -190,6 +198,8 @@ class ImportPassPhraseHandler {
}

class SafeNotesConfig {
static String appVersion = '2.0.1';
static int appVersionCode = 6;
static String appName = 'Safe Notes';
static String appSlogan = 'Encrypted note manager!';
static String firstLoginPageName = 'Set Passphrase';
Expand Down
18 changes: 18 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:flutter/services.dart';
// Package imports:
import 'package:flutter_windowmanager/flutter_windowmanager.dart';
import 'package:local_session_timeout/local_session_timeout.dart';
import 'package:safenotes/views/settings/backup_setting.dart';
import 'package:workmanager/workmanager.dart';

// Project imports:
Expand All @@ -35,6 +36,9 @@ Future main() async {
await PreferencesStorage.init();
if (Platform.isAndroid && PreferencesStorage.getIsFlagSecure())
await FlutterWindowManager.addFlags(FlutterWindowManager.FLAG_SECURE);

onAppUpdate();

runApp(SafeNotesApp());
}

Expand Down Expand Up @@ -147,3 +151,17 @@ void callbackDispatcher() {
return Future.value(true);
});
}

// run once every update
void onAppUpdate() async {
if (PreferencesStorage.getAppVersionCode() !=
SafeNotesConfig.appVersionCode) {
// Re-register the background update
var backupDestination = await PreferencesStorage.getBackupDestination();
if (PreferencesStorage.getIsBackupOn() && backupDestination.isNotEmpty)
backupRegister();

// insure onAppUpdate is run once each update
PreferencesStorage.setAppVersionCodeToCurrent();
}
}
39 changes: 20 additions & 19 deletions lib/views/settings/backup_setting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -269,25 +269,6 @@ class _BackupSettingState extends State<BackupSetting> {
}
}

void backupRegister() {
Workmanager().cancelByTag('com.trisven.safenotes.dailybackup');

Workmanager().registerPeriodicTask(
"safenotes-task",
"dailyBackup",
tag: 'com.trisven.safenotes.dailybackup',
frequency: Duration(hours: 15),
initialDelay: Duration(seconds: 1),
constraints: Constraints(
networkType: NetworkType.not_required,
requiresCharging: false,
requiresBatteryNotLow: false,
//requiresDeviceIdle: false,
requiresStorageNotLow: false,
),
);
}

Widget _buttonText(String text, double fontSize) {
return Text(
text,
Expand All @@ -299,3 +280,23 @@ class _BackupSettingState extends State<BackupSetting> {
);
}
}

void backupRegister() {
Workmanager().cancelByTag('com.trisven.safenotes.dailybackup');

Workmanager().registerPeriodicTask(
"safenotes-task",
"dailyBackup",
existingWorkPolicy: ExistingWorkPolicy.replace,
tag: 'com.trisven.safenotes.dailybackup',
frequency: Duration(hours: 15),
initialDelay: Duration(seconds: 1),
constraints: Constraints(
networkType: NetworkType.not_required,
requiresCharging: false,
requiresBatteryNotLow: false,
//requiresDeviceIdle: false,
requiresStorageNotLow: false,
),
);
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# 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: 2.0.0+5
version: 2.0.1+6

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down

0 comments on commit 6dd8f5a

Please sign in to comment.