1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-18 19:00:39 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

Compare commits

..

1 Commits

Author SHA1 Message Date
sunnylqm
dbca54a7f0 v10.20.0-beta.0 2025-01-11 19:23:31 +08:00
13 changed files with 24 additions and 39 deletions

View File

@@ -14,11 +14,11 @@ export function generatePushyBuildTime(str?: string) {
if (!fs.existsSync(dirPath)) { if (!fs.existsSync(dirPath)) {
fs.mkdirSync(dirPath, { recursive: true }); fs.mkdirSync(dirPath, { recursive: true });
} }
const moduleJsonPath = path.resolve(__dirname, '../AppScope/app.json5'); const moduleJsonPath = path.resolve(__dirname, './oh-package.json5');
let versionName = ''; let versionName = '';
if (fs.existsSync(moduleJsonPath)) { if (fs.existsSync(moduleJsonPath)) {
const moduleContent = fs.readFileSync(moduleJsonPath, 'utf-8'); const moduleContent = fs.readFileSync(moduleJsonPath, 'utf-8');
const versionMatch = moduleContent.match(/"versionName":\s*"([^"]+)"/); const versionMatch = moduleContent.match(/"version":\s*"([^"]+)"/);
if (versionMatch && versionMatch[1]) { if (versionMatch && versionMatch[1]) {
versionName = versionMatch[1]; versionName = versionMatch[1];
} }

5
Example/testHotUpdate/bun.lock Executable file → Normal file
View File

@@ -2,6 +2,7 @@
"lockfileVersion": 0, "lockfileVersion": 0,
"workspaces": { "workspaces": {
"": { "": {
"name": "testHotUpdate",
"dependencies": { "dependencies": {
"form-data": "^4.0.1", "form-data": "^4.0.1",
"patch-package": "^8.0.0", "patch-package": "^8.0.0",
@@ -11,7 +12,7 @@
"react-native-camera-kit": "^14.1.0", "react-native-camera-kit": "^14.1.0",
"react-native-paper": "^5.13.1", "react-native-paper": "^5.13.1",
"react-native-safe-area-context": "^5.1.0", "react-native-safe-area-context": "^5.1.0",
"react-native-update": "^10.21.1", "react-native-update": "^10.19.6",
"react-native-vector-icons": "^10.2.0", "react-native-vector-icons": "^10.2.0",
}, },
"devDependencies": { "devDependencies": {
@@ -1409,7 +1410,7 @@
"react-native-safe-area-context": ["react-native-safe-area-context@5.1.0", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-Y4vyJX+0HPJUQNVeIJTj2/UOjbSJcB09OEwirAWDrOZ67Lz5p43AmjxSy8nnZft1rMzoh3rcPuonB6jJyHTfCw=="], "react-native-safe-area-context": ["react-native-safe-area-context@5.1.0", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-Y4vyJX+0HPJUQNVeIJTj2/UOjbSJcB09OEwirAWDrOZ67Lz5p43AmjxSy8nnZft1rMzoh3rcPuonB6jJyHTfCw=="],
"react-native-update": ["react-native-update@10.21.1", "http://bnpm.byted.org/react-native-update/-/react-native-update-10.21.1.tgz", { "dependencies": { "nanoid": "^3.3.3", "react-native-url-polyfill": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0", "react-native": ">=0.59.0" } }, "sha512-rS0RxbrJkT29Q/vCQTc8SCMrjWEU+ltMHO+KsHsjy2qSECt/fZzF/kc2e01jdcukTFUtSedFnnKv3a5sWWemTg=="], "react-native-update": ["react-native-update@10.19.6", "", { "dependencies": { "nanoid": "^3.3.3", "react-native-url-polyfill": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0", "react-native": ">=0.59.0" } }, "sha512-6RRM9OvhC4DPFxzcbwDU1SE9Lgxi+p2jFu6CN56Dm2s+G7bIxhG5Y6cN0Y3/MtNFpzbmfsOFy1ywAxnkvUO7sQ=="],
"react-native-url-polyfill": ["react-native-url-polyfill@2.0.0", "", { "dependencies": { "whatwg-url-without-unicode": "8.0.0-3" }, "peerDependencies": { "react-native": "*" } }, "sha512-My330Do7/DvKnEvwQc0WdcBnFPploYKp9CYlefDXzIdEaA+PAhDYllkvGeEroEzvc4Kzzj2O4yVdz8v6fjRvhA=="], "react-native-url-polyfill": ["react-native-url-polyfill@2.0.0", "", { "dependencies": { "whatwg-url-without-unicode": "8.0.0-3" }, "peerDependencies": { "react-native": "*" } }, "sha512-My330Do7/DvKnEvwQc0WdcBnFPploYKp9CYlefDXzIdEaA+PAhDYllkvGeEroEzvc4Kzzj2O4yVdz8v6fjRvhA=="],

View File

@@ -22,7 +22,7 @@
"react-native-camera-kit": "^14.1.0", "react-native-camera-kit": "^14.1.0",
"react-native-paper": "^5.13.1", "react-native-paper": "^5.13.1",
"react-native-safe-area-context": "^5.1.0", "react-native-safe-area-context": "^5.1.0",
"react-native-update": "^10.21.1", "react-native-update": "^10.19.6",
"react-native-vector-icons": "^10.2.0" "react-native-vector-icons": "^10.2.0"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -2,8 +2,6 @@
本组件是面向 React Native 提供热更新功能的组件,详情请访问我们的官方网站 <https://pushy.reactnative.cn> 本组件是面向 React Native 提供热更新功能的组件,详情请访问我们的官方网站 <https://pushy.reactnative.cn>
**现已支持鸿蒙以及新架构**
### 快速开始 ### 快速开始
请查看[文档](https://pushy.reactnative.cn/docs/getting-started.html) 请查看[文档](https://pushy.reactnative.cn/docs/getting-started.html)

View File

@@ -144,24 +144,8 @@ public class UpdateModuleImpl {
return; return;
} }
try { try {
// Try to get getReactDelegate method using reflection final ReactDelegate reactDelegate = ((ReactActivity) currentActivity).getReactDelegate();
java.lang.reflect.Method getReactDelegateMethod = reactDelegate.reload();
ReactActivity.class.getMethod("getReactDelegate");
if (getReactDelegateMethod != null) {
ReactDelegate reactDelegate = (ReactDelegate)
getReactDelegateMethod.invoke(currentActivity);
// Try to get reload method using reflection
java.lang.reflect.Method reloadMethod =
ReactDelegate.class.getMethod("reload");
if (reloadMethod != null) {
reloadMethod.invoke(reactDelegate);
} else {
throw new NoSuchMethodException();
}
} else {
throw new NoSuchMethodException();
}
} catch (Throwable e) { } catch (Throwable e) {
currentActivity.runOnUiThread(new Runnable() { currentActivity.runOnUiThread(new Runnable() {
@Override @Override

11
harmony/README.OpenSource Normal file
View File

@@ -0,0 +1,11 @@
[
{
"Name": "react-native-netinfo",
"License": "MIT License",
"License File": "https://github.com/react-native-netinfo/react-native-netinfo/blob/master/LICENSE",
"Version Number": "11.1.0",
"Owner" : "Matt Oakes <hello@mattoakes.net>"
"Upstream URL": "https://github.com/react-native-netinfo/react-native-netinfo",
"Description": "React Native Network Info API for Android, iOS, macOS, Windows & Web. It allows you to get information on:Connection typeConnection quality"
}
]

0
harmony/README.md Normal file
View File

View File

@@ -1,6 +1,6 @@
{ {
"name": "react-native-update", "name": "react-native-update",
"version": "10.22.0", "version": "10.20.0-beta.0",
"description": "react-native hot update", "description": "react-native hot update",
"main": "src/index", "main": "src/index",
"scripts": { "scripts": {

View File

@@ -4,8 +4,6 @@ new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
podspec_dir = File.dirname(__FILE__)
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = package['name'] s.name = package['name']
s.version = package['version'] s.version = package['version']
@@ -22,12 +20,9 @@ Pod::Spec.new do |s|
s.source_files = "ios/**/*.{h,m,mm,swift}" s.source_files = "ios/**/*.{h,m,mm,swift}"
s.libraries = 'bz2', 'z' s.libraries = 'bz2', 'z'
s.vendored_libraries = 'RCTPushy/libRCTPushy.a' s.vendored_libraries = 'RCTPushy/libRCTPushy.a'
s.pod_target_xcconfig = { s.pod_target_xcconfig = { 'USER_HEADER_SEARCH_PATHS' => '"$(SRCROOT)/../node_modules/react-native-update/ios"' }
'USER_HEADER_SEARCH_PATHS' => "#{podspec_dir}/ios",
"DEFINES_MODULE" => "YES"
}
s.resource = 'ios/pushy_build_time.txt' s.resource = 'ios/pushy_build_time.txt'
s.script_phase = { :name => 'Generate build time', :script => "set -x;date +%s > \"#{podspec_dir}/ios/pushy_build_time.txt\"", :execution_position => :before_compile } s.script_phase = { :name => 'Generate build time', :script => 'set -x;date +%s > ${PODS_ROOT}/../../node_modules/react-native-update/ios/pushy_build_time.txt', :execution_position => :before_compile }
s.dependency 'React' s.dependency 'React'
s.dependency "React-Core" s.dependency "React-Core"
@@ -45,7 +40,7 @@ Pod::Spec.new do |s|
'android/jni/HDiffPatch/file_for_patch.{h,c}', 'android/jni/HDiffPatch/file_for_patch.{h,c}',
'android/jni/lzma/C/LzmaDec.{h,c}', 'android/jni/lzma/C/LzmaDec.{h,c}',
'android/jni/lzma/C/Lzma2Dec.{h,c}'] 'android/jni/lzma/C/Lzma2Dec.{h,c}']
ss.public_header_files = 'ios/RCTPushy/HDiffPatch/**/*.h' ss.private_header_files = 'ios/RCTPushy/HDiffPatch/**/*.h'
end end
if defined?(install_modules_dependencies()) != nil if defined?(install_modules_dependencies()) != nil

View File

@@ -205,11 +205,7 @@ export class Pushy {
// @ts-ignore // @ts-ignore
delete fetchBody.buildTime; delete fetchBody.buildTime;
} }
// harmony fetch body is not string const body = JSON.stringify(fetchBody);
let body: any = fetchBody;
if (Platform.OS === 'ios' || Platform.OS === 'android') {
body = JSON.stringify(fetchBody);
}
const fetchPayload = { const fetchPayload = {
method: 'POST', method: 'POST',
headers: { headers: {