c_shield_sdk 1.0.1 copy "c_shield_sdk: ^1.0.1" to clipboard
c_shield_sdk: ^1.0.1 copied to clipboard

CMC Cyber Security's C-Shield SDK for Flutter is a powerful security solution designed to protect your Flutter applications from various threats and vulnerabilities. It provides a comprehensive set of [...]

example/lib/main.dart

import 'package:c_shield_sdk/c_shield_sdk.dart';
import 'package:flutter/material.dart';

import 'network/api_client.dart';
import 'screen/otp_page.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  // Initialize CShieldSdk
  await CShieldSdk.initialize().timeout(
    const Duration(seconds: 10),
    onTimeout: () {
      debugPrint('CShieldSdk.initialize() timed out');
    },
  );

  await CShieldSSL.configure(pins: sslPins, hostname: sslHostname);
  var raspChecker = RASPChecker.builder();
  await raspChecker.setRASPConfig(
    RASPConfig(
      trustedStores: [],
      threatActionConfig: const ThreatActionConfig(
        rootDetectedAction: ThreatDetectedAction.notifyApp,
        tamperingDetectedAction: ThreatDetectedAction.notifyApp,
        emulatorDetectedAction: ThreatDetectedAction.notifyApp,
        deviceSecurityStateUnsafeDetectedAction: ThreatDetectedAction.notifyApp,
        userCADetectedAction: ThreatDetectedAction.notifyApp,
      ),
    ),
  );
  raspChecker.subscribe(detail: true, automaticallyShowPopup: true).listen((
    result,
  ) {
    if (result.vulnerable) {
      // Handle the detected threat, e.g., show a custom alert dialog
      debugPrint('Threat detected: ${result.toString()}');
    }
  });
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'CShield SDK Demo',
      theme: ThemeData(colorSchemeSeed: Colors.indigo, useMaterial3: true),
      home: const OtpPage(),
    );
  }
}
0
likes
110
points
84
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

CMC Cyber Security's C-Shield SDK for Flutter is a powerful security solution designed to protect your Flutter applications from various threats and vulnerabilities. It provides a comprehensive set of features to enhance the security of your app, including data encryption, secure storage, and protection against common attack vectors. With C-Shield SDK, you can ensure that your users' data is safe and secure while providing a seamless user experience.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

crypto, dio, flutter, http, plugin_platform_interface

More

Packages that depend on c_shield_sdk

Packages that implement c_shield_sdk