@pmishra0/react-native-aes-gcm 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AesGcm.podspec +18 -5
- package/ios/AesGcm.mm +9 -9
- package/lib/module/NativeAesGcm.ts +17 -2
- package/lib/typescript/src/NativeAesGcm.d.ts +2 -2
- package/lib/typescript/src/NativeAesGcm.d.ts.map +1 -1
- package/package.json +3 -1
- package/src/NativeAesGcm.ts +17 -2
- package/android/generated/java/com/aesgcm/NativeAesGcmSpec.java +0 -42
- package/android/generated/jni/CMakeLists.txt +0 -28
- package/android/generated/jni/RNAesGcmSpec-generated.cpp +0 -38
- package/android/generated/jni/RNAesGcmSpec.h +0 -31
- package/android/generated/jni/react/renderer/components/RNAesGcmSpec/RNAesGcmSpecJSI.h +0 -55
- package/ios/generated/Package.swift +0 -59
- package/ios/generated/ReactAppDependencyProvider/RCTAppDependencyProvider.h +0 -25
- package/ios/generated/ReactAppDependencyProvider/RCTAppDependencyProvider.mm +0 -40
- package/ios/generated/ReactAppDependencyProvider/ReactAppDependencyProvider.podspec +0 -34
- package/ios/generated/ReactCodegen/RCTModuleProviders.h +0 -16
- package/ios/generated/ReactCodegen/RCTModuleProviders.mm +0 -51
- package/ios/generated/ReactCodegen/RCTModulesConformingToProtocolsProvider.h +0 -18
- package/ios/generated/ReactCodegen/RCTModulesConformingToProtocolsProvider.mm +0 -54
- package/ios/generated/ReactCodegen/RCTThirdPartyComponentsProvider.h +0 -16
- package/ios/generated/ReactCodegen/RCTThirdPartyComponentsProvider.mm +0 -30
- package/ios/generated/ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.h +0 -14
- package/ios/generated/ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.mm +0 -19
- package/ios/generated/ReactCodegen/RNAesGcmSpec/RNAesGcmSpec-generated.mm +0 -46
- package/ios/generated/ReactCodegen/RNAesGcmSpec/RNAesGcmSpec.h +0 -75
- package/ios/generated/ReactCodegen/RNAesGcmSpecJSI.h +0 -55
- package/ios/generated/ReactCodegen/ReactCodegen.podspec +0 -110
package/AesGcm.podspec
CHANGED
|
@@ -16,8 +16,17 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
:tag => "#{s.version}"
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
# ✅ Build source file list safely
|
|
20
|
+
source_files = ["ios/**/*.{h,m,mm,swift}"]
|
|
21
|
+
|
|
22
|
+
if ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
23
|
+
source_files << "ios/generated/**/*.{h,mm}"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
s.source_files = source_files
|
|
27
|
+
|
|
28
|
+
# ✅ Exclusions
|
|
29
|
+
exclusions = [
|
|
21
30
|
"ios/**/RCTAppDependencyProvider.*",
|
|
22
31
|
"ios/**/RCTModuleProviders.*",
|
|
23
32
|
"ios/**/RCTThirdPartyComponentsProvider.*",
|
|
@@ -26,21 +35,25 @@ Pod::Spec.new do |s|
|
|
|
26
35
|
"**/Package.swift"
|
|
27
36
|
]
|
|
28
37
|
|
|
38
|
+
if ENV['RCT_NEW_ARCH_ENABLED'] != '1'
|
|
39
|
+
exclusions << "ios/generated/**/*"
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
s.exclude_files = exclusions
|
|
29
43
|
s.private_header_files = "ios/**/*.h"
|
|
30
44
|
|
|
31
45
|
# ✅ Dependencies
|
|
32
46
|
s.dependency "CryptoSwift"
|
|
33
47
|
|
|
34
|
-
# ✅ React Native dependency helper (RN ≥ 0.71)
|
|
35
48
|
if respond_to?(:install_modules_dependencies, true)
|
|
36
49
|
install_modules_dependencies(s)
|
|
37
50
|
else
|
|
38
51
|
s.dependency "React-Core"
|
|
39
52
|
end
|
|
40
53
|
|
|
41
|
-
# ✅ New Architecture
|
|
54
|
+
# ✅ New Architecture flags
|
|
42
55
|
if ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
43
|
-
s.compiler_flags =
|
|
56
|
+
s.compiler_flags = "-DRCT_NEW_ARCH_ENABLED=1"
|
|
44
57
|
s.pod_target_xcconfig = {
|
|
45
58
|
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
46
59
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
package/ios/AesGcm.mm
CHANGED
|
@@ -15,13 +15,13 @@ RCT_EXPORT_MODULE()
|
|
|
15
15
|
#pragma mark - Properties
|
|
16
16
|
EncryptionManager *_manager;
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
RCT_EXPORT_METHOD(encrypt:(NSString *)plainText
|
|
19
19
|
key:(NSString *)key
|
|
20
20
|
saltLength:(double)saltLength
|
|
21
21
|
ivLength:(double)ivLength
|
|
22
22
|
iterationCount:(double)iterationCount
|
|
23
23
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
24
|
-
reject:(RCTPromiseRejectBlock)reject {
|
|
24
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
25
25
|
|
|
26
26
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
27
27
|
NSLog(@"New Arch");
|
|
@@ -46,13 +46,13 @@ EncryptionManager *_manager;
|
|
|
46
46
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
RCT_EXPORT_METHOD(decrypt:(NSString *)encryptedText
|
|
50
|
+
key:(NSString *)key
|
|
51
|
+
saltLength:(double)saltLength
|
|
52
|
+
ivLength:(double)ivLength
|
|
53
|
+
iterationCount:(double)iterationCount
|
|
54
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
55
|
+
reject:(RCTPromiseRejectBlock)reject ) {
|
|
56
56
|
NSError *error = nil;
|
|
57
57
|
|
|
58
58
|
NSString *result = [_manager decrypt:encryptedText
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { NativeModules, TurboModuleRegistry } from 'react-native';
|
|
1
2
|
import type { TurboModule } from 'react-native';
|
|
2
|
-
import { TurboModuleRegistry } from 'react-native';
|
|
3
3
|
|
|
4
4
|
export interface Spec extends TurboModule {
|
|
5
5
|
encrypt(
|
|
@@ -9,6 +9,7 @@ export interface Spec extends TurboModule {
|
|
|
9
9
|
ivLength: number,
|
|
10
10
|
iterationCount: number
|
|
11
11
|
): Promise<string>;
|
|
12
|
+
|
|
12
13
|
decrypt(
|
|
13
14
|
encryptedText: string,
|
|
14
15
|
key: string,
|
|
@@ -18,4 +19,18 @@ export interface Spec extends TurboModule {
|
|
|
18
19
|
): Promise<string>;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
const isTurboModuleEnabled = (global as any).__turboModuleProxy != null;
|
|
23
|
+
|
|
24
|
+
const AesGcmModule = isTurboModuleEnabled
|
|
25
|
+
? TurboModuleRegistry.get<Spec>('AesGcm')
|
|
26
|
+
: NativeModules.AesGcm;
|
|
27
|
+
|
|
28
|
+
if (!AesGcmModule) {
|
|
29
|
+
throw new Error(
|
|
30
|
+
'AesGcm native module not found.\n\n' +
|
|
31
|
+
'• Did you run pod install?\n' +
|
|
32
|
+
'• Did you rebuild the app?\n'
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default AesGcmModule;
|
|
@@ -3,6 +3,6 @@ export interface Spec extends TurboModule {
|
|
|
3
3
|
encrypt(plainText: string, key: string, saltLength: number, ivLength: number, iterationCount: number): Promise<string>;
|
|
4
4
|
decrypt(encryptedText: string, key: string, saltLength: number, ivLength: number, iterationCount: number): Promise<string>;
|
|
5
5
|
}
|
|
6
|
-
declare const
|
|
7
|
-
export default
|
|
6
|
+
declare const AesGcmModule: any;
|
|
7
|
+
export default AesGcmModule;
|
|
8
8
|
//# sourceMappingURL=NativeAesGcm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeAesGcm.d.ts","sourceRoot":"","sources":["../../../src/NativeAesGcm.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NativeAesGcm.d.ts","sourceRoot":"","sources":["../../../src/NativeAesGcm.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,OAAO,CACL,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB,OAAO,CACL,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,MAAM,CAAC,CAAC;CACpB;AAID,QAAA,MAAM,YAAY,KAEM,CAAC;AAUzB,eAAe,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pmishra0/react-native-aes-gcm",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "AES-GCM encryption/decryption for React Native",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/module/index.js",
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
"*.podspec",
|
|
26
26
|
"react-native.config.js",
|
|
27
27
|
"!ios/build",
|
|
28
|
+
"!ios/generated",
|
|
29
|
+
"!android/generated",
|
|
28
30
|
"!android/build",
|
|
29
31
|
"!android/gradle",
|
|
30
32
|
"!android/gradlew",
|
package/src/NativeAesGcm.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { NativeModules, TurboModuleRegistry } from 'react-native';
|
|
1
2
|
import type { TurboModule } from 'react-native';
|
|
2
|
-
import { TurboModuleRegistry } from 'react-native';
|
|
3
3
|
|
|
4
4
|
export interface Spec extends TurboModule {
|
|
5
5
|
encrypt(
|
|
@@ -9,6 +9,7 @@ export interface Spec extends TurboModule {
|
|
|
9
9
|
ivLength: number,
|
|
10
10
|
iterationCount: number
|
|
11
11
|
): Promise<string>;
|
|
12
|
+
|
|
12
13
|
decrypt(
|
|
13
14
|
encryptedText: string,
|
|
14
15
|
key: string,
|
|
@@ -18,4 +19,18 @@ export interface Spec extends TurboModule {
|
|
|
18
19
|
): Promise<string>;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
const isTurboModuleEnabled = (global as any).__turboModuleProxy != null;
|
|
23
|
+
|
|
24
|
+
const AesGcmModule = isTurboModuleEnabled
|
|
25
|
+
? TurboModuleRegistry.get<Spec>('AesGcm')
|
|
26
|
+
: NativeModules.AesGcm;
|
|
27
|
+
|
|
28
|
+
if (!AesGcmModule) {
|
|
29
|
+
throw new Error(
|
|
30
|
+
'AesGcm native module not found.\n\n' +
|
|
31
|
+
'• Did you run pod install?\n' +
|
|
32
|
+
'• Did you rebuild the app?\n'
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default AesGcmModule;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJavaSpec.js
|
|
9
|
-
*
|
|
10
|
-
* @nolint
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
package com.aesgcm;
|
|
14
|
-
|
|
15
|
-
import com.facebook.proguard.annotations.DoNotStrip;
|
|
16
|
-
import com.facebook.react.bridge.Promise;
|
|
17
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
18
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
19
|
-
import com.facebook.react.bridge.ReactMethod;
|
|
20
|
-
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
21
|
-
import javax.annotation.Nonnull;
|
|
22
|
-
|
|
23
|
-
public abstract class NativeAesGcmSpec extends ReactContextBaseJavaModule implements TurboModule {
|
|
24
|
-
public static final String NAME = "AesGcm";
|
|
25
|
-
|
|
26
|
-
public NativeAesGcmSpec(ReactApplicationContext reactContext) {
|
|
27
|
-
super(reactContext);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@Override
|
|
31
|
-
public @Nonnull String getName() {
|
|
32
|
-
return NAME;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@ReactMethod
|
|
36
|
-
@DoNotStrip
|
|
37
|
-
public abstract void encrypt(String plainText, String key, double saltLength, double ivLength, double iterationCount, Promise promise);
|
|
38
|
-
|
|
39
|
-
@ReactMethod
|
|
40
|
-
@DoNotStrip
|
|
41
|
-
public abstract void decrypt(String encryptedText, String key, double saltLength, double ivLength, double iterationCount, Promise promise);
|
|
42
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
#
|
|
3
|
-
# This source code is licensed under the MIT license found in the
|
|
4
|
-
# LICENSE file in the root directory of this source tree.
|
|
5
|
-
|
|
6
|
-
cmake_minimum_required(VERSION 3.13)
|
|
7
|
-
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
8
|
-
|
|
9
|
-
file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNAesGcmSpec/*.cpp)
|
|
10
|
-
|
|
11
|
-
add_library(
|
|
12
|
-
react_codegen_RNAesGcmSpec
|
|
13
|
-
OBJECT
|
|
14
|
-
${react_codegen_SRCS}
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
target_include_directories(react_codegen_RNAesGcmSpec PUBLIC . react/renderer/components/RNAesGcmSpec)
|
|
18
|
-
|
|
19
|
-
target_link_libraries(
|
|
20
|
-
react_codegen_RNAesGcmSpec
|
|
21
|
-
fbjni
|
|
22
|
-
jsi
|
|
23
|
-
# We need to link different libraries based on whether we are building rncore or not, that's necessary
|
|
24
|
-
# because we want to break a circular dependency between react_codegen_rncore and reactnative
|
|
25
|
-
reactnative
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
target_compile_reactnative_options(react_codegen_RNAesGcmSpec PRIVATE)
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJniCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include "RNAesGcmSpec.h"
|
|
12
|
-
|
|
13
|
-
namespace facebook::react {
|
|
14
|
-
|
|
15
|
-
static facebook::jsi::Value __hostFunction_NativeAesGcmSpecJSI_encrypt(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
16
|
-
static jmethodID cachedMethodId = nullptr;
|
|
17
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "encrypt", "(Ljava/lang/String;Ljava/lang/String;DDDLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
static facebook::jsi::Value __hostFunction_NativeAesGcmSpecJSI_decrypt(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
21
|
-
static jmethodID cachedMethodId = nullptr;
|
|
22
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "decrypt", "(Ljava/lang/String;Ljava/lang/String;DDDLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
NativeAesGcmSpecJSI::NativeAesGcmSpecJSI(const JavaTurboModule::InitParams ¶ms)
|
|
26
|
-
: JavaTurboModule(params) {
|
|
27
|
-
methodMap_["encrypt"] = MethodMetadata {5, __hostFunction_NativeAesGcmSpecJSI_encrypt};
|
|
28
|
-
methodMap_["decrypt"] = MethodMetadata {5, __hostFunction_NativeAesGcmSpecJSI_decrypt};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
std::shared_ptr<TurboModule> RNAesGcmSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) {
|
|
32
|
-
if (moduleName == "AesGcm") {
|
|
33
|
-
return std::make_shared<NativeAesGcmSpecJSI>(params);
|
|
34
|
-
}
|
|
35
|
-
return nullptr;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
} // namespace facebook::react
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJniH.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#pragma once
|
|
12
|
-
|
|
13
|
-
#include <ReactCommon/JavaTurboModule.h>
|
|
14
|
-
#include <ReactCommon/TurboModule.h>
|
|
15
|
-
#include <jsi/jsi.h>
|
|
16
|
-
|
|
17
|
-
namespace facebook::react {
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* JNI C++ class for module 'NativeAesGcm'
|
|
21
|
-
*/
|
|
22
|
-
class JSI_EXPORT NativeAesGcmSpecJSI : public JavaTurboModule {
|
|
23
|
-
public:
|
|
24
|
-
NativeAesGcmSpecJSI(const JavaTurboModule::InitParams ¶ms);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
JSI_EXPORT
|
|
29
|
-
std::shared_ptr<TurboModule> RNAesGcmSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms);
|
|
30
|
-
|
|
31
|
-
} // namespace facebook::react
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GenerateModuleH.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
#pragma once
|
|
11
|
-
|
|
12
|
-
#include <ReactCommon/TurboModule.h>
|
|
13
|
-
#include <react/bridging/Bridging.h>
|
|
14
|
-
|
|
15
|
-
namespace facebook::react {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
template <typename T>
|
|
19
|
-
class JSI_EXPORT NativeAesGcmCxxSpec : public TurboModule {
|
|
20
|
-
public:
|
|
21
|
-
static constexpr std::string_view kModuleName = "AesGcm";
|
|
22
|
-
|
|
23
|
-
protected:
|
|
24
|
-
NativeAesGcmCxxSpec(std::shared_ptr<CallInvoker> jsInvoker) : TurboModule(std::string{NativeAesGcmCxxSpec::kModuleName}, jsInvoker) {
|
|
25
|
-
methodMap_["encrypt"] = MethodMetadata {.argCount = 5, .invoker = __encrypt};
|
|
26
|
-
methodMap_["decrypt"] = MethodMetadata {.argCount = 5, .invoker = __decrypt};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
private:
|
|
30
|
-
static jsi::Value __encrypt(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
31
|
-
static_assert(
|
|
32
|
-
bridging::getParameterCount(&T::encrypt) == 6,
|
|
33
|
-
"Expected encrypt(...) to have 6 parameters");
|
|
34
|
-
return bridging::callFromJs<jsi::Value>(rt, &T::encrypt, static_cast<NativeAesGcmCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
35
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
36
|
-
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
37
|
-
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
|
|
38
|
-
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber(),
|
|
39
|
-
count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asNumber());
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
static jsi::Value __decrypt(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
43
|
-
static_assert(
|
|
44
|
-
bridging::getParameterCount(&T::decrypt) == 6,
|
|
45
|
-
"Expected decrypt(...) to have 6 parameters");
|
|
46
|
-
return bridging::callFromJs<jsi::Value>(rt, &T::decrypt, static_cast<NativeAesGcmCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
47
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
48
|
-
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
49
|
-
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
|
|
50
|
-
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber(),
|
|
51
|
-
count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asNumber());
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
} // namespace facebook::react
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// swift-tools-version: 6.1
|
|
2
|
-
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
|
3
|
-
|
|
4
|
-
import PackageDescription
|
|
5
|
-
|
|
6
|
-
let package = Package(
|
|
7
|
-
name: "React-GeneratedCode",
|
|
8
|
-
platforms: [.iOS(.v15), .macCatalyst(SupportedPlatform.MacCatalystVersion.v13)],
|
|
9
|
-
products: [
|
|
10
|
-
// Products define the executables and libraries a package produces, making them visible to other packages.
|
|
11
|
-
.library(
|
|
12
|
-
name: "ReactCodegen",
|
|
13
|
-
targets: ["ReactCodegen"]),
|
|
14
|
-
.library(
|
|
15
|
-
name: "ReactAppDependencyProvider",
|
|
16
|
-
targets: ["ReactAppDependencyProvider"]),
|
|
17
|
-
],
|
|
18
|
-
dependencies: [
|
|
19
|
-
.package(name: "React", path: "../../../../../../../../node_modules/react-native")
|
|
20
|
-
],
|
|
21
|
-
targets: [
|
|
22
|
-
// Targets are the basic building blocks of a package, defining a module or a test suite.
|
|
23
|
-
// Targets can depend on other targets in this package and products from dependencies.
|
|
24
|
-
.target(
|
|
25
|
-
name: "ReactCodegen",
|
|
26
|
-
dependencies: ["React"],
|
|
27
|
-
path: "ReactCodegen",
|
|
28
|
-
exclude: ["ReactCodegen.podspec"],
|
|
29
|
-
publicHeadersPath: ".",
|
|
30
|
-
cSettings: [
|
|
31
|
-
.headerSearchPath("headers")
|
|
32
|
-
],
|
|
33
|
-
cxxSettings: [
|
|
34
|
-
.headerSearchPath("headers"),
|
|
35
|
-
.unsafeFlags(["-std=c++20"]),
|
|
36
|
-
],
|
|
37
|
-
linkerSettings: [
|
|
38
|
-
.linkedFramework("Foundation")
|
|
39
|
-
]
|
|
40
|
-
),
|
|
41
|
-
.target(
|
|
42
|
-
name: "ReactAppDependencyProvider",
|
|
43
|
-
dependencies: ["ReactCodegen"],
|
|
44
|
-
path: "ReactAppDependencyProvider",
|
|
45
|
-
exclude: ["ReactAppDependencyProvider.podspec"],
|
|
46
|
-
publicHeadersPath: ".",
|
|
47
|
-
cSettings: [
|
|
48
|
-
.headerSearchPath("headers"),
|
|
49
|
-
],
|
|
50
|
-
cxxSettings: [
|
|
51
|
-
.headerSearchPath("headers"),
|
|
52
|
-
.unsafeFlags(["-std=c++20"]),
|
|
53
|
-
],
|
|
54
|
-
linkerSettings: [
|
|
55
|
-
.linkedFramework("Foundation")
|
|
56
|
-
]
|
|
57
|
-
)
|
|
58
|
-
]
|
|
59
|
-
)
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
#import <Foundation/Foundation.h>
|
|
10
|
-
|
|
11
|
-
#if __has_include(<React-RCTAppDelegate/RCTDependencyProvider.h>)
|
|
12
|
-
#import <React-RCTAppDelegate/RCTDependencyProvider.h>
|
|
13
|
-
#elif __has_include(<React_RCTAppDelegate/RCTDependencyProvider.h>)
|
|
14
|
-
#import <React_RCTAppDelegate/RCTDependencyProvider.h>
|
|
15
|
-
#else
|
|
16
|
-
#import "RCTDependencyProvider.h"
|
|
17
|
-
#endif
|
|
18
|
-
|
|
19
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
20
|
-
|
|
21
|
-
@interface RCTAppDependencyProvider : NSObject <RCTDependencyProvider>
|
|
22
|
-
|
|
23
|
-
@end
|
|
24
|
-
|
|
25
|
-
NS_ASSUME_NONNULL_END
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#import "RCTAppDependencyProvider.h"
|
|
9
|
-
#import <ReactCodegen/RCTModulesConformingToProtocolsProvider.h>
|
|
10
|
-
#import <ReactCodegen/RCTThirdPartyComponentsProvider.h>
|
|
11
|
-
#import <ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.h>
|
|
12
|
-
#import <ReactCodegen/RCTModuleProviders.h>
|
|
13
|
-
|
|
14
|
-
@implementation RCTAppDependencyProvider
|
|
15
|
-
|
|
16
|
-
- (nonnull NSArray<NSString *> *)URLRequestHandlerClassNames {
|
|
17
|
-
return RCTModulesConformingToProtocolsProvider.URLRequestHandlerClassNames;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
- (nonnull NSArray<NSString *> *)imageDataDecoderClassNames {
|
|
21
|
-
return RCTModulesConformingToProtocolsProvider.imageDataDecoderClassNames;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
- (nonnull NSArray<NSString *> *)imageURLLoaderClassNames {
|
|
25
|
-
return RCTModulesConformingToProtocolsProvider.imageURLLoaderClassNames;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
- (nonnull NSArray<NSString *> *)unstableModulesRequiringMainQueueSetup {
|
|
29
|
-
return RCTUnstableModulesRequiringMainQueueSetupProvider.modules;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
- (nonnull NSDictionary<NSString *,Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents {
|
|
33
|
-
return RCTThirdPartyComponentsProvider.thirdPartyFabricComponents;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
- (nonnull NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders {
|
|
37
|
-
return RCTModuleProviders.moduleProviders;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
@end
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
#
|
|
3
|
-
# This source code is licensed under the MIT license found in the
|
|
4
|
-
# LICENSE file in the root directory of this source tree.
|
|
5
|
-
|
|
6
|
-
version = "0.84.0"
|
|
7
|
-
source = { :git => 'https://github.com/facebook/react-native.git' }
|
|
8
|
-
if version == '1000.0.0'
|
|
9
|
-
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
10
|
-
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
11
|
-
else
|
|
12
|
-
source[:tag] = "v#{version}"
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
Pod::Spec.new do |s|
|
|
16
|
-
s.name = "ReactAppDependencyProvider"
|
|
17
|
-
s.version = version
|
|
18
|
-
s.summary = "The third party dependency provider for the app"
|
|
19
|
-
s.homepage = "https://reactnative.dev/"
|
|
20
|
-
s.documentation_url = "https://reactnative.dev/"
|
|
21
|
-
s.license = "MIT"
|
|
22
|
-
s.author = "Meta Platforms, Inc. and its affiliates"
|
|
23
|
-
s.platforms = min_supported_versions
|
|
24
|
-
s.source = source
|
|
25
|
-
s.source_files = "**/RCTAppDependencyProvider.{h,mm}"
|
|
26
|
-
|
|
27
|
-
# This guard prevent to install the dependencies when we run `pod install` in the old architecture.
|
|
28
|
-
s.pod_target_xcconfig = {
|
|
29
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
|
30
|
-
"DEFINES_MODULE" => "YES"
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
s.dependency "ReactCodegen"
|
|
34
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
|
|
10
|
-
@protocol RCTModuleProvider;
|
|
11
|
-
|
|
12
|
-
@interface RCTModuleProviders: NSObject
|
|
13
|
-
|
|
14
|
-
+ (NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders;
|
|
15
|
-
|
|
16
|
-
@end
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
|
|
10
|
-
#import "RCTModuleProviders.h"
|
|
11
|
-
#import <ReactCommon/RCTTurboModule.h>
|
|
12
|
-
#import <React/RCTLog.h>
|
|
13
|
-
|
|
14
|
-
@implementation RCTModuleProviders
|
|
15
|
-
|
|
16
|
-
+ (NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders
|
|
17
|
-
{
|
|
18
|
-
static NSDictionary<NSString *, id<RCTModuleProvider>> *providers = nil;
|
|
19
|
-
static dispatch_once_t onceToken;
|
|
20
|
-
|
|
21
|
-
dispatch_once(&onceToken, ^{
|
|
22
|
-
NSDictionary<NSString *, NSString *> * moduleMapping = @{
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithCapacity:moduleMapping.count];
|
|
27
|
-
|
|
28
|
-
for (NSString *key in moduleMapping) {
|
|
29
|
-
NSString * moduleProviderName = moduleMapping[key];
|
|
30
|
-
Class klass = NSClassFromString(moduleProviderName);
|
|
31
|
-
if (!klass) {
|
|
32
|
-
RCTLogError(@"Module provider %@ cannot be found in the runtime", moduleProviderName);
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
id instance = [klass new];
|
|
37
|
-
if (![instance respondsToSelector:@selector(getTurboModule:)]) {
|
|
38
|
-
RCTLogError(@"Module provider %@ does not conform to RCTModuleProvider", moduleProviderName);
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
[dict setObject:instance forKey:key];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
providers = dict;
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
return providers;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
|
|
10
|
-
@interface RCTModulesConformingToProtocolsProvider: NSObject
|
|
11
|
-
|
|
12
|
-
+(NSArray<NSString *> *)imageURLLoaderClassNames;
|
|
13
|
-
|
|
14
|
-
+(NSArray<NSString *> *)imageDataDecoderClassNames;
|
|
15
|
-
|
|
16
|
-
+(NSArray<NSString *> *)URLRequestHandlerClassNames;
|
|
17
|
-
|
|
18
|
-
@end
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#import "RCTModulesConformingToProtocolsProvider.h"
|
|
9
|
-
|
|
10
|
-
@implementation RCTModulesConformingToProtocolsProvider
|
|
11
|
-
|
|
12
|
-
+(NSArray<NSString *> *)imageURLLoaderClassNames
|
|
13
|
-
{
|
|
14
|
-
static NSArray<NSString *> *classNames = nil;
|
|
15
|
-
static dispatch_once_t onceToken;
|
|
16
|
-
|
|
17
|
-
dispatch_once(&onceToken, ^{
|
|
18
|
-
classNames = @[
|
|
19
|
-
|
|
20
|
-
];
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
return classNames;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
+(NSArray<NSString *> *)imageDataDecoderClassNames
|
|
27
|
-
{
|
|
28
|
-
static NSArray<NSString *> *classNames = nil;
|
|
29
|
-
static dispatch_once_t onceToken;
|
|
30
|
-
|
|
31
|
-
dispatch_once(&onceToken, ^{
|
|
32
|
-
classNames = @[
|
|
33
|
-
|
|
34
|
-
];
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
return classNames;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
+(NSArray<NSString *> *)URLRequestHandlerClassNames
|
|
41
|
-
{
|
|
42
|
-
static NSArray<NSString *> *classNames = nil;
|
|
43
|
-
static dispatch_once_t onceToken;
|
|
44
|
-
|
|
45
|
-
dispatch_once(&onceToken, ^{
|
|
46
|
-
classNames = @[
|
|
47
|
-
|
|
48
|
-
];
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
return classNames;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
@end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
|
|
10
|
-
@protocol RCTComponentViewProtocol;
|
|
11
|
-
|
|
12
|
-
@interface RCTThirdPartyComponentsProvider: NSObject
|
|
13
|
-
|
|
14
|
-
+ (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents;
|
|
15
|
-
|
|
16
|
-
@end
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
#import <Foundation/Foundation.h>
|
|
10
|
-
|
|
11
|
-
#import "RCTThirdPartyComponentsProvider.h"
|
|
12
|
-
#import <React/RCTComponentViewProtocol.h>
|
|
13
|
-
|
|
14
|
-
@implementation RCTThirdPartyComponentsProvider
|
|
15
|
-
|
|
16
|
-
+ (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents
|
|
17
|
-
{
|
|
18
|
-
static NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *thirdPartyComponents = nil;
|
|
19
|
-
static dispatch_once_t nativeComponentsToken;
|
|
20
|
-
|
|
21
|
-
dispatch_once(&nativeComponentsToken, ^{
|
|
22
|
-
thirdPartyComponents = @{
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
return thirdPartyComponents;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
|
|
10
|
-
@interface RCTUnstableModulesRequiringMainQueueSetupProvider: NSObject
|
|
11
|
-
|
|
12
|
-
+(NSArray<NSString *> *)modules;
|
|
13
|
-
|
|
14
|
-
@end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#import "RCTUnstableModulesRequiringMainQueueSetupProvider.h"
|
|
9
|
-
|
|
10
|
-
@implementation RCTUnstableModulesRequiringMainQueueSetupProvider
|
|
11
|
-
|
|
12
|
-
+(NSArray<NSString *> *)modules
|
|
13
|
-
{
|
|
14
|
-
return @[
|
|
15
|
-
|
|
16
|
-
];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@end
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GenerateModuleObjCpp
|
|
8
|
-
*
|
|
9
|
-
* We create an umbrella header (and corresponding implementation) here since
|
|
10
|
-
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
|
|
11
|
-
* must have a single output. More files => more genrule()s => slower builds.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
#import "RNAesGcmSpec.h"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@implementation NativeAesGcmSpecBase
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper
|
|
21
|
-
{
|
|
22
|
-
_eventEmitterCallback = std::move(eventEmitterCallbackWrapper->_eventEmitterCallback);
|
|
23
|
-
}
|
|
24
|
-
@end
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
namespace facebook::react {
|
|
28
|
-
|
|
29
|
-
static facebook::jsi::Value __hostFunction_NativeAesGcmSpecJSI_encrypt(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
30
|
-
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "encrypt", @selector(encrypt:key:saltLength:ivLength:iterationCount:resolve:reject:), args, count);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
static facebook::jsi::Value __hostFunction_NativeAesGcmSpecJSI_decrypt(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
34
|
-
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "decrypt", @selector(decrypt:key:saltLength:ivLength:iterationCount:resolve:reject:), args, count);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
NativeAesGcmSpecJSI::NativeAesGcmSpecJSI(const ObjCTurboModule::InitParams ¶ms)
|
|
38
|
-
: ObjCTurboModule(params) {
|
|
39
|
-
|
|
40
|
-
methodMap_["encrypt"] = MethodMetadata {5, __hostFunction_NativeAesGcmSpecJSI_encrypt};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
methodMap_["decrypt"] = MethodMetadata {5, __hostFunction_NativeAesGcmSpecJSI_decrypt};
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
} // namespace facebook::react
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GenerateModuleObjCpp
|
|
8
|
-
*
|
|
9
|
-
* We create an umbrella header (and corresponding implementation) here since
|
|
10
|
-
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
|
|
11
|
-
* must have a single output. More files => more genrule()s => slower builds.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
#ifndef __cplusplus
|
|
15
|
-
#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
|
|
16
|
-
#endif
|
|
17
|
-
|
|
18
|
-
// Avoid multiple includes of RNAesGcmSpec symbols
|
|
19
|
-
#ifndef RNAesGcmSpec_H
|
|
20
|
-
#define RNAesGcmSpec_H
|
|
21
|
-
|
|
22
|
-
#import <Foundation/Foundation.h>
|
|
23
|
-
#import <RCTRequired/RCTRequired.h>
|
|
24
|
-
#import <RCTTypeSafety/RCTConvertHelpers.h>
|
|
25
|
-
#import <RCTTypeSafety/RCTTypedModuleConstants.h>
|
|
26
|
-
#import <React/RCTBridgeModule.h>
|
|
27
|
-
#import <React/RCTCxxConvert.h>
|
|
28
|
-
#import <React/RCTManagedPointer.h>
|
|
29
|
-
#import <ReactCommon/RCTTurboModule.h>
|
|
30
|
-
#import <optional>
|
|
31
|
-
#import <vector>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
35
|
-
|
|
36
|
-
@protocol NativeAesGcmSpec <RCTBridgeModule, RCTTurboModule>
|
|
37
|
-
|
|
38
|
-
- (void)encrypt:(NSString *)plainText
|
|
39
|
-
key:(NSString *)key
|
|
40
|
-
saltLength:(double)saltLength
|
|
41
|
-
ivLength:(double)ivLength
|
|
42
|
-
iterationCount:(double)iterationCount
|
|
43
|
-
resolve:(RCTPromiseResolveBlock)resolve
|
|
44
|
-
reject:(RCTPromiseRejectBlock)reject;
|
|
45
|
-
- (void)decrypt:(NSString *)encryptedText
|
|
46
|
-
key:(NSString *)key
|
|
47
|
-
saltLength:(double)saltLength
|
|
48
|
-
ivLength:(double)ivLength
|
|
49
|
-
iterationCount:(double)iterationCount
|
|
50
|
-
resolve:(RCTPromiseResolveBlock)resolve
|
|
51
|
-
reject:(RCTPromiseRejectBlock)reject;
|
|
52
|
-
|
|
53
|
-
@end
|
|
54
|
-
|
|
55
|
-
@interface NativeAesGcmSpecBase : NSObject {
|
|
56
|
-
@protected
|
|
57
|
-
facebook::react::EventEmitterCallback _eventEmitterCallback;
|
|
58
|
-
}
|
|
59
|
-
- (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
@end
|
|
63
|
-
|
|
64
|
-
namespace facebook::react {
|
|
65
|
-
/**
|
|
66
|
-
* ObjC++ class for module 'NativeAesGcm'
|
|
67
|
-
*/
|
|
68
|
-
class JSI_EXPORT NativeAesGcmSpecJSI : public ObjCTurboModule {
|
|
69
|
-
public:
|
|
70
|
-
NativeAesGcmSpecJSI(const ObjCTurboModule::InitParams ¶ms);
|
|
71
|
-
};
|
|
72
|
-
} // namespace facebook::react
|
|
73
|
-
|
|
74
|
-
NS_ASSUME_NONNULL_END
|
|
75
|
-
#endif // RNAesGcmSpec_H
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GenerateModuleH.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
#pragma once
|
|
11
|
-
|
|
12
|
-
#include <ReactCommon/TurboModule.h>
|
|
13
|
-
#include <react/bridging/Bridging.h>
|
|
14
|
-
|
|
15
|
-
namespace facebook::react {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
template <typename T>
|
|
19
|
-
class JSI_EXPORT NativeAesGcmCxxSpec : public TurboModule {
|
|
20
|
-
public:
|
|
21
|
-
static constexpr std::string_view kModuleName = "AesGcm";
|
|
22
|
-
|
|
23
|
-
protected:
|
|
24
|
-
NativeAesGcmCxxSpec(std::shared_ptr<CallInvoker> jsInvoker) : TurboModule(std::string{NativeAesGcmCxxSpec::kModuleName}, jsInvoker) {
|
|
25
|
-
methodMap_["encrypt"] = MethodMetadata {.argCount = 5, .invoker = __encrypt};
|
|
26
|
-
methodMap_["decrypt"] = MethodMetadata {.argCount = 5, .invoker = __decrypt};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
private:
|
|
30
|
-
static jsi::Value __encrypt(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
31
|
-
static_assert(
|
|
32
|
-
bridging::getParameterCount(&T::encrypt) == 6,
|
|
33
|
-
"Expected encrypt(...) to have 6 parameters");
|
|
34
|
-
return bridging::callFromJs<jsi::Value>(rt, &T::encrypt, static_cast<NativeAesGcmCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
35
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
36
|
-
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
37
|
-
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
|
|
38
|
-
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber(),
|
|
39
|
-
count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asNumber());
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
static jsi::Value __decrypt(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
43
|
-
static_assert(
|
|
44
|
-
bridging::getParameterCount(&T::decrypt) == 6,
|
|
45
|
-
"Expected decrypt(...) to have 6 parameters");
|
|
46
|
-
return bridging::callFromJs<jsi::Value>(rt, &T::decrypt, static_cast<NativeAesGcmCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
47
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
48
|
-
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
49
|
-
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
|
|
50
|
-
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber(),
|
|
51
|
-
count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asNumber());
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
} // namespace facebook::react
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
#
|
|
3
|
-
# This source code is licensed under the MIT license found in the
|
|
4
|
-
# LICENSE file in the root directory of this source tree.
|
|
5
|
-
|
|
6
|
-
version = "0.84.0"
|
|
7
|
-
source = { :git => 'https://github.com/facebook/react-native.git' }
|
|
8
|
-
if version == '1000.0.0'
|
|
9
|
-
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
10
|
-
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
11
|
-
else
|
|
12
|
-
source[:tag] = "v#{version}"
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
use_frameworks = ENV['USE_FRAMEWORKS'] != nil
|
|
16
|
-
folly_compiler_flags = Helpers::Constants.folly_config[:compiler_flags]
|
|
17
|
-
boost_compiler_flags = Helpers::Constants.boost_config[:compiler_flags]
|
|
18
|
-
|
|
19
|
-
header_search_paths = []
|
|
20
|
-
framework_search_paths = []
|
|
21
|
-
|
|
22
|
-
header_search_paths = [
|
|
23
|
-
"\"$(PODS_ROOT)/ReactNativeDependencies\"",
|
|
24
|
-
"\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
|
|
25
|
-
"\"$(PODS_ROOT)/Headers/Private/React-Fabric\"",
|
|
26
|
-
"\"$(PODS_ROOT)/Headers/Private/React-RCTFabric\"",
|
|
27
|
-
"\"$(PODS_ROOT)/Headers/Private/Yoga\"",
|
|
28
|
-
"\"$(PODS_TARGET_SRCROOT)\"",
|
|
29
|
-
]
|
|
30
|
-
|
|
31
|
-
if use_frameworks
|
|
32
|
-
ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-Fabric", "React_Fabric", ["react/renderer/components/view/platform/cxx"])
|
|
33
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-FabricImage", "React_FabricImage", []))
|
|
34
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-graphics", "React_graphics", ["react/renderer/graphics/platform/ios"]))
|
|
35
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "ReactCommon", "ReactCommon", ["react/nativemodule/core"]))
|
|
36
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-runtimeexecutor", "React_runtimeexecutor", ["platform/ios"]))
|
|
37
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-NativeModulesApple", "React_NativeModulesApple", []))
|
|
38
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-RCTFabric", "RCTFabric", []))
|
|
39
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-debug", "React_debug", []))
|
|
40
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-rendererdebug", "React_rendererdebug", []))
|
|
41
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-utils", "React_utils", []))
|
|
42
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-featureflags", "React_featureflags", []))
|
|
43
|
-
.each { |search_path|
|
|
44
|
-
header_search_paths << "\"#{search_path}\""
|
|
45
|
-
}
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
Pod::Spec.new do |s|
|
|
49
|
-
s.name = "ReactCodegen"
|
|
50
|
-
s.version = version
|
|
51
|
-
s.summary = 'Temp pod for generated files for React Native'
|
|
52
|
-
s.homepage = 'https://facebook.com/'
|
|
53
|
-
s.license = 'Unlicense'
|
|
54
|
-
s.authors = 'Facebook'
|
|
55
|
-
s.compiler_flags = "#{folly_compiler_flags} #{boost_compiler_flags} -Wno-nullability-completeness -std=c++20"
|
|
56
|
-
s.source = { :git => '' }
|
|
57
|
-
s.header_mappings_dir = './'
|
|
58
|
-
s.platforms = min_supported_versions
|
|
59
|
-
s.source_files = "**/*.{h,mm,cpp}"
|
|
60
|
-
s.exclude_files = "RCTAppDependencyProvider.{h,mm}" # these files are generated in the same codegen path but needs to belong to a different pod
|
|
61
|
-
s.pod_target_xcconfig = {
|
|
62
|
-
"HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
|
|
63
|
-
"FRAMEWORK_SEARCH_PATHS" => framework_search_paths,
|
|
64
|
-
"OTHER_CPLUSPLUSFLAGS" => "$(inherited) #{folly_compiler_flags} #{boost_compiler_flags}"
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
s.dependency "React-jsiexecutor"
|
|
68
|
-
s.dependency "RCTRequired"
|
|
69
|
-
s.dependency "RCTTypeSafety"
|
|
70
|
-
s.dependency "React-Core"
|
|
71
|
-
s.dependency "React-jsi"
|
|
72
|
-
s.dependency "ReactCommon/turbomodule/bridging"
|
|
73
|
-
s.dependency "ReactCommon/turbomodule/core"
|
|
74
|
-
s.dependency "React-NativeModulesApple"
|
|
75
|
-
s.dependency 'React-graphics'
|
|
76
|
-
s.dependency 'React-rendererdebug'
|
|
77
|
-
s.dependency 'React-Fabric'
|
|
78
|
-
s.dependency 'React-FabricImage'
|
|
79
|
-
s.dependency 'React-debug'
|
|
80
|
-
s.dependency 'React-utils'
|
|
81
|
-
s.dependency 'React-featureflags'
|
|
82
|
-
s.dependency 'React-RCTAppDelegate'
|
|
83
|
-
|
|
84
|
-
depend_on_js_engine(s)
|
|
85
|
-
add_rn_third_party_dependencies(s)
|
|
86
|
-
add_rncore_dependency(s)
|
|
87
|
-
|
|
88
|
-
s.script_phases = {
|
|
89
|
-
'name' => 'Generate Specs',
|
|
90
|
-
'execution_position' => :before_compile,
|
|
91
|
-
'input_files' => ["${PODS_ROOT}/../../../src/NativeAesGcm.ts"],
|
|
92
|
-
'show_env_vars_in_log' => true,
|
|
93
|
-
'output_files' => ["${DERIVED_FILE_DIR}/react-codegen.log"],
|
|
94
|
-
'script': <<-SCRIPT
|
|
95
|
-
pushd "$PODS_ROOT/../" > /dev/null
|
|
96
|
-
RCT_SCRIPT_POD_INSTALLATION_ROOT=$(pwd)
|
|
97
|
-
popd >/dev/null
|
|
98
|
-
|
|
99
|
-
export RCT_SCRIPT_RN_DIR="$RCT_SCRIPT_POD_INSTALLATION_ROOT/../../node_modules/react-native"
|
|
100
|
-
export RCT_SCRIPT_APP_PATH="$RCT_SCRIPT_POD_INSTALLATION_ROOT/../.."
|
|
101
|
-
export RCT_SCRIPT_OUTPUT_DIR="$RCT_SCRIPT_POD_INSTALLATION_ROOT"
|
|
102
|
-
export RCT_SCRIPT_TYPE="withCodegenDiscovery"
|
|
103
|
-
|
|
104
|
-
export SCRIPT_PHASES_SCRIPT="$RCT_SCRIPT_RN_DIR/scripts/react_native_pods_utils/script_phases.sh"
|
|
105
|
-
export WITH_ENVIRONMENT="$RCT_SCRIPT_RN_DIR/scripts/xcode/with-environment.sh"
|
|
106
|
-
/bin/sh -c '"$WITH_ENVIRONMENT" "$SCRIPT_PHASES_SCRIPT"'
|
|
107
|
-
SCRIPT
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
end
|