Code Monkey home page Code Monkey logo

devicesafetyinfo's Introduction

device_safety_info (Null-Safety)

Flutter JailBreak, Rooted, Emulator/Simulator, External storage and Screen Lock detection.

Getting Started

In your flutter project add the dependency:

dependencies:
  ...
  device_safety_info: ^0.0.1

Usage

Importing package

import 'package:device_safety_info/device_safety_info.dart';

Using it

Checks whether device JailBroken or Rooted on iOS/Android?

bool isRootedDevice = await DeviceSafetyInfo.isRootedDevice;

Checks whether device is Real or Emulator/Simulator

bool isRealDevice = await DeviceSafetyInfo.isRealDevice;

Checks whether screen lock enabled or disabled

bool isScreenLock = await DeviceSafetyInfo.isScreenLock;

Checks whether application is running on external storage (Android Only)

bool isExternalStorage = await DeviceSafetyInfo.isExternalStorage;

Checks whether development Options is enable on device (Android Only)

bool isDeveloperMode = await DeviceSafetyInfo.isDeveloperMode;

Checks VPN status on device For checking VPN status device must need to connected with the internet For android need to declare permission inside the manifest file


final vpnCheck = VPNCheck();

vpnCheck.vpnState.listen((state) {
      if (state == VPNState.CONNECTED) {
        if (kDebugMode) {
          print("VPN connected.");
        }
      } else {
        if (kDebugMode) {
          print("VPN disconnected.");
        }
      }
});
    

Checks if new version available For checking app new version device must need to connected with the internet. For android need to declare permission inside the manifest file

appVersionStatus(){
    
final newVersion = NewVersionChecker(
      iOSId: '',
      androidId: '',
    );

    statusCheck(newVersion);
}

statusCheck(NewVersionChecker newVersion) async {
    try {
      final status = await newVersion.getVersionStatus();

      if (status != null) {
        debugPrint(status.appStoreLink);
        debugPrint(status.localVersion);
        debugPrint(status.storeVersion);
        debugPrint(status.canUpdate.toString());

        if (status.canUpdate) {
         // new version available
        }
      }
    } catch (e) {
      if (kDebugMode) {
        print(e.toString());
      }
    }
}

devicesafetyinfo's People

Contributors

amitkumartiwari-androidflutter avatar sapatekno avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.