diff --git a/android/app/src/main/kotlin/yana/nostr/MainActivity.kt b/android/app/src/main/kotlin/yana/nostr/MainActivity.kt index 1dcae709..b31e2c8f 100644 --- a/android/app/src/main/kotlin/yana/nostr/MainActivity.kt +++ b/android/app/src/main/kotlin/yana/nostr/MainActivity.kt @@ -1,42 +1,36 @@ package yana.nostr - import io.flutter.embedding.android.FlutterActivity -import io.flutter.embedding.android.FlutterFragmentActivity -import fr.acinq.secp256k1.Secp256k1 -import androidx.annotation.NonNull -import io.flutter.embedding.engine.FlutterEngine -import io.flutter.plugin.common.MethodCall -import io.flutter.plugin.common.MethodChannel - -// class MainActivity: FlutterActivity() { -class MainActivity : FlutterFragmentActivity() { - private val CHANNEL = "flutter.native/helper" +//import io.flutter.embedding.android.FlutterFragmentActivity - private val secp256k1 = Secp256k1.get() +class MainActivity: FlutterActivity() { +//class MainActivity : FlutterFragmentActivity() { +// private val CHANNEL = "flutter.native/helper" - @ExperimentalStdlibApi - override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { - super.configureFlutterEngine(flutterEngine); - MethodChannel( - flutterEngine.dartExecutor.binaryMessenger, - CHANNEL - ).setMethodCallHandler { call, result -> - when { - call.method.equals("verifySignature") -> { - verifySignature(call, result) - } - } - } - } - fun verifySignature( - call: MethodCall, result: MethodChannel.Result - ) { - var sig = call.argument("signature"); - var hash = call.argument("hash"); - var pubKey = call.argument("pubKey"); +// private val secp256k1 = Secp256k1.get() - result.success(secp256k1.verifySchnorr(sig!!, hash!!, pubKey!!)); - } +// @ExperimentalStdlibApi +// override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { +// super.configureFlutterEngine(flutterEngine); +// MethodChannel( +// flutterEngine.dartExecutor.binaryMessenger, +// CHANNEL +// ).setMethodCallHandler { call, result -> +// when { +// call.method.equals("verifySignature") -> { +// verifySignature(call, result) +// } +// } +// } +// } +// fun verifySignature( +// call: MethodCall, result: MethodChannel.Result +// ) { +// var sig = call.argument("signature"); +// var hash = call.argument("hash"); +// var pubKey = call.argument("pubKey"); +// +// result.success(secp256k1.verifySchnorr(sig!!, hash!!, pubKey!!)); +// } // override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { // super.onActivityResult(requestCode, resultCode, data) diff --git a/lib/main.dart b/lib/main.dart index e3cf67fd..c120efdc 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -37,7 +37,6 @@ import 'package:provider/provider.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:sizer/sizer.dart'; import 'package:window_manager/window_manager.dart'; -import 'package:yana/hybrid_event_verifier.dart'; import 'package:yana/nostr/nip07/extension_event_signer.dart'; import 'package:yana/provider/badge_definition_provider.dart'; import 'package:yana/provider/community_info_provider.dart'; @@ -176,7 +175,7 @@ late PackageInfo packageInfo; FlutterBackgroundService? backgroundService; -late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin; +// late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin; int c = 0; @@ -252,7 +251,7 @@ Future initProvidersAndStuff() async { cacheManager = dbCacheManager; dbCacheManager.eventFilter = filterProvider; relayManager.cacheManager = cacheManager; - relayManager.eventVerifier = HybridEventVerifier(); + // relayManager.eventVerifier = HybridEventVerifier(); if (myInboxRelaySet==null) { await relayManager.connect(); @@ -427,7 +426,7 @@ Future main() async { cacheManager = relayManager.cacheManager; print(e); } - relayManager.eventVerifier = HybridEventVerifier(); + // relayManager.eventVerifier = HybridEventVerifier(); if (!PlatformUtil.isWeb() && PlatformUtil.isPC()) { await windowManager.ensureInitialized(); @@ -557,7 +556,7 @@ void initBackgroundService(bool startOnBoot) async { importance: Importance.low, // importance must be at low or higher level ); - flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); + var flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); // if (startOnBoot) { backgroundService = FlutterBackgroundService(); await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation()?.createNotificationChannel(channel); diff --git a/pubspec.lock b/pubspec.lock index e0363d3c..c7f95a2b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -301,10 +301,10 @@ packages: dependency: "direct main" description: name: dart_ndk - sha256: b615de1684fbd058aa93cd7136ea0595197e97dcea95a69d5e5128f3a1572284 + sha256: "50a75d6648ae8ddf113d99e9c9dda104e8208096fe36f7f7f543b274e89a3e1b" url: "https://pub.dev" source: hosted - version: "0.1.0-dev5" + version: "0.1.0-dev6" dart_style: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index bb08683a..63cdcdb3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -120,8 +120,8 @@ dependencies: # git: # url: https://github.com/relaystr/dart_ndk.git # ref: master - dart_ndk: 0.1.0-dev5 -# path: ../dart_ndk + dart_ndk: 0.1.0-dev6 + #path: ../dart_ndk dev_dependencies: flutter_launcher_icons: ^0.13.1