Kaynağa Gözat

add google migration helper

Sasan Salamzadeh 1 yıl önce
ebeveyn
işleme
2d26bff0a9

+ 597 - 0
pubspec.lock

@@ -0,0 +1,597 @@
+# Generated by pub
+# See https://dart.dev/tools/pub/glossary#lockfile
+packages:
+  async:
+    dependency: transitive
+    description:
+      name: async
+      sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.13.0"
+  barcode_scan2:
+    dependency: "direct main"
+    description:
+      name: barcode_scan2
+      sha256: "0f3eb7c0a0c80a0f65d3fa88737544fdb6d27127a4fad566e980e626f3fb76e1"
+      url: "https://pub.dev"
+    source: hosted
+    version: "4.5.1"
+  boolean_selector:
+    dependency: transitive
+    description:
+      name: boolean_selector
+      sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.1.2"
+  change_app_package_name:
+    dependency: "direct dev"
+    description:
+      name: change_app_package_name
+      sha256: "8e43b754fe960426904d77ed4c62fa8c9834deaf6e293ae40963fa447482c4c5"
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.5.0"
+  characters:
+    dependency: transitive
+    description:
+      name: characters
+      sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.4.0"
+  clock:
+    dependency: transitive
+    description:
+      name: clock
+      sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.1.2"
+  collection:
+    dependency: transitive
+    description:
+      name: collection
+      sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.19.1"
+  crypto:
+    dependency: transitive
+    description:
+      name: crypto
+      sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27
+      url: "https://pub.dev"
+    source: hosted
+    version: "3.0.5"
+  dots_indicator:
+    dependency: transitive
+    description:
+      name: dots_indicator
+      sha256: c070af5058a084ba7b354df4b4c26c719595d70a3531eea6edd8af8716684ba3
+      url: "https://pub.dev"
+    source: hosted
+    version: "4.0.1"
+  fake_async:
+    dependency: transitive
+    description:
+      name: fake_async
+      sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.3.3"
+  ffi:
+    dependency: transitive
+    description:
+      name: ffi
+      sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6"
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.1.3"
+  fixnum:
+    dependency: transitive
+    description:
+      name: fixnum
+      sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.1.1"
+  flutter:
+    dependency: "direct main"
+    description: flutter
+    source: sdk
+    version: "0.0.0"
+  flutter_keyboard_visibility:
+    dependency: transitive
+    description:
+      name: flutter_keyboard_visibility
+      sha256: "98664be7be0e3ffca00de50f7f6a287ab62c763fc8c762e0a21584584a3ff4f8"
+      url: "https://pub.dev"
+    source: hosted
+    version: "6.0.0"
+  flutter_keyboard_visibility_linux:
+    dependency: transitive
+    description:
+      name: flutter_keyboard_visibility_linux
+      sha256: "6fba7cd9bb033b6ddd8c2beb4c99ad02d728f1e6e6d9b9446667398b2ac39f08"
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.0.0"
+  flutter_keyboard_visibility_macos:
+    dependency: transitive
+    description:
+      name: flutter_keyboard_visibility_macos
+      sha256: c5c49b16fff453dfdafdc16f26bdd8fb8d55812a1d50b0ce25fc8d9f2e53d086
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.0.0"
+  flutter_keyboard_visibility_platform_interface:
+    dependency: transitive
+    description:
+      name: flutter_keyboard_visibility_platform_interface
+      sha256: e43a89845873f7be10cb3884345ceb9aebf00a659f479d1c8f4293fcb37022a4
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.0.0"
+  flutter_keyboard_visibility_web:
+    dependency: transitive
+    description:
+      name: flutter_keyboard_visibility_web
+      sha256: d3771a2e752880c79203f8d80658401d0c998e4183edca05a149f5098ce6e3d1
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.0.0"
+  flutter_keyboard_visibility_windows:
+    dependency: transitive
+    description:
+      name: flutter_keyboard_visibility_windows
+      sha256: fc4b0f0b6be9b93ae527f3d527fb56ee2d918cd88bbca438c478af7bcfd0ef73
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.0.0"
+  flutter_lints:
+    dependency: "direct dev"
+    description:
+      name: flutter_lints
+      sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
+      url: "https://pub.dev"
+    source: hosted
+    version: "4.0.0"
+  flutter_localizations:
+    dependency: "direct main"
+    description: flutter
+    source: sdk
+    version: "0.0.0"
+  flutter_test:
+    dependency: "direct dev"
+    description: flutter
+    source: sdk
+    version: "0.0.0"
+  flutter_web_plugins:
+    dependency: transitive
+    description: flutter
+    source: sdk
+    version: "0.0.0"
+  http:
+    dependency: transitive
+    description:
+      name: http
+      sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.2.2"
+  http_parser:
+    dependency: transitive
+    description:
+      name: http_parser
+      sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
+      url: "https://pub.dev"
+    source: hosted
+    version: "4.0.2"
+  intl:
+    dependency: "direct main"
+    description:
+      name: intl
+      sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5"
+      url: "https://pub.dev"
+    source: hosted
+    version: "0.20.2"
+  introduction_screen:
+    dependency: "direct main"
+    description:
+      name: introduction_screen
+      sha256: "02c123e074ee85b0ad0a8d3cd990f1eae78d5cfb2ac4588ad3703ac2a07fb5b0"
+      url: "https://pub.dev"
+    source: hosted
+    version: "3.1.17"
+  leak_tracker:
+    dependency: transitive
+    description:
+      name: leak_tracker
+      sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
+      url: "https://pub.dev"
+    source: hosted
+    version: "10.0.9"
+  leak_tracker_flutter_testing:
+    dependency: transitive
+    description:
+      name: leak_tracker_flutter_testing
+      sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
+      url: "https://pub.dev"
+    source: hosted
+    version: "3.0.9"
+  leak_tracker_testing:
+    dependency: transitive
+    description:
+      name: leak_tracker_testing
+      sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
+      url: "https://pub.dev"
+    source: hosted
+    version: "3.0.1"
+  lints:
+    dependency: transitive
+    description:
+      name: lints
+      sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
+      url: "https://pub.dev"
+    source: hosted
+    version: "4.0.0"
+  matcher:
+    dependency: transitive
+    description:
+      name: matcher
+      sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
+      url: "https://pub.dev"
+    source: hosted
+    version: "0.12.17"
+  material_color_utilities:
+    dependency: transitive
+    description:
+      name: material_color_utilities
+      sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
+      url: "https://pub.dev"
+    source: hosted
+    version: "0.11.1"
+  meta:
+    dependency: transitive
+    description:
+      name: meta
+      sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.16.0"
+  nested:
+    dependency: transitive
+    description:
+      name: nested
+      sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20"
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.0.0"
+  package_info_plus:
+    dependency: "direct main"
+    description:
+      name: package_info_plus
+      sha256: a75164ade98cb7d24cfd0a13c6408927c6b217fa60dee5a7ff5c116a58f28918
+      url: "https://pub.dev"
+    source: hosted
+    version: "8.0.2"
+  package_info_plus_platform_interface:
+    dependency: transitive
+    description:
+      name: package_info_plus_platform_interface
+      sha256: ac1f4a4847f1ade8e6a87d1f39f5d7c67490738642e2542f559ec38c37489a66
+      url: "https://pub.dev"
+    source: hosted
+    version: "3.0.1"
+  path:
+    dependency: transitive
+    description:
+      name: path
+      sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.9.1"
+  path_provider:
+    dependency: "direct main"
+    description:
+      name: path_provider
+      sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.1.4"
+  path_provider_android:
+    dependency: transitive
+    description:
+      name: path_provider_android
+      sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7"
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.2.10"
+  path_provider_foundation:
+    dependency: transitive
+    description:
+      name: path_provider_foundation
+      sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.4.0"
+  path_provider_linux:
+    dependency: transitive
+    description:
+      name: path_provider_linux
+      sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.2.1"
+  path_provider_platform_interface:
+    dependency: transitive
+    description:
+      name: path_provider_platform_interface
+      sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.1.2"
+  path_provider_windows:
+    dependency: transitive
+    description:
+      name: path_provider_windows
+      sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.3.0"
+  pb_authenticator_state:
+    dependency: "direct main"
+    description:
+      path: state
+      relative: true
+    source: path
+    version: "1.0.0"
+  pb_authenticator_totp:
+    dependency: "direct main"
+    description:
+      path: totp
+      relative: true
+    source: path
+    version: "1.0.0"
+  platform:
+    dependency: transitive
+    description:
+      name: platform
+      sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65"
+      url: "https://pub.dev"
+    source: hosted
+    version: "3.1.5"
+  plugin_platform_interface:
+    dependency: transitive
+    description:
+      name: plugin_platform_interface
+      sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.1.8"
+  protobuf:
+    dependency: transitive
+    description:
+      name: protobuf
+      sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d"
+      url: "https://pub.dev"
+    source: hosted
+    version: "3.1.0"
+  provider:
+    dependency: "direct main"
+    description:
+      name: provider
+      sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c
+      url: "https://pub.dev"
+    source: hosted
+    version: "6.1.2"
+  sky_engine:
+    dependency: transitive
+    description: flutter
+    source: sdk
+    version: "0.0.0"
+  source_span:
+    dependency: transitive
+    description:
+      name: source_span
+      sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.10.1"
+  sprintf:
+    dependency: transitive
+    description:
+      name: sprintf
+      sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23"
+      url: "https://pub.dev"
+    source: hosted
+    version: "7.0.0"
+  sqflite:
+    dependency: transitive
+    description:
+      name: sqflite
+      sha256: ff5a2436ef8ebdfda748fbfe957f9981524cb5ff11e7bafa8c42771840e8a788
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.3.3+2"
+  sqflite_common:
+    dependency: transitive
+    description:
+      name: sqflite_common
+      sha256: "2d8e607db72e9cb7748c9c6e739e2c9618320a5517de693d5a24609c4671b1a4"
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.5.4+4"
+  stack_trace:
+    dependency: transitive
+    description:
+      name: stack_trace
+      sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.12.1"
+  stream_channel:
+    dependency: transitive
+    description:
+      name: stream_channel
+      sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.1.4"
+  string_scanner:
+    dependency: transitive
+    description:
+      name: string_scanner
+      sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.4.1"
+  synchronized:
+    dependency: transitive
+    description:
+      name: synchronized
+      sha256: "69fe30f3a8b04a0be0c15ae6490fc859a78ef4c43ae2dd5e8a623d45bfcf9225"
+      url: "https://pub.dev"
+    source: hosted
+    version: "3.3.0+3"
+  term_glyph:
+    dependency: transitive
+    description:
+      name: term_glyph
+      sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.2.2"
+  test_api:
+    dependency: transitive
+    description:
+      name: test_api
+      sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
+      url: "https://pub.dev"
+    source: hosted
+    version: "0.7.4"
+  typed_data:
+    dependency: transitive
+    description:
+      name: typed_data
+      sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.3.2"
+  url_launcher:
+    dependency: "direct main"
+    description:
+      name: url_launcher
+      sha256: "21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3"
+      url: "https://pub.dev"
+    source: hosted
+    version: "6.3.0"
+  url_launcher_android:
+    dependency: transitive
+    description:
+      name: url_launcher_android
+      sha256: e35a698ac302dd68e41f73250bd9517fe3ab5fa4f18fe4647a0872db61bacbab
+      url: "https://pub.dev"
+    source: hosted
+    version: "6.3.10"
+  url_launcher_ios:
+    dependency: transitive
+    description:
+      name: url_launcher_ios
+      sha256: e43b677296fadce447e987a2f519dcf5f6d1e527dc35d01ffab4fff5b8a7063e
+      url: "https://pub.dev"
+    source: hosted
+    version: "6.3.1"
+  url_launcher_linux:
+    dependency: transitive
+    description:
+      name: url_launcher_linux
+      sha256: e2b9622b4007f97f504cd64c0128309dfb978ae66adbe944125ed9e1750f06af
+      url: "https://pub.dev"
+    source: hosted
+    version: "3.2.0"
+  url_launcher_macos:
+    dependency: transitive
+    description:
+      name: url_launcher_macos
+      sha256: "769549c999acdb42b8bcfa7c43d72bf79a382ca7441ab18a808e101149daf672"
+      url: "https://pub.dev"
+    source: hosted
+    version: "3.2.1"
+  url_launcher_platform_interface:
+    dependency: transitive
+    description:
+      name: url_launcher_platform_interface
+      sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.3.2"
+  url_launcher_web:
+    dependency: transitive
+    description:
+      name: url_launcher_web
+      sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e"
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.3.3"
+  url_launcher_windows:
+    dependency: transitive
+    description:
+      name: url_launcher_windows
+      sha256: "49c10f879746271804767cb45551ec5592cdab00ee105c06dddde1a98f73b185"
+      url: "https://pub.dev"
+    source: hosted
+    version: "3.1.2"
+  uuid:
+    dependency: transitive
+    description:
+      name: uuid
+      sha256: "814e9e88f21a176ae1359149021870e87f7cddaf633ab678a5d2b0bff7fd1ba8"
+      url: "https://pub.dev"
+    source: hosted
+    version: "4.4.0"
+  vector_math:
+    dependency: transitive
+    description:
+      name: vector_math
+      sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.1.4"
+  vm_service:
+    dependency: transitive
+    description:
+      name: vm_service
+      sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
+      url: "https://pub.dev"
+    source: hosted
+    version: "15.0.0"
+  web:
+    dependency: transitive
+    description:
+      name: web
+      sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.1.0"
+  win32:
+    dependency: transitive
+    description:
+      name: win32
+      sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a"
+      url: "https://pub.dev"
+    source: hosted
+    version: "5.5.4"
+  xdg_directories:
+    dependency: transitive
+    description:
+      name: xdg_directories
+      sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.0.4"
+sdks:
+  dart: ">=3.7.0-0 <4.0.0"
+  flutter: ">=3.24.0"

+ 380 - 0
totp/lib/generated/GoogleAuthenticatorImport.pb.dart

@@ -0,0 +1,380 @@
+///
+//  Generated code. Do not modify.
+//  source: GoogleAuthenticatorImport.proto
+//
+// @dart = 2.12
+// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
+
+import 'dart:core' as $core;
+
+import 'package:fixnum/fixnum.dart' as $fixnum;
+import 'package:protobuf/protobuf.dart' as $pb;
+
+import 'GoogleAuthenticatorImport.pbenum.dart';
+
+export 'GoogleAuthenticatorImport.pbenum.dart';
+
+class GoogleAuthenticatorImport_OtpParameters extends $pb.GeneratedMessage {
+  static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+      const $core.bool.fromEnvironment('protobuf.omit_message_names')
+          ? ''
+          : 'GoogleAuthenticatorImport.OtpParameters',
+      package: const $pb.PackageName(
+          const $core.bool.fromEnvironment('protobuf.omit_message_names')
+              ? ''
+              : 'KeePassOTP'),
+      createEmptyInstance: create)
+    ..a<$core.List<$core.int>>(
+        1,
+        const $core.bool.fromEnvironment('protobuf.omit_field_names')
+            ? ''
+            : 'secret',
+        $pb.PbFieldType.OY)
+    ..aOS(
+        2,
+        const $core.bool.fromEnvironment('protobuf.omit_field_names')
+            ? ''
+            : 'name')
+    ..aOS(
+        3,
+        const $core.bool.fromEnvironment('protobuf.omit_field_names')
+            ? ''
+            : 'issuer')
+    ..e<GoogleAuthenticatorImport_Algorithm>(
+        4,
+        const $core.bool.fromEnvironment('protobuf.omit_field_names')
+            ? ''
+            : 'algorithm',
+        $pb.PbFieldType.OE,
+        defaultOrMaker:
+            GoogleAuthenticatorImport_Algorithm.ALGORITHM_UNSPECIFIED,
+        valueOf: GoogleAuthenticatorImport_Algorithm.valueOf,
+        enumValues: GoogleAuthenticatorImport_Algorithm.values)
+    ..e<GoogleAuthenticatorImport_DigitCount>(
+        5,
+        const $core.bool.fromEnvironment('protobuf.omit_field_names')
+            ? ''
+            : 'digits',
+        $pb.PbFieldType.OE,
+        defaultOrMaker:
+            GoogleAuthenticatorImport_DigitCount.DIGIT_COUNT_UNSPECIFIED,
+        valueOf: GoogleAuthenticatorImport_DigitCount.valueOf,
+        enumValues: GoogleAuthenticatorImport_DigitCount.values)
+    ..e<GoogleAuthenticatorImport_OtpType>(
+        6,
+        const $core.bool.fromEnvironment('protobuf.omit_field_names')
+            ? ''
+            : 'type',
+        $pb.PbFieldType.OE,
+        defaultOrMaker: GoogleAuthenticatorImport_OtpType.OTP_TYPE_UNSPECIFIED,
+        valueOf: GoogleAuthenticatorImport_OtpType.valueOf,
+        enumValues: GoogleAuthenticatorImport_OtpType.values)
+    ..aInt64(
+        7,
+        const $core.bool.fromEnvironment('protobuf.omit_field_names')
+            ? ''
+            : 'counter')
+    ..hasRequiredFields = false;
+
+  GoogleAuthenticatorImport_OtpParameters._() : super();
+  factory GoogleAuthenticatorImport_OtpParameters({
+    $core.List<$core.int>? secret,
+    $core.String? name,
+    $core.String? issuer,
+    GoogleAuthenticatorImport_Algorithm? algorithm,
+    GoogleAuthenticatorImport_DigitCount? digits,
+    GoogleAuthenticatorImport_OtpType? type,
+    $fixnum.Int64? counter,
+  }) {
+    final _result = create();
+    if (secret != null) {
+      _result.secret = secret;
+    }
+    if (name != null) {
+      _result.name = name;
+    }
+    if (issuer != null) {
+      _result.issuer = issuer;
+    }
+    if (algorithm != null) {
+      _result.algorithm = algorithm;
+    }
+    if (digits != null) {
+      _result.digits = digits;
+    }
+    if (type != null) {
+      _result.type = type;
+    }
+    if (counter != null) {
+      _result.counter = counter;
+    }
+    return _result;
+  }
+  factory GoogleAuthenticatorImport_OtpParameters.fromBuffer(
+          $core.List<$core.int> i,
+          [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
+      create()..mergeFromBuffer(i, r);
+  factory GoogleAuthenticatorImport_OtpParameters.fromJson($core.String i,
+          [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
+      create()..mergeFromJson(i, r);
+  @$core.Deprecated('Using this can add significant overhead to your binary. '
+      'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
+      'Will be removed in next major version')
+  GoogleAuthenticatorImport_OtpParameters clone() =>
+      GoogleAuthenticatorImport_OtpParameters()..mergeFromMessage(this);
+  @$core.Deprecated('Using this can add significant overhead to your binary. '
+      'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
+      'Will be removed in next major version')
+  GoogleAuthenticatorImport_OtpParameters copyWith(
+          void Function(GoogleAuthenticatorImport_OtpParameters) updates) =>
+      super.copyWith((message) =>
+              updates(message as GoogleAuthenticatorImport_OtpParameters))
+          as GoogleAuthenticatorImport_OtpParameters; // ignore: deprecated_member_use
+  $pb.BuilderInfo get info_ => _i;
+  @$core.pragma('dart2js:noInline')
+  static GoogleAuthenticatorImport_OtpParameters create() =>
+      GoogleAuthenticatorImport_OtpParameters._();
+  GoogleAuthenticatorImport_OtpParameters createEmptyInstance() => create();
+  static $pb.PbList<GoogleAuthenticatorImport_OtpParameters> createRepeated() =>
+      $pb.PbList<GoogleAuthenticatorImport_OtpParameters>();
+  @$core.pragma('dart2js:noInline')
+  static GoogleAuthenticatorImport_OtpParameters getDefault() =>
+      _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<
+          GoogleAuthenticatorImport_OtpParameters>(create);
+  static GoogleAuthenticatorImport_OtpParameters? _defaultInstance;
+
+  @$pb.TagNumber(1)
+  $core.List<$core.int> get secret => $_getN(0);
+  @$pb.TagNumber(1)
+  set secret($core.List<$core.int> v) {
+    $_setBytes(0, v);
+  }
+
+  @$pb.TagNumber(1)
+  $core.bool hasSecret() => $_has(0);
+  @$pb.TagNumber(1)
+  void clearSecret() => clearField(1);
+
+  @$pb.TagNumber(2)
+  $core.String get name => $_getSZ(1);
+  @$pb.TagNumber(2)
+  set name($core.String v) {
+    $_setString(1, v);
+  }
+
+  @$pb.TagNumber(2)
+  $core.bool hasName() => $_has(1);
+  @$pb.TagNumber(2)
+  void clearName() => clearField(2);
+
+  @$pb.TagNumber(3)
+  $core.String get issuer => $_getSZ(2);
+  @$pb.TagNumber(3)
+  set issuer($core.String v) {
+    $_setString(2, v);
+  }
+
+  @$pb.TagNumber(3)
+  $core.bool hasIssuer() => $_has(2);
+  @$pb.TagNumber(3)
+  void clearIssuer() => clearField(3);
+
+  @$pb.TagNumber(4)
+  GoogleAuthenticatorImport_Algorithm get algorithm => $_getN(3);
+  @$pb.TagNumber(4)
+  set algorithm(GoogleAuthenticatorImport_Algorithm v) {
+    setField(4, v);
+  }
+
+  @$pb.TagNumber(4)
+  $core.bool hasAlgorithm() => $_has(3);
+  @$pb.TagNumber(4)
+  void clearAlgorithm() => clearField(4);
+
+  @$pb.TagNumber(5)
+  GoogleAuthenticatorImport_DigitCount get digits => $_getN(4);
+  @$pb.TagNumber(5)
+  set digits(GoogleAuthenticatorImport_DigitCount v) {
+    setField(5, v);
+  }
+
+  @$pb.TagNumber(5)
+  $core.bool hasDigits() => $_has(4);
+  @$pb.TagNumber(5)
+  void clearDigits() => clearField(5);
+
+  @$pb.TagNumber(6)
+  GoogleAuthenticatorImport_OtpType get type => $_getN(5);
+  @$pb.TagNumber(6)
+  set type(GoogleAuthenticatorImport_OtpType v) {
+    setField(6, v);
+  }
+
+  @$pb.TagNumber(6)
+  $core.bool hasType() => $_has(5);
+  @$pb.TagNumber(6)
+  void clearType() => clearField(6);
+
+  @$pb.TagNumber(7)
+  $fixnum.Int64 get counter => $_getI64(6);
+  @$pb.TagNumber(7)
+  set counter($fixnum.Int64 v) {
+    $_setInt64(6, v);
+  }
+
+  @$pb.TagNumber(7)
+  $core.bool hasCounter() => $_has(6);
+  @$pb.TagNumber(7)
+  void clearCounter() => clearField(7);
+}
+
+class GoogleAuthenticatorImport extends $pb.GeneratedMessage {
+  static final $pb.BuilderInfo _i = $pb.BuilderInfo(
+      const $core.bool.fromEnvironment('protobuf.omit_message_names')
+          ? ''
+          : 'GoogleAuthenticatorImport',
+      package: const $pb.PackageName(
+          const $core.bool.fromEnvironment('protobuf.omit_message_names')
+              ? ''
+              : 'KeePassOTP'),
+      createEmptyInstance: create)
+    ..pc<GoogleAuthenticatorImport_OtpParameters>(
+        1,
+        const $core.bool.fromEnvironment('protobuf.omit_field_names')
+            ? ''
+            : 'otpParameters',
+        $pb.PbFieldType.PM,
+        subBuilder: GoogleAuthenticatorImport_OtpParameters.create)
+    ..a<$core.int>(
+        2,
+        const $core.bool.fromEnvironment('protobuf.omit_field_names')
+            ? ''
+            : 'version',
+        $pb.PbFieldType.O3)
+    ..a<$core.int>(
+        3,
+        const $core.bool.fromEnvironment('protobuf.omit_field_names')
+            ? ''
+            : 'batchSize',
+        $pb.PbFieldType.O3)
+    ..a<$core.int>(
+        4,
+        const $core.bool.fromEnvironment('protobuf.omit_field_names')
+            ? ''
+            : 'batchIndex',
+        $pb.PbFieldType.O3)
+    ..a<$core.int>(
+        5,
+        const $core.bool.fromEnvironment('protobuf.omit_field_names')
+            ? ''
+            : 'batchId',
+        $pb.PbFieldType.O3)
+    ..hasRequiredFields = false;
+
+  GoogleAuthenticatorImport._() : super();
+  factory GoogleAuthenticatorImport({
+    $core.Iterable<GoogleAuthenticatorImport_OtpParameters>? otpParameters,
+    $core.int? version,
+    $core.int? batchSize,
+    $core.int? batchIndex,
+    $core.int? batchId,
+  }) {
+    final _result = create();
+    if (otpParameters != null) {
+      _result.otpParameters.addAll(otpParameters);
+    }
+    if (version != null) {
+      _result.version = version;
+    }
+    if (batchSize != null) {
+      _result.batchSize = batchSize;
+    }
+    if (batchIndex != null) {
+      _result.batchIndex = batchIndex;
+    }
+    if (batchId != null) {
+      _result.batchId = batchId;
+    }
+    return _result;
+  }
+  factory GoogleAuthenticatorImport.fromBuffer($core.List<$core.int> i,
+          [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
+      create()..mergeFromBuffer(i, r);
+  factory GoogleAuthenticatorImport.fromJson($core.String i,
+          [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
+      create()..mergeFromJson(i, r);
+  @$core.Deprecated('Using this can add significant overhead to your binary. '
+      'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
+      'Will be removed in next major version')
+  GoogleAuthenticatorImport clone() =>
+      GoogleAuthenticatorImport()..mergeFromMessage(this);
+  @$core.Deprecated('Using this can add significant overhead to your binary. '
+      'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
+      'Will be removed in next major version')
+  GoogleAuthenticatorImport copyWith(
+          void Function(GoogleAuthenticatorImport) updates) =>
+      super.copyWith((message) => updates(message as GoogleAuthenticatorImport))
+          as GoogleAuthenticatorImport; // ignore: deprecated_member_use
+  $pb.BuilderInfo get info_ => _i;
+  @$core.pragma('dart2js:noInline')
+  static GoogleAuthenticatorImport create() => GoogleAuthenticatorImport._();
+  GoogleAuthenticatorImport createEmptyInstance() => create();
+  static $pb.PbList<GoogleAuthenticatorImport> createRepeated() =>
+      $pb.PbList<GoogleAuthenticatorImport>();
+  @$core.pragma('dart2js:noInline')
+  static GoogleAuthenticatorImport getDefault() => _defaultInstance ??=
+      $pb.GeneratedMessage.$_defaultFor<GoogleAuthenticatorImport>(create);
+  static GoogleAuthenticatorImport? _defaultInstance;
+
+  @$pb.TagNumber(1)
+  $core.List<GoogleAuthenticatorImport_OtpParameters> get otpParameters =>
+      $_getList(0);
+
+  @$pb.TagNumber(2)
+  $core.int get version => $_getIZ(1);
+  @$pb.TagNumber(2)
+  set version($core.int v) {
+    $_setSignedInt32(1, v);
+  }
+
+  @$pb.TagNumber(2)
+  $core.bool hasVersion() => $_has(1);
+  @$pb.TagNumber(2)
+  void clearVersion() => clearField(2);
+
+  @$pb.TagNumber(3)
+  $core.int get batchSize => $_getIZ(2);
+  @$pb.TagNumber(3)
+  set batchSize($core.int v) {
+    $_setSignedInt32(2, v);
+  }
+
+  @$pb.TagNumber(3)
+  $core.bool hasBatchSize() => $_has(2);
+  @$pb.TagNumber(3)
+  void clearBatchSize() => clearField(3);
+
+  @$pb.TagNumber(4)
+  $core.int get batchIndex => $_getIZ(3);
+  @$pb.TagNumber(4)
+  set batchIndex($core.int v) {
+    $_setSignedInt32(3, v);
+  }
+
+  @$pb.TagNumber(4)
+  $core.bool hasBatchIndex() => $_has(3);
+  @$pb.TagNumber(4)
+  void clearBatchIndex() => clearField(4);
+
+  @$pb.TagNumber(5)
+  $core.int get batchId => $_getIZ(4);
+  @$pb.TagNumber(5)
+  set batchId($core.int v) {
+    $_setSignedInt32(4, v);
+  }
+
+  @$pb.TagNumber(5)
+  $core.bool hasBatchId() => $_has(4);
+  @$pb.TagNumber(5)
+  void clearBatchId() => clearField(5);
+}

+ 132 - 0
totp/lib/generated/GoogleAuthenticatorImport.pbenum.dart

@@ -0,0 +1,132 @@
+///
+//  Generated code. Do not modify.
+//  source: GoogleAuthenticatorImport.proto
+//
+// @dart = 2.12
+// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
+
+// ignore_for_file: UNDEFINED_SHOWN_NAME
+import 'dart:core' as $core;
+import 'package:protobuf/protobuf.dart' as $pb;
+
+class GoogleAuthenticatorImport_Algorithm extends $pb.ProtobufEnum {
+  static const GoogleAuthenticatorImport_Algorithm ALGORITHM_UNSPECIFIED =
+      GoogleAuthenticatorImport_Algorithm._(
+          0,
+          const $core.bool.fromEnvironment('protobuf.omit_enum_names')
+              ? ''
+              : 'ALGORITHM_UNSPECIFIED');
+  static const GoogleAuthenticatorImport_Algorithm ALGORITHM_SHA1 =
+      GoogleAuthenticatorImport_Algorithm._(
+          1,
+          const $core.bool.fromEnvironment('protobuf.omit_enum_names')
+              ? ''
+              : 'ALGORITHM_SHA1');
+  static const GoogleAuthenticatorImport_Algorithm ALGORITHM_SHA256 =
+      GoogleAuthenticatorImport_Algorithm._(
+          2,
+          const $core.bool.fromEnvironment('protobuf.omit_enum_names')
+              ? ''
+              : 'ALGORITHM_SHA256');
+  static const GoogleAuthenticatorImport_Algorithm ALGORITHM_SHA512 =
+      GoogleAuthenticatorImport_Algorithm._(
+          3,
+          const $core.bool.fromEnvironment('protobuf.omit_enum_names')
+              ? ''
+              : 'ALGORITHM_SHA512');
+  static const GoogleAuthenticatorImport_Algorithm ALGORITHM_MD5 =
+      GoogleAuthenticatorImport_Algorithm._(
+          4,
+          const $core.bool.fromEnvironment('protobuf.omit_enum_names')
+              ? ''
+              : 'ALGORITHM_MD5');
+
+  static const $core.List<GoogleAuthenticatorImport_Algorithm> values =
+      <GoogleAuthenticatorImport_Algorithm>[
+    ALGORITHM_UNSPECIFIED,
+    ALGORITHM_SHA1,
+    ALGORITHM_SHA256,
+    ALGORITHM_SHA512,
+    ALGORITHM_MD5,
+  ];
+
+  static final $core.Map<$core.int, GoogleAuthenticatorImport_Algorithm>
+      _byValue = $pb.ProtobufEnum.initByValue(values);
+  static GoogleAuthenticatorImport_Algorithm? valueOf($core.int value) =>
+      _byValue[value];
+
+  const GoogleAuthenticatorImport_Algorithm._($core.int v, $core.String n)
+      : super(v, n);
+}
+
+class GoogleAuthenticatorImport_DigitCount extends $pb.ProtobufEnum {
+  static const GoogleAuthenticatorImport_DigitCount DIGIT_COUNT_UNSPECIFIED =
+      GoogleAuthenticatorImport_DigitCount._(
+          0,
+          const $core.bool.fromEnvironment('protobuf.omit_enum_names')
+              ? ''
+              : 'DIGIT_COUNT_UNSPECIFIED');
+  static const GoogleAuthenticatorImport_DigitCount DIGIT_COUNT_SIX =
+      GoogleAuthenticatorImport_DigitCount._(
+          1,
+          const $core.bool.fromEnvironment('protobuf.omit_enum_names')
+              ? ''
+              : 'DIGIT_COUNT_SIX');
+  static const GoogleAuthenticatorImport_DigitCount DIGIT_COUNT_EIGHT =
+      GoogleAuthenticatorImport_DigitCount._(
+          2,
+          const $core.bool.fromEnvironment('protobuf.omit_enum_names')
+              ? ''
+              : 'DIGIT_COUNT_EIGHT');
+
+  static const $core.List<GoogleAuthenticatorImport_DigitCount> values =
+      <GoogleAuthenticatorImport_DigitCount>[
+    DIGIT_COUNT_UNSPECIFIED,
+    DIGIT_COUNT_SIX,
+    DIGIT_COUNT_EIGHT,
+  ];
+
+  static final $core.Map<$core.int, GoogleAuthenticatorImport_DigitCount>
+      _byValue = $pb.ProtobufEnum.initByValue(values);
+  static GoogleAuthenticatorImport_DigitCount? valueOf($core.int value) =>
+      _byValue[value];
+
+  const GoogleAuthenticatorImport_DigitCount._($core.int v, $core.String n)
+      : super(v, n);
+}
+
+class GoogleAuthenticatorImport_OtpType extends $pb.ProtobufEnum {
+  static const GoogleAuthenticatorImport_OtpType OTP_TYPE_UNSPECIFIED =
+      GoogleAuthenticatorImport_OtpType._(
+          0,
+          const $core.bool.fromEnvironment('protobuf.omit_enum_names')
+              ? ''
+              : 'OTP_TYPE_UNSPECIFIED');
+  static const GoogleAuthenticatorImport_OtpType OTP_TYPE_HOTP =
+      GoogleAuthenticatorImport_OtpType._(
+          1,
+          const $core.bool.fromEnvironment('protobuf.omit_enum_names')
+              ? ''
+              : 'OTP_TYPE_HOTP');
+  static const GoogleAuthenticatorImport_OtpType OTP_TYPE_TOTP =
+      GoogleAuthenticatorImport_OtpType._(
+          2,
+          const $core.bool.fromEnvironment('protobuf.omit_enum_names')
+              ? ''
+              : 'OTP_TYPE_TOTP');
+
+  static const $core.List<GoogleAuthenticatorImport_OtpType> values =
+      <GoogleAuthenticatorImport_OtpType>[
+    OTP_TYPE_UNSPECIFIED,
+    OTP_TYPE_HOTP,
+    OTP_TYPE_TOTP,
+  ];
+
+  static final $core.Map<$core.int, GoogleAuthenticatorImport_OtpType>
+      _byValue = $pb.ProtobufEnum.initByValue(values);
+  static GoogleAuthenticatorImport_OtpType? valueOf($core.int value) =>
+      _byValue[value];
+
+  const GoogleAuthenticatorImport_OtpType._($core.int v, $core.String n)
+      : super(v, n);
+}

+ 107 - 0
totp/lib/generated/GoogleAuthenticatorImport.pbjson.dart

@@ -0,0 +1,107 @@
+///
+//  Generated code. Do not modify.
+//  source: GoogleAuthenticatorImport.proto
+//
+// @dart = 2.12
+// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
+
+import 'dart:core' as $core;
+import 'dart:convert' as $convert;
+import 'dart:typed_data' as $typed_data;
+
+@$core.Deprecated('Use googleAuthenticatorImportDescriptor instead')
+const GoogleAuthenticatorImport$json = const {
+  '1': 'GoogleAuthenticatorImport',
+  '2': const [
+    const {
+      '1': 'otp_parameters',
+      '3': 1,
+      '4': 3,
+      '5': 11,
+      '6': '.KeePassOTP.GoogleAuthenticatorImport.OtpParameters',
+      '10': 'otpParameters'
+    },
+    const {'1': 'version', '3': 2, '4': 1, '5': 5, '10': 'version'},
+    const {'1': 'batch_size', '3': 3, '4': 1, '5': 5, '10': 'batchSize'},
+    const {'1': 'batch_index', '3': 4, '4': 1, '5': 5, '10': 'batchIndex'},
+    const {'1': 'batch_id', '3': 5, '4': 1, '5': 5, '10': 'batchId'},
+  ],
+  '3': const [GoogleAuthenticatorImport_OtpParameters$json],
+  '4': const [
+    GoogleAuthenticatorImport_Algorithm$json,
+    GoogleAuthenticatorImport_DigitCount$json,
+    GoogleAuthenticatorImport_OtpType$json
+  ],
+};
+
+@$core.Deprecated('Use googleAuthenticatorImportDescriptor instead')
+const GoogleAuthenticatorImport_OtpParameters$json = const {
+  '1': 'OtpParameters',
+  '2': const [
+    const {'1': 'secret', '3': 1, '4': 1, '5': 12, '10': 'secret'},
+    const {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'},
+    const {'1': 'issuer', '3': 3, '4': 1, '5': 9, '10': 'issuer'},
+    const {
+      '1': 'algorithm',
+      '3': 4,
+      '4': 1,
+      '5': 14,
+      '6': '.KeePassOTP.GoogleAuthenticatorImport.Algorithm',
+      '10': 'algorithm'
+    },
+    const {
+      '1': 'digits',
+      '3': 5,
+      '4': 1,
+      '5': 14,
+      '6': '.KeePassOTP.GoogleAuthenticatorImport.DigitCount',
+      '10': 'digits'
+    },
+    const {
+      '1': 'type',
+      '3': 6,
+      '4': 1,
+      '5': 14,
+      '6': '.KeePassOTP.GoogleAuthenticatorImport.OtpType',
+      '10': 'type'
+    },
+    const {'1': 'counter', '3': 7, '4': 1, '5': 3, '10': 'counter'},
+  ],
+};
+
+@$core.Deprecated('Use googleAuthenticatorImportDescriptor instead')
+const GoogleAuthenticatorImport_Algorithm$json = const {
+  '1': 'Algorithm',
+  '2': const [
+    const {'1': 'ALGORITHM_UNSPECIFIED', '2': 0},
+    const {'1': 'ALGORITHM_SHA1', '2': 1},
+    const {'1': 'ALGORITHM_SHA256', '2': 2},
+    const {'1': 'ALGORITHM_SHA512', '2': 3},
+    const {'1': 'ALGORITHM_MD5', '2': 4},
+  ],
+};
+
+@$core.Deprecated('Use googleAuthenticatorImportDescriptor instead')
+const GoogleAuthenticatorImport_DigitCount$json = const {
+  '1': 'DigitCount',
+  '2': const [
+    const {'1': 'DIGIT_COUNT_UNSPECIFIED', '2': 0},
+    const {'1': 'DIGIT_COUNT_SIX', '2': 1},
+    const {'1': 'DIGIT_COUNT_EIGHT', '2': 2},
+  ],
+};
+
+@$core.Deprecated('Use googleAuthenticatorImportDescriptor instead')
+const GoogleAuthenticatorImport_OtpType$json = const {
+  '1': 'OtpType',
+  '2': const [
+    const {'1': 'OTP_TYPE_UNSPECIFIED', '2': 0},
+    const {'1': 'OTP_TYPE_HOTP', '2': 1},
+    const {'1': 'OTP_TYPE_TOTP', '2': 2},
+  ],
+};
+
+/// Descriptor for `GoogleAuthenticatorImport`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List googleAuthenticatorImportDescriptor =
+    $convert.base64Decode(
+        'ChlHb29nbGVBdXRoZW50aWNhdG9ySW1wb3J0EloKDm90cF9wYXJhbWV0ZXJzGAEgAygLMjMuS2VlUGFzc09UUC5Hb29nbGVBdXRoZW50aWNhdG9ySW1wb3J0Lk90cFBhcmFtZXRlcnNSDW90cFBhcmFtZXRlcnMSGAoHdmVyc2lvbhgCIAEoBVIHdmVyc2lvbhIdCgpiYXRjaF9zaXplGAMgASgFUgliYXRjaFNpemUSHwoLYmF0Y2hfaW5kZXgYBCABKAVSCmJhdGNoSW5kZXgSGQoIYmF0Y2hfaWQYBSABKAVSB2JhdGNoSWQayQIKDU90cFBhcmFtZXRlcnMSFgoGc2VjcmV0GAEgASgMUgZzZWNyZXQSEgoEbmFtZRgCIAEoCVIEbmFtZRIWCgZpc3N1ZXIYAyABKAlSBmlzc3VlchJNCglhbGdvcml0aG0YBCABKA4yLy5LZWVQYXNzT1RQLkdvb2dsZUF1dGhlbnRpY2F0b3JJbXBvcnQuQWxnb3JpdGhtUglhbGdvcml0aG0SSAoGZGlnaXRzGAUgASgOMjAuS2VlUGFzc09UUC5Hb29nbGVBdXRoZW50aWNhdG9ySW1wb3J0LkRpZ2l0Q291bnRSBmRpZ2l0cxJBCgR0eXBlGAYgASgOMi0uS2VlUGFzc09UUC5Hb29nbGVBdXRoZW50aWNhdG9ySW1wb3J0Lk90cFR5cGVSBHR5cGUSGAoHY291bnRlchgHIAEoA1IHY291bnRlciJ5CglBbGdvcml0aG0SGQoVQUxHT1JJVEhNX1VOU1BFQ0lGSUVEEAASEgoOQUxHT1JJVEhNX1NIQTEQARIUChBBTEdPUklUSE1fU0hBMjU2EAISFAoQQUxHT1JJVEhNX1NIQTUxMhADEhEKDUFMR09SSVRITV9NRDUQBCJVCgpEaWdpdENvdW50EhsKF0RJR0lUX0NPVU5UX1VOU1BFQ0lGSUVEEAASEwoPRElHSVRfQ09VTlRfU0lYEAESFQoRRElHSVRfQ09VTlRfRUlHSFQQAiJJCgdPdHBUeXBlEhgKFE9UUF9UWVBFX1VOU1BFQ0lGSUVEEAASEQoNT1RQX1RZUEVfSE9UUBABEhEKDU9UUF9UWVBFX1RPVFAQAg==');

+ 8 - 0
totp/lib/generated/GoogleAuthenticatorImport.pbserver.dart

@@ -0,0 +1,8 @@
+///
+//  Generated code. Do not modify.
+//  source: GoogleAuthenticatorImport.proto
+//
+// @dart = 2.12
+// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
+
+export 'GoogleAuthenticatorImport.pb.dart';

+ 343 - 0
totp/lib/otpauth_migration.dart

@@ -0,0 +1,343 @@
+/// Provides encode and decode functions for the otpauth-migration URI format used to import into and export 2FA secrets from the Google Authenticator app
+library otpauth_migration;
+
+import 'dart:convert';
+import 'dart:typed_data';
+import 'generated/GoogleAuthenticatorImport.pb.dart';
+
+/// A stateless class (not a singleton) that provides encode and decode functions for the otpauth-migration URI format used to import into and export 2FA secrets from the Google Authenticator app
+class OtpAuthMigration {
+  final List<String> _rfc3548 = [
+    "A",
+    "B",
+    "C",
+    "D",
+    "E",
+    "F",
+    "G",
+    "H",
+    "I",
+    "J",
+    "K",
+    "L",
+    "M",
+    "N",
+    "O",
+    "P",
+    "Q",
+    "R",
+    "S",
+    "T",
+    "U",
+    "V",
+    "W",
+    "X",
+    "Y",
+    "Z",
+    "2",
+    "3",
+    "4",
+    "5",
+    "6",
+    "7"
+  ];
+
+  /// encode given list of optauth URIs into a single otpauth-migration URI
+  String encode(List<String> otpAuths,
+      {bool debug = false,
+      int version = -1,
+      int batchSize = -1,
+      int batchIndex = -1,
+      int batchId = -1}) {
+    var gai = GoogleAuthenticatorImport();
+    for (var otp in otpAuths) {
+      var uri = Uri.parse(otp);
+      //uri.queryParameters.forEach((k, v) {
+      //  print('key: $k - value: $v');
+      //  });
+      var gaip = GoogleAuthenticatorImport_OtpParameters();
+      gaip.name = Uri.decodeFull(uri.path.substring(1));
+      //print("name = ${gaip.name}");
+      try {
+        gaip.secret = _encodeBase32(uri.queryParameters['secret']);
+      } catch (e) {
+        return "";
+      }
+      //print("issuer = ${uri.queryParameters['issuer']}");
+      var issuer = uri.queryParameters['issuer'];
+      if (issuer != null && issuer != "") {
+        gaip.issuer = issuer;
+      }
+      gaip.type = GoogleAuthenticatorImport_OtpType.OTP_TYPE_TOTP;
+      gaip.algorithm = GoogleAuthenticatorImport_Algorithm.ALGORITHM_SHA1;
+      gaip.digits = GoogleAuthenticatorImport_DigitCount.DIGIT_COUNT_SIX;
+      gai.otpParameters.add(gaip);
+      if (debug) print(gaip);
+    }
+    if (version >= 0) gai.version = version;
+    if (batchSize >= 0) gai.batchSize = batchSize;
+    if (batchIndex >= 0) gai.batchIndex = batchIndex;
+    if (batchId >= 0) gai.batchId = batchId;
+    final bytes = gai.writeToBuffer();
+    return "otpauth-migration://offline?data=${base64.encode(bytes)}";
+  }
+  
+  int batchSize(String value) {
+  	RegExp exp = RegExp(r"otpauth-migration\:\/\/offline\?data=(.*)$");
+    final match = exp.firstMatch(value);
+    final encodedUrl = match?.group(1);
+    if (encodedUrl != null) {
+      final encoded = Uri.decodeComponent(encodedUrl);
+      var decoded = base64.decode(encoded);
+
+      try {
+        final gai = GoogleAuthenticatorImport.fromBuffer(decoded);
+        return gai.batchSize;
+      } catch(e) {
+      	return -1;
+      }
+    } else {
+    	return -1;
+    }
+  }
+  
+  int batchIndex(String value) {
+  	RegExp exp = RegExp(r"otpauth-migration\:\/\/offline\?data=(.*)$");
+    final match = exp.firstMatch(value);
+    final encodedUrl = match?.group(1);
+    if (encodedUrl != null) {
+      final encoded = Uri.decodeComponent(encodedUrl);
+      var decoded = base64.decode(encoded);
+
+      try {
+        final gai = GoogleAuthenticatorImport.fromBuffer(decoded);
+        return gai.batchIndex;
+      } catch(e) {
+      	return -1;
+      }
+    } else {
+    	return -1;
+    }
+  }
+
+  /// decode a given otpauth-migration URI into a list of one or more otpauth URIs
+  List<String> decode(String value, {bool debug = false}) {
+    // check prefix "otpauth-migration://offline?data="
+    // extract suffix - Base64 encode
+    List<String> results = [];
+
+    RegExp exp = RegExp(r"otpauth-migration\:\/\/offline\?data=(.*)$");
+    final match = exp.firstMatch(value);
+    final encodedUrl = match?.group(1);
+    if (encodedUrl != null) {
+      final encoded = Uri.decodeComponent(encodedUrl);
+      var decoded = base64.decode(encoded);
+
+      try {
+        final gai = GoogleAuthenticatorImport.fromBuffer(decoded);
+
+        if (debug) print(gai);
+
+        //print(gai.otpParameters.length);
+        for (var param in gai.otpParameters) {
+          //print(param);
+          var base32 = _decodeBase32(param.secret);
+          //print("otpauth://totp/${param.name}?secret=${base32}");
+          final name = Uri.encodeFull(param.name);
+          final issuer = Uri.encodeComponent(param.issuer);
+          String algorithm = "";
+          switch(param.algorithm) {
+          case GoogleAuthenticatorImport_Algorithm.ALGORITHM_SHA1:
+          	algorithm = "&algorithm=SHA1";
+          	break;
+          case GoogleAuthenticatorImport_Algorithm.ALGORITHM_SHA256:
+          	algorithm = "&algorithm=SHA256";
+          	break;
+          case GoogleAuthenticatorImport_Algorithm.ALGORITHM_SHA512:
+          	algorithm = "&algorithm=SHA512";
+          	break;
+          case GoogleAuthenticatorImport_Algorithm.ALGORITHM_MD5:
+          	algorithm = "&algorithm=MD5";
+          	break;
+          default:
+          	algorithm = "";
+          	break;
+          }
+          String digits = "";
+          switch(param.digits) {
+          case GoogleAuthenticatorImport_DigitCount.DIGIT_COUNT_SIX:
+          	digits = "&digits=6";
+          	break;
+          case GoogleAuthenticatorImport_DigitCount.DIGIT_COUNT_EIGHT:
+          	digits = "&digits=8";
+          	break;
+          default:
+          	digits = "";
+          	break;
+          }
+          results.add("otpauth://totp/$name?secret=$base32&issuer=$issuer$algorithm$digits&period=30");
+        }
+
+        //print("good");
+        return results;
+      } catch (e) {
+        return results;
+      }
+    } else {
+      //print("bad");
+      return [];
+    }
+  }
+
+  List<int> _encodeBase32(String? s) {
+    int i = 0;
+    var j = 0;
+
+    if (s != null) {
+      Uint8List result = Uint8List((s.length * 5) ~/ 8);
+      while (i < s.length) {
+        // ZERO
+        var c = s[i];
+        var k = _rfc3548.indexOf(c);
+        //print(k);
+        result[j] = k << 3;
+        i++;
+
+        c = s[i];
+        k = _rfc3548.indexOf(c);
+        //print(k);
+        result[j] = result[j] | (k >> 2);
+
+        //print("---> ${result[j]}");
+        j++;
+
+        // ONE
+        result[j] = k << 6;
+        i++;
+
+        c = s[i];
+        k = _rfc3548.indexOf(c);
+        //print(k);
+        result[j] = result[j] | (k << 1);
+        i++;
+
+        c = s[i];
+        k = _rfc3548.indexOf(c);
+        //print(k);
+        result[j] = result[j] | (k >> 4);
+
+        //print("---> ${result[j]}");
+        j++;
+
+        // TWO
+        result[j] = k << 4;
+        i++;
+
+        c = s[i];
+        k = _rfc3548.indexOf(c);
+        //print(k);
+        result[j] = result[j] | (k >> 1);
+
+        //print("---> ${result[j]}");
+        j++;
+
+        // THREE
+        result[j] = k << 7;
+        i++;
+
+        c = s[i];
+        k = _rfc3548.indexOf(c);
+        //print(k);
+        result[j] = result[j] | (k << 2);
+        i++;
+
+        c = s[i];
+        k = _rfc3548.indexOf(c);
+        //print(k);
+        result[j] = result[j] | (k >> 3);
+
+        //print("---> ${result[j]}");
+        j++;
+
+        // FOUR
+        result[j] = k << 5;
+        i++;
+
+        c = s[i];
+        k = _rfc3548.indexOf(c);
+        //print(k);
+        result[j] = result[j] | k;
+        i++;
+
+        //print("---> ${result[j]}");
+        j++;
+      }
+      //print(result);
+      return result;
+    }
+    return Uint8List(0);
+  }
+
+  String _decodeBase32(List<int> s) {
+    //print(s);
+    Uint8List ulist = s as Uint8List;
+    String result = "";
+
+    var i = 0;
+    while (i < ulist.length) {
+      var q0 = ulist[i] & 0xF8;
+      q0 = q0 >> 3;
+      //print(_rfc3548[q0]);
+      result += _rfc3548[q0];
+
+      var q1 = ulist[i++] & 0x07;
+      q1 = q1 << 2;
+      var temp = ulist[i] & 0xC0;
+      temp = temp >> 6;
+      q1 = q1 + temp;
+      //print(_rfc3548[q1]);
+      result += _rfc3548[q1];
+
+      var q2 = ulist[i] & 0x3E;
+      q2 = q2 >> 1;
+      //print(_rfc3548[q2]);
+      result += _rfc3548[q2];
+
+      var q3 = ulist[i++] & 0x01;
+      q3 = q3 << 4;
+      temp = ulist[i] & 0xF0;
+      temp = temp >> 4;
+      q3 = q3 + temp;
+      //print(_rfc3548[q3]);
+      result += _rfc3548[q3];
+
+      var q4 = ulist[i++] & 0x0F;
+      q4 = q4 << 1;
+      temp = ulist[i] & 0x80;
+      temp = temp >> 7;
+      q4 = q4 + temp;
+      //print(_rfc3548[q4]);
+      result += _rfc3548[q4];
+
+      var q5 = ulist[i] & 0x7c;
+      q5 = q5 >> 2;
+      //print(_rfc3548[q5]);
+      result += _rfc3548[q5];
+
+      var q6 = ulist[i++] & 0x03;
+      q6 = q6 << 3;
+      temp = ulist[i] & 0xE0;
+      temp = temp >> 5;
+      q6 = q6 + temp;
+      //print(_rfc3548[q6]);
+      result += _rfc3548[q6];
+
+      var q7 = ulist[i++] & 0x1F;
+      //print(_rfc3548[q7]);
+      result += _rfc3548[q7];
+    }
+
+    //print(result);
+    return result;
+  }
+}