Skip to content

Commit a83c244

Browse files
committed
Added ios support
1 parent 1b7f095 commit a83c244

File tree

239 files changed

+5226
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

239 files changed

+5226
-4
lines changed

ios/Assets/.gitkeep

Whitespace-only changes.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2020 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import Flutter
18+
import UIKit
19+
20+
public class SwiftWebcryptoPlugin: NSObject, FlutterPlugin {
21+
public static func register(with registrar: FlutterPluginRegistrar) {
22+
let channel = FlutterMethodChannel(name: "webcrypto", binaryMessenger: registrar.messenger())
23+
let instance = SwiftWebcryptoPlugin()
24+
registrar.addMethodCallDelegate(instance, channel: channel)
25+
}
26+
27+
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
28+
result("iOS " + UIDevice.current.systemVersion)
29+
}
30+
}

ios/Classes/WebcryptoPlugin.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright 2020 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#import <Flutter/Flutter.h>
18+
19+
@interface WebcryptoPlugin : NSObject<FlutterPlugin>
20+
@end

ios/Classes/WebcryptoPlugin.m

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright 2020 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#import "WebcryptoPlugin.h"
18+
#if __has_include(<webcrypto/webcrypto-Swift.h>)
19+
#import <webcrypto/webcrypto-Swift.h>
20+
#else
21+
// Support project import fallback if the generated compatibility header
22+
// is not copied when this plugin is created as a library.
23+
// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816
24+
#import "webcrypto-Swift.h"
25+
#endif
26+
27+
@implementation WebcryptoPlugin
28+
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
29+
[SwiftWebcryptoPlugin registerWithRegistrar:registrar];
30+
}
31+
@end

ios/Classes/include_webcrypto.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright 2020 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// **Include Hacks**
18+
//
19+
// Since `webcrypto.podspec` cannot include sources that are not under the
20+
// `ios/` folder, we simply make a C file here, and include the sources using
21+
// C-preprocessor includes.
22+
23+
#include "../../src/symbols.generated.c"
24+
#include "../../src/webcrypto.c"

ios/README.md

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright 2020 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// **GENERATED FILE DO NOT MODIFY**
18+
//
19+
// This file is generated using:
20+
// `tool/update-boringssl.py`
21+
22+
#include "../../../third_party/boringssl/err_data.c"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright 2020 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// **GENERATED FILE DO NOT MODIFY**
18+
//
19+
// This file is generated using:
20+
// `tool/update-boringssl.py`
21+
22+
#include "../../../../../../third_party/boringssl/src/crypto/asn1/a_bitstr.c"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright 2020 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// **GENERATED FILE DO NOT MODIFY**
18+
//
19+
// This file is generated using:
20+
// `tool/update-boringssl.py`
21+
22+
#include "../../../../../../third_party/boringssl/src/crypto/asn1/a_bool.c"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright 2020 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// **GENERATED FILE DO NOT MODIFY**
18+
//
19+
// This file is generated using:
20+
// `tool/update-boringssl.py`
21+
22+
#include "../../../../../../third_party/boringssl/src/crypto/asn1/a_d2i_fp.c"

0 commit comments

Comments
 (0)