Skip to content

Commit 647cab5

Browse files
committed
chore: iOS setup
1 parent 54a22f3 commit 647cab5

File tree

16 files changed

+15077
-97
lines changed

16 files changed

+15077
-97
lines changed

cpp/NativeBcryptCppTurboModule.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
#include "NativeBcryptCppTurboModule.h"
3+
4+
5+
6+
namespace facebook::react {
7+
NativeBcryptCppTurboModule::NativeBcryptCppTurboModule(std::shared_ptr<CallInvoker> jsinvoker): NativeBcryptCppCxxSpec<NativeBcryptCppTurboModule>(std::move(jsinvoker)) {}
8+
9+
jsi::Value NativeBcryptCppTurboModule::generateHash(jsi::Runtime &rt, std::string password, double workload) {
10+
return jsi::Value::undefined();
11+
}
12+
13+
14+
jsi::Value NativeBcryptCppTurboModule::validatePassword(jsi::Runtime &rt, std::string password, std::string hash) {
15+
return jsi::Value::undefined();
16+
}
17+
std::string NativeBcryptCppTurboModule::generateHashSync(jsi::Runtime &rt, std::string password, double workload){
18+
19+
return "generateHashSync";
20+
}
21+
bool NativeBcryptCppTurboModule::validatePasswordSync(jsi::Runtime &rt, std::string password, std::string hash) {
22+
return "validatePasswordSync";
23+
}
24+
25+
}

cpp/NativeBcryptCppTurboModule.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include <React-Codegen/RNBcryptCppSpecJSI.h>
2+
3+
4+
namespace facebook::react {
5+
class NativeBcryptCppTurboModule: public NativeBcryptCppCxxSpec<NativeBcryptCppTurboModule> {
6+
public:
7+
NativeBcryptCppTurboModule(std::shared_ptr<CallInvoker> jsInvoker);
8+
9+
jsi::Value generateHash(jsi::Runtime &rt, std::string password, double workload);
10+
jsi::Value validatePassword(jsi::Runtime &rt, std::string password, std::string hash);
11+
std::string generateHashSync(jsi::Runtime &rt, std::string password, double workload);
12+
bool validatePasswordSync(jsi::Runtime &rt, std::string password, std::string hash);
13+
};
14+
}

cpp/react-native-bcrypt-cpp.cpp

Lines changed: 0 additions & 7 deletions
This file was deleted.

cpp/react-native-bcrypt-cpp.h

Lines changed: 0 additions & 8 deletions
This file was deleted.

example/ios/BcryptCppExample.xcodeproj/project.pbxproj

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
1313
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
1414
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
15+
32F8072EC354884BC9DEA9A8 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 0580ABFB39ADC1A50C1EF3C7 /* PrivacyInfo.xcprivacy */; };
1516
7699B88040F8A987B510C191 /* libPods-BcryptCppExample-BcryptCppExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-BcryptCppExample-BcryptCppExampleTests.a */; };
1617
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
1718
/* End PBXBuildFile section */
@@ -30,13 +31,14 @@
3031
00E356EE1AD99517003FC87E /* BcryptCppExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BcryptCppExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3132
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3233
00E356F21AD99517003FC87E /* BcryptCppExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BcryptCppExampleTests.m; sourceTree = "<group>"; };
34+
0580ABFB39ADC1A50C1EF3C7 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = BcryptCppExample/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
3335
13B07F961A680F5B00A75B9A /* BcryptCppExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BcryptCppExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
3436
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = BcryptCppExample/AppDelegate.h; sourceTree = "<group>"; };
3537
13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = BcryptCppExample/AppDelegate.mm; sourceTree = "<group>"; };
3638
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = BcryptCppExample/Images.xcassets; sourceTree = "<group>"; };
3739
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = BcryptCppExample/Info.plist; sourceTree = "<group>"; };
3840
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = BcryptCppExample/main.m; sourceTree = "<group>"; };
39-
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = BcryptCppExample/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
41+
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = BcryptCppExample/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
4042
19F6CBCC0A4E27FBF8BF4A61 /* libPods-BcryptCppExample-BcryptCppExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BcryptCppExample-BcryptCppExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
4143
3B4392A12AC88292D35C810B /* Pods-BcryptCppExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BcryptCppExample.debug.xcconfig"; path = "Target Support Files/Pods-BcryptCppExample/Pods-BcryptCppExample.debug.xcconfig"; sourceTree = "<group>"; };
4244
5709B34CF0A7D63546082F79 /* Pods-BcryptCppExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BcryptCppExample.release.xcconfig"; path = "Target Support Files/Pods-BcryptCppExample/Pods-BcryptCppExample.release.xcconfig"; sourceTree = "<group>"; };
@@ -94,6 +96,7 @@
9496
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
9597
13B07FB71A68108700A75B9A /* main.m */,
9698
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */,
99+
0580ABFB39ADC1A50C1EF3C7 /* PrivacyInfo.xcprivacy */,
97100
);
98101
name = BcryptCppExample;
99102
sourceTree = "<group>";
@@ -245,6 +248,7 @@
245248
files = (
246249
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
247250
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
251+
32F8072EC354884BC9DEA9A8 /* PrivacyInfo.xcprivacy in Resources */,
248252
);
249253
runOnlyForDeploymentPostprocessing = 0;
250254
};
@@ -431,7 +435,7 @@
431435
"-lc++",
432436
"$(inherited)",
433437
);
434-
PRODUCT_BUNDLE_IDENTIFIER = "bcryptcpp.example";
438+
PRODUCT_BUNDLE_IDENTIFIER = bcryptcpp.example;
435439
PRODUCT_NAME = "$(TARGET_NAME)";
436440
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BcryptCppExample.app/BcryptCppExample";
437441
};
@@ -455,7 +459,7 @@
455459
"-lc++",
456460
"$(inherited)",
457461
);
458-
PRODUCT_BUNDLE_IDENTIFIER = "bcryptcpp.example";
462+
PRODUCT_BUNDLE_IDENTIFIER = bcryptcpp.example;
459463
PRODUCT_NAME = "$(TARGET_NAME)";
460464
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BcryptCppExample.app/BcryptCppExample";
461465
};
@@ -480,7 +484,7 @@
480484
"-ObjC",
481485
"-lc++",
482486
);
483-
PRODUCT_BUNDLE_IDENTIFIER = "bcryptcpp.example";
487+
PRODUCT_BUNDLE_IDENTIFIER = bcryptcpp.example;
484488
PRODUCT_NAME = BcryptCppExample;
485489
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
486490
SWIFT_VERSION = 5.0;
@@ -506,7 +510,7 @@
506510
"-ObjC",
507511
"-lc++",
508512
);
509-
PRODUCT_BUNDLE_IDENTIFIER = "bcryptcpp.example";
513+
PRODUCT_BUNDLE_IDENTIFIER = bcryptcpp.example;
510514
PRODUCT_NAME = BcryptCppExample;
511515
SWIFT_VERSION = 5.0;
512516
VERSIONING_SYSTEM = "apple-generic";
@@ -517,6 +521,7 @@
517521
isa = XCBuildConfiguration;
518522
buildSettings = {
519523
ALWAYS_SEARCH_USER_PATHS = NO;
524+
CC = "";
520525
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
521526
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
522527
CLANG_CXX_LIBRARY = "libc++";
@@ -544,6 +549,7 @@
544549
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
545550
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
546551
COPY_PHASE_STRIP = NO;
552+
CXX = "";
547553
ENABLE_STRICT_OBJC_MSGSEND = YES;
548554
ENABLE_TESTABILITY = YES;
549555
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
@@ -563,6 +569,8 @@
563569
GCC_WARN_UNUSED_FUNCTION = YES;
564570
GCC_WARN_UNUSED_VARIABLE = YES;
565571
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
572+
LD = "";
573+
LDPLUSPLUS = "";
566574
LD_RUNPATH_SEARCH_PATHS = (
567575
/usr/lib/swift,
568576
"$(inherited)",
@@ -582,14 +590,21 @@
582590
"-DFOLLY_CFG_NO_COROUTINES=1",
583591
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
584592
);
593+
OTHER_LDFLAGS = (
594+
"$(inherited)",
595+
" ",
596+
);
597+
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
585598
SDKROOT = iphoneos;
599+
USE_HERMES = true;
586600
};
587601
name = Debug;
588602
};
589603
83CBBA211A601CBA00E9B192 /* Release */ = {
590604
isa = XCBuildConfiguration;
591605
buildSettings = {
592606
ALWAYS_SEARCH_USER_PATHS = NO;
607+
CC = "";
593608
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
594609
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
595610
CLANG_CXX_LIBRARY = "libc++";
@@ -617,6 +632,7 @@
617632
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
618633
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
619634
COPY_PHASE_STRIP = YES;
635+
CXX = "";
620636
ENABLE_NS_ASSERTIONS = NO;
621637
ENABLE_STRICT_OBJC_MSGSEND = YES;
622638
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
@@ -629,6 +645,8 @@
629645
GCC_WARN_UNUSED_FUNCTION = YES;
630646
GCC_WARN_UNUSED_VARIABLE = YES;
631647
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
648+
LD = "";
649+
LDPLUSPLUS = "";
632650
LD_RUNPATH_SEARCH_PATHS = (
633651
/usr/lib/swift,
634652
"$(inherited)",
@@ -647,7 +665,13 @@
647665
"-DFOLLY_CFG_NO_COROUTINES=1",
648666
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
649667
);
668+
OTHER_LDFLAGS = (
669+
"$(inherited)",
670+
" ",
671+
);
672+
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
650673
SDKROOT = iphoneos;
674+
USE_HERMES = true;
651675
VALIDATE_PRODUCT = YES;
652676
};
653677
name = Release;

example/ios/BcryptCppExample.xcworkspace/contents.xcworkspacedata

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

example/ios/BcryptCppExample/PrivacyInfo.xcprivacy

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,36 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>NSPrivacyCollectedDataTypes</key>
6-
<array>
7-
</array>
8-
<key>NSPrivacyAccessedAPITypes</key>
9-
<array>
10-
<dict>
11-
<key>NSPrivacyAccessedAPIType</key>
12-
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
13-
<key>NSPrivacyAccessedAPITypeReasons</key>
14-
<array>
15-
<string>C617.1</string>
16-
</array>
17-
</dict>
18-
<dict>
19-
<key>NSPrivacyAccessedAPIType</key>
20-
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
21-
<key>NSPrivacyAccessedAPITypeReasons</key>
22-
<array>
23-
<string>CA92.1</string>
24-
</array>
25-
</dict>
26-
<dict>
27-
<key>NSPrivacyAccessedAPIType</key>
28-
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
29-
<key>NSPrivacyAccessedAPITypeReasons</key>
30-
<array>
31-
<string>35F9.1</string>
32-
</array>
33-
</dict>
34-
</array>
35-
<key>NSPrivacyTracking</key>
36-
<false/>
5+
<key>NSPrivacyAccessedAPITypes</key>
6+
<array>
7+
<dict>
8+
<key>NSPrivacyAccessedAPIType</key>
9+
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
10+
<key>NSPrivacyAccessedAPITypeReasons</key>
11+
<array>
12+
<string>C617.1</string>
13+
</array>
14+
</dict>
15+
<dict>
16+
<key>NSPrivacyAccessedAPIType</key>
17+
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
18+
<key>NSPrivacyAccessedAPITypeReasons</key>
19+
<array>
20+
<string>CA92.1</string>
21+
</array>
22+
</dict>
23+
<dict>
24+
<key>NSPrivacyAccessedAPIType</key>
25+
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
26+
<key>NSPrivacyAccessedAPITypeReasons</key>
27+
<array>
28+
<string>35F9.1</string>
29+
</array>
30+
</dict>
31+
</array>
32+
<key>NSPrivacyCollectedDataTypes</key>
33+
<array/>
34+
<key>NSPrivacyTracking</key>
35+
<false/>
3736
</dict>
3837
</plist>

0 commit comments

Comments
 (0)