On Android, the Loop through Polar's BLE SDK 8.3.0 (from JitPack, asked for Polar's group alone, its files pinned by SHA-256 in Gradle's verification metadata): LoopBridge.kt over app.halkyon.train/loop, the first-time use's figures mapped and checked in LoopSetup.kt, tested on the JVM. PolarLoop per person remembers the band in loop.json, connects while the app is open, sets its clock at each connection, keeps what it tells (battery, charging, firmware), offers a changed profile and sends it only when asked (D35: first-time use writes a new user identifier each time), and lets the band go by a factory reset after asking. The setup sheet finds Loops nearest first and asks only for what the profile lacks; Polar's defaults (60, 220 less the age, a VO2max from Polar's fitness tables) go to the band alone. Polar's SDK is not free software (D36, correcting D32): the app's AGPL gains a section 7 permission for linking it, LICENSE.md names it, and its licence and bundled notices join the licence list on Android. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
43 lines
1.7 KiB
Dart
43 lines
1.7 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:halkyon_app/halkyon_app.dart';
|
|
import 'package:halkyon_train_flutter/src/app/licences.dart';
|
|
import 'package:halkyon_train_flutter/src/app/train_app.dart';
|
|
import 'package:halkyon_train_flutter/src/app/train_dependencies.dart';
|
|
import 'package:halkyon_ui/halkyon_ui.dart';
|
|
import 'package:material_ui/material_ui.dart';
|
|
import 'package:path/path.dart' as p;
|
|
import 'package:serverpod_flutter/serverpod_flutter.dart';
|
|
|
|
Future<void> main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
// Noto Sans' notice (halkyon_ui), the flags' and Unicode CLDR's
|
|
// (halkyon_app), Lucide's for the app's icon, and Polar's where its SDK
|
|
// is linked, on Android.
|
|
registerFontLicenses();
|
|
registerHalkyonAppLicenses();
|
|
registerLucideLicense();
|
|
if (Platform.isAndroid) {
|
|
registerPolarLicense();
|
|
}
|
|
// The instance the build names (`--dart-define=SERVER_URL=…`, or
|
|
// `assets/config.json`): the first offered at the first start.
|
|
final builtIn = Instance.parse(await getServerUrl())!;
|
|
final device = await TrainDevice.create(builtIn: builtIn);
|
|
final instances = InstanceChoice(
|
|
FileInstanceStore(File(p.join(device.support, 'instances.json'))),
|
|
builtIn: builtIn,
|
|
forget: device.storage.forget,
|
|
sharesStorage: device.storage.sharesWith,
|
|
);
|
|
await instances.load(usedBefore: device.storage.usedBefore());
|
|
runApp(
|
|
TrainApp(
|
|
choice: instances,
|
|
// Only an instance of Halkyon Train: one of another Halkyon app's
|
|
// answers too, but holds nothing of this app's.
|
|
checker: ServerpodInstanceChecker(app: 'train'),
|
|
open: (instance) => TrainDependencies.create(instance, device),
|
|
),
|
|
);
|
|
}
|