Fix macos performance issue

Support custom global-ua

Update core

Optimize some details
This commit is contained in:
chen08209
2026-05-27 15:16:51 +08:00
parent 5179d55dfb
commit 7e7f1f89f3
192 changed files with 4904 additions and 2910 deletions
+4 -11
View File
@@ -29,23 +29,16 @@ android {
namespace 'com.flutter_rust_bridge.rust_api'
}
// Bumping the plugin compileSdkVersion requires all clients of this plugin
// to bump the version in their app.
compileSdkVersion 33
// Use the NDK version
// declared in /android/app/build.gradle file of the Flutter project.
// Replace it with a version number if this plugin requires a specfic NDK version.
// (e.g. ndkVersion "23.1.7779620")
compileSdkVersion 36
ndkVersion android.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
defaultConfig {
minSdkVersion 19
minSdkVersion 23
}
}
+4 -4
View File
@@ -24,16 +24,16 @@ android {
if (project.android.hasProperty("namespace")) {
namespace 'com.follow.clash.setup'
}
compileSdkVersion 33
compileSdkVersion 36
ndkVersion android.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
defaultConfig {
minSdkVersion 19
minSdkVersion 23
}
}
@@ -17,7 +17,8 @@ class RustBuilder {
String get _helperPath => p.join(rootDir, config.helperDir);
String get _outputPath => p.join(rootDir, config.outputDir);
Future<String> build(Target target, String token, {bool release = true}) async {
Future<String> build(Target target, String token,
{bool release = true}) async {
final args = ['build'];
if (release) {
args.addAll(['--release', '--features', 'windows-service']);
@@ -32,7 +33,9 @@ class RustBuilder {
workingDirectory: _helperPath, environment: env);
final srcPath = p.join(
_helperPath, 'target', release ? 'release' : 'debug',
_helperPath,
'target',
release ? 'release' : 'debug',
'helper${target.executableExtension}',
);
final destDir = p.join(_outputPath, target.goos);
@@ -109,7 +109,6 @@ void copyFile(String source, String destination) {
_log.fine('Copied $source -> $destination');
}
String joinPath(String part1,
[String? part2, String? part3, String? part4]) {
String joinPath(String part1, [String? part2, String? part3, String? part4]) {
return p.join(part1, part2, part3, part4);
}
@@ -44,8 +44,7 @@ void main() {
group('copyFile', () {
test('copies file to destination', () {
final src =
File('${Directory.systemTemp.path}/build_tool_test_src.txt');
final src = File('${Directory.systemTemp.path}/build_tool_test_src.txt');
final dest =
'${Directory.systemTemp.path}/build_tool_test_dest/sub/file.txt';
src.writeAsStringSync('content');
@@ -3,6 +3,8 @@ setlocal
setlocal ENABLEDELAYEDEXPANSION
echo warning: [setup] Plugin triggered
SET BASEDIR=%~dp0
SET PROJECT_DIR=%CD%
+2
View File
@@ -2,6 +2,8 @@
set -e
echo "warning: [setup] Plugin triggered"
BASEDIR=$(cd "$(dirname "$0")" && pwd)
PROJECT_DIR="${PROJECT_DIR:-$(pwd)}"
+6 -6
View File
@@ -9,7 +9,6 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:8.12.2'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.2.10'
}
}
@@ -21,7 +20,6 @@ allprojects {
}
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
namespace 'com.example.wifi_ssid'
@@ -32,15 +30,17 @@ android {
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
defaultConfig {
minSdk 21
}
}
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.15.0'
}
-20
View File
@@ -1,20 +0,0 @@
Pod::Spec.new do |s|
s.name = 'wifi_ssid'
s.version = '0.0.1'
s.summary = 'A Flutter plugin to retrieve the current WiFi SSID.'
s.description = <<-DESC
A Flutter plugin to retrieve the current WiFi SSID.
DESC
s.homepage = 'http://example.com'
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => 'email@example.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'FlutterMacOS'
s.platform = :osx, '10.11'
s.frameworks = 'CoreWLAN', 'CoreLocation'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.swift_version = '5.0'
end
@@ -0,0 +1,30 @@
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "wifi_ssid",
platforms: [
.macOS(.v11)
],
products: [
.library(name: "wifi-ssid", targets: ["wifi_ssid"])
],
dependencies: [
.package(name: "FlutterFramework", path: "../FlutterFramework")
],
targets: [
.target(
name: "wifi_ssid",
dependencies: [
.product(name: "FlutterFramework", package: "FlutterFramework")
],
path: "Sources/wifi_ssid",
linkerSettings: [
.linkedFramework("CoreWLAN"),
.linkedFramework("CoreLocation")
]
)
]
)
@@ -1,7 +1,7 @@
import Cocoa
import FlutterMacOS
import CoreWLAN
import CoreLocation
import CoreWLAN
import FlutterMacOS
// Permission values must match WifiSsidPermission enum index in Dart:
// 0 = granted, 1 = denied, 2 = permanentlyDenied
+1 -1
View File
@@ -1,2 +1,2 @@
export 'window_ext_listener.dart';
export 'window_ext_manager.dart';
export 'window_ext_manager.dart';
@@ -1,23 +0,0 @@
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint window_ext.podspec` to validate before publishing.
#
Pod::Spec.new do |s|
s.name = 'window_ext'
s.version = '0.0.1'
s.summary = 'A new Flutter plugin project.'
s.description = <<-DESC
A new Flutter plugin project.
DESC
s.homepage = 'http://example.com'
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => 'email@example.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'FlutterMacOS'
s.platform = :osx, '10.11'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.swift_version = '5.0'
end
@@ -0,0 +1,26 @@
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "window_ext",
platforms: [
.macOS("10.13")
],
products: [
.library(name: "window-ext", targets: ["window_ext"])
],
dependencies: [
.package(name: "FlutterFramework", path: "../FlutterFramework")
],
targets: [
.target(
name: "window_ext",
dependencies: [
.product(name: "FlutterFramework", package: "FlutterFramework")
],
path: "Sources/window_ext"
)
]
)
@@ -2,24 +2,24 @@ import Cocoa
import FlutterMacOS
public class WindowExtPlugin: NSObject, FlutterPlugin {
public static var instance:WindowExtPlugin?
public static var instance: WindowExtPlugin?
public static func register(with registrar: FlutterPluginRegistrar) {
let channel = FlutterMethodChannel(name: "window_ext", binaryMessenger: registrar.messenger)
instance = WindowExtPlugin(registrar, channel)
registrar.addMethodCallDelegate(instance!, channel: channel)
}
private var registrar: FlutterPluginRegistrar!
private var channel: FlutterMethodChannel!
public init(_ registrar: FlutterPluginRegistrar, _ channel: FlutterMethodChannel) {
super.init()
self.registrar = registrar
self.channel = channel
}
public func handleShouldTerminate(){
public func handleShouldTerminate() {
channel.invokeMethod("shouldTerminate", arguments: nil)
}
}