import 'package:flyinsono/architecture/utils/dongle_data.dart';
import 'package:flyinsono/js_platform/handlers/base.dart';
import 'package:flyinsono/js_platform/methods.dart';

class LicenseDataHandler extends MethodHandlerBase {
  LicenseDataHandler() : super(TargetMethodName.LicenseData);

  @override
  void execute(List<String> args) {
    var licenseData = args[0];
    print(licenseData);
    var splitItems = licenseData.split(';');
    if (splitItems.length < 6) {
      return;
    }
    if (splitItems[1] != "Vinno" || splitItems[2] != "vLab") {
      return;
    }
    DongleData.anyCode = splitItems[0];
    DongleData.labDongle = splitItems[3];
    DongleData.anyAccount = splitItems[4];
  }
}
