android link call

This commit is contained in:
DASHU
2025-11-25 21:57:53 +08:00
parent 228a30e74c
commit e7f79c0f06
17 changed files with 308 additions and 23 deletions

View File

@@ -29,7 +29,7 @@ if (flutterVersionName == null) {
android { android {
namespace = "com.github.haorendashu.nowser" namespace = "com.github.haorendashu.nowser"
compileSdk = flutter.compileSdkVersion compileSdk = 36
ndkVersion = "28.0.13004108" ndkVersion = "28.0.13004108"
// compileOptions { // compileOptions {
@@ -57,7 +57,7 @@ android {
// minSdk = flutter.minSdkVersion // minSdk = flutter.minSdkVersion
// targetSdk = flutter.targetSdkVersion // targetSdk = flutter.targetSdkVersion
minSdkVersion flutter.minSdkVersion minSdkVersion flutter.minSdkVersion
targetSdk = 33 targetSdk = 36
versionCode = flutterVersionCode.toInteger() versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName versionName = flutterVersionName
} }

View File

@@ -22,6 +22,8 @@
android:name="io.flutter.embedding.android.NormalTheme" android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" android:resource="@style/NormalTheme"
/> />
<meta-data android:name="flutter_deeplinking_enabled" android:value="false" />
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
@@ -32,12 +34,6 @@
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<!-- <category android:name="android.intent.category.BROWSABLE" /> -->
<data android:scheme="nostrsigner" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<!-- <category android:name="android.intent.category.DEFAULT"/> -->
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="nostrsigner" /> <data android:scheme="nostrsigner" />
</intent-filter> </intent-filter>

View File

@@ -1,3 +1,15 @@
buildscript {
ext.kotlin_version = '2.1.0'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.13.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects { allprojects {
repositories { repositories {
google() google()
@@ -13,8 +25,8 @@ subprojects {
if (namespace == null) { if (namespace == null) {
namespace project.group namespace project.group
} }
compileSdkVersion 34 compileSdkVersion 36
buildToolsVersion "34.0.0" buildToolsVersion "36.0.0"
} }
} }
} }

View File

@@ -5,3 +5,6 @@ android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false android.nonTransitiveRClass=false
android.nonFinalResIds=false android.nonFinalResIds=false
kotlin.jvm.target.validation.mode = IGNORE kotlin.jvm.target.validation.mode = IGNORE
org.gradle.parallel=true
org.gradle.configureondemand=true
android.enableR8=true

View File

@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View File

@@ -18,7 +18,7 @@ pluginManagement {
plugins { plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.7.0" apply false id "com.android.application" version "8.9.1" apply false
id "org.jetbrains.kotlin.android" version "2.0.20" apply false id "org.jetbrains.kotlin.android" version "2.0.20" apply false
} }

View File

@@ -4,4 +4,6 @@ class AppType {
static const REMOTE = 2; static const REMOTE = 2;
static const ANDROID_APP = 3; static const ANDROID_APP = 3;
static const URI = 4;
} }

View File

@@ -15,6 +15,7 @@ import 'package:nostr_sdk/utils/platform_util.dart';
import 'package:nostr_sdk/utils/string_util.dart'; import 'package:nostr_sdk/utils/string_util.dart';
import 'package:nowser/data/db.dart'; import 'package:nowser/data/db.dart';
import 'package:nowser/provider/android_signer_mixin.dart'; import 'package:nowser/provider/android_signer_mixin.dart';
import 'package:nowser/provider/app_links_service.dart';
import 'package:nowser/provider/app_provider.dart'; import 'package:nowser/provider/app_provider.dart';
import 'package:nowser/provider/bookmark_provider.dart'; import 'package:nowser/provider/bookmark_provider.dart';
import 'package:nowser/provider/build_in_relay_provider.dart'; import 'package:nowser/provider/build_in_relay_provider.dart';
@@ -85,6 +86,8 @@ late UserinfoProvider userinfoProvider;
late RelayProvider relayProvider; late RelayProvider relayProvider;
late AppLinksService appLinksService;
Nostr? nostr; Nostr? nostr;
Future<void> main() async { Future<void> main() async {
@@ -160,6 +163,7 @@ Future<void> doInit() async {
webProvider = WebProvider(); webProvider = WebProvider();
downloadProvider = DownloadProvider(); downloadProvider = DownloadProvider();
await downloadProvider.init(); await downloadProvider.init();
appLinksService = AppLinksService();
} }
class MyApp extends StatefulWidget { class MyApp extends StatefulWidget {

View File

@@ -0,0 +1,133 @@
import 'dart:convert';
import 'dart:developer';
import 'package:app_links/app_links.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:nostr_sdk/event.dart';
import 'package:nostr_sdk/utils/string_util.dart';
import 'package:nowser/const/app_type.dart';
import 'package:nowser/const/auth_type.dart';
import 'package:nowser/provider/permission_check_mixin.dart';
import 'package:url_launcher/url_launcher.dart';
class AppLinksService with PermissionCheckMixin {
static const UNKNOWN_CODE = "unknown";
var appLinks = AppLinks();
BuildContext? context;
void updateContext(BuildContext _context) {
context = _context;
}
void listen() {
appLinks.uriLinkStream.listen(handleUri);
}
void handleUri(Uri uri) {
var callbackUrl = uri.queryParameters["callbackUrl"];
var type = uri.queryParameters["type"];
// var compressionType = uri.queryParameters["compressionType"]; // ignore compressionType now
// var returnType = uri.queryParameters["returnType"]; // ignore returnType now
// intent call also will call this method, if there isn't a type param skip the next handle and it may be a intent call.
if (StringUtil.isBlank(type) || !uri.isScheme('nostrsigner')) {
return;
}
log("AppLinksService $uri");
var appType = AppType.URI;
callbackUrl ??= UNKNOWN_CODE;
var code = callbackUrl;
int? eventKind;
String? authDetail;
String? thirdPartyPubkey;
int authType = AuthType.GET_PUBLIC_KEY;
dynamic eventObj;
if (type == "sign_event") {
authType = AuthType.SIGN_EVENT;
authDetail = uri.host;
eventObj = jsonDecode(authDetail);
eventKind = eventObj["kind"];
} else if (type == "get_relays") {
authType = AuthType.GET_RELAYS;
} else if (type == "get_public_key") {
authType = AuthType.GET_PUBLIC_KEY;
} else if (type == "nip04_encrypt") {
authType = AuthType.NIP04_ENCRYPT;
thirdPartyPubkey = uri.queryParameters["pubkey"];
authDetail = uri.host;
} else if (type == "nip04_decrypt") {
authType = AuthType.NIP04_DECRYPT;
thirdPartyPubkey = uri.queryParameters["pubkey"];
authDetail = uri.host;
} else if (type == "nip44_encrypt") {
authType = AuthType.NIP44_ENCRYPT;
thirdPartyPubkey = uri.queryParameters["pubkey"];
authDetail = uri.host;
} else if (type == "nip44_decrypt") {
authType = AuthType.NIP44_DECRYPT;
thirdPartyPubkey = uri.queryParameters["pubkey"];
authDetail = uri.host;
}
checkPermission(context!, appType, code, authType,
eventKind: eventKind, authDetail: authDetail, (app, rejectType) {
// TODO How to return a reject message to app ?
return;
}, (app, signer) async {
String? response;
if (type == "sign_event") {
var tags = eventObj["tags"];
Event? event = Event(
app.pubkey!, eventObj["kind"], tags ?? [], eventObj["content"],
createdAt: eventObj["created_at"]);
log(jsonEncode(event.toJson()));
event = await signer.signEvent(event);
if (event == null) {
log("sign event fail");
return;
}
response = event.sig;
} else if (type == "get_relays") {
response = '{}';
} else if (type == "get_public_key") {
response = await signer.getPublicKey();
} else if (type == "nip04_encrypt") {
response = await signer.encrypt(thirdPartyPubkey, authDetail);
} else if (type == "nip04_decrypt") {
response = await signer.decrypt(thirdPartyPubkey, authDetail);
} else if (type == "nip44_encrypt") {
response = await signer.nip44Encrypt(thirdPartyPubkey, authDetail);
} else if (type == "nip44_decrypt") {
response = await signer.nip44Decrypt(thirdPartyPubkey, authDetail);
}
sendResponse(callbackUrl!, response);
});
}
Future<void> sendResponse(String callbackUrl, String? response) async {
if (StringUtil.isBlank(response)) {
return;
}
if (callbackUrl == UNKNOWN_CODE) {
Clipboard.setData(ClipboardData(text: response!));
return;
}
var url = callbackUrl + response!;
var uri = Uri.parse(url);
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
}
}
}

View File

@@ -66,6 +66,8 @@ class _IndexRouter extends CustState<IndexRouter>
webProvider.checkAndOpenUrl(shortcutType); webProvider.checkAndOpenUrl(shortcutType);
}); });
} }
appLinksService.listen();
} }
@override @override
@@ -96,6 +98,7 @@ class _IndexRouter extends CustState<IndexRouter>
// }); // });
// } // }
remoteSigningProvider.updateContext(context); remoteSigningProvider.updateContext(context);
appLinksService.updateContext(context);
webProvider.checkBlank(); webProvider.checkBlank();
var _webProvider = Provider.of<WebProvider>(context); var _webProvider = Provider.of<WebProvider>(context);

View File

@@ -9,10 +9,12 @@
#include <flutter_libserialport/flutter_libserialport_plugin.h> #include <flutter_libserialport/flutter_libserialport_plugin.h>
#include <flutter_nesigner_sdk/flutter_nesigner_sdk_plugin.h> #include <flutter_nesigner_sdk/flutter_nesigner_sdk_plugin.h>
#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h> #include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
#include <gtk/gtk_plugin.h>
#include <isar_flutter_libs/isar_flutter_libs_plugin.h> #include <isar_flutter_libs/isar_flutter_libs_plugin.h>
#include <nesigner_adapter/nesigner_adapter_plugin.h> #include <nesigner_adapter/nesigner_adapter_plugin.h>
#include <open_file_linux/open_file_linux_plugin.h> #include <open_file_linux/open_file_linux_plugin.h>
#include <screen_retriever_linux/screen_retriever_linux_plugin.h> #include <screen_retriever_linux/screen_retriever_linux_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
#include <window_manager/window_manager_plugin.h> #include <window_manager/window_manager_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) { void fl_register_plugins(FlPluginRegistry* registry) {
@@ -25,6 +27,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar = g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin"); fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");
flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar); flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);
g_autoptr(FlPluginRegistrar) gtk_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "GtkPlugin");
gtk_plugin_register_with_registrar(gtk_registrar);
g_autoptr(FlPluginRegistrar) isar_flutter_libs_registrar = g_autoptr(FlPluginRegistrar) isar_flutter_libs_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "IsarFlutterLibsPlugin"); fl_plugin_registry_get_registrar_for_plugin(registry, "IsarFlutterLibsPlugin");
isar_flutter_libs_plugin_register_with_registrar(isar_flutter_libs_registrar); isar_flutter_libs_plugin_register_with_registrar(isar_flutter_libs_registrar);
@@ -37,6 +42,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) screen_retriever_linux_registrar = g_autoptr(FlPluginRegistrar) screen_retriever_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverLinuxPlugin"); fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverLinuxPlugin");
screen_retriever_linux_plugin_register_with_registrar(screen_retriever_linux_registrar); screen_retriever_linux_plugin_register_with_registrar(screen_retriever_linux_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
g_autoptr(FlPluginRegistrar) window_manager_registrar = g_autoptr(FlPluginRegistrar) window_manager_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "WindowManagerPlugin"); fl_plugin_registry_get_registrar_for_plugin(registry, "WindowManagerPlugin");
window_manager_plugin_register_with_registrar(window_manager_registrar); window_manager_plugin_register_with_registrar(window_manager_registrar);

View File

@@ -6,10 +6,12 @@ list(APPEND FLUTTER_PLUGIN_LIST
flutter_libserialport flutter_libserialport
flutter_nesigner_sdk flutter_nesigner_sdk
flutter_secure_storage_linux flutter_secure_storage_linux
gtk
isar_flutter_libs isar_flutter_libs
nesigner_adapter nesigner_adapter
open_file_linux open_file_linux
screen_retriever_linux screen_retriever_linux
url_launcher_linux
window_manager window_manager
) )

View File

@@ -5,6 +5,7 @@
import FlutterMacOS import FlutterMacOS
import Foundation import Foundation
import app_links
import cryptography_flutter import cryptography_flutter
import device_info_plus import device_info_plus
import flutter_inappwebview_macos import flutter_inappwebview_macos
@@ -18,9 +19,11 @@ import path_provider_foundation
import screen_retriever_macos import screen_retriever_macos
import shared_preferences_foundation import shared_preferences_foundation
import sqflite_darwin import sqflite_darwin
import url_launcher_macos
import window_manager import window_manager
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AppLinksMacosPlugin.register(with: registry.registrar(forPlugin: "AppLinksMacosPlugin"))
CryptographyFlutterPlugin.register(with: registry.registrar(forPlugin: "CryptographyFlutterPlugin")) CryptographyFlutterPlugin.register(with: registry.registrar(forPlugin: "CryptographyFlutterPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin")) InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
@@ -34,5 +37,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ScreenRetrieverMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverMacosPlugin")) ScreenRetrieverMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverMacosPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin")) WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin"))
} }

View File

@@ -9,6 +9,38 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.5.2" version: "0.5.2"
app_links:
dependency: "direct main"
description:
name: app_links
sha256: "85ed8fc1d25a76475914fff28cc994653bd900bc2c26e4b57a49e097febb54ba"
url: "https://pub.dev"
source: hosted
version: "6.4.0"
app_links_linux:
dependency: transitive
description:
name: app_links_linux
sha256: f5f7173a78609f3dfd4c2ff2c95bd559ab43c80a87dc6a095921d96c05688c81
url: "https://pub.dev"
source: hosted
version: "1.0.3"
app_links_platform_interface:
dependency: transitive
description:
name: app_links_platform_interface
sha256: "05f5379577c513b534a29ddea68176a4d4802c46180ee8e2e966257158772a3f"
url: "https://pub.dev"
source: hosted
version: "2.0.2"
app_links_web:
dependency: transitive
description:
name: app_links_web
sha256: af060ed76183f9e2b87510a9480e56a5352b6c249778d07bd2c95fc35632a555
url: "https://pub.dev"
source: hosted
version: "1.0.4"
archive: archive:
dependency: transitive dependency: transitive
description: description:
@@ -502,6 +534,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.2.1" version: "6.2.1"
gtk:
dependency: transitive
description:
name: gtk
sha256: e8ce9ca4b1df106e4d72dad201d345ea1a036cc12c360f1a7d5a758f78ffa42c
url: "https://pub.dev"
source: hosted
version: "2.1.0"
hex: hex:
dependency: transitive dependency: transitive
description: description:
@@ -943,11 +983,12 @@ packages:
receive_intent: receive_intent:
dependency: "direct main" dependency: "direct main"
description: description:
name: receive_intent path: "."
sha256: "59afac5bcac8a0c6fc5067d03b4daeb260399cc8485256d6fe40a26640512cda" ref: master
url: "https://pub.dev" resolved-ref: "471e074120ce7bdffe39e351af0c8d13d1bcd64c"
source: hosted url: "https://github.com/daadu/receive_intent"
version: "0.2.5" source: git
version: "0.2.7"
relay_isar_db: relay_isar_db:
dependency: transitive dependency: transitive
description: description:
@@ -1231,6 +1272,70 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.2" version: "2.2.2"
url_launcher:
dependency: "direct main"
description:
name: url_launcher
sha256: b1c9e98774adf8820c96fbc7ae3601231d324a7d5ebd8babe27b6dfac91357ba
url: "https://pub.dev"
source: hosted
version: "6.2.1"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
sha256: "767344bf3063897b5cf0db830e94f904528e6dd50a6dfaf839f0abf509009611"
url: "https://pub.dev"
source: hosted
version: "6.3.28"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
sha256: cfde38aa257dae62ffe79c87fab20165dfdf6988c1d31b58ebf59b9106062aad
url: "https://pub.dev"
source: hosted
version: "6.3.6"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
sha256: d5e14138b3bc193a0f63c10a53c94b91d399df0512b1f29b94a043db7482384a
url: "https://pub.dev"
source: hosted
version: "3.2.2"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
sha256: "368adf46f71ad3c21b8f06614adb38346f193f3a59ba8fe9a2fd74133070ba18"
url: "https://pub.dev"
source: hosted
version: "3.2.5"
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: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2"
url: "https://pub.dev"
source: hosted
version: "2.4.1"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
sha256: "712c70ab1b99744ff066053cbe3e80c73332b38d46e5e945c98689b2e66fc15f"
url: "https://pub.dev"
source: hosted
version: "3.1.5"
usb_serial: usb_serial:
dependency: transitive dependency: transitive
description: description:
@@ -1336,5 +1441,5 @@ packages:
source: hosted source: hosted
version: "3.1.2" version: "3.1.2"
sdks: sdks:
dart: ">=3.8.0 <4.0.0" dart: ">=3.9.0 <4.0.0"
flutter: ">=3.29.0" flutter: ">=3.35.0"

View File

@@ -42,7 +42,10 @@ dependencies:
nesigner_adapter: nesigner_adapter:
path: packages/nesigner_adapter path: packages/nesigner_adapter
receive_intent: ^0.2.5 receive_intent:
git:
url: https://github.com/daadu/receive_intent
ref: master
provider: ^6.1.2 provider: ^6.1.2
flutter_inappwebview: ^6.1.5 flutter_inappwebview: ^6.1.5
bot_toast: ^4.1.3 bot_toast: ^4.1.3
@@ -67,6 +70,8 @@ dependencies:
path_provider: ^2.1.5 path_provider: ^2.1.5
background_downloader: ^9.2.1 background_downloader: ^9.2.1
open_file: ^3.5.10 open_file: ^3.5.10
app_links: 6.4.0
url_launcher: 6.2.1
dev_dependencies: dev_dependencies:
flutter_launcher_icons: ^0.13.1 flutter_launcher_icons: ^0.13.1

View File

@@ -6,6 +6,7 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <app_links/app_links_plugin_c_api.h>
#include <flutter_inappwebview_windows/flutter_inappwebview_windows_plugin_c_api.h> #include <flutter_inappwebview_windows/flutter_inappwebview_windows_plugin_c_api.h>
#include <flutter_libserialport/flutter_libserialport_plugin.h> #include <flutter_libserialport/flutter_libserialport_plugin.h>
#include <flutter_nesigner_sdk/flutter_nesigner_sdk_plugin_c_api.h> #include <flutter_nesigner_sdk/flutter_nesigner_sdk_plugin_c_api.h>
@@ -13,9 +14,12 @@
#include <isar_flutter_libs/isar_flutter_libs_plugin.h> #include <isar_flutter_libs/isar_flutter_libs_plugin.h>
#include <nesigner_adapter/nesigner_adapter_plugin_c_api.h> #include <nesigner_adapter/nesigner_adapter_plugin_c_api.h>
#include <screen_retriever_windows/screen_retriever_windows_plugin_c_api.h> #include <screen_retriever_windows/screen_retriever_windows_plugin_c_api.h>
#include <url_launcher_windows/url_launcher_windows.h>
#include <window_manager/window_manager_plugin.h> #include <window_manager/window_manager_plugin.h>
void RegisterPlugins(flutter::PluginRegistry* registry) { void RegisterPlugins(flutter::PluginRegistry* registry) {
AppLinksPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("AppLinksPluginCApi"));
FlutterInappwebviewWindowsPluginCApiRegisterWithRegistrar( FlutterInappwebviewWindowsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterInappwebviewWindowsPluginCApi")); registry->GetRegistrarForPlugin("FlutterInappwebviewWindowsPluginCApi"));
FlutterLibserialportPluginRegisterWithRegistrar( FlutterLibserialportPluginRegisterWithRegistrar(
@@ -30,6 +34,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("NesignerAdapterPluginCApi")); registry->GetRegistrarForPlugin("NesignerAdapterPluginCApi"));
ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar( ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("ScreenRetrieverWindowsPluginCApi")); registry->GetRegistrarForPlugin("ScreenRetrieverWindowsPluginCApi"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
WindowManagerPluginRegisterWithRegistrar( WindowManagerPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("WindowManagerPlugin")); registry->GetRegistrarForPlugin("WindowManagerPlugin"));
} }

View File

@@ -3,6 +3,7 @@
# #
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
app_links
flutter_inappwebview_windows flutter_inappwebview_windows
flutter_libserialport flutter_libserialport
flutter_nesigner_sdk flutter_nesigner_sdk
@@ -10,6 +11,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
isar_flutter_libs isar_flutter_libs
nesigner_adapter nesigner_adapter
screen_retriever_windows screen_retriever_windows
url_launcher_windows
window_manager window_manager
) )