https://github.com/shadow60539/encrypto_app
Want to securely encrypt your private and confidential files?
https://github.com/shadow60539/encrypto_app
aes-encryption dart flutter googlemobileads inapppurchase inappupdate pkcs7-padding playstore
Last synced: 2 months ago
JSON representation
Want to securely encrypt your private and confidential files?
- Host: GitHub
- URL: https://github.com/shadow60539/encrypto_app
- Owner: Shadow60539
- License: mit
- Created: 2022-06-20T06:51:20.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-06-21T11:43:46.000Z (over 3 years ago)
- Last Synced: 2025-05-18T16:54:20.723Z (8 months ago)
- Topics: aes-encryption, dart, flutter, googlemobileads, inapppurchase, inappupdate, pkcs7-padding, playstore
- Language: Dart
- Homepage: https://play.google.com/store/apps/details?id=com.sanjeev.flutter_encrypto
- Size: 578 KB
- Stars: 8
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pub.dev/packages/fancy_text_reveal)

[](https://github.com/Shadow60539/encrypto_app/actions/workflows/test.yml)


[](https://play.google.com/store/apps/details?id=com.sanjeev.flutter_encrypto)
# πEncrypto: Easy File Encryption
### Introduction π
> Want to securely encrypt your private and confidential files?
> With Encrypto you easily and securely protect all your important files, in an interface that is fun and simple to use.
### Demo π
https://user-images.githubusercontent.com/59445273/174485877-42a3a771-2940-486d-aebf-4164f500f0d0.mp4
### Key Features π
β Supports all file types (PDF, MP3, MP4, PNG, DOCX,...)
β Add files from outside the app
β Share the converted file from the app
### Algorithm π
Everything is encrypted using the strong encryption algorithm: AES with PKCS7 padding
### Usage π
To clone and run this application, you'll need [git](https://git-scm.com) and [flutter](https://flutter.dev/docs/get-started/install) installed on your computer. From your command line:
```bash
# Clone this repository
$ git clone https://github.com/Shadow60539/encrypto_app.git
# Go into the repository
$ cd encrypto_app
# Install dependencies
$ flutter packages get
# Run the app
$ flutter run
```
### Packages π¦
Package | Description
---|---
[file_cryptor](https://pub.dev/packages/file_cryptor) | FileCryptor is for encryption and decryption files.
[file_picker](https://pub.dev/packages/file_picker) | A package that allows you to use the native file explorer to pick single or multiple files, with extensions filtering support.
[mockito](https://pub.dev/packages/mockito) | A mock framework inspired by Mockito with APIs for Fakes, Mocks, behavior verification, and stubbing.
[open_file](https://pub.dev/packages/open_file) | A plug-in that can call native APP to open files with string result in flutter.
[path_provider](https://pub.dev/packages/path_provider) | A Flutter plugin for finding commonly used locations on the filesystem
[permission_handler](https://pub.dev/packages/permission_handler) | This plugin provides a cross-platform (iOS, Android) API to request permissions and check their status.
[lottie](https://pub.dev/packages/lottie) | Lottie is a mobile library for Android and iOS that parses Adobe After Effects animations exported as json with Bodymovin and renders them natively on mobile.
[share_plus](https://pub.dev/packages/share_plus) | A Flutter plugin to share content from your Flutter app via the platform's share dialog.
[flutter_archive](https://pub.dev/packages/flutter_archive) | Create and extract ZIP archive files.
[flutter_bloc](https://pub.dev/packages/flutter_bloc) | State management.
[freezed](https://pub.dev/packages/freezed) | Code generation for immutable classes that has a simple syntax/API without compromising on the features.
[dartz](https://pub.dev/packages/dartz) | Functional Programming in Dart.
[injectable](https://pub.dev/packages/injectable) | Injectable is a convenient code generator for get_it.
[fancy_text_reveal](https://pub.dev/packages/fancy_text_reveal) | πββοΈ My package. Fancy way to reveal widgets.
[animated_text_kit](https://pub.dev/packages/animated_text_kit) | A flutter package project which contains a collection of cool and beautiful text animations.
[flutter_svg](https://pub.dev/packages/flutter_svg) | An SVG rendering and widget library for Flutter.
[package_info_plus](https://pub.dev/packages/package_info_plus) | Flutter plugin for querying information about the application package, such as CFBundleVersion on iOS or versionCode on Android.
[flutter_isolate](https://pub.dev/packages/flutter_isolate) | FlutterIsolate provides a way to launch dart isolate in flutter that work with flutter plugins.
[change_app_package_name](https://pub.dev/packages/change_app_package_name) | Change App Package Name with single command.
[firebase_core](https://pub.dev/packages/firebase_core) | Flutter plugin for Firebase Core, enabling connecting to multiple Firebase apps.
[cloud_firestore](https://pub.dev/packages/cloud_firestore) | Flutter plugin for Cloud Firestore, a cloud-hosted, noSQL database with live synchronization and offline support on Android and iOS.
[equatable](https://pub.dev/packages/equatable) | A Dart package that helps to implement value based equality without needing to explicitly override == and hashCode.
[countup](https://pub.dev/packages/countup) | An flutter plugin that will help you to build animated counter texts.
[flutter_keyboard_visibility](https://pub.dev/packages/flutter_keyboard_visibility) | Flutter plugin for discovering the state of the soft-keyboard visibility on Android and iOS
[flutter_launcher_icons](https://pub.dev/packages/flutter_launcher_icons) | A package which simplifies the task of updating your Flutter app's launcher icon.
[flutter_native_splash](https://pub.dev/packages/flutter_native_splash) | Customize Flutter's default white native splash screen with background color and splash image.
[fake_cloud_firestore](https://pub.dev/packages/fake_cloud_firestore) | Fake implementation of Cloud Firestore
[in_app_update](https://pub.dev/packages/in_app_update) | Enables In App Updates on Android using the official Android APIs.
[restart_app](https://pub.dev/packages/restart_app) | A simple package that helps you to restart the whole android app with a single function call.
[flutter_lints](https://pub.dev/packages/flutter_lints) | This package contains a recommended set of lints for Flutter apps, packages, and plugins to encourage good coding practices.
[receive_sharing_intent](https://pub.dev/packages/receive_sharing_intent) | A flutter plugin that enables flutter apps to receive sharing photos, videos, text, urls or any other file types from another app.
### Directory Structure π’
The [lib](lib) directory structure is as follows:
```
βββ application
| βββ crypto
| | βββ crypto_bloc.dart
| | βββ crypto_event.dart
| | βββ crypto_state.dart
| |ββ save
| | βββ save_bloc.dart
| | βββ save_event.dart
| | βββ save_state.dart
βββ core
| |ββ enums.dart
| |ββ extension.dart
| |ββ navigation_service.dart
| |ββ usecase.dart
βββ domain
| |ββ entity
| | βββ file_count.dart
| |ββ failure
| | βββ crypto_failure.dart
| | βββ save_failure.dart
| |ββ repoitory
| | βββ i_crypto_repo.dart
| | βββ i_save_repo.dart
| |ββ usecase
| | βββ decrypt_file.dart
| | βββ encrypt_file.dart
| | βββ get_file_count.dart
| | βββ increment_file_count.dart
| | βββ save_file.dart
| | βββ share_file.dart
βββ infrastructure
| |ββ core
| | βββ firebase_helper.dart
| | βββ injection_module.dart
| | βββ permission_handler.dart
| |ββ data
| | βββ crypto_data_source.dart
| | βββ save_data_source.dart
| |ββ exception
| | βββ crypto_exception.dart
| | βββ save_exception.dart
| |ββ model
| | βββ file_count_model.dart
| |ββ repository
| | βββ crypto_repo.dart
| | βββ save_repo.dart
βββ presentation
| |ββ core
| | βββ palette.dart
| |ββ pages
| | βββ home_page.dart
| | βββ result_page.dart
| | βββ splash_page.dart
| |ββ widgets
| | βββ add_file_widget.dart
| | βββ app_version_widget.dart
| | βββ app_widget.dart
| | βββ count_animated_widget.dart
| | βββ key_widget.dart
| | βββ moon_animated_widget.dart
| | βββ permission_dialog.dart
| | βββ title_animated_widget.dart
| | βββ usecase_button.dart
βββ injection.dart
βββ main.dart
```
#### In App Purchase v3.0.5
```dart
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_encrypto/application/ad/ad_bloc.dart';
import 'package:flutter_encrypto/core/navigation_service.dart';
import 'package:in_app_purchase/in_app_purchase.dart';
const String kRemoveAds = "remove_ads";
class PurchaseProvider with ChangeNotifier {
bool _isAvailable = false;
final InAppPurchase _iap = InAppPurchase.instance;
List _products = [];
List _purchases = [];
late StreamSubscription _subscription;
InAppPurchase get iap => _iap;
bool get isAvailable => _isAvailable;
Future initialize() async {
_isAvailable = await _iap.isAvailable();
_subscription = _iap.purchaseStream.listen(_listener);
_getProducts();
_getPastPurchases();
}
void _listener(List purchaseDetails) {
if (purchaseDetails.isEmpty) {
return;
}
_verifyPurchase(purchaseDetails[0]);
_purchases.addAll(purchaseDetails);
notifyListeners();
}
Future _verifyPurchase(PurchaseDetails purchaseDetail) async {
final bool isRemoveAdsPurchase = purchaseDetail.productID == kRemoveAds;
if (!isRemoveAdsPurchase) {
return;
}
final bool isPurchasePending = purchaseDetail.pendingCompletePurchase;
if (isPurchasePending) {
await _iap.completePurchase(purchaseDetail);
}
final bool isPurchaseSuccess =
purchaseDetail.status == PurchaseStatus.purchased ||
purchaseDetail.status == PurchaseStatus.restored;
if (!isPurchaseSuccess) {
return;
}
// Remove ads
BlocProvider.of(globalContext, listen: false)
.add(AdEvent.removeAds());
}
void cancelSubscription() {
_subscription.cancel();
}
Future _getPastPurchases() async {
await _iap.restorePurchases();
}
Future _getProducts() async {
final ProductDetailsResponse response =
await _iap.queryProductDetails({kRemoveAds});
_products = response.productDetails;
notifyListeners();
}
Future buyRemoveAds() async {
final PurchaseParam _removeAdParam =
PurchaseParam(productDetails: _products[0]);
await _iap.buyNonConsumable(purchaseParam: _removeAdParam);
}
}
```
#### In App Update v3.0.0
```dart
Future _checkForUpdate() async {
final AppUpdateInfo info = await InAppUpdate.checkForUpdate();
final bool isUpdateAvailable =
info.updateAvailability == UpdateAvailability.updateAvailable;
if (isUpdateAvailable) {
final result = await InAppUpdate.performImmediateUpdate();
if (result == AppUpdateResult.userDeniedUpdate ||
result == AppUpdateResult.inAppUpdateFailed) {
// close the app
SystemNavigator.pop();
}
if (result == AppUpdateResult.success) {
Restart.restartApp();
}
}
}
```
#### Google Mobile Ads v1.2.0
Inside main.dart
```dart
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Include
MobileAds.instance.initialize();
// runApp(const MyApp());
}
```
Declare ```bannerAd```, ```isBannerAdLoaded```, ```interstitialAd``` in the state
```dart
late BannerAd bannerAd;
bool isBannerAdLoaded = false;
InterstitialAd? interstitialAd;
```
```dart
@override
void initState() {
_createInterstitialAd();
_createBannerAd();
super.initState();
}
@override
void dispose() {
bannerAd.dispose();
interstitialAd?.dispose();
super.dispose();
}
```
Interstitial Ad setup
```dart
Future _createInterstitialAd({int counter=0}) async {
if (counter > 3) return;
await InterstitialAd.load(
adUnitId: "ca-app-pub-3940256099942544/8691691433",
request: const AdRequest(),
adLoadCallback: InterstitialAdLoadCallback(
onAdLoaded: (ad) {
interstitialAd = ad;
setState(() {});
},
onAdFailedToLoad: (ad) {
interstitialAd = null;
_createInterstitialAd( counter: counter + 1);
setState(() {});
},
),
);
}
Future _showInterstitialAd() async {
if (interstitialAd == null) return;
interstitialAd!.fullScreenContentCallback = FullScreenContentCallback(
onAdDismissedFullScreenContent: (ad) {
ad.dispose();
_createInterstitialAd();
},
onAdFailedToShowFullScreenContent: (ad, _) {
ad.dispose();
_createInterstitialAd();
},
);
await interstitialAd!.show();
}
```
Banner Ad setup
```dart
Future _createBannerAd() async {
bannerAd = BannerAd(
size: AdSize.banner,
adUnitId: "ca-app-pub-3940256099942544/6300978111",
listener: BannerAdListener(
onAdLoaded: (_) {
setState(() {
isBannerAdLoaded = true;
});
},
onAdFailedToLoad: (ad, _) {
ad.dispose();
},
),
request: const AdRequest(),
);
await bannerAd.load();
}
```