feat(#1309): open offband.app share links in Offband on Android and web
A share link can now be https://offband.app/add/channel#... or /add/contact#..., on offband.app or dev.offband.app. The fields sit after the #, which browsers never send, so a channel secret stays out of the server's logs. The router turns the link into its meshcore:// twin, so one parser still reads every form. - Android: an autoVerify App Links filter for /add/ on both hosts, and web/.well-known/assetlinks.json with the release key's SHA-256, served as JSON. A verified link opens Offband with no chooser, so the stock app, which also answers meshcore://, is out of the way. - Web: the page's own address arrives as the initial link. Once read it is cleared from the address bar, so a reload asks nothing. - A tap on such a link in a chat message opens the add confirmation, as meshcore:// links already do. - An /add/ address with broken fields shows the invalid-link message; the site's other pages are ignored. iOS Universal Links follow once the Apple team ID and a profile with Associated Domains are in place. Agent: StormyElk (session 088ce922)pull/1328/head
parent
be6b699405
commit
edfb57c7fd
@ -0,0 +1,2 @@
|
||||
export 'address_bar_stub.dart'
|
||||
if (dart.library.js_interop) 'address_bar_web.dart';
|
||||
@ -0,0 +1,2 @@
|
||||
/// Only the web client has an address bar.
|
||||
void clearShareLinkFromAddressBar() {}
|
||||
@ -0,0 +1,9 @@
|
||||
import 'package:web/web.dart' as web;
|
||||
|
||||
/// Puts the address back to the site root once a share link has been read,
|
||||
/// so a reload, a bookmark or a copied address does not carry the link, or
|
||||
/// its channel secret, any further (#1309). The history entry's state is
|
||||
/// kept: Flutter keeps its own navigation state there.
|
||||
void clearShareLinkFromAddressBar() {
|
||||
web.window.history.replaceState(web.window.history.state, '', '/');
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
[
|
||||
{
|
||||
"relation": ["delegate_permission/common.handle_all_urls"],
|
||||
"target": {
|
||||
"namespace": "android_app",
|
||||
"package_name": "app.offband.meshcore",
|
||||
"sha256_cert_fingerprints": [
|
||||
"E7:DA:8C:D5:BF:22:AC:3E:DA:7C:B9:54:B8:B1:20:A1:8B:6C:43:82:D1:B6:E6:FD:D2:04:DD:ED:DD:AF:54:88"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
Loading…
Reference in new issue