mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-16 12:51:44 +08:00
Compare commits
35 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
35939286d0 | ||
![]() |
f49ce30cef | ||
![]() |
e6cd25a2d8 | ||
![]() |
0cc96ee59c | ||
![]() |
6dd71a36e8 | ||
![]() |
8db8d2162e | ||
![]() |
2bf25f37f0 | ||
![]() |
ca3c3d86b5 | ||
![]() |
3edb3cca57 | ||
![]() |
d80531dbcc | ||
![]() |
07003a4767 | ||
![]() |
ee7be88542 | ||
![]() |
cac92b43c7 | ||
![]() |
e66d102e85 | ||
![]() |
94d52bb415 | ||
![]() |
775e567062 | ||
![]() |
bf1701031b | ||
![]() |
d32d395a2a | ||
![]() |
3bc63acad4 | ||
![]() |
898ed85b8c | ||
![]() |
3a526d1b15 | ||
![]() |
05563c3393 | ||
![]() |
b193b4b1df | ||
![]() |
451e298ba5 | ||
![]() |
1b5c07be9e | ||
![]() |
13cf53974e | ||
![]() |
2a1915c50c | ||
![]() |
3de78a9dbd | ||
![]() |
ef065e4072 | ||
![]() |
ff67829a27 | ||
![]() |
206a04b331 | ||
![]() |
d087c167f1 | ||
![]() |
f4c62cc3d1 | ||
![]() |
431940a423 | ||
![]() |
2dc9243bb8 |
@@ -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'
|
||||
}
|
||||
|
||||
|
@@ -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>
|
||||
|
@@ -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' }
|
||||
}
|
||||
}
|
||||
|
@@ -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
|
@@ -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
|
||||
|
@@ -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.84.0'})
|
||||
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
|
||||
|
||||
|
@@ -1,371 +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.0)
|
||||
- FBReactNativeSpec (0.64.0):
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- RCTRequired (= 0.64.0)
|
||||
- RCTTypeSafety (= 0.64.0)
|
||||
- React-Core (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- ReactCommon/turbomodule/core (= 0.64.0)
|
||||
- Flipper (0.84.0):
|
||||
- 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.1):
|
||||
- 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.84.0):
|
||||
- FlipperKit/Core (= 0.84.0)
|
||||
- FlipperKit/Core (0.84.0):
|
||||
- Flipper (~> 0.84.0)
|
||||
- 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.84.0):
|
||||
- Flipper (~> 0.84.0)
|
||||
- FlipperKit/FBCxxFollyDynamicConvert (0.84.0):
|
||||
- Flipper-Folly (~> 2.5)
|
||||
- FlipperKit/FBDefines (0.84.0)
|
||||
- FlipperKit/FKPortForwarding (0.84.0):
|
||||
- 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.84.0)
|
||||
- FlipperKit/FlipperKitLayoutHelpers (0.84.0):
|
||||
- FlipperKit/FlipperKitHighlightOverlay (0.99.0)
|
||||
- FlipperKit/FlipperKitLayoutHelpers (0.99.0):
|
||||
- FlipperKit/Core
|
||||
- FlipperKit/FlipperKitHighlightOverlay
|
||||
- FlipperKit/FlipperKitLayoutTextSearchable
|
||||
- FlipperKit/FlipperKitLayoutIOSDescriptors (0.84.0):
|
||||
- FlipperKit/FlipperKitLayoutIOSDescriptors (0.99.0):
|
||||
- FlipperKit/Core
|
||||
- FlipperKit/FlipperKitHighlightOverlay
|
||||
- FlipperKit/FlipperKitLayoutHelpers
|
||||
- YogaKit (~> 1.18)
|
||||
- FlipperKit/FlipperKitLayoutPlugin (0.84.0):
|
||||
- FlipperKit/FlipperKitLayoutPlugin (0.99.0):
|
||||
- FlipperKit/Core
|
||||
- FlipperKit/FlipperKitHighlightOverlay
|
||||
- FlipperKit/FlipperKitLayoutHelpers
|
||||
- FlipperKit/FlipperKitLayoutIOSDescriptors
|
||||
- FlipperKit/FlipperKitLayoutTextSearchable
|
||||
- YogaKit (~> 1.18)
|
||||
- FlipperKit/FlipperKitLayoutTextSearchable (0.84.0)
|
||||
- FlipperKit/FlipperKitNetworkPlugin (0.84.0):
|
||||
- FlipperKit/FlipperKitLayoutTextSearchable (0.99.0)
|
||||
- FlipperKit/FlipperKitNetworkPlugin (0.99.0):
|
||||
- FlipperKit/Core
|
||||
- FlipperKit/FlipperKitReactPlugin (0.84.0):
|
||||
- FlipperKit/FlipperKitReactPlugin (0.99.0):
|
||||
- FlipperKit/Core
|
||||
- FlipperKit/FlipperKitUserDefaultsPlugin (0.84.0):
|
||||
- FlipperKit/FlipperKitUserDefaultsPlugin (0.99.0):
|
||||
- FlipperKit/Core
|
||||
- FlipperKit/SKIOSNetworkPlugin (0.84.0):
|
||||
- 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.0)
|
||||
- RCTTypeSafety (0.64.0):
|
||||
- FBLazyVector (= 0.64.0)
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- RCTRequired (= 0.64.0)
|
||||
- React-Core (= 0.64.0)
|
||||
- React (0.64.0):
|
||||
- React-Core (= 0.64.0)
|
||||
- React-Core/DevSupport (= 0.64.0)
|
||||
- React-Core/RCTWebSocket (= 0.64.0)
|
||||
- React-RCTActionSheet (= 0.64.0)
|
||||
- React-RCTAnimation (= 0.64.0)
|
||||
- React-RCTBlob (= 0.64.0)
|
||||
- React-RCTImage (= 0.64.0)
|
||||
- React-RCTLinking (= 0.64.0)
|
||||
- React-RCTNetwork (= 0.64.0)
|
||||
- React-RCTSettings (= 0.64.0)
|
||||
- React-RCTText (= 0.64.0)
|
||||
- React-RCTVibration (= 0.64.0)
|
||||
- React-callinvoker (0.64.0)
|
||||
- React-Core (0.64.0):
|
||||
- glog
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- React-Core/Default (= 0.64.0)
|
||||
- React-cxxreact (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-jsiexecutor (= 0.64.0)
|
||||
- React-perflogger (= 0.64.0)
|
||||
- Yoga
|
||||
- React-Core/CoreModulesHeaders (0.64.0):
|
||||
- glog
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- React-Core/Default
|
||||
- React-cxxreact (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-jsiexecutor (= 0.64.0)
|
||||
- React-perflogger (= 0.64.0)
|
||||
- Yoga
|
||||
- React-Core/Default (0.64.0):
|
||||
- glog
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- React-cxxreact (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-jsiexecutor (= 0.64.0)
|
||||
- React-perflogger (= 0.64.0)
|
||||
- Yoga
|
||||
- React-Core/DevSupport (0.64.0):
|
||||
- glog
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- React-Core/Default (= 0.64.0)
|
||||
- React-Core/RCTWebSocket (= 0.64.0)
|
||||
- React-cxxreact (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-jsiexecutor (= 0.64.0)
|
||||
- React-jsinspector (= 0.64.0)
|
||||
- React-perflogger (= 0.64.0)
|
||||
- Yoga
|
||||
- React-Core/RCTActionSheetHeaders (0.64.0):
|
||||
- glog
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- React-Core/Default
|
||||
- React-cxxreact (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-jsiexecutor (= 0.64.0)
|
||||
- React-perflogger (= 0.64.0)
|
||||
- Yoga
|
||||
- React-Core/RCTAnimationHeaders (0.64.0):
|
||||
- glog
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- React-Core/Default
|
||||
- React-cxxreact (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-jsiexecutor (= 0.64.0)
|
||||
- React-perflogger (= 0.64.0)
|
||||
- Yoga
|
||||
- React-Core/RCTBlobHeaders (0.64.0):
|
||||
- glog
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- React-Core/Default
|
||||
- React-cxxreact (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-jsiexecutor (= 0.64.0)
|
||||
- React-perflogger (= 0.64.0)
|
||||
- Yoga
|
||||
- React-Core/RCTImageHeaders (0.64.0):
|
||||
- glog
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- React-Core/Default
|
||||
- React-cxxreact (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-jsiexecutor (= 0.64.0)
|
||||
- React-perflogger (= 0.64.0)
|
||||
- Yoga
|
||||
- React-Core/RCTLinkingHeaders (0.64.0):
|
||||
- glog
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- React-Core/Default
|
||||
- React-cxxreact (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-jsiexecutor (= 0.64.0)
|
||||
- React-perflogger (= 0.64.0)
|
||||
- Yoga
|
||||
- React-Core/RCTNetworkHeaders (0.64.0):
|
||||
- glog
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- React-Core/Default
|
||||
- React-cxxreact (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-jsiexecutor (= 0.64.0)
|
||||
- React-perflogger (= 0.64.0)
|
||||
- Yoga
|
||||
- React-Core/RCTSettingsHeaders (0.64.0):
|
||||
- glog
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- React-Core/Default
|
||||
- React-cxxreact (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-jsiexecutor (= 0.64.0)
|
||||
- React-perflogger (= 0.64.0)
|
||||
- Yoga
|
||||
- React-Core/RCTTextHeaders (0.64.0):
|
||||
- glog
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- React-Core/Default
|
||||
- React-cxxreact (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-jsiexecutor (= 0.64.0)
|
||||
- React-perflogger (= 0.64.0)
|
||||
- Yoga
|
||||
- React-Core/RCTVibrationHeaders (0.64.0):
|
||||
- glog
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- React-Core/Default
|
||||
- React-cxxreact (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-jsiexecutor (= 0.64.0)
|
||||
- React-perflogger (= 0.64.0)
|
||||
- Yoga
|
||||
- React-Core/RCTWebSocket (0.64.0):
|
||||
- glog
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- React-Core/Default (= 0.64.0)
|
||||
- React-cxxreact (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-jsiexecutor (= 0.64.0)
|
||||
- React-perflogger (= 0.64.0)
|
||||
- Yoga
|
||||
- React-CoreModules (0.64.0):
|
||||
- FBReactNativeSpec (= 0.64.0)
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- RCTTypeSafety (= 0.64.0)
|
||||
- React-Core/CoreModulesHeaders (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-RCTImage (= 0.64.0)
|
||||
- ReactCommon/turbomodule/core (= 0.64.0)
|
||||
- React-cxxreact (0.64.0):
|
||||
- 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.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-jsinspector (= 0.64.0)
|
||||
- React-perflogger (= 0.64.0)
|
||||
- React-runtimeexecutor (= 0.64.0)
|
||||
- React-jsi (0.64.0):
|
||||
- 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.0)
|
||||
- React-jsi/Default (0.64.0):
|
||||
- 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.0):
|
||||
- DoubleConversion
|
||||
- glog
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- React-cxxreact (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-perflogger (= 0.64.0)
|
||||
- React-jsinspector (0.64.0)
|
||||
- react-native-update (5.11.0-beta2):
|
||||
- react-native-update (6.3.0):
|
||||
- React
|
||||
- react-native-update/HDiffPatch (= 5.11.0-beta2)
|
||||
- react-native-update/RCTPushy (= 5.11.0-beta2)
|
||||
- react-native-update/HDiffPatch (= 6.3.0)
|
||||
- react-native-update/RCTPushy (= 6.3.0)
|
||||
- SSZipArchive
|
||||
- react-native-update/HDiffPatch (5.11.0-beta2):
|
||||
- react-native-update/HDiffPatch (6.3.0):
|
||||
- React
|
||||
- SSZipArchive
|
||||
- react-native-update/RCTPushy (5.11.0-beta2):
|
||||
- react-native-update/RCTPushy (6.3.0):
|
||||
- React
|
||||
- SSZipArchive
|
||||
- React-perflogger (0.64.0)
|
||||
- React-RCTActionSheet (0.64.0):
|
||||
- React-Core/RCTActionSheetHeaders (= 0.64.0)
|
||||
- React-RCTAnimation (0.64.0):
|
||||
- FBReactNativeSpec (= 0.64.0)
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- RCTTypeSafety (= 0.64.0)
|
||||
- React-Core/RCTAnimationHeaders (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- ReactCommon/turbomodule/core (= 0.64.0)
|
||||
- React-RCTBlob (0.64.0):
|
||||
- FBReactNativeSpec (= 0.64.0)
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- React-Core/RCTBlobHeaders (= 0.64.0)
|
||||
- React-Core/RCTWebSocket (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-RCTNetwork (= 0.64.0)
|
||||
- ReactCommon/turbomodule/core (= 0.64.0)
|
||||
- React-RCTImage (0.64.0):
|
||||
- FBReactNativeSpec (= 0.64.0)
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- RCTTypeSafety (= 0.64.0)
|
||||
- React-Core/RCTImageHeaders (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-RCTNetwork (= 0.64.0)
|
||||
- ReactCommon/turbomodule/core (= 0.64.0)
|
||||
- React-RCTLinking (0.64.0):
|
||||
- FBReactNativeSpec (= 0.64.0)
|
||||
- React-Core/RCTLinkingHeaders (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- ReactCommon/turbomodule/core (= 0.64.0)
|
||||
- React-RCTNetwork (0.64.0):
|
||||
- FBReactNativeSpec (= 0.64.0)
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- RCTTypeSafety (= 0.64.0)
|
||||
- React-Core/RCTNetworkHeaders (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- ReactCommon/turbomodule/core (= 0.64.0)
|
||||
- React-RCTSettings (0.64.0):
|
||||
- FBReactNativeSpec (= 0.64.0)
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- RCTTypeSafety (= 0.64.0)
|
||||
- React-Core/RCTSettingsHeaders (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- ReactCommon/turbomodule/core (= 0.64.0)
|
||||
- React-RCTText (0.64.0):
|
||||
- React-Core/RCTTextHeaders (= 0.64.0)
|
||||
- React-RCTVibration (0.64.0):
|
||||
- FBReactNativeSpec (= 0.64.0)
|
||||
- RCT-Folly (= 2020.01.13.00)
|
||||
- React-Core/RCTVibrationHeaders (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- ReactCommon/turbomodule/core (= 0.64.0)
|
||||
- React-runtimeexecutor (0.64.0):
|
||||
- React-jsi (= 0.64.0)
|
||||
- ReactCommon/turbomodule/core (0.64.0):
|
||||
- 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.0)
|
||||
- React-Core (= 0.64.0)
|
||||
- React-cxxreact (= 0.64.0)
|
||||
- React-jsi (= 0.64.0)
|
||||
- React-perflogger (= 0.64.0)
|
||||
- SSZipArchive (2.2.3)
|
||||
- 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.84.0)
|
||||
- Flipper (= 0.99.0)
|
||||
- Flipper-Boost-iOSX (= 1.76.0.1.11)
|
||||
- Flipper-DoubleConversion (= 1.1.7)
|
||||
- Flipper-Folly (~> 2.5)
|
||||
- Flipper-Fmt (= 7.1.7)
|
||||
- Flipper-Folly (= 2.6.7)
|
||||
- Flipper-Glog (= 0.3.6)
|
||||
- Flipper-PeerTalk (~> 0.0.4)
|
||||
- Flipper-RSocket (~> 1.3)
|
||||
- FlipperKit (= 0.84.0)
|
||||
- FlipperKit/Core (= 0.84.0)
|
||||
- FlipperKit/CppBridge (= 0.84.0)
|
||||
- FlipperKit/FBCxxFollyDynamicConvert (= 0.84.0)
|
||||
- FlipperKit/FBDefines (= 0.84.0)
|
||||
- FlipperKit/FKPortForwarding (= 0.84.0)
|
||||
- FlipperKit/FlipperKitHighlightOverlay (= 0.84.0)
|
||||
- FlipperKit/FlipperKitLayoutPlugin (= 0.84.0)
|
||||
- FlipperKit/FlipperKitLayoutTextSearchable (= 0.84.0)
|
||||
- FlipperKit/FlipperKitNetworkPlugin (= 0.84.0)
|
||||
- FlipperKit/FlipperKitReactPlugin (= 0.84.0)
|
||||
- FlipperKit/FlipperKitUserDefaultsPlugin (= 0.84.0)
|
||||
- FlipperKit/SKIOSNetworkPlugin (= 0.84.0)
|
||||
- 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`)
|
||||
@@ -380,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`)
|
||||
@@ -397,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:
|
||||
@@ -442,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:
|
||||
@@ -472,49 +492,53 @@ EXTERNAL SOURCES:
|
||||
:path: "../node_modules/react-native/ReactCommon/yoga"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
|
||||
boost: a7c83b31436843459a1961bfd74b96033dc77234
|
||||
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
|
||||
DoubleConversion: cde416483dac037923206447da6e1454df403714
|
||||
FBLazyVector: 49cbe4b43e445b06bf29199b6ad2057649e4c8f5
|
||||
FBReactNativeSpec: 82f183aa413052f325b10b585b747af4823e4b18
|
||||
Flipper: 1e9b42d953eb33b2367f372ae25e64f6b86f4361
|
||||
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
|
||||
FBLazyVector: 6816ca39e1cc8beffd2a96783f518296789d1c48
|
||||
FBReactNativeSpec: 3b1e86618e902743fde35b40cf9ebd100fd655b7
|
||||
Flipper: 30e8eeeed6abdc98edaf32af0cda2f198be4b733
|
||||
Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
|
||||
Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41
|
||||
Flipper-Folly: f7a3caafbd74bda4827954fd7a6e000e36355489
|
||||
Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b
|
||||
Flipper-Folly: 83af37379faa69497529e414bd43fbfc7cae259a
|
||||
Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6
|
||||
Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
|
||||
Flipper-RSocket: 127954abe8b162fcaf68d2134d34dc2bd7076154
|
||||
FlipperKit: 3970c0e7566160eda3defc580980c55f4ad585e8
|
||||
glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
|
||||
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
|
||||
FlipperKit: d8d346844eca5d9120c17d441a2f38596e8ed2b9
|
||||
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
|
||||
glog: 5337263514dd6f09803962437687240c5dc39aa4
|
||||
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
|
||||
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
|
||||
RCT-Folly: ec7a233ccc97cc556cf7237f0db1ff65b986f27c
|
||||
RCTRequired: 2f8cb5b7533219bf4218a045f92768129cf7050a
|
||||
RCTTypeSafety: 512728b73549e72ad7330b92f3d42936f2a4de5b
|
||||
React: 98eac01574128a790f0bbbafe2d1a8607291ac24
|
||||
React-callinvoker: def3f7fae16192df68d9b69fd4bbb59092ee36bc
|
||||
React-Core: 70a52aa5dbe9b83befae82038451a7df9fd54c5a
|
||||
React-CoreModules: 052edef46117862e2570eb3a0f06d81c61d2c4b8
|
||||
React-cxxreact: c1dc71b30653cfb4770efdafcbdc0ad6d388baab
|
||||
React-jsi: 74341196d9547cbcbcfa4b3bbbf03af56431d5a1
|
||||
React-jsiexecutor: 06a9c77b56902ae7ffcdd7a4905f664adc5d237b
|
||||
React-jsinspector: 0ae35a37b20d5e031eb020a69cc5afdbd6406301
|
||||
react-native-update: a4ff51ac2ffc0e1950690b9a304a5efa5a9869b2
|
||||
React-perflogger: 9c547d8f06b9bf00cb447f2b75e8d7f19b7e02af
|
||||
React-RCTActionSheet: 3080b6e12e0e1a5b313c8c0050699b5c794a1b11
|
||||
React-RCTAnimation: 3f96f21a497ae7dabf4d2f150ee43f906aaf516f
|
||||
React-RCTBlob: 283b8e5025e7f954176bc48164f846909002f3ed
|
||||
React-RCTImage: 5088a484faac78f2d877e1b79125d3bb1ea94a16
|
||||
React-RCTLinking: 5e8fbb3e9a8bc2e4e3eb15b1eb8bda5fcac27b8c
|
||||
React-RCTNetwork: 38ec277217b1e841d5e6a1fa78da65b9212ccb28
|
||||
React-RCTSettings: 242d6e692108c3de4f3bb74b7586a8799e9ab070
|
||||
React-RCTText: 8746736ac8eb5a4a74719aa695b7a236a93a83d2
|
||||
React-RCTVibration: 0fd6b21751a33cb72fce1a4a33ab9678416d307a
|
||||
React-runtimeexecutor: cad74a1eaa53ee6e7a3620231939d8fe2c6afcf0
|
||||
ReactCommon: cfe2b7fd20e0dbd2d1185cd7d8f99633fbc5ff05
|
||||
SSZipArchive: 62d4947b08730e4cda640473b0066d209ff033c9
|
||||
Yoga: 8c8436d4171c87504c648ae23b1d81242bdf3bbf
|
||||
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: c11abbf5809216c91fcd62f5571078b83d9b6720
|
||||
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
|
||||
|
||||
PODFILE CHECKSUM: 519089f4194b2734ec99f1355a2d6fa8ed4aefbd
|
||||
PODFILE CHECKSUM: a26b18e70d6c4725e0254b56751afbc7620020ff
|
||||
|
||||
COCOAPODS: 1.10.1
|
||||
COCOAPODS: 1.11.2
|
||||
|
@@ -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 = (
|
||||
@@ -330,6 +310,7 @@
|
||||
DEAD_CODE_STRIPPING = NO;
|
||||
DEVELOPMENT_TEAM = JD75Q9JJL2;
|
||||
INFOPLIST_FILE = testHotUpdate/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
OTHER_LDFLAGS = (
|
||||
"$(inherited)",
|
||||
@@ -354,6 +335,7 @@
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = JD75Q9JJL2;
|
||||
INFOPLIST_FILE = testHotUpdate/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
OTHER_LDFLAGS = (
|
||||
"$(inherited)",
|
||||
|
@@ -2,37 +2,52 @@
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x",
|
||||
"size" : "60x60"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x",
|
||||
"size" : "60x60"
|
||||
},
|
||||
{
|
||||
"idiom" : "ios-marketing",
|
||||
"scale" : "1x",
|
||||
"size" : "1024x1024"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -11,8 +11,8 @@
|
||||
"apk": "(cd android && ./gradlew aR)"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "17.0.1",
|
||||
"react-native": "0.64.0",
|
||||
"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"
|
||||
|
@@ -22,6 +22,7 @@ export default function TestConsole({visible}) {
|
||||
<Text>调试Pushy方法(方法名,参数,值换行)</Text>
|
||||
<TextInput
|
||||
autoCorrect={false}
|
||||
autoCapitalize="none"
|
||||
style={{
|
||||
borderWidth: StyleSheet.hairlineWidth * 4,
|
||||
borderColor: 'black',
|
||||
|
File diff suppressed because it is too large
Load Diff
2
LICENSE
2
LICENSE
@@ -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.
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
### 优势
|
||||
|
||||
1. 基于阿里云高速 CDN 分发,对比其他在服务器在国外的热更新服务,分发更稳定,更新成功率极高。
|
||||
1. 基于阿里云高速 CDN 分发,对比其他服务器在国外的热更新服务,分发更稳定,更新成功率极高。
|
||||
2. 基于 bsdiff/hdiff 算法创建的**超小更新包**,通常版本迭代后在 1-10KB 之间,避免数百 KB 的流量消耗。
|
||||
3. 跨越多个版本进行更新时,只需要下载**一个更新包**,不需要逐版本依次更新。
|
||||
4. 命令行工具&网页双端管理,版本发布过程简单便捷,完全可以集成 CI。
|
||||
|
@@ -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");
|
||||
|
@@ -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.
|
||||
|
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -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) {
|
||||
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;
|
||||
}
|
||||
|
@@ -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,
|
||||
|
@@ -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>
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
|
@@ -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>
|
||||
|
@@ -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
|
||||
|
@@ -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"
|
||||
|
@@ -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
11
lib/index.d.ts
vendored
@@ -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;
|
||||
|
247
lib/index.js
247
lib/index.js
@@ -1,245 +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.');
|
||||
}
|
||||
}
|
||||
|
||||
export async function checkUpdate(APPKEY, isRetry) {
|
||||
assertRelease();
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export async function downloadUpdate(options, eventListeners) {
|
||||
assertRelease();
|
||||
if (!options.update) {
|
||||
return;
|
||||
}
|
||||
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();
|
||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||
return options.hash;
|
||||
}
|
||||
|
||||
export function switchVersion(hash) {
|
||||
assertRelease();
|
||||
logger('switchVersion');
|
||||
Pushy.reloadUpdate({ hash });
|
||||
}
|
||||
|
||||
export function switchVersionLater(hash) {
|
||||
assertRelease();
|
||||
logger('switchVersionLater');
|
||||
Pushy.setNeedUpdate({ hash });
|
||||
}
|
||||
|
||||
export function markSuccess() {
|
||||
assertRelease();
|
||||
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
334
lib/main.js
Normal 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');
|
||||
return;
|
||||
}
|
||||
}
|
||||
} 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');
|
||||
return;
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
116
lib/simpleUpdate.js
Normal file
116
lib/simpleUpdate.js
Normal file
@@ -0,0 +1,116 @@
|
||||
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.remove();
|
||||
}
|
||||
doUpdate = async (info) => {
|
||||
try {
|
||||
const hash = await downloadUpdate(info);
|
||||
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 {
|
||||
Alert.alert(
|
||||
'提示',
|
||||
'检查到新的版本' + info.name + ',是否下载?\n' + info.description,
|
||||
[
|
||||
{ text: '否', style: 'cancel' },
|
||||
{
|
||||
text: '是',
|
||||
style: 'default',
|
||||
onPress: () => {
|
||||
this.doUpdate(info);
|
||||
},
|
||||
},
|
||||
],
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
return <WrappedComponent {...this.props} />;
|
||||
}
|
||||
};
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-update",
|
||||
"version": "6.0.5",
|
||||
"version": "7.3.0",
|
||||
"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.28"
|
||||
}
|
||||
}
|
||||
|
@@ -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==
|
||||
|
Reference in New Issue
Block a user