react-native-update 10.37.20 → 10.38.0-beta.0
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 +4 -4
- package/README.md +2 -12
- package/android/bin/.settings/org.eclipse.buildship.core.prefs +13 -0
- package/android/build.gradle +4 -0
- package/android/jni/Android.mk +14 -1
- package/android/jni/Application.mk +5 -2
- 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/android/src/main/java/cn/reactnative/modules/update/ArchivePatchPlanResult.java +6 -0
- package/android/src/main/java/cn/reactnative/modules/update/CopyGroupResult.java +6 -0
- package/android/src/main/java/cn/reactnative/modules/update/DownloadTask.java +136 -136
- package/android/src/main/java/cn/reactnative/modules/update/NativeUpdateCore.java +34 -0
- package/android/src/main/java/cn/reactnative/modules/update/StateCoreResult.java +16 -0
- package/android/src/main/java/cn/reactnative/modules/update/UpdateContext.java +131 -48
- package/cpp/patch_core/archive_patch_core.cpp +125 -0
- package/cpp/patch_core/archive_patch_core.h +59 -0
- package/cpp/patch_core/patch_core.cpp +533 -0
- package/cpp/patch_core/patch_core.h +68 -0
- package/cpp/patch_core/patch_core_android.cpp +112 -0
- package/cpp/patch_core/state_core.cpp +110 -0
- package/cpp/patch_core/state_core.h +58 -0
- package/cpp/patch_core/tests/patch_core_test.cpp +473 -0
- package/cpp/patch_core/update_core_android.cpp +469 -0
- package/harmony/pushy.har +0 -0
- package/ios/RCTPushy/RCTPushy.mm +233 -143
- package/package.json +17 -15
- package/react-native-update.podspec +3 -0
- package/scripts/build-harmony-har.js +12 -0
- package/scripts/prepublish.ts +49 -3
- package/scripts/prune-host-stl.sh +6 -0
- package/scripts/test-patch-core.sh +39 -0
- package/src/client.ts +129 -76
- package/src/core.ts +2 -1
- package/src/endpoint.ts +171 -0
- package/src/utils.ts +40 -27
- package/android/jni/lzma/DOC/7zC.txt +0 -187
- package/android/jni/lzma/DOC/7zFormat.txt +0 -469
- package/android/jni/lzma/DOC/Methods.txt +0 -173
- package/android/jni/lzma/DOC/installer.txt +0 -166
- package/android/jni/lzma/DOC/lzma-history.txt +0 -446
- package/android/jni/lzma/DOC/lzma-sdk.txt +0 -357
- package/android/jni/lzma/DOC/lzma-specification.txt +0 -1176
- package/android/jni/lzma/DOC/lzma.txt +0 -328
- package/android/jni/lzma/bin/7zS2.sfx +0 -0
- package/android/jni/lzma/bin/7zS2con.sfx +0 -0
- package/android/jni/lzma/bin/7zSD.sfx +0 -0
- package/android/jni/lzma/bin/7zdec.exe +0 -0
- package/android/jni/lzma/bin/7zr.exe +0 -0
- package/android/jni/lzma/bin/installer/config.txt +0 -5
- package/android/jni/lzma/bin/installer/cr.bat +0 -5
- package/android/jni/lzma/bin/lzma.exe +0 -0
- package/android/jni/lzma/bin/x64/7zr.exe +0 -0
- package/error.js +0 -1609
- package/harmony/har-wrapper/AppScope/app.json5 +0 -8
- package/harmony/har-wrapper/build-profile.json5 +0 -35
- package/harmony/har-wrapper/hvigor/hvigor-config.json5 +0 -5
- package/harmony/har-wrapper/hvigorfile.ts +0 -6
- package/harmony/har-wrapper/oh-package.json5 +0 -4
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/.cmake/api/v1/reply/cache-v2-77b153ce45aba0ed28ef.json +0 -1415
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/.cmake/api/v1/reply/cmakeFiles-v1-b65a07793384e0ce3e08.json +0 -809
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/.cmake/api/v1/reply/codemodel-v2-ce0e89410afd8bf3a057.json +0 -60
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/.cmake/api/v1/reply/directory-.-Release-f5ebdc15457944623624.json +0 -14
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/.cmake/api/v1/reply/index-2026-03-18T12-50-36-0050.json +0 -89
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/.cmake/api/v1/reply/target-rnupdate-Release-267153624504c9c3ffdd.json +0 -222
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/.ninja_deps +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/.ninja_log +0 -8
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeCache.txt +0 -415
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/3.28.2/CMakeCCompiler.cmake +0 -74
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/3.28.2/CMakeCXXCompiler.cmake +0 -85
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/3.28.2/CMakeDetermineCompilerABI_C.bin +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/3.28.2/CMakeDetermineCompilerABI_CXX.bin +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/3.28.2/CMakeSystem.cmake +0 -15
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/3.28.2/CompilerIdC/CMakeCCompilerId.c +0 -880
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/3.28.2/CompilerIdC/CMakeCCompilerId.o +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/3.28.2/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -869
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/3.28.2/CompilerIdCXX/CMakeCXXCompilerId.o +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/CMakeConfigureLog.yaml +0 -388
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/TargetDirectories.txt +0 -3
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/cmake.check_cache +0 -1
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/rnupdate.dir/__w/react-native-update/react-native-update/android/jni/HDiffPatch/file_for_patch.c.o +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/rnupdate.dir/__w/react-native-update/react-native-update/android/jni/HDiffPatch/libHDiffPatch/HPatch/patch.c.o +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/rnupdate.dir/__w/react-native-update/react-native-update/android/jni/hpatch.c.o +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/rnupdate.dir/__w/react-native-update/react-native-update/android/jni/lzma/C/Lzma2Dec.c.o +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/rnupdate.dir/__w/react-native-update/react-native-update/android/jni/lzma/C/LzmaDec.c.o +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/rnupdate.dir/pushy.c.o +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/CMakeFiles/rules.ninja +0 -64
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/additional_project_files.txt +0 -0
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/build.ninja +0 -206
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/build_file_index.txt +0 -1
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/cmake_install.cmake +0 -54
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/compile_commands.json +0 -38
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/configure_fingerprint.json +0 -1
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/hvigor_native_config.json +0 -1
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/metadata_generation_command.txt +0 -17
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/native_work_dir.txt +0 -1
- package/harmony/pushy/.cxx/default/default/release/arm64-v8a/output.log +0 -14
- package/harmony/pushy/.cxx/default/default/release/hvigor/arm64-v8a/summary.cmake +0 -0
- package/harmony/pushy/BuildProfile.ets +0 -17
- package/harmony/pushy/OAT.xml +0 -38
- package/harmony/pushy/README.md +0 -0
- package/harmony/pushy/build-profile.json5 +0 -15
- package/harmony/pushy/hvigor-plugin.ts +0 -34
- package/harmony/pushy/hvigorfile.ts +0 -1
- package/harmony/pushy/index.ets +0 -2
- package/harmony/pushy/oh-package-lock.json5 +0 -20
- package/harmony/pushy/oh-package.json5 +0 -13
- package/harmony/pushy/src/main/cpp/CMakeLists.txt +0 -51
- package/harmony/pushy/src/main/cpp/PushyPackage.h +0 -55
- package/harmony/pushy/src/main/cpp/PushyTurboModule.cpp +0 -142
- package/harmony/pushy/src/main/cpp/PushyTurboModule.h +0 -38
- package/harmony/pushy/src/main/cpp/pushy.c +0 -117
- package/harmony/pushy/src/main/cpp/pushy.h +0 -8
- package/harmony/pushy/src/main/ets/DownloadTask.ts +0 -570
- package/harmony/pushy/src/main/ets/DownloadTaskParams.ts +0 -19
- package/harmony/pushy/src/main/ets/EventHub.ts +0 -39
- package/harmony/pushy/src/main/ets/Logger.ts +0 -52
- package/harmony/pushy/src/main/ets/PushyFileJSBundleProvider.ets +0 -50
- package/harmony/pushy/src/main/ets/PushyPackage.ts +0 -22
- package/harmony/pushy/src/main/ets/PushyTurboModule.ts +0 -171
- package/harmony/pushy/src/main/ets/SaveFile.ts +0 -34
- package/harmony/pushy/src/main/ets/UpdateContext.ts +0 -262
- package/harmony/pushy/src/main/ets/UpdateModuleImpl.ts +0 -123
- package/harmony/pushy/src/main/module.json5 +0 -7
- package/harmony/pushy/src/main/resources/base/element/string.json +0 -8
- package/harmony/pushy/src/main/resources/en_US/element/string.json +0 -8
- package/harmony/pushy/src/main/resources/zh_CN/element/string.json +0 -8
- package/harmony/pushy/ts.ts +0 -3
- package/src/__tests__/core.test.ts +0 -103
- package/src/__tests__/utils.test.ts +0 -36
package/harmony/pushy/ts.ts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test, mock } from 'bun:test';
|
|
2
|
-
|
|
3
|
-
// In Bun, top-level imports are cached.
|
|
4
|
-
// We can use mock.module to change the implementation of a module,
|
|
5
|
-
// but if a module has already been executed (like core.ts),
|
|
6
|
-
// re-importing it might not re-run the top-level code unless we use some tricks
|
|
7
|
-
// or run tests in isolation.
|
|
8
|
-
// Actually, bun test runs each file in its own environment usually,
|
|
9
|
-
// BUT if we run multiple test files in one process, they might share the cache.
|
|
10
|
-
const importFreshCore = (cacheKey: string) => import(`../core?${cacheKey}`);
|
|
11
|
-
|
|
12
|
-
describe('core info parsing', () => {
|
|
13
|
-
test('should call error when currentVersionInfo is invalid JSON', async () => {
|
|
14
|
-
const mockError = mock(() => {});
|
|
15
|
-
|
|
16
|
-
mock.module('react-native', () => ({
|
|
17
|
-
Platform: {
|
|
18
|
-
OS: 'ios',
|
|
19
|
-
Version: 13,
|
|
20
|
-
},
|
|
21
|
-
NativeModules: {
|
|
22
|
-
Pushy: {
|
|
23
|
-
currentVersionInfo: '{invalid}',
|
|
24
|
-
downloadRootDir: '/tmp',
|
|
25
|
-
packageVersion: '1.0.0',
|
|
26
|
-
currentVersion: 'hash1',
|
|
27
|
-
isFirstTime: false,
|
|
28
|
-
rolledBackVersion: '',
|
|
29
|
-
buildTime: '2023-01-01',
|
|
30
|
-
uuid: 'existing-uuid',
|
|
31
|
-
setLocalHashInfo: mock(() => {}),
|
|
32
|
-
getLocalHashInfo: mock(() => Promise.resolve('{}')),
|
|
33
|
-
setUuid: mock(() => {}),
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
NativeEventEmitter: class {
|
|
37
|
-
addListener = mock(() => ({ remove: mock(() => {}) }));
|
|
38
|
-
},
|
|
39
|
-
}));
|
|
40
|
-
|
|
41
|
-
mock.module('react-native/Libraries/Core/ReactNativeVersion', () => ({
|
|
42
|
-
version: { major: 0, minor: 73, patch: 0 },
|
|
43
|
-
}));
|
|
44
|
-
|
|
45
|
-
mock.module('nanoid/non-secure', () => ({
|
|
46
|
-
nanoid: () => 'mock-uuid',
|
|
47
|
-
}));
|
|
48
|
-
|
|
49
|
-
mock.module('../utils', () => ({
|
|
50
|
-
error: mockError,
|
|
51
|
-
log: mock(() => {}),
|
|
52
|
-
emptyModule: {},
|
|
53
|
-
}));
|
|
54
|
-
|
|
55
|
-
// Use a unique query parameter to bypass cache if supported, or just rely on fresh environment per file.
|
|
56
|
-
// In Bun, you can sometimes use a cache buster if it's dynamic import.
|
|
57
|
-
await importFreshCore('error');
|
|
58
|
-
|
|
59
|
-
expect(mockError).toHaveBeenCalledWith(
|
|
60
|
-
expect.stringContaining('error_parse_version_info')
|
|
61
|
-
);
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
test('should not call error when currentVersionInfo is valid JSON', async () => {
|
|
65
|
-
const mockError = mock(() => {});
|
|
66
|
-
const mockSetLocalHashInfo = mock(() => {});
|
|
67
|
-
|
|
68
|
-
mock.module('react-native', () => ({
|
|
69
|
-
Platform: {
|
|
70
|
-
OS: 'ios',
|
|
71
|
-
Version: 13,
|
|
72
|
-
},
|
|
73
|
-
NativeModules: {
|
|
74
|
-
Pushy: {
|
|
75
|
-
currentVersionInfo: JSON.stringify({ name: 'v1', debugChannel: true }),
|
|
76
|
-
downloadRootDir: '/tmp',
|
|
77
|
-
packageVersion: '1.0.0',
|
|
78
|
-
currentVersion: 'hash1',
|
|
79
|
-
isFirstTime: false,
|
|
80
|
-
rolledBackVersion: '',
|
|
81
|
-
buildTime: '2023-01-01',
|
|
82
|
-
uuid: 'existing-uuid',
|
|
83
|
-
setLocalHashInfo: mockSetLocalHashInfo,
|
|
84
|
-
getLocalHashInfo: mock(() => Promise.resolve('{}')),
|
|
85
|
-
setUuid: mock(() => {}),
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
NativeEventEmitter: class {
|
|
89
|
-
addListener = mock(() => ({ remove: mock(() => {}) }));
|
|
90
|
-
},
|
|
91
|
-
}));
|
|
92
|
-
|
|
93
|
-
mock.module('../utils', () => ({
|
|
94
|
-
error: mockError,
|
|
95
|
-
log: mock(() => {}),
|
|
96
|
-
emptyModule: {},
|
|
97
|
-
}));
|
|
98
|
-
|
|
99
|
-
await importFreshCore('success');
|
|
100
|
-
|
|
101
|
-
expect(mockError).not.toHaveBeenCalled();
|
|
102
|
-
});
|
|
103
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test, mock } from 'bun:test';
|
|
2
|
-
|
|
3
|
-
mock.module('react-native', () => {
|
|
4
|
-
return {
|
|
5
|
-
Platform: {
|
|
6
|
-
OS: 'ios',
|
|
7
|
-
},
|
|
8
|
-
};
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
mock.module('../i18n', () => {
|
|
12
|
-
return {
|
|
13
|
-
default: {
|
|
14
|
-
t: (key: string) => key,
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
import { joinUrls } from '../utils';
|
|
20
|
-
|
|
21
|
-
describe('joinUrls', () => {
|
|
22
|
-
test('returns undefined when fileName is not provided', () => {
|
|
23
|
-
expect(joinUrls(['example.com'])).toBeUndefined();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
test('returns an empty array when paths is empty', () => {
|
|
27
|
-
expect(joinUrls([], 'file.txt')).toEqual([]);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
test('maps over paths and prepends https:// with fileName', () => {
|
|
31
|
-
expect(joinUrls(['example.com', 'test.org'], 'file.txt')).toEqual([
|
|
32
|
-
'https://example.com/file.txt',
|
|
33
|
-
'https://test.org/file.txt',
|
|
34
|
-
]);
|
|
35
|
-
});
|
|
36
|
-
});
|