fix: read back sent copies after the sec 5.6 upstream fix, pinned at 2d65d66
This commit is contained in:
parent
52947e153d
commit
d6f4c434fa
36 changed files with 4223 additions and 3118 deletions
|
|
@ -1,7 +1,3 @@
|
|||
import "package:smol_mail/smol/proto.dart";
|
||||
import "package:smol_mail/smol/errors.dart";
|
||||
import "package:smol_mail/smol/store.dart";
|
||||
|
||||
// Deploy-time configuration, empty by default (mirrors gsmol's config.js).
|
||||
// A release may bake in a server key with:
|
||||
// flutter build apk --dart-define=SMOL_PRESET_SERVER=example.org \
|
||||
|
|
@ -12,15 +8,15 @@ import "package:smol_mail/smol/store.dart";
|
|||
// This only seeds the first run — once written it is an ordinary pin,
|
||||
// removable in settings like any other, and never overwrites a host the user
|
||||
// (or a previous install) already pinned.
|
||||
|
||||
import "package:smol_mail/smol/store.dart";
|
||||
|
||||
const _presetHost = String.fromEnvironment("SMOL_PRESET_SERVER");
|
||||
const _presetKey = String.fromEnvironment("SMOL_PRESET_SERVER_KEY");
|
||||
|
||||
void applyPresetServer(SmolStore store) {
|
||||
if (_presetHost.isEmpty || _presetKey.isEmpty) return;
|
||||
if (store.serverPin(_presetHost) != null) return;
|
||||
try {
|
||||
store.pinServer(_presetHost, b32decode(_presetKey));
|
||||
} on SmolError {
|
||||
// malformed preset: leave unpinned rather than block boot
|
||||
}
|
||||
// A malformed preset leaves the host unpinned rather than blocking boot.
|
||||
store.pinServer(_presetHost, _presetKey);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue