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

Compare commits

...

44 Commits

Author SHA1 Message Date
sunnylqm
c26080325d v7.3.8 2021-11-22 18:11:22 +08:00
sunnylqm
ec0a9e0a3e Revert "Update pod script path"
This reverts commit fddae3d79a.
2021-11-11 18:46:48 +08:00
sunnylqm
b34b70ed01 v7.3.6 2021-11-11 18:09:21 +08:00
sunnylqm
fddae3d79a Update pod script path 2021-11-11 18:08:49 +08:00
sunnylqm
7fc0d717d5 v7.3.5 2021-11-10 22:31:56 +08:00
sunnylqm
686209d50e Check stateListener 2021-11-10 22:31:23 +08:00
sunnylqm
80b0401b02 v7.3.4 2021-11-04 17:53:05 +08:00
sunnylqm
786d32d92f Fix simpleUpdate 2021-11-04 17:52:30 +08:00
sunnylqm
27327dbe12 v7.3.3 2021-11-04 16:40:35 +08:00
sunnylqm
96a81cc36d Improve download exception handling 2021-11-04 16:39:50 +08:00
sunnylqm
0aa063c584 v7.3.2 2021-11-04 16:36:06 +08:00
sunnylqm
4d72d49fe4 Chech downloaded hash 2021-11-04 16:35:34 +08:00
sunnylqm
53d07406ef v7.3.1 2021-10-30 14:56:58 +08:00
sunnylqm
d0804cfe15 Fix rolledBackVersion 2021-10-30 14:56:23 +08:00
sunnylqm
35939286d0 v7.3.0 2021-10-29 13:03:34 +08:00
sunnylqm
f49ce30cef Fix assertHash 2021-10-29 13:02:49 +08:00
sunnylqm
e6cd25a2d8 v7.2.0 2021-10-24 16:19:48 +08:00
sunnylqm
0cc96ee59c Add error report 2021-10-24 16:19:17 +08:00
sunnylqm
6dd71a36e8 v7.1.0 2021-10-24 13:17:49 +08:00
sunnylqm
8db8d2162e Add report 2021-10-24 10:19:43 +08:00
sunnylqm
2bf25f37f0 v7.0.0 2021-10-12 15:57:39 +08:00
sunnylqm
ca3c3d86b5 Use androidX by default 2021-10-12 15:56:51 +08:00
sunnylqm
3edb3cca57 v6.5.0 2021-10-09 13:14:17 +08:00
sunnylqm
d80531dbcc Add simple update 2021-10-09 13:12:09 +08:00
sunnylqm
07003a4767 v6.4.0 2021-10-06 10:50:14 +08:00
sunnylqm
ee7be88542 Return empty object for version info 2021-10-06 09:30:36 +08:00
sunnylqm
cac92b43c7 Fix event warning 2021-10-06 09:26:42 +08:00
sunnylqm
e66d102e85 Fix ios example 2021-10-06 00:34:15 +08:00
sunnylqm
94d52bb415 Add set local hash info for ios 2021-10-06 00:33:54 +08:00
sunnylqm
775e567062 Update example to 0.66.0 2021-10-05 13:23:54 +08:00
sunnylqm
bf1701031b Record local hash info 2021-10-05 00:44:33 +08:00
sunnylqm
d32d395a2a Update types 2021-10-04 12:27:54 +08:00
sunnylqm
3bc63acad4 v6.3.0 2021-10-04 00:42:21 +08:00
sunnylqm
898ed85b8c Use nanoid 2021-10-04 00:41:34 +08:00
sunnylqm
3a526d1b15 Update license 2021-10-04 00:41:04 +08:00
sunnylqm
05563c3393 v6.2.1 2021-08-22 11:39:32 +08:00
sunnylqm
b193b4b1df Check hash more strict 2021-08-22 11:33:54 +08:00
sunnylqm
451e298ba5 v6.2.0 2021-08-13 20:52:49 +08:00
sunnylqm
1b5c07be9e v6.2.0-beta0 2021-08-13 20:11:09 +08:00
sunnylqm
13cf53974e Use zipfile 2021-08-13 18:30:28 +08:00
sunnylqm
2a1915c50c Revert "Check packageVersion"
This reverts commit ff67829a27.
2021-08-03 13:28:39 +08:00
sunnylqm
3de78a9dbd Fix typo 2021-08-02 11:15:00 +08:00
sunnylqm
ef065e4072 v6.1.1 2021-08-02 11:03:31 +08:00
sunnylqm
ff67829a27 Check packageVersion 2021-08-02 11:03:04 +08:00
31 changed files with 3058 additions and 3589 deletions

View File

@@ -120,15 +120,16 @@ def jscFlavor = 'org.webkit:android-jsc:+'
*/
def enableHermes = project.ext.react.get("enableHermes", false);
/**
* Architectures to build native code for in debug.
*/
def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")
android {
ndkVersion rootProject.ext.ndkVersion
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.testhotupdate"
minSdkVersion rootProject.ext.minSdkVersion
@@ -155,6 +156,11 @@ android {
buildTypes {
debug {
signingConfig signingConfigs.debug
if (nativeArchitectures) {
ndk {
abiFilters nativeArchitectures.split(',')
}
}
}
release {
crunchPngs false
@@ -213,9 +219,9 @@ dependencies {
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
// puts all implementation dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
from configurations.implementation
into 'libs'
}

View File

@@ -3,7 +3,6 @@
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:textColor">#000000</item>
</style>
</resources>

View File

@@ -2,18 +2,18 @@
buildscript {
ext {
buildToolsVersion = "29.0.3"
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29
ndkVersion = "20.1.5948944"
compileSdkVersion = 30
targetSdkVersion = 30
ndkVersion = "21.4.7075529"
}
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath('com.android.tools.build:gradle:4.1.0')
classpath('com.android.tools.build:gradle:4.2.2')
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -22,6 +22,7 @@ buildscript {
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
@@ -33,7 +34,6 @@ allprojects {
}
google()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}

View File

@@ -25,4 +25,4 @@ android.useAndroidX=true
android.enableJetifier=true
# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.84.0
FLIPPER_VERSION=0.99.0

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@@ -1,7 +1,7 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '10.0'
platform :ios, '11.0'
target 'testHotUpdate' do
config = use_native_modules!
@@ -16,10 +16,11 @@ target 'testHotUpdate' do
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
use_flipper!({'Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1'})
use_flipper!({ "Flipper-DoubleConversion" => "1.1.7" })
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end

View File

@@ -1,360 +1,384 @@
PODS:
- boost-for-react-native (1.63.0)
- boost (1.76.0)
- CocoaAsyncSocket (7.6.5)
- DoubleConversion (1.1.6)
- FBLazyVector (0.64.2)
- FBReactNativeSpec (0.64.2):
- RCT-Folly (= 2020.01.13.00)
- RCTRequired (= 0.64.2)
- RCTTypeSafety (= 0.64.2)
- React-Core (= 0.64.2)
- React-jsi (= 0.64.2)
- ReactCommon/turbomodule/core (= 0.64.2)
- Flipper (0.75.1):
- Flipper-Folly (~> 2.5)
- Flipper-RSocket (~> 1.3)
- FBLazyVector (0.66.0)
- FBReactNativeSpec (0.66.0):
- RCT-Folly (= 2021.06.28.00-v2)
- RCTRequired (= 0.66.0)
- RCTTypeSafety (= 0.66.0)
- React-Core (= 0.66.0)
- React-jsi (= 0.66.0)
- ReactCommon/turbomodule/core (= 0.66.0)
- Flipper (0.99.0):
- Flipper-Folly (~> 2.6)
- Flipper-RSocket (~> 1.4)
- Flipper-Boost-iOSX (1.76.0.1.11)
- Flipper-DoubleConversion (1.1.7)
- Flipper-Folly (2.5.3):
- boost-for-react-native
- Flipper-Fmt (7.1.7)
- Flipper-Folly (2.6.7):
- Flipper-Boost-iOSX
- Flipper-DoubleConversion
- Flipper-Fmt (= 7.1.7)
- Flipper-Glog
- libevent (~> 2.1.12)
- OpenSSL-Universal (= 1.1.180)
- Flipper-Glog (0.3.6)
- Flipper-PeerTalk (0.0.4)
- Flipper-RSocket (1.3.1):
- Flipper-Folly (~> 2.5)
- FlipperKit (0.75.1):
- FlipperKit/Core (= 0.75.1)
- FlipperKit/Core (0.75.1):
- Flipper (~> 0.75.1)
- Flipper-RSocket (1.4.3):
- Flipper-Folly (~> 2.6)
- FlipperKit (0.99.0):
- FlipperKit/Core (= 0.99.0)
- FlipperKit/Core (0.99.0):
- Flipper (~> 0.99.0)
- FlipperKit/CppBridge
- FlipperKit/FBCxxFollyDynamicConvert
- FlipperKit/FBDefines
- FlipperKit/FKPortForwarding
- FlipperKit/CppBridge (0.75.1):
- Flipper (~> 0.75.1)
- FlipperKit/FBCxxFollyDynamicConvert (0.75.1):
- Flipper-Folly (~> 2.5)
- FlipperKit/FBDefines (0.75.1)
- FlipperKit/FKPortForwarding (0.75.1):
- FlipperKit/CppBridge (0.99.0):
- Flipper (~> 0.99.0)
- FlipperKit/FBCxxFollyDynamicConvert (0.99.0):
- Flipper-Folly (~> 2.6)
- FlipperKit/FBDefines (0.99.0)
- FlipperKit/FKPortForwarding (0.99.0):
- CocoaAsyncSocket (~> 7.6)
- Flipper-PeerTalk (~> 0.0.4)
- FlipperKit/FlipperKitHighlightOverlay (0.75.1)
- FlipperKit/FlipperKitLayoutPlugin (0.75.1):
- FlipperKit/FlipperKitHighlightOverlay (0.99.0)
- FlipperKit/FlipperKitLayoutHelpers (0.99.0):
- FlipperKit/Core
- FlipperKit/FlipperKitHighlightOverlay
- FlipperKit/FlipperKitLayoutTextSearchable
- FlipperKit/FlipperKitLayoutIOSDescriptors (0.99.0):
- FlipperKit/Core
- FlipperKit/FlipperKitHighlightOverlay
- FlipperKit/FlipperKitLayoutHelpers
- YogaKit (~> 1.18)
- FlipperKit/FlipperKitLayoutTextSearchable (0.75.1)
- FlipperKit/FlipperKitNetworkPlugin (0.75.1):
- FlipperKit/FlipperKitLayoutPlugin (0.99.0):
- FlipperKit/Core
- FlipperKit/FlipperKitReactPlugin (0.75.1):
- FlipperKit/FlipperKitHighlightOverlay
- FlipperKit/FlipperKitLayoutHelpers
- FlipperKit/FlipperKitLayoutIOSDescriptors
- FlipperKit/FlipperKitLayoutTextSearchable
- YogaKit (~> 1.18)
- FlipperKit/FlipperKitLayoutTextSearchable (0.99.0)
- FlipperKit/FlipperKitNetworkPlugin (0.99.0):
- FlipperKit/Core
- FlipperKit/FlipperKitUserDefaultsPlugin (0.75.1):
- FlipperKit/FlipperKitReactPlugin (0.99.0):
- FlipperKit/Core
- FlipperKit/SKIOSNetworkPlugin (0.75.1):
- FlipperKit/FlipperKitUserDefaultsPlugin (0.99.0):
- FlipperKit/Core
- FlipperKit/SKIOSNetworkPlugin (0.99.0):
- FlipperKit/Core
- FlipperKit/FlipperKitNetworkPlugin
- fmt (6.2.1)
- glog (0.3.5)
- libevent (2.1.12)
- OpenSSL-Universal (1.1.180)
- RCT-Folly (2020.01.13.00):
- boost-for-react-native
- RCT-Folly (2021.06.28.00-v2):
- boost
- DoubleConversion
- fmt (~> 6.2.1)
- glog
- RCT-Folly/Default (= 2021.06.28.00-v2)
- RCT-Folly/Default (2021.06.28.00-v2):
- boost
- DoubleConversion
- fmt (~> 6.2.1)
- glog
- RCTRequired (0.66.0)
- RCTTypeSafety (0.66.0):
- FBLazyVector (= 0.66.0)
- RCT-Folly (= 2021.06.28.00-v2)
- RCTRequired (= 0.66.0)
- React-Core (= 0.66.0)
- React (0.66.0):
- React-Core (= 0.66.0)
- React-Core/DevSupport (= 0.66.0)
- React-Core/RCTWebSocket (= 0.66.0)
- React-RCTActionSheet (= 0.66.0)
- React-RCTAnimation (= 0.66.0)
- React-RCTBlob (= 0.66.0)
- React-RCTImage (= 0.66.0)
- React-RCTLinking (= 0.66.0)
- React-RCTNetwork (= 0.66.0)
- React-RCTSettings (= 0.66.0)
- React-RCTText (= 0.66.0)
- React-RCTVibration (= 0.66.0)
- React-callinvoker (0.66.0)
- React-Core (0.66.0):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default (= 0.66.0)
- React-cxxreact (= 0.66.0)
- React-jsi (= 0.66.0)
- React-jsiexecutor (= 0.66.0)
- React-perflogger (= 0.66.0)
- Yoga
- React-Core/CoreModulesHeaders (0.66.0):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.66.0)
- React-jsi (= 0.66.0)
- React-jsiexecutor (= 0.66.0)
- React-perflogger (= 0.66.0)
- Yoga
- React-Core/Default (0.66.0):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-cxxreact (= 0.66.0)
- React-jsi (= 0.66.0)
- React-jsiexecutor (= 0.66.0)
- React-perflogger (= 0.66.0)
- Yoga
- React-Core/DevSupport (0.66.0):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default (= 0.66.0)
- React-Core/RCTWebSocket (= 0.66.0)
- React-cxxreact (= 0.66.0)
- React-jsi (= 0.66.0)
- React-jsiexecutor (= 0.66.0)
- React-jsinspector (= 0.66.0)
- React-perflogger (= 0.66.0)
- Yoga
- React-Core/RCTActionSheetHeaders (0.66.0):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.66.0)
- React-jsi (= 0.66.0)
- React-jsiexecutor (= 0.66.0)
- React-perflogger (= 0.66.0)
- Yoga
- React-Core/RCTAnimationHeaders (0.66.0):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.66.0)
- React-jsi (= 0.66.0)
- React-jsiexecutor (= 0.66.0)
- React-perflogger (= 0.66.0)
- Yoga
- React-Core/RCTBlobHeaders (0.66.0):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.66.0)
- React-jsi (= 0.66.0)
- React-jsiexecutor (= 0.66.0)
- React-perflogger (= 0.66.0)
- Yoga
- React-Core/RCTImageHeaders (0.66.0):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.66.0)
- React-jsi (= 0.66.0)
- React-jsiexecutor (= 0.66.0)
- React-perflogger (= 0.66.0)
- Yoga
- React-Core/RCTLinkingHeaders (0.66.0):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.66.0)
- React-jsi (= 0.66.0)
- React-jsiexecutor (= 0.66.0)
- React-perflogger (= 0.66.0)
- Yoga
- React-Core/RCTNetworkHeaders (0.66.0):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.66.0)
- React-jsi (= 0.66.0)
- React-jsiexecutor (= 0.66.0)
- React-perflogger (= 0.66.0)
- Yoga
- React-Core/RCTSettingsHeaders (0.66.0):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.66.0)
- React-jsi (= 0.66.0)
- React-jsiexecutor (= 0.66.0)
- React-perflogger (= 0.66.0)
- Yoga
- React-Core/RCTTextHeaders (0.66.0):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.66.0)
- React-jsi (= 0.66.0)
- React-jsiexecutor (= 0.66.0)
- React-perflogger (= 0.66.0)
- Yoga
- React-Core/RCTVibrationHeaders (0.66.0):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.66.0)
- React-jsi (= 0.66.0)
- React-jsiexecutor (= 0.66.0)
- React-perflogger (= 0.66.0)
- Yoga
- React-Core/RCTWebSocket (0.66.0):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default (= 0.66.0)
- React-cxxreact (= 0.66.0)
- React-jsi (= 0.66.0)
- React-jsiexecutor (= 0.66.0)
- React-perflogger (= 0.66.0)
- Yoga
- React-CoreModules (0.66.0):
- FBReactNativeSpec (= 0.66.0)
- RCT-Folly (= 2021.06.28.00-v2)
- RCTTypeSafety (= 0.66.0)
- React-Core/CoreModulesHeaders (= 0.66.0)
- React-jsi (= 0.66.0)
- React-RCTImage (= 0.66.0)
- ReactCommon/turbomodule/core (= 0.66.0)
- React-cxxreact (0.66.0):
- boost (= 1.76.0)
- DoubleConversion
- glog
- RCT-Folly/Default (= 2020.01.13.00)
- RCT-Folly/Default (2020.01.13.00):
- boost-for-react-native
- RCT-Folly (= 2021.06.28.00-v2)
- React-callinvoker (= 0.66.0)
- React-jsi (= 0.66.0)
- React-jsinspector (= 0.66.0)
- React-logger (= 0.66.0)
- React-perflogger (= 0.66.0)
- React-runtimeexecutor (= 0.66.0)
- React-jsi (0.66.0):
- boost (= 1.76.0)
- DoubleConversion
- glog
- RCTRequired (0.64.2)
- RCTTypeSafety (0.64.2):
- FBLazyVector (= 0.64.2)
- RCT-Folly (= 2020.01.13.00)
- RCTRequired (= 0.64.2)
- React-Core (= 0.64.2)
- React (0.64.2):
- React-Core (= 0.64.2)
- React-Core/DevSupport (= 0.64.2)
- React-Core/RCTWebSocket (= 0.64.2)
- React-RCTActionSheet (= 0.64.2)
- React-RCTAnimation (= 0.64.2)
- React-RCTBlob (= 0.64.2)
- React-RCTImage (= 0.64.2)
- React-RCTLinking (= 0.64.2)
- React-RCTNetwork (= 0.64.2)
- React-RCTSettings (= 0.64.2)
- React-RCTText (= 0.64.2)
- React-RCTVibration (= 0.64.2)
- React-callinvoker (0.64.2)
- React-Core (0.64.2):
- glog
- RCT-Folly (= 2020.01.13.00)
- React-Core/Default (= 0.64.2)
- React-cxxreact (= 0.64.2)
- React-jsi (= 0.64.2)
- React-jsiexecutor (= 0.64.2)
- React-perflogger (= 0.64.2)
- Yoga
- React-Core/CoreModulesHeaders (0.64.2):
- glog
- RCT-Folly (= 2020.01.13.00)
- React-Core/Default
- React-cxxreact (= 0.64.2)
- React-jsi (= 0.64.2)
- React-jsiexecutor (= 0.64.2)
- React-perflogger (= 0.64.2)
- Yoga
- React-Core/Default (0.64.2):
- glog
- RCT-Folly (= 2020.01.13.00)
- React-cxxreact (= 0.64.2)
- React-jsi (= 0.64.2)
- React-jsiexecutor (= 0.64.2)
- React-perflogger (= 0.64.2)
- Yoga
- React-Core/DevSupport (0.64.2):
- glog
- RCT-Folly (= 2020.01.13.00)
- React-Core/Default (= 0.64.2)
- React-Core/RCTWebSocket (= 0.64.2)
- React-cxxreact (= 0.64.2)
- React-jsi (= 0.64.2)
- React-jsiexecutor (= 0.64.2)
- React-jsinspector (= 0.64.2)
- React-perflogger (= 0.64.2)
- Yoga
- React-Core/RCTActionSheetHeaders (0.64.2):
- glog
- RCT-Folly (= 2020.01.13.00)
- React-Core/Default
- React-cxxreact (= 0.64.2)
- React-jsi (= 0.64.2)
- React-jsiexecutor (= 0.64.2)
- React-perflogger (= 0.64.2)
- Yoga
- React-Core/RCTAnimationHeaders (0.64.2):
- glog
- RCT-Folly (= 2020.01.13.00)
- React-Core/Default
- React-cxxreact (= 0.64.2)
- React-jsi (= 0.64.2)
- React-jsiexecutor (= 0.64.2)
- React-perflogger (= 0.64.2)
- Yoga
- React-Core/RCTBlobHeaders (0.64.2):
- glog
- RCT-Folly (= 2020.01.13.00)
- React-Core/Default
- React-cxxreact (= 0.64.2)
- React-jsi (= 0.64.2)
- React-jsiexecutor (= 0.64.2)
- React-perflogger (= 0.64.2)
- Yoga
- React-Core/RCTImageHeaders (0.64.2):
- glog
- RCT-Folly (= 2020.01.13.00)
- React-Core/Default
- React-cxxreact (= 0.64.2)
- React-jsi (= 0.64.2)
- React-jsiexecutor (= 0.64.2)
- React-perflogger (= 0.64.2)
- Yoga
- React-Core/RCTLinkingHeaders (0.64.2):
- glog
- RCT-Folly (= 2020.01.13.00)
- React-Core/Default
- React-cxxreact (= 0.64.2)
- React-jsi (= 0.64.2)
- React-jsiexecutor (= 0.64.2)
- React-perflogger (= 0.64.2)
- Yoga
- React-Core/RCTNetworkHeaders (0.64.2):
- glog
- RCT-Folly (= 2020.01.13.00)
- React-Core/Default
- React-cxxreact (= 0.64.2)
- React-jsi (= 0.64.2)
- React-jsiexecutor (= 0.64.2)
- React-perflogger (= 0.64.2)
- Yoga
- React-Core/RCTSettingsHeaders (0.64.2):
- glog
- RCT-Folly (= 2020.01.13.00)
- React-Core/Default
- React-cxxreact (= 0.64.2)
- React-jsi (= 0.64.2)
- React-jsiexecutor (= 0.64.2)
- React-perflogger (= 0.64.2)
- Yoga
- React-Core/RCTTextHeaders (0.64.2):
- glog
- RCT-Folly (= 2020.01.13.00)
- React-Core/Default
- React-cxxreact (= 0.64.2)
- React-jsi (= 0.64.2)
- React-jsiexecutor (= 0.64.2)
- React-perflogger (= 0.64.2)
- Yoga
- React-Core/RCTVibrationHeaders (0.64.2):
- glog
- RCT-Folly (= 2020.01.13.00)
- React-Core/Default
- React-cxxreact (= 0.64.2)
- React-jsi (= 0.64.2)
- React-jsiexecutor (= 0.64.2)
- React-perflogger (= 0.64.2)
- Yoga
- React-Core/RCTWebSocket (0.64.2):
- glog
- RCT-Folly (= 2020.01.13.00)
- React-Core/Default (= 0.64.2)
- React-cxxreact (= 0.64.2)
- React-jsi (= 0.64.2)
- React-jsiexecutor (= 0.64.2)
- React-perflogger (= 0.64.2)
- Yoga
- React-CoreModules (0.64.2):
- FBReactNativeSpec (= 0.64.2)
- RCT-Folly (= 2020.01.13.00)
- RCTTypeSafety (= 0.64.2)
- React-Core/CoreModulesHeaders (= 0.64.2)
- React-jsi (= 0.64.2)
- React-RCTImage (= 0.64.2)
- ReactCommon/turbomodule/core (= 0.64.2)
- React-cxxreact (0.64.2):
- boost-for-react-native (= 1.63.0)
- RCT-Folly (= 2021.06.28.00-v2)
- React-jsi/Default (= 0.66.0)
- React-jsi/Default (0.66.0):
- boost (= 1.76.0)
- DoubleConversion
- glog
- RCT-Folly (= 2020.01.13.00)
- React-callinvoker (= 0.64.2)
- React-jsi (= 0.64.2)
- React-jsinspector (= 0.64.2)
- React-perflogger (= 0.64.2)
- React-runtimeexecutor (= 0.64.2)
- React-jsi (0.64.2):
- boost-for-react-native (= 1.63.0)
- RCT-Folly (= 2021.06.28.00-v2)
- React-jsiexecutor (0.66.0):
- DoubleConversion
- glog
- RCT-Folly (= 2020.01.13.00)
- React-jsi/Default (= 0.64.2)
- React-jsi/Default (0.64.2):
- boost-for-react-native (= 1.63.0)
- DoubleConversion
- RCT-Folly (= 2021.06.28.00-v2)
- React-cxxreact (= 0.66.0)
- React-jsi (= 0.66.0)
- React-perflogger (= 0.66.0)
- React-jsinspector (0.66.0)
- React-logger (0.66.0):
- glog
- RCT-Folly (= 2020.01.13.00)
- React-jsiexecutor (0.64.2):
- DoubleConversion
- glog
- RCT-Folly (= 2020.01.13.00)
- React-cxxreact (= 0.64.2)
- React-jsi (= 0.64.2)
- React-perflogger (= 0.64.2)
- React-jsinspector (0.64.2)
- react-native-update (6.0.5):
- react-native-update (6.3.0):
- React
- react-native-update/HDiffPatch (= 6.0.5)
- react-native-update/RCTPushy (= 6.0.5)
- react-native-update/HDiffPatch (= 6.3.0)
- react-native-update/RCTPushy (= 6.3.0)
- SSZipArchive
- react-native-update/HDiffPatch (6.0.5):
- react-native-update/HDiffPatch (6.3.0):
- React
- SSZipArchive
- react-native-update/RCTPushy (6.0.5):
- react-native-update/RCTPushy (6.3.0):
- React
- SSZipArchive
- React-perflogger (0.64.2)
- React-RCTActionSheet (0.64.2):
- React-Core/RCTActionSheetHeaders (= 0.64.2)
- React-RCTAnimation (0.64.2):
- FBReactNativeSpec (= 0.64.2)
- RCT-Folly (= 2020.01.13.00)
- RCTTypeSafety (= 0.64.2)
- React-Core/RCTAnimationHeaders (= 0.64.2)
- React-jsi (= 0.64.2)
- ReactCommon/turbomodule/core (= 0.64.2)
- React-RCTBlob (0.64.2):
- FBReactNativeSpec (= 0.64.2)
- RCT-Folly (= 2020.01.13.00)
- React-Core/RCTBlobHeaders (= 0.64.2)
- React-Core/RCTWebSocket (= 0.64.2)
- React-jsi (= 0.64.2)
- React-RCTNetwork (= 0.64.2)
- ReactCommon/turbomodule/core (= 0.64.2)
- React-RCTImage (0.64.2):
- FBReactNativeSpec (= 0.64.2)
- RCT-Folly (= 2020.01.13.00)
- RCTTypeSafety (= 0.64.2)
- React-Core/RCTImageHeaders (= 0.64.2)
- React-jsi (= 0.64.2)
- React-RCTNetwork (= 0.64.2)
- ReactCommon/turbomodule/core (= 0.64.2)
- React-RCTLinking (0.64.2):
- FBReactNativeSpec (= 0.64.2)
- React-Core/RCTLinkingHeaders (= 0.64.2)
- React-jsi (= 0.64.2)
- ReactCommon/turbomodule/core (= 0.64.2)
- React-RCTNetwork (0.64.2):
- FBReactNativeSpec (= 0.64.2)
- RCT-Folly (= 2020.01.13.00)
- RCTTypeSafety (= 0.64.2)
- React-Core/RCTNetworkHeaders (= 0.64.2)
- React-jsi (= 0.64.2)
- ReactCommon/turbomodule/core (= 0.64.2)
- React-RCTSettings (0.64.2):
- FBReactNativeSpec (= 0.64.2)
- RCT-Folly (= 2020.01.13.00)
- RCTTypeSafety (= 0.64.2)
- React-Core/RCTSettingsHeaders (= 0.64.2)
- React-jsi (= 0.64.2)
- ReactCommon/turbomodule/core (= 0.64.2)
- React-RCTText (0.64.2):
- React-Core/RCTTextHeaders (= 0.64.2)
- React-RCTVibration (0.64.2):
- FBReactNativeSpec (= 0.64.2)
- RCT-Folly (= 2020.01.13.00)
- React-Core/RCTVibrationHeaders (= 0.64.2)
- React-jsi (= 0.64.2)
- ReactCommon/turbomodule/core (= 0.64.2)
- React-runtimeexecutor (0.64.2):
- React-jsi (= 0.64.2)
- ReactCommon/turbomodule/core (0.64.2):
- React-perflogger (0.66.0)
- React-RCTActionSheet (0.66.0):
- React-Core/RCTActionSheetHeaders (= 0.66.0)
- React-RCTAnimation (0.66.0):
- FBReactNativeSpec (= 0.66.0)
- RCT-Folly (= 2021.06.28.00-v2)
- RCTTypeSafety (= 0.66.0)
- React-Core/RCTAnimationHeaders (= 0.66.0)
- React-jsi (= 0.66.0)
- ReactCommon/turbomodule/core (= 0.66.0)
- React-RCTBlob (0.66.0):
- FBReactNativeSpec (= 0.66.0)
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/RCTBlobHeaders (= 0.66.0)
- React-Core/RCTWebSocket (= 0.66.0)
- React-jsi (= 0.66.0)
- React-RCTNetwork (= 0.66.0)
- ReactCommon/turbomodule/core (= 0.66.0)
- React-RCTImage (0.66.0):
- FBReactNativeSpec (= 0.66.0)
- RCT-Folly (= 2021.06.28.00-v2)
- RCTTypeSafety (= 0.66.0)
- React-Core/RCTImageHeaders (= 0.66.0)
- React-jsi (= 0.66.0)
- React-RCTNetwork (= 0.66.0)
- ReactCommon/turbomodule/core (= 0.66.0)
- React-RCTLinking (0.66.0):
- FBReactNativeSpec (= 0.66.0)
- React-Core/RCTLinkingHeaders (= 0.66.0)
- React-jsi (= 0.66.0)
- ReactCommon/turbomodule/core (= 0.66.0)
- React-RCTNetwork (0.66.0):
- FBReactNativeSpec (= 0.66.0)
- RCT-Folly (= 2021.06.28.00-v2)
- RCTTypeSafety (= 0.66.0)
- React-Core/RCTNetworkHeaders (= 0.66.0)
- React-jsi (= 0.66.0)
- ReactCommon/turbomodule/core (= 0.66.0)
- React-RCTSettings (0.66.0):
- FBReactNativeSpec (= 0.66.0)
- RCT-Folly (= 2021.06.28.00-v2)
- RCTTypeSafety (= 0.66.0)
- React-Core/RCTSettingsHeaders (= 0.66.0)
- React-jsi (= 0.66.0)
- ReactCommon/turbomodule/core (= 0.66.0)
- React-RCTText (0.66.0):
- React-Core/RCTTextHeaders (= 0.66.0)
- React-RCTVibration (0.66.0):
- FBReactNativeSpec (= 0.66.0)
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/RCTVibrationHeaders (= 0.66.0)
- React-jsi (= 0.66.0)
- ReactCommon/turbomodule/core (= 0.66.0)
- React-runtimeexecutor (0.66.0):
- React-jsi (= 0.66.0)
- ReactCommon/turbomodule/core (0.66.0):
- DoubleConversion
- glog
- RCT-Folly (= 2020.01.13.00)
- React-callinvoker (= 0.64.2)
- React-Core (= 0.64.2)
- React-cxxreact (= 0.64.2)
- React-jsi (= 0.64.2)
- React-perflogger (= 0.64.2)
- RCT-Folly (= 2021.06.28.00-v2)
- React-callinvoker (= 0.66.0)
- React-Core (= 0.66.0)
- React-cxxreact (= 0.66.0)
- React-jsi (= 0.66.0)
- React-logger (= 0.66.0)
- React-perflogger (= 0.66.0)
- SSZipArchive (2.4.2)
- Yoga (1.14.0)
- YogaKit (1.18.1):
- Yoga (~> 1.14)
DEPENDENCIES:
- boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
- FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
- Flipper (= 0.75.1)
- Flipper (= 0.99.0)
- Flipper-Boost-iOSX (= 1.76.0.1.11)
- Flipper-DoubleConversion (= 1.1.7)
- Flipper-Folly (= 2.5.3)
- Flipper-Fmt (= 7.1.7)
- Flipper-Folly (= 2.6.7)
- Flipper-Glog (= 0.3.6)
- Flipper-PeerTalk (~> 0.0.4)
- Flipper-RSocket (= 1.3.1)
- FlipperKit (= 0.75.1)
- FlipperKit/Core (= 0.75.1)
- FlipperKit/CppBridge (= 0.75.1)
- FlipperKit/FBCxxFollyDynamicConvert (= 0.75.1)
- FlipperKit/FBDefines (= 0.75.1)
- FlipperKit/FKPortForwarding (= 0.75.1)
- FlipperKit/FlipperKitHighlightOverlay (= 0.75.1)
- FlipperKit/FlipperKitLayoutPlugin (= 0.75.1)
- FlipperKit/FlipperKitLayoutTextSearchable (= 0.75.1)
- FlipperKit/FlipperKitNetworkPlugin (= 0.75.1)
- FlipperKit/FlipperKitReactPlugin (= 0.75.1)
- FlipperKit/FlipperKitUserDefaultsPlugin (= 0.75.1)
- FlipperKit/SKIOSNetworkPlugin (= 0.75.1)
- Flipper-PeerTalk (= 0.0.4)
- Flipper-RSocket (= 1.4.3)
- FlipperKit (= 0.99.0)
- FlipperKit/Core (= 0.99.0)
- FlipperKit/CppBridge (= 0.99.0)
- FlipperKit/FBCxxFollyDynamicConvert (= 0.99.0)
- FlipperKit/FBDefines (= 0.99.0)
- FlipperKit/FKPortForwarding (= 0.99.0)
- FlipperKit/FlipperKitHighlightOverlay (= 0.99.0)
- FlipperKit/FlipperKitLayoutPlugin (= 0.99.0)
- FlipperKit/FlipperKitLayoutTextSearchable (= 0.99.0)
- FlipperKit/FlipperKitNetworkPlugin (= 0.99.0)
- FlipperKit/FlipperKitReactPlugin (= 0.99.0)
- FlipperKit/FlipperKitUserDefaultsPlugin (= 0.99.0)
- FlipperKit/SKIOSNetworkPlugin (= 0.99.0)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
@@ -369,6 +393,7 @@ DEPENDENCIES:
- React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- react-native-update (from `../../..`)
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
@@ -386,21 +411,25 @@ DEPENDENCIES:
SPEC REPOS:
trunk:
- boost-for-react-native
- CocoaAsyncSocket
- Flipper
- Flipper-Boost-iOSX
- Flipper-DoubleConversion
- Flipper-Fmt
- Flipper-Folly
- Flipper-Glog
- Flipper-PeerTalk
- Flipper-RSocket
- FlipperKit
- fmt
- libevent
- OpenSSL-Universal
- SSZipArchive
- YogaKit
EXTERNAL SOURCES:
boost:
:podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec"
DoubleConversion:
:podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
FBLazyVector:
@@ -431,6 +460,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/jsiexecutor"
React-jsinspector:
:path: "../node_modules/react-native/ReactCommon/jsinspector"
React-logger:
:path: "../node_modules/react-native/ReactCommon/logger"
react-native-update:
:path: "../../.."
React-perflogger:
@@ -461,49 +492,53 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"
SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
boost: a7c83b31436843459a1961bfd74b96033dc77234
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de
FBLazyVector: e686045572151edef46010a6f819ade377dfeb4b
FBReactNativeSpec: a4e8a870ae782beff5646319965896a3a5979664
Flipper: d3da1aa199aad94455ae725e9f3aa43f3ec17021
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
FBLazyVector: 6816ca39e1cc8beffd2a96783f518296789d1c48
FBReactNativeSpec: 3b1e86618e902743fde35b40cf9ebd100fd655b7
Flipper: 30e8eeeed6abdc98edaf32af0cda2f198be4b733
Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41
Flipper-Folly: 755929a4f851b2fb2c347d533a23f191b008554c
Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b
Flipper-Folly: 83af37379faa69497529e414bd43fbfc7cae259a
Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6
Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
Flipper-RSocket: 127954abe8b162fcaf68d2134d34dc2bd7076154
FlipperKit: 8a20b5c5fcf9436cac58551dc049867247f64b00
glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
FlipperKit: d8d346844eca5d9120c17d441a2f38596e8ed2b9
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 5337263514dd6f09803962437687240c5dc39aa4
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
RCT-Folly: ec7a233ccc97cc556cf7237f0db1ff65b986f27c
RCTRequired: 6d3e854f0e7260a648badd0d44fc364bc9da9728
RCTTypeSafety: c1f31d19349c6b53085766359caac425926fafaa
React: bda6b6d7ae912de97d7a61aa5c160db24aa2ad69
React-callinvoker: 9840ea7e8e88ed73d438edb725574820b29b5baa
React-Core: b5e385da7ce5f16a220fc60fd0749eae2c6120f0
React-CoreModules: 17071a4e2c5239b01585f4aa8070141168ab298f
React-cxxreact: 9be7b6340ed9f7c53e53deca7779f07cd66525ba
React-jsi: 67747b9722f6dab2ffe15b011bcf6b3f2c3f1427
React-jsiexecutor: 80c46bd381fd06e418e0d4f53672dc1d1945c4c3
React-jsinspector: cc614ec18a9ca96fd275100c16d74d62ee11f0ae
react-native-update: f5af67d7fdbc0295adaabd974c181b8d1458b17a
React-perflogger: 25373e382fed75ce768a443822f07098a15ab737
React-RCTActionSheet: af7796ba49ffe4ca92e7277a5d992d37203f7da5
React-RCTAnimation: 6a2e76ab50c6f25b428d81b76a5a45351c4d77aa
React-RCTBlob: 02a2887023e0eed99391b6445b2e23a2a6f9226d
React-RCTImage: ce5bf8e7438f2286d9b646a05d6ab11f38b0323d
React-RCTLinking: ccd20742de14e020cb5f99d5c7e0bf0383aefbd9
React-RCTNetwork: dfb9d089ab0753e5e5f55fc4b1210858f7245647
React-RCTSettings: b14aef2d83699e48b410fb7c3ba5b66cd3291ae2
React-RCTText: 41a2e952dd9adc5caf6fb68ed46b275194d5da5f
React-RCTVibration: 24600e3b1aaa77126989bc58b6747509a1ba14f3
React-runtimeexecutor: a9904c6d0218fb9f8b19d6dd88607225927668f9
ReactCommon: 149906e01aa51142707a10665185db879898e966
RCT-Folly: a21c126816d8025b547704b777a2ba552f3d9fa9
RCTRequired: e4a18a90004e0ed97bba9081099104fd0f658dc9
RCTTypeSafety: 8a3c31d38de58e1a6a7df6e4e643644a60b00e22
React: 2b1d0dc3c23e01b754588a74a5b265282d9eb61e
React-callinvoker: 57c195e780695285fa56e61efdbc0ca0e9204484
React-Core: 45e4b3c57b0b5fdbb24bc6a63a964870c0405955
React-CoreModules: d7bb1ae3436eddd85a7eb6d5e928f8c1655d87db
React-cxxreact: 60c850e9997b21ee302757c36a460efc944183e7
React-jsi: 38d68cb1b53843703100830d530342b32f8e0878
React-jsiexecutor: 6a05173dc0142abc582bd4edd2d23146b8cc218a
React-jsinspector: be95ad424ba9f7b817aff22732eb9b1b810a000a
React-logger: 9a9cd87d4ea681ae929b32ef580638ff1b50fb24
react-native-update: 0fc93e720f09bf7b465292dcd2fb8d8db3aef763
React-perflogger: 1f554c2b684e2f484f9edcdfdaeedab039fbaca8
React-RCTActionSheet: 610d5a5d71ab4808734782c8bca6a12ec3563672
React-RCTAnimation: ec6ed97370ace32724c253f29f0586cafcab8126
React-RCTBlob: b3270d498ff240f49c50e1bc950b6e5fd48886ba
React-RCTImage: 23d5e26669b31230bea3fd99eb703af699e5d61a
React-RCTLinking: edaaee9dee82b79e90e7b903d8913fa72284fbba
React-RCTNetwork: e8825053dd1b5c2a0e1aa3cf1127750b624f90c0
React-RCTSettings: 40d7ae987031c5dc561d11cd3a15cc1245a11d42
React-RCTText: 6e104479d4f0bb593b4cf90b6fc6e5390c12ccde
React-RCTVibration: 53b92d54b923283638cb0186da7a5c2d2b70a49b
React-runtimeexecutor: 4bb657a97aa74568d9ed634c8bd478299bb8a3a6
ReactCommon: eb059748e842a1a86025ebbd4ac9d99e74492f88
SSZipArchive: e7b4f3d9e780c2acc1764cd88fbf2de28f26e5b2
Yoga: 575c581c63e0d35c9a83f4b46d01d63abc1100ac
Yoga: c11abbf5809216c91fcd62f5571078b83d9b6720
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
PODFILE CHECKSUM: 84e4a563ad749afa88eb98a303cbbd3476bf71a5
PODFILE CHECKSUM: a26b18e70d6c4725e0254b56751afbc7620020ff
COCOAPODS: 1.10.1
COCOAPODS: 1.11.2

View File

@@ -17,7 +17,6 @@
/* Begin PBXFileReference section */
008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = "<group>"; };
0583A8BB0D57980C590354CD /* Pods-testHotUpdate-tvOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-testHotUpdate-tvOSTests.release.xcconfig"; path = "Target Support Files/Pods-testHotUpdate-tvOSTests/Pods-testHotUpdate-tvOSTests.release.xcconfig"; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* testHotUpdate.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testHotUpdate.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = testHotUpdate/AppDelegate.h; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = testHotUpdate/AppDelegate.m; sourceTree = "<group>"; };
@@ -27,17 +26,8 @@
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = testHotUpdate/main.m; sourceTree = "<group>"; };
1A3E77317B15A5C3816ACE3A /* Pods-testHotUpdate.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-testHotUpdate.release.xcconfig"; path = "Target Support Files/Pods-testHotUpdate/Pods-testHotUpdate.release.xcconfig"; sourceTree = "<group>"; };
28C264AEBE1E206870F9D871 /* libPods-testHotUpdate.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-testHotUpdate.a"; sourceTree = BUILT_PRODUCTS_DIR; };
5975B699C3CC54D97D7D17AC /* Pods-testHotUpdate-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-testHotUpdate-tvOS.debug.xcconfig"; path = "Target Support Files/Pods-testHotUpdate-tvOS/Pods-testHotUpdate-tvOS.debug.xcconfig"; sourceTree = "<group>"; };
84EBA9C1A760F4136B306391 /* Pods-testHotUpdate.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-testHotUpdate.debug.xcconfig"; path = "Target Support Files/Pods-testHotUpdate/Pods-testHotUpdate.debug.xcconfig"; sourceTree = "<group>"; };
8D1BC055E138B80CD38184D9 /* libPods-testHotUpdate-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-testHotUpdate-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
95A532A9388B822764C95FE7 /* libPods-testHotUpdateTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-testHotUpdateTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
9E6234BBCA688ADDFBCB18E0 /* Pods-testHotUpdate-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-testHotUpdate-tvOS.release.xcconfig"; path = "Target Support Files/Pods-testHotUpdate-tvOS/Pods-testHotUpdate-tvOS.release.xcconfig"; sourceTree = "<group>"; };
A210EF57CA3ECCF4BA22ACD7 /* libPods-testHotUpdate-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-testHotUpdate-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
C29B96E519A1834F3DC4E653 /* Pods-testHotUpdateTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-testHotUpdateTests.debug.xcconfig"; path = "Target Support Files/Pods-testHotUpdateTests/Pods-testHotUpdateTests.debug.xcconfig"; sourceTree = "<group>"; };
DBD82A01837CBC988265B839 /* Pods-testHotUpdate-tvOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-testHotUpdate-tvOSTests.debug.xcconfig"; path = "Target Support Files/Pods-testHotUpdate-tvOSTests/Pods-testHotUpdate-tvOSTests.debug.xcconfig"; sourceTree = "<group>"; };
ED1DB2CEADC1A82A43867C0E /* Pods-testHotUpdateTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-testHotUpdateTests.release.xcconfig"; path = "Target Support Files/Pods-testHotUpdateTests/Pods-testHotUpdateTests.release.xcconfig"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
F1CBCFD524FE1CF80019170D /* testHotUpdate-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "testHotUpdate-Bridging-Header.h"; sourceTree = "<group>"; };
F1CBCFD624FE1CF80019170D /* dummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dummy.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -59,12 +49,6 @@
children = (
84EBA9C1A760F4136B306391 /* Pods-testHotUpdate.debug.xcconfig */,
1A3E77317B15A5C3816ACE3A /* Pods-testHotUpdate.release.xcconfig */,
5975B699C3CC54D97D7D17AC /* Pods-testHotUpdate-tvOS.debug.xcconfig */,
9E6234BBCA688ADDFBCB18E0 /* Pods-testHotUpdate-tvOS.release.xcconfig */,
DBD82A01837CBC988265B839 /* Pods-testHotUpdate-tvOSTests.debug.xcconfig */,
0583A8BB0D57980C590354CD /* Pods-testHotUpdate-tvOSTests.release.xcconfig */,
C29B96E519A1834F3DC4E653 /* Pods-testHotUpdateTests.debug.xcconfig */,
ED1DB2CEADC1A82A43867C0E /* Pods-testHotUpdateTests.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
@@ -89,11 +73,7 @@
isa = PBXGroup;
children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
28C264AEBE1E206870F9D871 /* libPods-testHotUpdate.a */,
8D1BC055E138B80CD38184D9 /* libPods-testHotUpdate-tvOS.a */,
A210EF57CA3ECCF4BA22ACD7 /* libPods-testHotUpdate-tvOSTests.a */,
95A532A9388B822764C95FE7 /* libPods-testHotUpdateTests.a */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -262,7 +242,7 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-testHotUpdate/Pods-testHotUpdate-frameworks.sh",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL/OpenSSL.framework/OpenSSL",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework/OpenSSL",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (

View File

@@ -11,8 +11,8 @@
"apk": "(cd android && ./gradlew aR)"
},
"dependencies": {
"react": "17.0.1",
"react-native": "0.64.2",
"react": "17.0.2",
"react-native": "0.66.0",
"react-native-update": "link:../.."
},
"devDependencies": {
@@ -22,8 +22,8 @@
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.64.0",
"react-test-renderer": "17.0.1"
"metro-react-native-babel-preset": "^0.66.2",
"react-test-renderer": "17.0.2"
},
"jest": {
"preset": "react-native"

View File

@@ -68,6 +68,9 @@ export default class App extends Component {
});
},
});
if (!hash) {
return;
}
Alert.alert('提示', '下载完毕,是否重启应用?', [
{
text: '是',

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@ Update Plugin for React Native
Powered by ReactNative.cn
Copyright (c) Hangzhou Erica Network Technology Co., Ltd.
Copyright (c) Wuhan Charmlot Network Technology Co., Ltd.
All rights reserved.

View File

@@ -8,7 +8,7 @@
### 优势
1. 基于阿里云高速 CDN 分发,对比其他服务器在国外的热更新服务,分发更稳定,更新成功率极高。
1. 基于阿里云高速 CDN 分发,对比其他服务器在国外的热更新服务,分发更稳定,更新成功率极高。
2. 基于 bsdiff/hdiff 算法创建的**超小更新包**,通常版本迭代后在 1-10KB 之间,避免数百 KB 的流量消耗。
3. 跨越多个版本进行更新时,只需要下载**一个更新包**,不需要逐版本依次更新。
4. 命令行工具&网页双端管理,版本发布过程简单便捷,完全可以集成 CI。

View File

@@ -15,28 +15,24 @@ import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.HashMap;
import okio.BufferedSink;
import okio.BufferedSource;
import okio.Okio;
import static cn.reactnative.modules.update.UpdateModule.sendEvent;
/**
* Created by tdzl2003 on 3/31/16.
*/
class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
final int DOWNLOAD_CHUNK_SIZE = 4096;
@@ -138,19 +134,6 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
private static native byte[] hdiffPatch(byte[] origin, byte[] patch);
private void unzipToFile(ZipInputStream zis, File fmd) throws IOException {
int count;
FileOutputStream fout = new FileOutputStream(fmd);
while ((count = zis.read(buffer)) != -1)
{
fout.write(buffer, 0, count);
}
fout.close();
zis.closeEntry();
}
private void copyFile(File from, File fmd) throws IOException {
int count;
@@ -167,7 +150,7 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
in.close();
}
private byte[] readBytes(ZipInputStream zis) throws IOException {
private byte[] readBytes(InputStream zis) throws IOException {
int count;
ByteArrayOutputStream fout = new ByteArrayOutputStream();
@@ -177,7 +160,7 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
}
fout.close();
zis.closeEntry();
zis.close();
return fout.toByteArray();
}
@@ -246,15 +229,14 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
private void doFullPatch(DownloadTaskParams param) throws IOException {
downloadFile(param);
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(new FileInputStream(param.targetFile)));
ZipEntry ze;
String filename;
removeDirectory(param.unzipDirectory);
param.unzipDirectory.mkdirs();
while ((ze = zis.getNextEntry()) != null)
{
SafeZipFile zipFile = new SafeZipFile(param.targetFile);
Enumeration<? extends ZipEntry> entries = zipFile.entries();
while (entries.hasMoreElements()) {
ZipEntry ze = entries.nextElement();
String fn = ze.getName();
File fmd = new File(param.unzipDirectory, fn);
@@ -267,10 +249,11 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
continue;
}
unzipToFile(zis, fmd);
zipFile.unzipToFile(ze, fmd);
}
zis.close();
zipFile.close();
if (UpdateContext.DEBUG) {
Log.d("RNUpdate", "Unzip finished");
@@ -278,9 +261,11 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
}
private void copyFromResource(HashMap<String, ArrayList<File> > resToCopy) throws IOException {
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(new FileInputStream(context.getPackageResourcePath())));
ZipEntry ze;
while ((ze = zis.getNextEntry()) != null) {
SafeZipFile zipFile = new SafeZipFile(new File(context.getPackageResourcePath()));
Enumeration<? extends ZipEntry> entries = zipFile.entries();
while (entries.hasMoreElements()) {
ZipEntry ze = entries.nextElement();
String fn = ze.getName();
ArrayList<File> targets = resToCopy.get(fn);
if (targets != null) {
@@ -292,37 +277,35 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
if (lastTarget != null) {
copyFile(lastTarget, target);
} else {
unzipToFile(zis, target);
zipFile.unzipToFile(ze, target);
lastTarget = target;
}
}
}
}
zipFile.close();
}
private void doPatchFromApk(DownloadTaskParams param) throws IOException, JSONException {
downloadFile(param);
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(new FileInputStream(param.targetFile)));
ZipEntry ze;
int count;
String filename;
removeDirectory(param.unzipDirectory);
param.unzipDirectory.mkdirs();
HashMap<String, ArrayList<File>> copyList = new HashMap<String, ArrayList<File>>();
boolean foundDiff = false;
boolean foundBundlePatch = false;
removeDirectory(param.unzipDirectory);
param.unzipDirectory.mkdirs();
HashMap<String, ArrayList<File>> copyList = new HashMap<String, ArrayList<File>>();
while ((ze = zis.getNextEntry()) != null)
{
SafeZipFile zipFile = new SafeZipFile(param.targetFile);
Enumeration<? extends ZipEntry> entries = zipFile.entries();
while (entries.hasMoreElements()) {
ZipEntry ze = entries.nextElement();
String fn = ze.getName();
if (fn.equals("__diff.json")) {
foundDiff = true;
// copy files from assets
byte[] bytes = readBytes(zis);
byte[] bytes = readBytes(zipFile.getInputStream(ze));
String json = new String(bytes, "UTF-8");
JSONObject obj = (JSONObject)new JSONTokener(json).nextValue();
@@ -348,8 +331,8 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
}
if (fn.equals("index.bundlejs.patch")) {
foundBundlePatch = true;
byte[] patched = hdiffPatch(readOriginBundle(), readBytes(zis));
byte[] patched = hdiffPatch(readOriginBundle(), readBytes(zipFile.getInputStream(ze)));
FileOutputStream fout = new FileOutputStream(new File(param.unzipDirectory, "index.bundlejs"));
fout.write(patched);
@@ -367,10 +350,12 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
continue;
}
unzipToFile(zis, fmd);
zipFile.unzipToFile(ze, fmd);
}
zis.close();
zipFile.close();
if (!foundDiff) {
throw new Error("diff.json not found");
}
@@ -389,24 +374,25 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
private void doPatchFromPpk(DownloadTaskParams param) throws IOException, JSONException {
downloadFile(param);
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(new FileInputStream(param.targetFile)));
ZipEntry ze;
removeDirectory(param.unzipDirectory);
param.unzipDirectory.mkdirs();
int count;
String filename;
boolean foundDiff = false;
boolean foundBundlePatch = false;
removeDirectory(param.unzipDirectory);
param.unzipDirectory.mkdirs();
while ((ze = zis.getNextEntry()) != null)
{
SafeZipFile zipFile = new SafeZipFile(param.targetFile);
Enumeration<? extends ZipEntry> entries = zipFile.entries();
while (entries.hasMoreElements()) {
ZipEntry ze = entries.nextElement();
String fn = ze.getName();
if (fn.equals("__diff.json")) {
foundDiff = true;
// copy files from assets
byte[] bytes = readBytes(zis);
byte[] bytes = readBytes(zipFile.getInputStream(ze));
String json = new String(bytes, "UTF-8");
JSONObject obj = (JSONObject)new JSONTokener(json).nextValue();
@@ -426,8 +412,8 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
}
if (fn.equals("index.bundlejs.patch")) {
foundBundlePatch = true;
byte[] patched = hdiffPatch(readFile(new File(param.originDirectory, "index.bundlejs")), readBytes(zis));
byte[] patched = hdiffPatch(readFile(new File(param.originDirectory, "index.bundlejs")), readBytes(zipFile.getInputStream(ze)));
FileOutputStream fout = new FileOutputStream(new File(param.unzipDirectory, "index.bundlejs"));
fout.write(patched);
fout.close();
@@ -444,10 +430,10 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
continue;
}
unzipToFile(zis, fmd);
zipFile.unzipToFile(ze, fmd);
}
zis.close();
zipFile.close();
if (!foundDiff) {
throw new Error("diff.json not found");

View File

@@ -1,6 +1,6 @@
package cn.reactnative.modules.update;
import android.support.v4.content.FileProvider;
import androidx.core.content.FileProvider;
/**
* Providing a custom {@code FileProvider} prevents manifest {@code <provider>} name collisions.

View File

@@ -0,0 +1,82 @@
package cn.reactnative.modules.update;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
public class SafeZipFile extends ZipFile {
public SafeZipFile(File file) throws IOException {
super(file);
}
@Override
public Enumeration<? extends ZipEntry> entries() {
return new SafeZipEntryIterator(super.entries());
}
private static class SafeZipEntryIterator implements Enumeration<ZipEntry> {
final private Enumeration<? extends ZipEntry> delegate;
private SafeZipEntryIterator(Enumeration<? extends ZipEntry> delegate) {
this.delegate = delegate;
}
@Override
public boolean hasMoreElements() {
return delegate.hasMoreElements();
}
@Override
public ZipEntry nextElement() {
ZipEntry entry = delegate.nextElement();
if (null != entry) {
String name = entry.getName();
/**
* avoid ZipperDown
*/
if (null != name && (name.contains("../") || name.contains("..\\"))) {
throw new SecurityException("illegal entry: " + entry.getName());
}
}
return entry;
}
}
public void unzipToFile(ZipEntry entry, File output) throws IOException {
InputStream inputStream = null;
try {
inputStream = getInputStream(entry);
writeOutInputStream(output, inputStream);
} finally {
if (inputStream != null) {
inputStream.close();
}
}
}
private void writeOutInputStream(File file, InputStream inputStream) throws IOException {
BufferedOutputStream output = null;
try {
output = new BufferedOutputStream(
new FileOutputStream(file));
BufferedInputStream input = new BufferedInputStream(inputStream);
byte b[] = new byte[8192];
int n;
while ((n = input.read(b, 0, 8192)) >= 0) {
output.write(b, 0, n);
}
} finally {
if (output != null) {
output.close();
}
}
}
}

View File

@@ -17,9 +17,6 @@ import java.util.concurrent.Executors;
import java.io.File;
/**
* Created by tdzl2003 on 3/31/16.
*/
public class UpdateContext {
private Context context;
private File rootDir;
@@ -72,10 +69,6 @@ public class UpdateContext {
return context.getString(R.string.pushy_build_time);
}
public String getUuid() {
return sp.getString("uuid", null);
}
public Map getBlockUpdate() {
return new HashMap<String, Object>() {{
put("until", sp.getInt("blockUntil", 0));
@@ -154,21 +147,25 @@ public class UpdateContext {
String lastVersion = getCurrentVersion();
SharedPreferences.Editor editor = sp.edit();
editor.putString("currentVersion", hash);
if (lastVersion != null && lastVersion != hash) {
if (lastVersion != null && !lastVersion.equals(hash)) {
editor.putString("lastVersion", lastVersion);
}
editor.putBoolean("firstTime", true);
editor.putBoolean("firstTimeOk", false);
editor.putBoolean("rolledBack", false);
editor.putString("rolledBackVersion", null);
editor.apply();
}
public void setUuid(String uuid) {
public void setKv(String key, String value) {
SharedPreferences.Editor editor = sp.edit();
editor.putString("uuid", uuid);
editor.putString(key, value);
editor.apply();
}
public String getKv(String key) {
return sp.getString(key, null);
}
public void setBlockUpdate(int until, String reason) {
SharedPreferences.Editor editor = sp.edit();
editor.putInt("blockUntil", until);
@@ -184,14 +181,19 @@ public class UpdateContext {
return sp.getBoolean("firstTime", false);
}
public boolean isRolledBack() {
return sp.getBoolean("rolledBack", false);
public String rolledBackVersion() {
return sp.getString("rolledBackVersion", null);
}
public void markSuccess() {
SharedPreferences.Editor editor = sp.edit();
editor.putBoolean("firstTimeOk", true);
editor.remove("lastVersion");
String lastVersion = sp.getString("lastVersion", null);
String curVersion = sp.getString("currentVersion", null);
if (lastVersion != null && !lastVersion.equals(curVersion)) {
editor.remove("lastVersion");
editor.remove("hash_" + lastVersion);
}
editor.apply();
this.cleanUp();
@@ -207,7 +209,7 @@ public class UpdateContext {
public void clearRollbackMark() {
SharedPreferences.Editor editor = sp.edit();
editor.putBoolean("rolledBack", false);
editor.putString("rolledBackVersion", null);
editor.apply();
this.cleanUp();
@@ -263,6 +265,7 @@ public class UpdateContext {
private String rollBack() {
String lastVersion = sp.getString("lastVersion", null);
String currentVersion = sp.getString("currentVersion", null);
SharedPreferences.Editor editor = sp.edit();
if (lastVersion == null) {
editor.remove("currentVersion");
@@ -271,7 +274,7 @@ public class UpdateContext {
}
editor.putBoolean("firstTimeOk", true);
editor.putBoolean("firstTime", false);
editor.putBoolean("rolledBack", true);
editor.putString("rolledBackVersion", currentVersion);
editor.apply();
return lastVersion;
}

View File

@@ -22,15 +22,11 @@ import com.facebook.react.modules.core.DeviceEventManagerModule;
import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import static android.support.v4.content.FileProvider.getUriForFile;
import static androidx.core.content.FileProvider.getUriForFile;
/**
* Created by tdzl2003 on 3/31/16.
*/
public class UpdateModule extends ReactContextBaseJavaModule {
UpdateContext updateContext;
public static ReactApplicationContext mContext;
@@ -58,13 +54,13 @@ public class UpdateModule extends ReactContextBaseJavaModule {
if (isFirstTime) {
updateContext.clearFirstTime();
}
boolean isRolledBack = updateContext.isRolledBack();
constants.put("isRolledBack", isRolledBack);
if (isRolledBack) {
String rolledBackVersion = updateContext.rolledBackVersion();
constants.put("rolledBackVersion", rolledBackVersion);
if (rolledBackVersion != null) {
updateContext.clearRollbackMark();
}
constants.put("blockUpdate", updateContext.getBlockUpdate());
constants.put("uuid", updateContext.getUuid());
constants.put("uuid", updateContext.getKv("uuid"));
return constants;
}
@@ -138,9 +134,7 @@ public class UpdateModule extends ReactContextBaseJavaModule {
private void downloadPatchFromPackage(ReadableMap options, final Promise promise) {
String url = options.getString("updateUrl");
String hash = options.getString("hash");
if (hash == null) {
hash = options.getString("hashName");
}
updateContext.downloadPatchFromApk(url, hash, new UpdateContext.DownloadFileListener() {
@Override
public void onDownloadCompleted(DownloadTaskParams params) {
@@ -158,13 +152,9 @@ public class UpdateModule extends ReactContextBaseJavaModule {
private void downloadPatchFromPpk(ReadableMap options, final Promise promise) {
String url = options.getString("updateUrl");
String hash = options.getString("hash");
if (hash == null) {
hash = options.getString("hashName");
}
String originHash = options.getString("originHash");
if (originHash == null) {
originHash = options.getString(("originHashName"));
}
updateContext.downloadPatchFromPpk(url, hash, originHash, new UpdateContext.DownloadFileListener() {
@Override
public void onDownloadCompleted(DownloadTaskParams params) {
@@ -180,8 +170,7 @@ public class UpdateModule extends ReactContextBaseJavaModule {
@ReactMethod
public void reloadUpdate(ReadableMap options) {
final String hash = options.getString("hash") == null ?
options.getString("hashName") : options.getString("hash");
final String hash = options.getString("hash");
UiThreadUtil.runOnUiThread(new Runnable() {
@Override
@@ -222,8 +211,7 @@ public class UpdateModule extends ReactContextBaseJavaModule {
@ReactMethod
public void setNeedUpdate(ReadableMap options) {
final String hash = options.getString("hash") == null ?
options.getString("hashName") : options.getString("hash");
final String hash = options.getString("hash");
UiThreadUtil.runOnUiThread(new Runnable() {
@Override
@@ -264,11 +252,36 @@ public class UpdateModule extends ReactContextBaseJavaModule {
UiThreadUtil.runOnUiThread(new Runnable() {
@Override
public void run() {
updateContext.setUuid(uuid);
updateContext.setKv("uuid", uuid);
}
});
}
@ReactMethod
public void setLocalHashInfo(final String hash, final String info) {
UiThreadUtil.runOnUiThread(new Runnable() {
@Override
public void run() {
updateContext.setKv("hash_" + hash, info);
}
});
}
@ReactMethod
public void getLocalHashInfo(final String hash, final Promise promise) {
promise.resolve(updateContext.getKv("hash_" + hash));
}
@ReactMethod
public void addListener(String eventName) {
// Set up any upstream listeners or background tasks as necessary
}
@ReactMethod
public void removeListeners(Integer count) {
// Remove upstream listeners, stop unnecessary background tasks
}
/* 发送事件*/
public static void sendEvent(String eventName, WritableMap params) {
((ReactContext) mContext).getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit(eventName,

View File

@@ -1,11 +1,3 @@
//
// RCTPushy.h
// RCTPushy
//
// Created by LvBingru on 2/19/16.
// Copyright © 2016 erica. All rights reserved.
//
#import <React/RCTBridgeModule.h>
#import <React/RCTEventEmitter.h>

View File

@@ -1,11 +1,3 @@
//
// RCTPushy.m
// RCTPushy
//
// Created by LvBingru on 2/19/16.
// Copyright © 2016 erica. All rights reserved.
//
#import "RCTPushy.h"
#import "RCTPushyDownloader.h"
#import "RCTPushyManager.h"
@@ -23,6 +15,7 @@ static NSString *const paramIsFirstTime = @"isFirstTime";
static NSString *const paramIsFirstLoadOk = @"isFirstLoadOK";
static NSString *const keyBlockUpdate = @"REACTNATIVECN_PUSHY_BLOCKUPDATE";
static NSString *const keyUuid = @"REACTNATIVECN_PUSHY_UUID";
static NSString *const keyHashInfo = @"REACTNATIVECN_PUSHY_HASH_";
static NSString *const keyFirstLoadMarked = @"REACTNATIVECN_PUSHY_FIRSTLOADMARKED_KEY";
static NSString *const keyRolledBackMarked = @"REACTNATIVECN_PUSHY_ROLLEDBACKMARKED_KEY";
static NSString *const KeyPackageUpdatedMarked = @"REACTNATIVECN_PUSHY_ISPACKAGEUPDATEDMARKED_KEY";
@@ -127,6 +120,7 @@ RCT_EXPORT_MODULE(RCTPushy);
NSDictionary *pushyInfo = [defaults dictionaryForKey:keyPushyInfo];
NSString *lastVersion = pushyInfo[paramLastVersion];
NSString *curVersion = pushyInfo[paramCurrentVersion];
NSString *curPackageVersion = [RCTPushy packageVersion];
if (lastVersion.length) {
// roll back to last version
@@ -140,7 +134,7 @@ RCT_EXPORT_MODULE(RCTPushy);
// roll back to bundle
[defaults setObject:nil forKey:keyPushyInfo];
}
[defaults setObject:@(YES) forKey:keyRolledBackMarked];
[defaults setObject:curVersion forKey:keyRolledBackMarked];
[defaults synchronize];
return lastVersion;
}
@@ -158,7 +152,7 @@ RCT_EXPORT_MODULE(RCTPushy);
ret[@"downloadRootDir"] = [RCTPushy downloadDir];
ret[@"packageVersion"] = [RCTPushy packageVersion];
ret[@"buildTime"] = [RCTPushy buildTime];
ret[@"isRolledBack"] = [defaults objectForKey:keyRolledBackMarked];
ret[@"rolledBackVersion"] = [defaults objectForKey:keyRolledBackMarked];
ret[@"isFirstTime"] = [defaults objectForKey:keyFirstLoadMarked];
ret[@"blockUpdate"] = [defaults objectForKey:keyBlockUpdate];
ret[@"uuid"] = [defaults objectForKey:keyUuid];
@@ -166,12 +160,12 @@ RCT_EXPORT_MODULE(RCTPushy);
ret[@"currentVersion"] = [pushyInfo objectForKey:paramCurrentVersion];
// clear isFirstTimemarked
if ([[defaults objectForKey:keyFirstLoadMarked] boolValue]) {
if (ret[@"isFirstTime"]) {
[defaults setObject:nil forKey:keyFirstLoadMarked];
}
// clear rolledbackmark
if ([[defaults objectForKey:keyRolledBackMarked] boolValue]) {
if (ret[@"rolledBackVersion"] != nil) {
[defaults setObject:nil forKey:keyRolledBackMarked];
[self clearInvalidFiles];
}
@@ -212,6 +206,24 @@ RCT_EXPORT_METHOD(setUuid:(NSString *)uuid)
[defaults synchronize];
}
RCT_EXPORT_METHOD(setLocalHashInfo:(NSString *)hash
value:(NSString *)value)
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:value forKey:[keyHashInfo stringByAppendingString:hash]];
[defaults synchronize];
}
RCT_EXPORT_METHOD(getLocalHashInfo:(NSString *)hash
resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject)
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
resolve([defaults stringForKey:[keyHashInfo stringByAppendingString:hash]]);
}
RCT_EXPORT_METHOD(downloadUpdate:(NSDictionary *)options
resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject)
@@ -257,9 +269,7 @@ RCT_EXPORT_METHOD(downloadPatchFromPpk:(NSDictionary *)options
RCT_EXPORT_METHOD(setNeedUpdate:(NSDictionary *)options)
{
NSString *hash = options[@"hash"];
if (hash.length <= 0) {
hash = options[@"hashName"];
}
if (hash.length) {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *lastVersion = nil;
@@ -283,9 +293,7 @@ RCT_EXPORT_METHOD(setNeedUpdate:(NSDictionary *)options)
RCT_EXPORT_METHOD(reloadUpdate:(NSDictionary *)options)
{
NSString *hash = options[@"hash"];
if (hash.length <= 0) {
hash = options[@"hashName"];
}
if (hash.length) {
[self setNeedUpdate:options];
@@ -304,10 +312,16 @@ RCT_EXPORT_METHOD(markSuccess)
{
// up package info
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSMutableDictionary *packageInfo = [[NSMutableDictionary alloc] initWithDictionary:[defaults objectForKey:keyPushyInfo]];
[packageInfo setObject:@(NO) forKey:paramIsFirstTime];
[packageInfo setObject:@(YES) forKey:paramIsFirstLoadOk];
[defaults setObject:packageInfo forKey:keyPushyInfo];
NSMutableDictionary *pushyInfo = [[NSMutableDictionary alloc] initWithDictionary:[defaults objectForKey:keyPushyInfo]];
[pushyInfo setObject:@(NO) forKey:paramIsFirstTime];
[pushyInfo setObject:@(YES) forKey:paramIsFirstLoadOk];
NSString *lastVersion = pushyInfo[paramLastVersion];
NSString *curVersion = pushyInfo[paramCurrentVersion];
if (lastVersion != nil && ![lastVersion isEqualToString:curVersion]) {
[pushyInfo removeObjectForKey:[keyHashInfo stringByAppendingString:lastVersion]];
}
[defaults setObject:pushyInfo forKey:keyPushyInfo];
[defaults synchronize];
// clear other package dir
@@ -342,9 +356,7 @@ RCT_EXPORT_METHOD(markSuccess)
{
NSString *updateUrl = [RCTConvert NSString:options[@"updateUrl"]];
NSString *hash = [RCTConvert NSString:options[@"hash"]];
if (hash.length <= 0) {
hash = [RCTConvert NSString:options[@"hashName"]];;
}
if (updateUrl.length <= 0 || hash.length <= 0) {
callback([self errorWithMessage:ERROR_OPTIONS]);
return;

View File

@@ -1,11 +1,3 @@
//
// RCTPushyDownloader.h
// RCTPushy
//
// Created by lvbingru on 16/2/23.
// Copyright © 2016年 erica. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface RCTPushyDownloader : NSObject

View File

@@ -1,11 +1,3 @@
//
// RCTPushyDownloader.m
// RCTPushy
//
// Created by lvbingru on 16/2/23.
// Copyright © 2016 erica. All rights reserved.
//
#import "RCTPushyDownloader.h"
@interface RCTPushyDownloader()<NSURLSessionDelegate>

View File

@@ -1,11 +1,3 @@
//
// RCTPushyManager.h
// RCTPushy
//
// Created by lvbingru on 16/4/1.
// Copyright © 2016年 erica. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface RCTPushyManager : NSObject

View File

@@ -1,11 +1,3 @@
//
// RCTPushyManager.m
// RCTPushy
//
// Created by lvbingru on 16/4/1.
// Copyright © 2016 erica. All rights reserved.
//
#import "RCTPushyManager.h"
#import "ZipArchive.h"
#import "HDiffPatch.h"

View File

@@ -76,6 +76,10 @@ export function getCheckUrl(APPKEY, endpoint = currentEndpoint) {
return `${endpoint}/checkUpdate/${APPKEY}`;
}
export function getReportUrl(endpoint = currentEndpoint) {
return `${endpoint}/report`;
}
export function setCustomEndpoints({ main, backups, backupQueryUrl }) {
currentEndpoint = main;
backupEndpointsQueryUrl = null;

11
lib/index.d.ts vendored
View File

@@ -13,6 +13,7 @@ export interface ExpiredResult {
export interface UpTodateResult {
expired?: false;
upToDate: true;
paused?: 'app' | 'package';
}
export interface UpdateAvailableResult {
@@ -25,8 +26,6 @@ export interface UpdateAvailableResult {
metaInfo: string;
pdiffUrl: string;
diffUrl?: string;
phdiffUrl?: string;
hdiffUrl?: string;
}
export type CheckResult =
@@ -73,8 +72,16 @@ export function setCustomEndpoints({
backupQueryUrl?: string;
}): void;
export function getCurrentVersionInfo(): Promise<{
name?: string;
description?: string;
metaInfo?: string;
}>;
interface ProgressData {
hash: string;
received: number;
total: number;
}
export function simpleUpdate(wrappedComponent: any): any;

View File

@@ -1,280 +1,2 @@
import {
tryBackupEndpoints,
getCheckUrl,
setCustomEndpoints,
} from './endpoint';
import {
NativeEventEmitter,
NativeModules,
Platform,
PermissionsAndroid,
} from 'react-native';
export { setCustomEndpoints };
const {
version: v,
} = require('react-native/Libraries/Core/ReactNativeVersion');
const RNVersion = `${v.major}.${v.minor}.${v.patch}`;
let Pushy = NativeModules.Pushy;
if (!Pushy) {
throw new Error('react-native-update模块无法加载请对照安装文档检查配置。');
}
export const downloadRootDir = Pushy.downloadRootDir;
export const packageVersion = Pushy.packageVersion;
export const currentVersion = Pushy.currentVersion;
export const isFirstTime = Pushy.isFirstTime;
export const isRolledBack = Pushy.isRolledBack;
export const buildTime = Pushy.buildTime;
let blockUpdate = Pushy.blockUpdate;
let uuid = Pushy.uuid;
if (Platform.OS === 'android' && !Pushy.isUsingBundleUrl) {
throw new Error(
'react-native-update模块无法加载请对照文档检查Bundle URL的配置',
);
}
const eventEmitter = new NativeEventEmitter(Pushy);
if (!uuid) {
uuid = require('uuid/v4')();
Pushy.setUuid(uuid);
}
function logger(text) {
console.log(`Pushy: ${text}`);
}
logger('uuid: ' + uuid);
/*
Return json:
Package expired:
{
expired: true,
downloadUrl: 'http://appstore/downloadUrl',
}
Package is up to date:
{
upToDate: true,
}
There is available update:
{
update: true,
name: '1.0.3-rc',
hash: 'hash',
description: '添加聊天功能\n修复商城页面BUG',
metaInfo: '{"silent":true}',
pdiffUrl: 'http://update-packages.reactnative.cn/hash',
diffUrl: 'http://update-packages.reactnative.cn/hash',
}
*/
export const cInfo = {
pushy: require('../package.json').version,
rn: RNVersion,
os: Platform.OS + ' ' + Platform.Version,
uuid,
};
function assertRelease() {
if (__DEV__) {
throw new Error('react-native-update can only run on RELEASE version.');
}
}
let checkingThrottling = false;
export async function checkUpdate(APPKEY, isRetry) {
assertRelease();
if (checkingThrottling) {
logger('repeated checking, ignored');
return;
}
checkingThrottling = true;
setTimeout(() => {
checkingThrottling = false;
}, 3000);
if (blockUpdate && blockUpdate.until > Date.now() / 1000) {
throw new Error(
`热更新已暂停,原因:${blockUpdate.reason}。请在"${new Date(
blockUpdate.until * 1000,
).toLocaleString()}"之后重试。`,
);
}
if (typeof APPKEY !== 'string') {
throw new Error('未检查到合法的APPKEY请查看update.json文件是否正确生成');
}
logger('checking update');
let resp;
try {
resp = await fetch(getCheckUrl(APPKEY), {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
packageVersion,
hash: currentVersion,
buildTime,
cInfo,
}),
});
} catch (e) {
if (isRetry) {
throw new Error('Could not connect to pushy server');
}
await tryBackupEndpoints(APPKEY);
return checkUpdate(APPKEY, true);
}
const result = await resp.json();
checkOperation(result.op);
if (resp.status !== 200) {
throw new Error(result.message);
}
return result;
}
function checkOperation(op) {
if (!Array.isArray(op)) {
return;
}
op.forEach((action) => {
if (action.type === 'block') {
blockUpdate = {
reason: action.reason,
until: Math.round((Date.now() + action.duration) / 1000),
};
Pushy.setBlockUpdate(blockUpdate);
}
});
}
let downloadingThrottling = false;
let downloadedHash;
export async function downloadUpdate(options, eventListeners) {
assertRelease();
if (!options.update) {
return;
}
if (downloadedHash === options.hash) {
logger(`duplicated downloaded hash ${downloadedHash}, ignored`);
return;
}
if (downloadingThrottling) {
logger('repeated downloading, ignored');
return;
}
downloadingThrottling = true;
setTimeout(() => {
downloadingThrottling = false;
}, 3000);
let progressHandler;
if (eventListeners) {
if (eventListeners.onDownloadProgress) {
const downloadCallback = eventListeners.onDownloadProgress;
progressHandler = eventEmitter.addListener(
'RCTPushyDownloadProgress',
(progressData) => {
if (progressData.hash === options.hash) {
downloadCallback(progressData);
}
},
);
}
}
if (options.diffUrl) {
logger('downloading diff');
try {
await Pushy.downloadPatchFromPpk({
updateUrl: options.diffUrl,
hash: options.hash,
originHash: currentVersion,
});
} catch (e) {
logger(e.message);
logger('diff error, try pdiff');
await Pushy.downloadPatchFromPackage({
updateUrl: options.pdiffUrl,
hash: options.hash,
});
}
} else if (options.pdiffUrl) {
logger('downloading pdiff');
await Pushy.downloadPatchFromPackage({
updateUrl: options.pdiffUrl,
hash: options.hash,
});
}
progressHandler && progressHandler.remove();
downloadedHash = options.hash;
return options.hash;
}
export function switchVersion(hash) {
assertRelease();
logger('switchVersion');
Pushy.reloadUpdate({ hash });
}
let readyHash;
export function switchVersionLater(hash) {
assertRelease();
if (readyHash === hash) {
logger(`duplicated ready hash ${readyHash}, ignored`);
return;
}
readyHash = hash;
logger('switchVersionLater');
Pushy.setNeedUpdate({ hash });
}
let marked = false;
export function markSuccess() {
assertRelease();
if (marked) {
logger('repeated markSuccess, ignored');
return;
}
marked = true;
logger('markSuccess');
Pushy.markSuccess();
}
export async function downloadAndInstallApk({ url, onDownloadProgress }) {
logger('downloadAndInstallApk');
if (Platform.OS === 'android' && Platform.Version <= 23) {
try {
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE,
);
if (granted !== PermissionsAndroid.RESULTS.GRANTED) {
return;
}
} catch (err) {
console.warn(err);
}
}
let hash = Date.now().toString();
let progressHandler;
if (onDownloadProgress) {
progressHandler = eventEmitter.addListener(
'RCTPushyDownloadProgress',
(progressData) => {
if (progressData.hash === hash) {
onDownloadProgress(progressData);
}
},
);
}
await Pushy.downloadAndInstallApk({
url,
target: 'update.apk',
hash,
});
progressHandler && progressHandler.remove();
}
export * from './main';
export * from './simpleUpdate';

334
lib/main.js Normal file
View File

@@ -0,0 +1,334 @@
import {
tryBackupEndpoints,
getCheckUrl,
setCustomEndpoints,
getReportUrl,
} from './endpoint';
import {
NativeEventEmitter,
NativeModules,
Platform,
PermissionsAndroid,
} from 'react-native';
export { setCustomEndpoints };
const {
version: v,
} = require('react-native/Libraries/Core/ReactNativeVersion');
const RNVersion = `${v.major}.${v.minor}.${v.patch}`;
let Pushy = NativeModules.Pushy;
if (!Pushy) {
throw new Error('react-native-update模块无法加载请对照安装文档检查配置。');
}
export const downloadRootDir = Pushy.downloadRootDir;
export const packageVersion = Pushy.packageVersion;
export const currentVersion = Pushy.currentVersion;
export const isFirstTime = Pushy.isFirstTime;
const rolledBackVersion = Pushy.rolledBackVersion;
export const isRolledBack = typeof rolledBackVersion === 'string';
export const buildTime = Pushy.buildTime;
let blockUpdate = Pushy.blockUpdate;
let uuid = Pushy.uuid;
if (Platform.OS === 'android' && !Pushy.isUsingBundleUrl) {
throw new Error(
'react-native-update模块无法加载请对照文档检查Bundle URL的配置',
);
}
function setLocalHashInfo(hash, info) {
Pushy.setLocalHashInfo(hash, JSON.stringify(info));
}
async function getLocalHashInfo(hash) {
return JSON.parse(await Pushy.getLocalHashInfo(hash));
}
export async function getCurrentVersionInfo() {
return currentVersion ? (await getLocalHashInfo(currentVersion)) || {} : {};
}
const eventEmitter = new NativeEventEmitter(Pushy);
if (!uuid) {
uuid = require('nanoid/non-secure').nanoid();
Pushy.setUuid(uuid);
}
function logger(text) {
console.log(`Pushy: ${text}`);
}
function report(hash, type) {
logger(type);
fetch(getReportUrl(), {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
hash,
type,
cInfo,
packageVersion,
buildTime,
}),
}).catch((_e) => {});
}
logger('uuid: ' + uuid);
if (isRolledBack) {
report(rolledBackVersion, 'rollback');
}
export const cInfo = {
pushy: require('../package.json').version,
rn: RNVersion,
os: Platform.OS + ' ' + Platform.Version,
uuid,
};
function assertRelease() {
if (__DEV__) {
throw new Error('react-native-update can only run on RELEASE version.');
}
}
let checkingThrottling = false;
export async function checkUpdate(APPKEY, isRetry) {
assertRelease();
if (checkingThrottling) {
logger('repeated checking, ignored');
return;
}
checkingThrottling = true;
setTimeout(() => {
checkingThrottling = false;
}, 3000);
if (blockUpdate && blockUpdate.until > Date.now() / 1000) {
throw new Error(
`热更新已暂停,原因:${blockUpdate.reason}。请在"${new Date(
blockUpdate.until * 1000,
).toLocaleString()}"之后重试。`,
);
}
if (typeof APPKEY !== 'string') {
throw new Error('未检查到合法的APPKEY请查看update.json文件是否正确生成');
}
logger('checking update');
let resp;
try {
resp = await fetch(getCheckUrl(APPKEY), {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
packageVersion,
hash: currentVersion,
buildTime,
cInfo,
}),
});
} catch (e) {
if (isRetry) {
throw new Error('Could not connect to pushy server');
}
await tryBackupEndpoints(APPKEY);
return checkUpdate(APPKEY, true);
}
const result = await resp.json();
checkOperation(result.op);
if (resp.status !== 200) {
throw new Error(result.message);
}
return result;
}
function checkOperation(op) {
if (!Array.isArray(op)) {
return;
}
op.forEach((action) => {
if (action.type === 'block') {
blockUpdate = {
reason: action.reason,
until: Math.round((Date.now() + action.duration) / 1000),
};
Pushy.setBlockUpdate(blockUpdate);
}
});
}
let downloadingThrottling = false;
let downloadedHash;
export async function downloadUpdate(options, eventListeners) {
assertRelease();
if (!options.update) {
return;
}
if (rolledBackVersion === options.hash) {
logger(`rolledback hash ${rolledBackVersion}, ignored`);
return;
}
if (downloadedHash === options.hash) {
logger(`duplicated downloaded hash ${downloadedHash}, ignored`);
return;
}
if (readyHash) {
logger(`hash ${readyHash} applied. reboot first`);
return;
}
if (downloadingThrottling) {
logger('repeated downloading, ignored');
return;
}
downloadingThrottling = true;
setTimeout(() => {
downloadingThrottling = false;
}, 3000);
let progressHandler;
if (eventListeners) {
if (eventListeners.onDownloadProgress) {
const downloadCallback = eventListeners.onDownloadProgress;
progressHandler = eventEmitter.addListener(
'RCTPushyDownloadProgress',
(progressData) => {
if (progressData.hash === options.hash) {
downloadCallback(progressData);
}
},
);
}
}
if (options.diffUrl) {
logger('downloading diff');
try {
await Pushy.downloadPatchFromPpk({
updateUrl: options.diffUrl,
hash: options.hash,
originHash: currentVersion,
});
} catch (e) {
logger(`diff error: ${e.message}, try pdiff`);
try {
await Pushy.downloadPatchFromPackage({
updateUrl: options.pdiffUrl,
hash: options.hash,
});
} catch (e) {
progressHandler && progressHandler.remove();
report(options.hash, 'error');
throw e;
}
}
} else if (options.pdiffUrl) {
logger('downloading pdiff');
try {
await Pushy.downloadPatchFromPackage({
updateUrl: options.pdiffUrl,
hash: options.hash,
});
} catch (e) {
progressHandler && progressHandler.remove();
report(options.hash, 'error');
throw e;
}
}
setLocalHashInfo(options.hash, {
name: options.name,
description: options.description,
metaInfo: options.metaInfo,
});
progressHandler && progressHandler.remove();
downloadedHash = options.hash;
return options.hash;
}
let readyHash;
function assertHash(hash) {
if (!downloadedHash) {
logger(`no downloaded hash`);
return;
}
if (hash !== downloadedHash) {
logger(`use downloaded hash ${downloadedHash} first`);
return;
}
if (readyHash === hash) {
logger(`hash ${readyHash} already applied. reboot first.`);
return;
}
readyHash = hash;
return true;
}
export function switchVersion(hash) {
assertRelease();
if (assertHash(hash)) {
logger('switchVersion: ' + hash);
Pushy.reloadUpdate({ hash });
}
}
export function switchVersionLater(hash) {
assertRelease();
if (assertHash(hash)) {
logger('switchVersionLater: ' + hash);
Pushy.setNeedUpdate({ hash });
}
}
let marked = false;
export function markSuccess() {
assertRelease();
if (marked) {
logger('repeated markSuccess, ignored');
return;
}
marked = true;
Pushy.markSuccess();
report(currentVersion, 'success');
}
export async function downloadAndInstallApk({ url, onDownloadProgress }) {
logger('downloadAndInstallApk');
if (Platform.OS === 'android' && Platform.Version <= 23) {
try {
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE,
);
if (granted !== PermissionsAndroid.RESULTS.GRANTED) {
return;
}
} catch (err) {
console.warn(err);
}
}
let hash = Date.now().toString();
let progressHandler;
if (onDownloadProgress) {
progressHandler = eventEmitter.addListener(
'RCTPushyDownloadProgress',
(progressData) => {
if (progressData.hash === hash) {
onDownloadProgress(progressData);
}
},
);
}
await Pushy.downloadAndInstallApk({
url,
target: 'update.apk',
hash,
});
progressHandler && progressHandler.remove();
}

119
lib/simpleUpdate.js Normal file
View File

@@ -0,0 +1,119 @@
import React, { Component } from 'react';
import { Platform, Alert, Linking, AppState } from 'react-native';
import {
isFirstTime,
isRolledBack,
checkUpdate,
downloadUpdate,
switchVersion,
switchVersionLater,
markSuccess,
downloadAndInstallApk,
} from './main';
import _updateConfig from '../../../update.json';
const { appKey } = _updateConfig[Platform.OS];
export function simpleUpdate(WrappedComponent) {
return __DEV__
? WrappedComponent
: class AppUpdate extends Component {
componentDidMount() {
if (isRolledBack) {
Alert.alert('抱歉', '刚刚更新遭遇错误,已为您恢复到更新前版本');
} else if (isFirstTime) {
markSuccess();
}
this.stateListener = AppState.addEventListener(
'change',
(nextAppState) => {
if (nextAppState === 'active') {
this.checkUpdate();
}
},
);
this.checkUpdate();
}
componentWillUnmount() {
this.stateListener && this.stateListener.remove();
}
doUpdate = async (info) => {
try {
const hash = await downloadUpdate(info);
if (!hash) {
return;
}
this.stateListener && this.stateListener.remove();
Alert.alert('提示', '下载完毕,是否立即更新?', [
{
text: '以后再说',
style: 'cancel',
onPress: () => {
switchVersionLater(hash);
},
},
{
text: '立即更新',
style: 'default',
onPress: () => {
switchVersion(hash);
},
},
]);
} catch (err) {
Alert.alert('更新失败', err.message);
}
};
checkUpdate = async () => {
let info;
try {
info = await checkUpdate(appKey);
} catch (err) {
Alert.alert('更新检查失败', err.message);
return;
}
if (info.expired) {
Alert.alert('提示', '您的应用版本已更新,点击确定下载安装新版本', [
{
text: '确定',
onPress: () => {
if (info.downloadUrl) {
if (
Platform.OS === 'android' &&
info.downloadUrl.endsWith('.apk')
) {
downloadAndInstallApk({
url: info.downloadUrl,
});
} else {
Linking.openURL(info.downloadUrl);
}
}
},
},
]);
} else if (info.update) {
Alert.alert(
'提示',
'检查到新的版本' + info.name + ',是否下载?\n' + info.description,
[
{ text: '否', style: 'cancel' },
{
text: '是',
style: 'default',
onPress: () => {
this.doUpdate(info);
},
},
],
);
}
};
render() {
return <WrappedComponent {...this.props} />;
}
};
}

View File

@@ -1,6 +1,6 @@
{
"name": "react-native-update",
"version": "6.1.0",
"version": "7.3.8",
"description": "react-native hot update",
"main": "lib/index.js",
"scripts": {
@@ -19,7 +19,7 @@
"update"
],
"author": "reactnativecn",
"license": "BSD-3-Clause",
"license": "MIT",
"bugs": {
"url": "https://github.com/reactnativecn/react-native-pushy/issues"
},
@@ -28,6 +28,6 @@
},
"homepage": "https://github.com/reactnativecn/react-native-pushy#readme",
"dependencies": {
"uuid": "3"
"nanoid": "^3.1.30"
}
}

View File

@@ -2,7 +2,7 @@
# yarn lockfile v1
uuid@3:
version "3.4.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
nanoid@^3.1.28:
version "3.1.28"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.28.tgz#3c01bac14cb6c5680569014cc65a2f26424c6bd4"
integrity sha512-gSu9VZ2HtmoKYe/lmyPFES5nknFrHa+/DT9muUFWFMi6Jh9E1I7bkvlQ8xxf1Kos9pi9o8lBnIOkatMhKX/YUw==