react-native-beidou 1.0.3 → 1.0.4

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.
Files changed (70) hide show
  1. package/BeiDouAIDLTestPage.tsx +7 -7
  2. package/Compass.android.tsx +20 -0
  3. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  4. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  5. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  6. package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
  7. package/android/.idea/AndroidProjectSystem.xml +6 -0
  8. package/android/.idea/gradle.xml +13 -0
  9. package/android/.idea/migrations.xml +10 -0
  10. package/android/.idea/misc.xml +9 -0
  11. package/android/.idea/runConfigurations.xml +17 -0
  12. package/android/.idea/vcs.xml +6 -0
  13. package/android/build.gradle +3 -0
  14. package/android/src/main/AndroidManifest.xml +7 -0
  15. package/android/src/main/java/com/cmcc_rn_module/BeiDouBluetoothModule.java +343 -101
  16. package/android/src/main/java/com/cmcc_rn_module/BeiDouBluetoothPackage.java +4 -1
  17. package/android/src/main/java/com/cmcc_rn_module/ChatDBManager.java +306 -0
  18. package/android/src/main/java/com/cmcc_rn_module/JsonUtil.java +113 -7
  19. package/android/src/main/java/com/cmcc_rn_module/view/CompassManager.java +41 -0
  20. package/android/src/main/java/com/cmcc_rn_module/view/CompassView.java +277 -0
  21. package/android/src/main/libs/bluetooth-sdk.aar +0 -0
  22. package/index.ts +188 -10
  23. package/ios/BDTCompassViewManager.h +15 -0
  24. package/ios/BDTCompassViewManager.m +24 -0
  25. package/ios/BeiDouBluetoothModule.h +20 -0
  26. package/ios/BeiDouBluetoothModule.m +424 -0
  27. package/ios/BeidouBluetooth.framework/BeidouBluetooth +0 -0
  28. package/ios/BeidouBluetooth.framework/Headers/BDTBluetoothManager.h +76 -0
  29. package/ios/BeidouBluetooth.framework/Headers/BDTChatDBManager.h +41 -0
  30. package/ios/BeidouBluetooth.framework/Headers/BDTDataPacketBuilder.h +62 -0
  31. package/ios/BeidouBluetooth.framework/Headers/BeidouBluetooth.h +21 -0
  32. package/ios/BeidouBluetooth.framework/Info.plist +0 -0
  33. package/ios/BeidouBluetooth.framework/Modules/module.modulemap +6 -0
  34. package/ios/BeidouBluetooth.framework/_CodeSignature/CodeDirectory +0 -0
  35. package/ios/BeidouBluetooth.framework/_CodeSignature/CodeRequirements +0 -0
  36. package/ios/BeidouBluetooth.framework/_CodeSignature/CodeRequirements-1 +0 -0
  37. package/ios/BeidouBluetooth.framework/_CodeSignature/CodeResources +177 -0
  38. package/ios/BeidouBluetooth.framework/_CodeSignature/CodeSignature +0 -0
  39. package/ios/CompassView.h +20 -0
  40. package/ios/CompassView.m +201 -0
  41. package/package.json +2 -1
  42. package/android/.gradle/8.8/checksums/checksums.lock +0 -0
  43. package/android/.gradle/8.8/dependencies-accessors/gc.properties +0 -0
  44. package/android/.gradle/8.8/fileChanges/last-build.bin +0 -0
  45. package/android/.gradle/8.8/fileHashes/fileHashes.bin +0 -0
  46. package/android/.gradle/8.8/fileHashes/fileHashes.lock +0 -0
  47. package/android/.gradle/8.8/gc.properties +0 -0
  48. package/ios/Podfile +0 -79
  49. package/ios/build_sdk.sh +0 -30
  50. package/ios/cmcc_rn_module/AppDelegate.h +0 -8
  51. package/ios/cmcc_rn_module/AppDelegate.mm +0 -108
  52. package/ios/cmcc_rn_module/CMCCAssetsLoaderModule.h +0 -17
  53. package/ios/cmcc_rn_module/CMCCAssetsLoaderModule.m +0 -38
  54. package/ios/cmcc_rn_module/Images.xcassets/AppIcon.appiconset/Contents.json +0 -53
  55. package/ios/cmcc_rn_module/Images.xcassets/Contents.json +0 -6
  56. package/ios/cmcc_rn_module/Info.plist +0 -62
  57. package/ios/cmcc_rn_module/LaunchScreen.storyboard +0 -47
  58. package/ios/cmcc_rn_module/main.m +0 -10
  59. package/ios/cmcc_rn_module.xcodeproj/project.pbxproj +0 -708
  60. package/ios/cmcc_rn_module.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  61. package/ios/cmcc_rn_module.xcodeproj/xcshareddata/xcschemes/cmcc_rn_module.xcscheme +0 -88
  62. package/ios/cmcc_rn_module.xcworkspace/contents.xcworkspacedata +0 -10
  63. package/ios/cmcc_rn_module.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  64. package/ios/cmcc_rn_moduleTests/Info.plist +0 -24
  65. package/ios/cmcc_rn_moduleTests/cmcc_rn_moduleTests.m +0 -66
  66. package/ios/reset_env.sh +0 -24
  67. package/ios/scripts/RNReanimated.podspec +0 -90
  68. package/ios/scripts/generate_dynamic_pod.rb +0 -166
  69. package/ios/scripts/native_modules_dy.rb +0 -317
  70. package/ios/scripts/react_native_pods_dy.rb +0 -773
@@ -1,8 +0,0 @@
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>
@@ -1,88 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Scheme
3
- LastUpgradeVersion = "1210"
4
- version = "1.3">
5
- <BuildAction
6
- parallelizeBuildables = "YES"
7
- buildImplicitDependencies = "YES">
8
- <BuildActionEntries>
9
- <BuildActionEntry
10
- buildForTesting = "YES"
11
- buildForRunning = "YES"
12
- buildForProfiling = "YES"
13
- buildForArchiving = "YES"
14
- buildForAnalyzing = "YES">
15
- <BuildableReference
16
- BuildableIdentifier = "primary"
17
- BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
18
- BuildableName = "cmcc_rn_module.app"
19
- BlueprintName = "cmcc_rn_module"
20
- ReferencedContainer = "container:cmcc_rn_module.xcodeproj">
21
- </BuildableReference>
22
- </BuildActionEntry>
23
- </BuildActionEntries>
24
- </BuildAction>
25
- <TestAction
26
- buildConfiguration = "Debug"
27
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
- shouldUseLaunchSchemeArgsEnv = "YES">
30
- <Testables>
31
- <TestableReference
32
- skipped = "NO">
33
- <BuildableReference
34
- BuildableIdentifier = "primary"
35
- BlueprintIdentifier = "00E356ED1AD99517003FC87E"
36
- BuildableName = "cmcc_rn_moduleTests.xctest"
37
- BlueprintName = "cmcc_rn_moduleTests"
38
- ReferencedContainer = "container:cmcc_rn_module.xcodeproj">
39
- </BuildableReference>
40
- </TestableReference>
41
- </Testables>
42
- </TestAction>
43
- <LaunchAction
44
- buildConfiguration = "Debug"
45
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
46
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47
- launchStyle = "0"
48
- useCustomWorkingDirectory = "NO"
49
- ignoresPersistentStateOnLaunch = "NO"
50
- debugDocumentVersioning = "YES"
51
- debugServiceExtension = "internal"
52
- allowLocationSimulation = "YES">
53
- <BuildableProductRunnable
54
- runnableDebuggingMode = "0">
55
- <BuildableReference
56
- BuildableIdentifier = "primary"
57
- BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
58
- BuildableName = "cmcc_rn_module.app"
59
- BlueprintName = "cmcc_rn_module"
60
- ReferencedContainer = "container:cmcc_rn_module.xcodeproj">
61
- </BuildableReference>
62
- </BuildableProductRunnable>
63
- </LaunchAction>
64
- <ProfileAction
65
- buildConfiguration = "Release"
66
- shouldUseLaunchSchemeArgsEnv = "YES"
67
- savedToolIdentifier = ""
68
- useCustomWorkingDirectory = "NO"
69
- debugDocumentVersioning = "YES">
70
- <BuildableProductRunnable
71
- runnableDebuggingMode = "0">
72
- <BuildableReference
73
- BuildableIdentifier = "primary"
74
- BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
75
- BuildableName = "cmcc_rn_module.app"
76
- BlueprintName = "cmcc_rn_module"
77
- ReferencedContainer = "container:cmcc_rn_module.xcodeproj">
78
- </BuildableReference>
79
- </BuildableProductRunnable>
80
- </ProfileAction>
81
- <AnalyzeAction
82
- buildConfiguration = "Debug">
83
- </AnalyzeAction>
84
- <ArchiveAction
85
- buildConfiguration = "Release"
86
- revealArchiveInOrganizer = "YES">
87
- </ArchiveAction>
88
- </Scheme>
@@ -1,10 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Workspace
3
- version = "1.0">
4
- <FileRef
5
- location = "group:cmcc_rn_module.xcodeproj">
6
- </FileRef>
7
- <FileRef
8
- location = "group:Pods/Pods.xcodeproj">
9
- </FileRef>
10
- </Workspace>
@@ -1,8 +0,0 @@
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>
@@ -1,24 +0,0 @@
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>CFBundleDevelopmentRegion</key>
6
- <string>en</string>
7
- <key>CFBundleExecutable</key>
8
- <string>$(EXECUTABLE_NAME)</string>
9
- <key>CFBundleIdentifier</key>
10
- <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11
- <key>CFBundleInfoDictionaryVersion</key>
12
- <string>6.0</string>
13
- <key>CFBundleName</key>
14
- <string>$(PRODUCT_NAME)</string>
15
- <key>CFBundlePackageType</key>
16
- <string>BNDL</string>
17
- <key>CFBundleShortVersionString</key>
18
- <string>1.0</string>
19
- <key>CFBundleSignature</key>
20
- <string>????</string>
21
- <key>CFBundleVersion</key>
22
- <string>1</string>
23
- </dict>
24
- </plist>
@@ -1,66 +0,0 @@
1
- #import <UIKit/UIKit.h>
2
- #import <XCTest/XCTest.h>
3
-
4
- #import <React/RCTLog.h>
5
- #import <React/RCTRootView.h>
6
-
7
- #define TIMEOUT_SECONDS 600
8
- #define TEXT_TO_LOOK_FOR @"Welcome to React"
9
-
10
- @interface cmcc_rn_moduleTests : XCTestCase
11
-
12
- @end
13
-
14
- @implementation cmcc_rn_moduleTests
15
-
16
- - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test
17
- {
18
- if (test(view)) {
19
- return YES;
20
- }
21
- for (UIView *subview in [view subviews]) {
22
- if ([self findSubviewInView:subview matching:test]) {
23
- return YES;
24
- }
25
- }
26
- return NO;
27
- }
28
-
29
- - (void)testRendersWelcomeScreen
30
- {
31
- UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
32
- NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
33
- BOOL foundElement = NO;
34
-
35
- __block NSString *redboxError = nil;
36
- #ifdef DEBUG
37
- RCTSetLogFunction(
38
- ^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
39
- if (level >= RCTLogLevelError) {
40
- redboxError = message;
41
- }
42
- });
43
- #endif
44
-
45
- while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
46
- [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
47
- [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
48
-
49
- foundElement = [self findSubviewInView:vc.view
50
- matching:^BOOL(UIView *view) {
51
- if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
52
- return YES;
53
- }
54
- return NO;
55
- }];
56
- }
57
-
58
- #ifdef DEBUG
59
- RCTSetLogFunction(RCTDefaultLogFunction);
60
- #endif
61
-
62
- XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
63
- XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
64
- }
65
-
66
- @end
package/ios/reset_env.sh DELETED
@@ -1,24 +0,0 @@
1
- if [[ $1 == true ]]; then
2
- export DYNAMIC_POD_ENABLED=true
3
- echo "\033[32m设置环境变量 [DYNAMIC_POD_ENABLED] $DYNAMIC_POD_ENABLED\033[0m"
4
-
5
- if [[ -n $2 ]]; then
6
- export DYNAMIC_POD_PATH=$2
7
- echo "\033[32m设置环境变量 [DYNAMIC_POD_PATH] $DYNAMIC_POD_PATH\033[0m"
8
- fi
9
-
10
- if [[ -n $3 ]]; then
11
- export RN_POD_GIT_PATH=$3
12
- echo "\033[32m设置环境变量 [RN_POD_GIT_PATH] $RN_POD_GIT_PATH\033[0m"
13
- fi
14
-
15
- else
16
- unset DYNAMIC_POD_ENABLED
17
- echo "\033[32m清除环境变量 [DYNAMIC_POD_ENABLED]\033[0m"
18
-
19
- unset DYNAMIC_POD_PATH
20
- echo "\033[32m清除环境变量 [DYNAMIC_POD_PATH]\033[0m"
21
-
22
- unset RN_POD_GIT_PATH
23
- echo "\033[32m清除环境变量 [RN_POD_GIT_PATH]\033[0m"
24
- fi
@@ -1,90 +0,0 @@
1
- require "json"
2
- # require_relative './scripts/reanimated_utils'
3
-
4
- reanimated_package_json = JSON.parse(File.read(File.join(__dir__, "package.json")))
5
- # config = find_config()
6
- # assert_no_multiple_instances(config)
7
- # assert_no_reanimated2_with_new_architecture(reanimated_package_json)
8
-
9
- version_code = '68'
10
- folly_prefix = 'RCT-'
11
- folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DREACT_NATIVE_MINOR_VERSION=' + version_code
12
- folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
13
- boost_compiler_flags = '-Wno-documentation'
14
- version_flag = '-DREANIMATED_VERSION=' + reanimated_package_json["version"]
15
-
16
- Pod::Spec.new do |s|
17
-
18
- s.name = "RNReanimated"
19
- s.version = reanimated_package_json["version"]
20
- s.summary = reanimated_package_json["description"]
21
- s.description = <<-DESC
22
- RNReanimated
23
- DESC
24
- s.homepage = "https://github.com/software-mansion/react-native-reanimated"
25
- s.license = "MIT"
26
- # s.license = { :type => "MIT", :file => "FILE_LICENSE" }
27
- s.author = { "author" => "author@domain.cn" }
28
- s.platforms = { :ios => "9.0", :tvos => "9.0" }
29
- s.source = { :git => "https://github.com/software-mansion/react-native-reanimated.git", :tag => "#{s.version}" }
30
-
31
- s.source_files = [
32
- "ios/**/*.{mm,h,m}",
33
- "Common/cpp/**/*.{cpp,h}"
34
- ]
35
-
36
- s.preserve_paths = [
37
- "Common/cpp/hidden_headers/**"
38
- ]
39
-
40
- s.pod_target_xcconfig = {
41
- "USE_HEADERMAP" => "YES",
42
- "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/#{folly_prefix}Folly\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\" ",
43
- "FRAMEWORK_SEARCH_PATHS" => "\"${PODS_CONFIGURATION_BUILD_DIR}/React-hermes\"",
44
- }
45
- s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
46
- s.xcconfig = {
47
- "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/#{folly_prefix}Folly\" \"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-hermes\" \"${PODS_ROOT}/Headers/Public/hermes-engine\" \"$(PODS_ROOT)/ReactCommon\"",
48
- "OTHER_CFLAGS" => "$(inherited)" + " " + folly_flags + " " + version_flag
49
- }
50
-
51
- s.requires_arc = true
52
-
53
- s.dependency "React-Core"
54
- s.dependency "#{folly_prefix}Folly"
55
- s.dependency "RCTRequired"
56
- s.dependency "RCTTypeSafety"
57
- s.dependency "ReactCommon/turbomodule/core"
58
- s.dependency 'FBLazyVector'
59
- s.dependency 'FBReactNativeSpec'
60
- s.dependency 'RCTRequired'
61
- s.dependency 'RCTTypeSafety'
62
- s.dependency 'React-Core'
63
- s.dependency 'React-CoreModules'
64
- s.dependency 'React-Core/DevSupport'
65
- # if !config[:is_tvos_target]
66
- s.dependency 'React-RCTActionSheet'
67
- # end
68
- s.dependency 'React-RCTNetwork'
69
- s.dependency 'React-RCTAnimation'
70
- s.dependency 'React-RCTLinking'
71
- s.dependency 'React-RCTBlob'
72
- s.dependency 'React-RCTSettings'
73
- s.dependency 'React-RCTText'
74
- s.dependency 'React-RCTImage'
75
- s.dependency 'React-Core/RCTWebSocket'
76
- s.dependency 'React-cxxreact'
77
- s.dependency 'React-jsi'
78
- s.dependency 'React-jsiexecutor'
79
- s.dependency 'React-jsinspector'
80
- s.dependency 'ReactCommon/turbomodule/core'
81
- s.dependency 'Yoga'
82
- s.dependency 'DoubleConversion'
83
- s.dependency 'glog'
84
-
85
- # if config[:react_native_minor_version] == 62
86
- # s.dependency 'ReactCommon/callinvoker'
87
- # else
88
- s.dependency 'React-callinvoker'
89
- # end
90
- end
@@ -1,166 +0,0 @@
1
- # 1.替换native_modules脚本,增加生成rn中使用原生pod功能
2
- # 2.dynamic_pod拷贝到手厅指定目录
3
-
4
- require 'fileutils'
5
-
6
- # 工程内React Native路径
7
- $dynamic_pod_pre_dir = "ReactNative"
8
-
9
- # 替换native_modules.rb
10
- def replace_native_modules()
11
- # native_modules相对路径
12
- native_modules_file = '../node_modules/@react-native-community/cli-platform-ios/native_modules.rb'
13
- # 替换文件
14
- native_modules_dy_file = 'native_modules_dy.rb'
15
- native_modules_dy_dir = "scripts/#{native_modules_dy_file}"
16
- # 替换文件不存在退出程序
17
- if !File.exist?(native_modules_dy_dir)
18
- puts "\033[31m[#{native_modules_dy_file}] 文件不存在\033[0m"
19
- return
20
- end
21
-
22
- FileUtils.cp(native_modules_dy_dir, native_modules_file)
23
-
24
- # react_native_pods相对路径
25
- react_native_pods_file = '../node_modules/react-native/scripts/react_native_pods.rb'
26
- # 替换文件
27
- react_native_pods_dy_file = 'react_native_pods_dy.rb'
28
- react_native_pods_dy_dir = "scripts/#{react_native_pods_dy_file}"
29
- # 替换文件不存在退出程序
30
- if !File.exist?(react_native_pods_dy_dir)
31
- puts "\033[31m[#{react_native_pods_dy_file}] 文件不存在\033[0m"
32
- return
33
- end
34
-
35
- FileUtils.cp(react_native_pods_dy_dir, react_native_pods_file)
36
-
37
- puts "\033[32m[native_modules、react_native_pods] 脚本替换完成\033[0m"
38
- end
39
-
40
- # 拷贝脚本到手厅指定目录
41
- def copy_script()
42
-
43
- # 未开启直接退出
44
- if ENV['DYNAMIC_POD_ENABLED'].nil? || ENV['DYNAMIC_POD_ENABLED'] != "true"
45
- return
46
- end
47
-
48
- rn_dynamic_pod_file = 'rn_dynamic_pod.rb'
49
- if !File.exist?(rn_dynamic_pod_file)
50
- return
51
- end
52
-
53
- dir_items = []
54
-
55
- if ENV['DYNAMIC_POD_PATH'].nil? || ENV['DYNAMIC_POD_PATH'].empty?
56
- puts "\033[33m[可忽略] 未传入工程目录\033[0m"
57
- return
58
- end
59
-
60
- dir_items = ENV['DYNAMIC_POD_PATH'].split(',')
61
-
62
- method_str = "\n\nrequire_relative 'scripts/react_native_pods.rb'\n\ndef react_native_xcode_15_adaptive(installer)
63
-
64
- react_native_post_install(installer)
65
- __apply_Xcode_12_5_M1_post_install_workaround(installer)
66
-
67
- # 修复iOS 17报错问题
68
- # No template named 'unary_function' in namespace 'std'; did you mean '__unary_function'?
69
- installer.pods_project.targets.each do |target|
70
- target.build_configurations.each do |config|
71
- config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']
72
- end
73
- end
74
- end"
75
-
76
- # 追加写入dynamic_pod中
77
- File.open(rn_dynamic_pod_file, 'a') do |file|
78
- file.write("#{method_str}")
79
- file.fsync
80
- puts "\033[32mWirting fix_iOS_17_error method\033[0m"
81
- end
82
-
83
- dir_items.each do |item|
84
- if File.exist?(item)
85
- # 拼接目录
86
- dynamic_pod_des_dir = File.join(item, $dynamic_pod_pre_dir)
87
- # 拼接目录
88
- des_dir = File.join(item, $dynamic_pod_pre_dir)
89
- # 拷贝rn_dynamic_pod_file脚本
90
- copy_file('', des_dir, rn_dynamic_pod_file)
91
-
92
- # 拷贝react_native_pods_dy脚本
93
- react_native_pods_file = "../node_modules/react-native/scripts/react_native_pods.rb"
94
- react_native_pods_dir = "../node_modules/react-native/scripts"
95
- react_native_pods_name = 'react_native_pods.rb'
96
- if File.exist?(react_native_pods_file)
97
- # 拼接目录
98
- des_dir = File.join(des_dir, 'scripts')
99
- copy_file(react_native_pods_dir, des_dir, react_native_pods_name)
100
-
101
- else
102
- puts "\033[31m[#{react_native_pods_name}] 文件不存在\033[0m"
103
- break
104
- end
105
-
106
- # 拷贝script_phases.rb脚本
107
- script_phases_rb_file = "../node_modules/react-native/scripts/react_native_pods_utils/script_phases.rb"
108
- script_phases_rb_dir = "../node_modules/react-native/scripts/react_native_pods_utils"
109
- script_phases_rb_name = "script_phases.rb"
110
- if File.exist?(script_phases_rb_file)
111
- # 拼接目录
112
- des_dir = File.join(des_dir, 'react_native_pods_utils')
113
- copy_file(script_phases_rb_dir, des_dir, script_phases_rb_name)
114
-
115
- else
116
- puts "\033[31m[#{script_phases_rb_name}] 文件不存在\033[0m"
117
- break
118
- end
119
-
120
- # 拷贝script_phases.sh脚本
121
- script_phases_sh_file = "../node_modules/react-native/scripts/react_native_pods_utils/script_phases.sh"
122
- script_phases_sh_name = "script_phases.sh"
123
- if File.exist?(script_phases_sh_file)
124
- copy_file(script_phases_rb_dir, des_dir, script_phases_sh_name)
125
- else
126
- puts "\033[31m[#{script_phases_sh_name}] 文件不存在\033[0m"
127
- break
128
- end
129
-
130
- # 拷贝RNReanimated.podspec
131
- reanimated_name = "RNReanimated.podspec"
132
- reanimated_des_dir = File.join(dynamic_pod_des_dir, 'dynamic_pod/react-native-reanimated')
133
- if File.exist?(script_phases_sh_file)
134
- copy_file('scripts', reanimated_des_dir, reanimated_name)
135
- else
136
- puts "\033[31m[#{reanimated_name}] 文件不存在\033[0m"
137
- break
138
- end
139
-
140
- else
141
- puts "\033[33m[可忽略][#{item}/#{rn_dynamic_pod_file}] 工程目录/#{rn_dynamic_pod_file}不存在\033[0m"
142
- end
143
- end
144
-
145
- end
146
-
147
- # 拷贝文件
148
- def copy_file(source_dir, target_dir, file)
149
- # 目录不存在创建
150
- unless Dir.exist?(target_dir)
151
- FileUtils.mkdir_p(target_dir)
152
- end
153
-
154
- begin
155
- target_file = File.join(target_dir, file)
156
- des_file = file
157
- if source_dir.present?
158
- des_file = File.join(source_dir, file)
159
- end
160
-
161
- FileUtils.cp(des_file, target_file)
162
- puts "\033[32mCopying #{file} >> #{target_dir}\033[0m"
163
- rescue StandardError => e
164
- puts "\033[33m[可忽略] Copying fail #{file} >> #{target_dir}\033[0m"
165
- end
166
- end