react-native-update 10.58.1 → 10.59.1
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/README-CN.md +7 -0
- package/README.md +8 -0
- package/android/build.gradle +46 -14
- package/android/jni/Android.mk +2 -1
- package/android/lib/arm64-v8a/librnpushy.so +0 -0
- package/android/lib/armeabi-v7a/librnpushy.so +0 -0
- package/android/lib/x86/librnpushy.so +0 -0
- package/android/lib/x86_64/librnpushy.so +0 -0
- package/android/src/main/java/cn/reactnative/modules/update/ApkInstaller.java +6 -6
- package/android/src/main/java/cn/reactnative/modules/update/{NativeUpdateResult.java → BundlePreparationResult.java} +6 -6
- package/android/src/main/java/cn/reactnative/modules/update/BundledResourceCopier.java +4 -4
- package/android/src/main/java/cn/reactnative/modules/update/{CrashRescue.java → CrashHold.java} +12 -12
- package/android/src/main/java/cn/reactnative/modules/update/DownloadTask.java +28 -24
- package/android/src/main/java/cn/reactnative/modules/update/ErrorCodes.java +2 -1
- package/android/src/main/java/cn/reactnative/modules/update/{NativeUpdateFlow.java → FlowBridge.java} +6 -6
- package/android/src/main/java/cn/reactnative/modules/update/HttpUtils.java +6 -3
- package/android/src/main/java/cn/reactnative/modules/update/{NativeUpdateCore.java → NativeCore.java} +4 -4
- package/android/src/main/java/cn/reactnative/modules/update/{NativeUpdateConfig.java → PushyConfiguration.java} +13 -8
- package/android/src/main/java/cn/reactnative/modules/update/{PushyNativeUpdate.java → PushyRuntime.java} +15 -15
- package/android/src/main/java/cn/reactnative/modules/update/ReactReloadManager.java +7 -7
- package/android/src/main/java/cn/reactnative/modules/update/StateSerialRunner.java +1 -1
- package/android/src/main/java/cn/reactnative/modules/update/{NativeCheckOrchestrator.java → SyncCoordinator.java} +107 -103
- package/android/src/main/java/cn/reactnative/modules/update/Texts.java +28 -0
- package/android/src/main/java/cn/reactnative/modules/update/UiThreadRunner.java +1 -1
- package/android/src/main/java/cn/reactnative/modules/update/UpdateContext.java +29 -29
- package/android/src/main/java/cn/reactnative/modules/update/UpdateModuleImpl.java +12 -9
- package/cpp/patch_core/archive_limits.h +5 -0
- package/cpp/patch_core/archive_patch_core.cpp +26 -19
- package/cpp/patch_core/archive_patch_core.h +17 -8
- package/cpp/patch_core/digest.h +6 -1
- package/cpp/patch_core/error_codes.h +8 -1
- package/cpp/patch_core/hbc_transform.h +5 -0
- package/cpp/patch_core/hbc_transform_wire.h +5 -0
- package/cpp/patch_core/install_record.h +5 -0
- package/cpp/patch_core/jni_natives.h +27 -0
- package/cpp/patch_core/jni_registration.cpp +103 -0
- package/cpp/patch_core/obscured_text.h +44 -0
- package/cpp/patch_core/patch_core.cpp +13 -13
- package/cpp/patch_core/patch_core.h +11 -6
- package/cpp/patch_core/patch_core_android.cpp +10 -10
- package/cpp/patch_core/state_core.h +5 -0
- package/cpp/patch_core/state_ops.h +5 -0
- package/cpp/patch_core/update_core_android.cpp +23 -22
- package/cpp/update_flow_core/flow_json.h +6 -1
- package/cpp/update_flow_core/update_flow_core.cpp +35 -18
- package/cpp/update_flow_core/update_flow_core.h +13 -8
- package/cpp/update_flow_core/update_flow_jni.cpp +11 -13
- package/harmony/pushy/src/main/cpp/CMakeLists.txt +8 -8
- package/harmony/pushy/src/main/cpp/pushy.cpp +33 -33
- package/harmony/pushy/src/main/ets/ArchiveLimits.ts +15 -15
- package/harmony/pushy/src/main/ets/{NativeUpdateResult.ts → BundlePreparationResult.ts} +6 -6
- package/harmony/pushy/src/main/ets/DownloadTask.ts +60 -60
- package/harmony/pushy/src/main/ets/ErrorCodes.ts +13 -11
- package/harmony/pushy/src/main/ets/InstallRecord.ts +4 -4
- package/harmony/pushy/src/main/ets/NativePatchCore.ts +9 -9
- package/harmony/pushy/src/main/ets/PathUtils.ts +2 -2
- package/harmony/pushy/src/main/ets/{NativeUpdateConfig.ts → PushyConfiguration.ts} +12 -10
- package/harmony/pushy/src/main/ets/PushyFileJSBundleProvider.ets +8 -8
- package/harmony/pushy/src/main/ets/PushyTurboModule.ts +42 -41
- package/harmony/pushy/src/main/ets/{NativeCheckOrchestrator.ts → SyncCoordinator.ts} +71 -70
- package/harmony/pushy/src/main/ets/Texts.ts +28 -0
- package/harmony/pushy/src/main/ets/UpdateContext.ts +32 -31
- package/harmony/pushy.har +0 -0
- package/ios/RCTPushy/RCTPushy.h +8 -8
- package/ios/RCTPushy/RCTPushy.mm +155 -147
- package/ios/RCTPushy/RCTPushyConfiguration.h +13 -0
- package/ios/RCTPushy/{RCTPushyNativeConfig.mm → RCTPushyConfiguration.mm} +34 -7
- package/package.json +1 -1
- package/react-native-update.podspec +15 -3
- package/android/lib/arm64-v8a/librnupdate.so +0 -0
- package/android/lib/armeabi-v7a/librnupdate.so +0 -0
- package/android/lib/x86/librnupdate.so +0 -0
- package/android/lib/x86_64/librnupdate.so +0 -0
- package/ios/RCTPushy/RCTPushyNativeConfig.h +0 -5
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
|
|
3
|
+
// Validates and snapshots host options without changing any update state.
|
|
4
|
+
FOUNDATION_EXPORT NSString * _Nullable RCTPushyNormalizeConfiguration(
|
|
5
|
+
NSDictionary * _Nonnull options, NSError * _Nullable * _Nullable error);
|
|
6
|
+
|
|
7
|
+
// Decodes text produced by scripts/encode-native-text.ts (byte i XORed with
|
|
8
|
+
// (0x5A + 0x1D * i) & 0xFF), keeping service addresses and paths out of static
|
|
9
|
+
// string scans of the binary. Not a secret.
|
|
10
|
+
FOUNDATION_EXPORT NSString * _Nonnull RCTPushyRevealText(const char * _Nonnull hex);
|
|
11
|
+
|
|
12
|
+
// Request path appended to an endpoint base.
|
|
13
|
+
FOUNDATION_EXPORT NSString * _Nonnull RCTPushyQueryPath(void);
|
|
@@ -1,4 +1,29 @@
|
|
|
1
|
-
#import "
|
|
1
|
+
#import "RCTPushyConfiguration.h"
|
|
2
|
+
|
|
3
|
+
// Read through a volatile so the optimizer cannot fold the decode of a constant
|
|
4
|
+
// argument back into a plain string in the binary.
|
|
5
|
+
static volatile unsigned char PushyTextKeyBase = 0x5A;
|
|
6
|
+
|
|
7
|
+
NSString *RCTPushyRevealText(const char *hex) {
|
|
8
|
+
size_t length = strlen(hex) / 2;
|
|
9
|
+
NSMutableString *text = [NSMutableString stringWithCapacity:length];
|
|
10
|
+
unsigned char base = PushyTextKeyBase;
|
|
11
|
+
for (size_t i = 0; i < length; i++) {
|
|
12
|
+
char pair[3] = {hex[i * 2], hex[i * 2 + 1], 0};
|
|
13
|
+
unsigned char byte = (unsigned char)strtoul(pair, NULL, 16);
|
|
14
|
+
[text appendFormat:@"%c", (char)(byte ^ (unsigned char)(base + 0x1D * i))];
|
|
15
|
+
}
|
|
16
|
+
return text;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
NSString *RCTPushyQueryPath(void) {
|
|
20
|
+
static NSString *path;
|
|
21
|
+
static dispatch_once_t once;
|
|
22
|
+
dispatch_once(&once, ^{
|
|
23
|
+
path = RCTPushyRevealText("7514fcd4ad805d55263e08fc99");
|
|
24
|
+
});
|
|
25
|
+
return path;
|
|
26
|
+
}
|
|
2
27
|
|
|
3
28
|
static void PushyConfigInvalid(NSString *message) {
|
|
4
29
|
@throw [NSException exceptionWithName:NSInvalidArgumentException
|
|
@@ -48,7 +73,7 @@ static NSArray *PushyConfigUrls(id value, NSString *name, BOOL base) {
|
|
|
48
73
|
return result;
|
|
49
74
|
}
|
|
50
75
|
|
|
51
|
-
NSString *
|
|
76
|
+
NSString *RCTPushyNormalizeConfiguration(NSDictionary *options, NSError **error) {
|
|
52
77
|
@try {
|
|
53
78
|
if (![options isKindOfClass:NSDictionary.class]) {
|
|
54
79
|
PushyConfigInvalid(@"expected an object");
|
|
@@ -63,16 +88,18 @@ NSString *RCTPushyNormalizeNativeConfig(NSDictionary *options, NSError **error)
|
|
|
63
88
|
NSString *appKey = PushyConfigString(options[@"appKey"], @"appKey", NO);
|
|
64
89
|
BOOL customEndpoints = options[@"endpoints"] != nil;
|
|
65
90
|
NSArray *endpoints = PushyConfigUrls(customEndpoints ? options[@"endpoints"]
|
|
66
|
-
: @[
|
|
91
|
+
: @[RCTPushyRevealText("3203e0c1bdd1270a372f18f8c2b6de7f4f2607f5b3d5b9817b592947e5cdefbc8a7e"),
|
|
92
|
+
RCTPushyRevealText("3203e0c1bdd1270a372f18f8c2b6de7f4f2607f5f0daac9c644a620ae88ca1ad93")],
|
|
67
93
|
@"endpoints", YES);
|
|
68
94
|
NSArray *queryUrls = PushyConfigUrls(options[@"queryUrls"] ?: (customEndpoints ? @[]
|
|
69
|
-
: @[
|
|
70
|
-
|
|
95
|
+
: @[RCTPushyRevealText("3203e0c1bdd1270a253608fcd3fd9362476817f4f0d5a1996342631be3c2a3a9d779552507fdcde8928a6f512f5ce2ccbdc869404d2f1de79daa826d562c0913eec4fa9b7d4426"),
|
|
96
|
+
RCTPushyRevealText("3203e0c1bdd1270a213b12b7dca09468462e12f3b0d5bd813d482446f4c6a1be8e79552507fdcda68cd06e5c3710e480a4867048483e55e0c2ab8d7d43030d1ce9c3b183214e2601f2f0d5b782601e2719e8ca")]),
|
|
71
97
|
@"queryUrls", NO);
|
|
72
98
|
NSString *afterDownload = options[@"afterDownload"]
|
|
73
99
|
? PushyConfigString(options[@"afterDownload"], @"afterDownload", NO) : @"none";
|
|
74
|
-
|
|
75
|
-
|
|
100
|
+
NSString *nextLaunch = RCTPushyRevealText("2912e0ffab8e6c70323b1dedd3");
|
|
101
|
+
if (![@[@"none", nextLaunch] containsObject:afterDownload]) {
|
|
102
|
+
PushyConfigInvalid([@"afterDownload must be none or " stringByAppendingString:nextLaunch]);
|
|
76
103
|
}
|
|
77
104
|
id disabled = options[@"disabled"] ?: @NO;
|
|
78
105
|
if (![disabled isKindOfClass:NSNumber.class] || CFGetTypeID((__bridge CFTypeRef)disabled) != CFBooleanGetTypeID()) {
|
package/package.json
CHANGED
|
@@ -166,9 +166,12 @@ Pod::Spec.new do |s|
|
|
|
166
166
|
s.dependency 'ExpoModulesCore'
|
|
167
167
|
end
|
|
168
168
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
# Shared C/C++ core. Built with hidden visibility so none of its symbols are
|
|
170
|
+
# exported when the pod is linked as a dynamic framework. Per-file flags: the
|
|
171
|
+
# Objective-C classes in the RCTPushy subspec keep default visibility, which
|
|
172
|
+
# the host app and the Expo module need to link against RCTPushy.
|
|
173
|
+
s.subspec 'Core' do |ss|
|
|
174
|
+
ss.source_files = ['cpp/update_flow_core/flow_json.{h,cpp}',
|
|
172
175
|
'cpp/update_flow_core/update_flow_core.{h,cpp}',
|
|
173
176
|
'cpp/patch_core/archive_patch_core.{h,cpp}',
|
|
174
177
|
'cpp/patch_core/digest.{h,cpp}',
|
|
@@ -181,6 +184,15 @@ Pod::Spec.new do |s|
|
|
|
181
184
|
'android/jni/HDiffPatch/file_for_patch.{h,c}',
|
|
182
185
|
'android/jni/lzma/C/LzmaDec.{h,c}',
|
|
183
186
|
'android/jni/lzma/C/Lzma2Dec.{h,c}']
|
|
187
|
+
ss.private_header_files = ['cpp/**/*.h', 'android/jni/**/*.h']
|
|
188
|
+
# NDEBUG matches the prebuilt Android library and keeps third-party assertion
|
|
189
|
+
# text (file and expression strings) out of the binary.
|
|
190
|
+
ss.compiler_flags = '-DNDEBUG -fvisibility=hidden -fvisibility-inlines-hidden'
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
s.subspec 'RCTPushy' do |ss|
|
|
194
|
+
ss.dependency 'react-native-update/Core'
|
|
195
|
+
ss.source_files = ['ios/RCTPushy/*.{h,m,mm}']
|
|
184
196
|
ss.public_header_files = ['ios/RCTPushy/*.h']
|
|
185
197
|
end
|
|
186
198
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|