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

Compare commits

..

1 Commits

Author SHA1 Message Date
sunnylqm
1b2eb2361d v6.0.1 2021-05-10 14:36:14 +08:00
36 changed files with 3502 additions and 3072 deletions

View File

@@ -36,8 +36,6 @@ project.xcworkspace
.idea .idea
.gradle .gradle
local.properties local.properties
android/build
android/obj
# node.js # node.js
# #
@@ -45,6 +43,7 @@ node_modules/
npm-debug.log npm-debug.log
Example Example
yarn.lock yarn.lock
android/jni
domains.json domains.json
endpoints.json endpoints.json

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,384 +1,371 @@
PODS: PODS:
- boost (1.76.0) - boost-for-react-native (1.63.0)
- CocoaAsyncSocket (7.6.5) - CocoaAsyncSocket (7.6.5)
- DoubleConversion (1.1.6) - DoubleConversion (1.1.6)
- FBLazyVector (0.66.0) - FBLazyVector (0.64.0)
- FBReactNativeSpec (0.66.0): - FBReactNativeSpec (0.64.0):
- RCT-Folly (= 2021.06.28.00-v2) - RCT-Folly (= 2020.01.13.00)
- RCTRequired (= 0.66.0) - RCTRequired (= 0.64.0)
- RCTTypeSafety (= 0.66.0) - RCTTypeSafety (= 0.64.0)
- React-Core (= 0.66.0) - React-Core (= 0.64.0)
- React-jsi (= 0.66.0) - React-jsi (= 0.64.0)
- ReactCommon/turbomodule/core (= 0.66.0) - ReactCommon/turbomodule/core (= 0.64.0)
- Flipper (0.99.0): - Flipper (0.84.0):
- Flipper-Folly (~> 2.6) - Flipper-Folly (~> 2.5)
- Flipper-RSocket (~> 1.4) - Flipper-RSocket (~> 1.3)
- Flipper-Boost-iOSX (1.76.0.1.11)
- Flipper-DoubleConversion (1.1.7) - Flipper-DoubleConversion (1.1.7)
- Flipper-Fmt (7.1.7) - Flipper-Folly (2.5.1):
- Flipper-Folly (2.6.7): - boost-for-react-native
- Flipper-Boost-iOSX
- Flipper-DoubleConversion - Flipper-DoubleConversion
- Flipper-Fmt (= 7.1.7)
- Flipper-Glog - Flipper-Glog
- libevent (~> 2.1.12) - libevent (~> 2.1.12)
- OpenSSL-Universal (= 1.1.180) - OpenSSL-Universal (= 1.1.180)
- Flipper-Glog (0.3.6) - Flipper-Glog (0.3.6)
- Flipper-PeerTalk (0.0.4) - Flipper-PeerTalk (0.0.4)
- Flipper-RSocket (1.4.3): - Flipper-RSocket (1.3.1):
- Flipper-Folly (~> 2.6) - Flipper-Folly (~> 2.5)
- FlipperKit (0.99.0): - FlipperKit (0.84.0):
- FlipperKit/Core (= 0.99.0) - FlipperKit/Core (= 0.84.0)
- FlipperKit/Core (0.99.0): - FlipperKit/Core (0.84.0):
- Flipper (~> 0.99.0) - Flipper (~> 0.84.0)
- FlipperKit/CppBridge - FlipperKit/CppBridge
- FlipperKit/FBCxxFollyDynamicConvert - FlipperKit/FBCxxFollyDynamicConvert
- FlipperKit/FBDefines - FlipperKit/FBDefines
- FlipperKit/FKPortForwarding - FlipperKit/FKPortForwarding
- FlipperKit/CppBridge (0.99.0): - FlipperKit/CppBridge (0.84.0):
- Flipper (~> 0.99.0) - Flipper (~> 0.84.0)
- FlipperKit/FBCxxFollyDynamicConvert (0.99.0): - FlipperKit/FBCxxFollyDynamicConvert (0.84.0):
- Flipper-Folly (~> 2.6) - Flipper-Folly (~> 2.5)
- FlipperKit/FBDefines (0.99.0) - FlipperKit/FBDefines (0.84.0)
- FlipperKit/FKPortForwarding (0.99.0): - FlipperKit/FKPortForwarding (0.84.0):
- CocoaAsyncSocket (~> 7.6) - CocoaAsyncSocket (~> 7.6)
- Flipper-PeerTalk (~> 0.0.4) - Flipper-PeerTalk (~> 0.0.4)
- FlipperKit/FlipperKitHighlightOverlay (0.99.0) - FlipperKit/FlipperKitHighlightOverlay (0.84.0)
- FlipperKit/FlipperKitLayoutHelpers (0.99.0): - FlipperKit/FlipperKitLayoutHelpers (0.84.0):
- FlipperKit/Core - FlipperKit/Core
- FlipperKit/FlipperKitHighlightOverlay - FlipperKit/FlipperKitHighlightOverlay
- FlipperKit/FlipperKitLayoutTextSearchable - FlipperKit/FlipperKitLayoutTextSearchable
- FlipperKit/FlipperKitLayoutIOSDescriptors (0.99.0): - FlipperKit/FlipperKitLayoutIOSDescriptors (0.84.0):
- FlipperKit/Core - FlipperKit/Core
- FlipperKit/FlipperKitHighlightOverlay - FlipperKit/FlipperKitHighlightOverlay
- FlipperKit/FlipperKitLayoutHelpers - FlipperKit/FlipperKitLayoutHelpers
- YogaKit (~> 1.18) - YogaKit (~> 1.18)
- FlipperKit/FlipperKitLayoutPlugin (0.99.0): - FlipperKit/FlipperKitLayoutPlugin (0.84.0):
- FlipperKit/Core - FlipperKit/Core
- FlipperKit/FlipperKitHighlightOverlay - FlipperKit/FlipperKitHighlightOverlay
- FlipperKit/FlipperKitLayoutHelpers - FlipperKit/FlipperKitLayoutHelpers
- FlipperKit/FlipperKitLayoutIOSDescriptors - FlipperKit/FlipperKitLayoutIOSDescriptors
- FlipperKit/FlipperKitLayoutTextSearchable - FlipperKit/FlipperKitLayoutTextSearchable
- YogaKit (~> 1.18) - YogaKit (~> 1.18)
- FlipperKit/FlipperKitLayoutTextSearchable (0.99.0) - FlipperKit/FlipperKitLayoutTextSearchable (0.84.0)
- FlipperKit/FlipperKitNetworkPlugin (0.99.0): - FlipperKit/FlipperKitNetworkPlugin (0.84.0):
- FlipperKit/Core - FlipperKit/Core
- FlipperKit/FlipperKitReactPlugin (0.99.0): - FlipperKit/FlipperKitReactPlugin (0.84.0):
- FlipperKit/Core - FlipperKit/Core
- FlipperKit/FlipperKitUserDefaultsPlugin (0.99.0): - FlipperKit/FlipperKitUserDefaultsPlugin (0.84.0):
- FlipperKit/Core - FlipperKit/Core
- FlipperKit/SKIOSNetworkPlugin (0.99.0): - FlipperKit/SKIOSNetworkPlugin (0.84.0):
- FlipperKit/Core - FlipperKit/Core
- FlipperKit/FlipperKitNetworkPlugin - FlipperKit/FlipperKitNetworkPlugin
- fmt (6.2.1)
- glog (0.3.5) - glog (0.3.5)
- libevent (2.1.12) - libevent (2.1.12)
- OpenSSL-Universal (1.1.180) - OpenSSL-Universal (1.1.180)
- RCT-Folly (2021.06.28.00-v2): - RCT-Folly (2020.01.13.00):
- boost - boost-for-react-native
- 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 - DoubleConversion
- glog - glog
- RCT-Folly (= 2021.06.28.00-v2) - RCT-Folly/Default (= 2020.01.13.00)
- React-callinvoker (= 0.66.0) - RCT-Folly/Default (2020.01.13.00):
- React-jsi (= 0.66.0) - boost-for-react-native
- 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 - DoubleConversion
- glog - glog
- RCT-Folly (= 2021.06.28.00-v2) - RCTRequired (0.64.0)
- React-jsi/Default (= 0.66.0) - RCTTypeSafety (0.64.0):
- React-jsi/Default (0.66.0): - FBLazyVector (= 0.64.0)
- boost (= 1.76.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)
- DoubleConversion - DoubleConversion
- glog - glog
- RCT-Folly (= 2021.06.28.00-v2) - RCT-Folly (= 2020.01.13.00)
- React-jsiexecutor (0.66.0): - 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)
- DoubleConversion - DoubleConversion
- glog - glog
- RCT-Folly (= 2021.06.28.00-v2) - RCT-Folly (= 2020.01.13.00)
- React-cxxreact (= 0.66.0) - React-jsi/Default (= 0.64.0)
- React-jsi (= 0.66.0) - React-jsi/Default (0.64.0):
- React-perflogger (= 0.66.0) - boost-for-react-native (= 1.63.0)
- React-jsinspector (0.66.0) - DoubleConversion
- React-logger (0.66.0):
- glog - glog
- react-native-update (6.3.0): - 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 - React
- react-native-update/HDiffPatch (= 6.3.0) - react-native-update/HDiffPatch (= 5.11.0-beta2)
- react-native-update/RCTPushy (= 6.3.0) - react-native-update/RCTPushy (= 5.11.0-beta2)
- SSZipArchive - SSZipArchive
- react-native-update/HDiffPatch (6.3.0): - react-native-update/HDiffPatch (5.11.0-beta2):
- React - React
- SSZipArchive - SSZipArchive
- react-native-update/RCTPushy (6.3.0): - react-native-update/RCTPushy (5.11.0-beta2):
- React - React
- SSZipArchive - SSZipArchive
- React-perflogger (0.66.0) - React-perflogger (0.64.0)
- React-RCTActionSheet (0.66.0): - React-RCTActionSheet (0.64.0):
- React-Core/RCTActionSheetHeaders (= 0.66.0) - React-Core/RCTActionSheetHeaders (= 0.64.0)
- React-RCTAnimation (0.66.0): - React-RCTAnimation (0.64.0):
- FBReactNativeSpec (= 0.66.0) - FBReactNativeSpec (= 0.64.0)
- RCT-Folly (= 2021.06.28.00-v2) - RCT-Folly (= 2020.01.13.00)
- RCTTypeSafety (= 0.66.0) - RCTTypeSafety (= 0.64.0)
- React-Core/RCTAnimationHeaders (= 0.66.0) - React-Core/RCTAnimationHeaders (= 0.64.0)
- React-jsi (= 0.66.0) - React-jsi (= 0.64.0)
- ReactCommon/turbomodule/core (= 0.66.0) - ReactCommon/turbomodule/core (= 0.64.0)
- React-RCTBlob (0.66.0): - React-RCTBlob (0.64.0):
- FBReactNativeSpec (= 0.66.0) - FBReactNativeSpec (= 0.64.0)
- RCT-Folly (= 2021.06.28.00-v2) - RCT-Folly (= 2020.01.13.00)
- React-Core/RCTBlobHeaders (= 0.66.0) - React-Core/RCTBlobHeaders (= 0.64.0)
- React-Core/RCTWebSocket (= 0.66.0) - React-Core/RCTWebSocket (= 0.64.0)
- React-jsi (= 0.66.0) - React-jsi (= 0.64.0)
- React-RCTNetwork (= 0.66.0) - React-RCTNetwork (= 0.64.0)
- ReactCommon/turbomodule/core (= 0.66.0) - ReactCommon/turbomodule/core (= 0.64.0)
- React-RCTImage (0.66.0): - React-RCTImage (0.64.0):
- FBReactNativeSpec (= 0.66.0) - FBReactNativeSpec (= 0.64.0)
- RCT-Folly (= 2021.06.28.00-v2) - RCT-Folly (= 2020.01.13.00)
- RCTTypeSafety (= 0.66.0) - RCTTypeSafety (= 0.64.0)
- React-Core/RCTImageHeaders (= 0.66.0) - React-Core/RCTImageHeaders (= 0.64.0)
- React-jsi (= 0.66.0) - React-jsi (= 0.64.0)
- React-RCTNetwork (= 0.66.0) - React-RCTNetwork (= 0.64.0)
- ReactCommon/turbomodule/core (= 0.66.0) - ReactCommon/turbomodule/core (= 0.64.0)
- React-RCTLinking (0.66.0): - React-RCTLinking (0.64.0):
- FBReactNativeSpec (= 0.66.0) - FBReactNativeSpec (= 0.64.0)
- React-Core/RCTLinkingHeaders (= 0.66.0) - React-Core/RCTLinkingHeaders (= 0.64.0)
- React-jsi (= 0.66.0) - React-jsi (= 0.64.0)
- ReactCommon/turbomodule/core (= 0.66.0) - ReactCommon/turbomodule/core (= 0.64.0)
- React-RCTNetwork (0.66.0): - React-RCTNetwork (0.64.0):
- FBReactNativeSpec (= 0.66.0) - FBReactNativeSpec (= 0.64.0)
- RCT-Folly (= 2021.06.28.00-v2) - RCT-Folly (= 2020.01.13.00)
- RCTTypeSafety (= 0.66.0) - RCTTypeSafety (= 0.64.0)
- React-Core/RCTNetworkHeaders (= 0.66.0) - React-Core/RCTNetworkHeaders (= 0.64.0)
- React-jsi (= 0.66.0) - React-jsi (= 0.64.0)
- ReactCommon/turbomodule/core (= 0.66.0) - ReactCommon/turbomodule/core (= 0.64.0)
- React-RCTSettings (0.66.0): - React-RCTSettings (0.64.0):
- FBReactNativeSpec (= 0.66.0) - FBReactNativeSpec (= 0.64.0)
- RCT-Folly (= 2021.06.28.00-v2) - RCT-Folly (= 2020.01.13.00)
- RCTTypeSafety (= 0.66.0) - RCTTypeSafety (= 0.64.0)
- React-Core/RCTSettingsHeaders (= 0.66.0) - React-Core/RCTSettingsHeaders (= 0.64.0)
- React-jsi (= 0.66.0) - React-jsi (= 0.64.0)
- ReactCommon/turbomodule/core (= 0.66.0) - ReactCommon/turbomodule/core (= 0.64.0)
- React-RCTText (0.66.0): - React-RCTText (0.64.0):
- React-Core/RCTTextHeaders (= 0.66.0) - React-Core/RCTTextHeaders (= 0.64.0)
- React-RCTVibration (0.66.0): - React-RCTVibration (0.64.0):
- FBReactNativeSpec (= 0.66.0) - FBReactNativeSpec (= 0.64.0)
- RCT-Folly (= 2021.06.28.00-v2) - RCT-Folly (= 2020.01.13.00)
- React-Core/RCTVibrationHeaders (= 0.66.0) - React-Core/RCTVibrationHeaders (= 0.64.0)
- React-jsi (= 0.66.0) - React-jsi (= 0.64.0)
- ReactCommon/turbomodule/core (= 0.66.0) - ReactCommon/turbomodule/core (= 0.64.0)
- React-runtimeexecutor (0.66.0): - React-runtimeexecutor (0.64.0):
- React-jsi (= 0.66.0) - React-jsi (= 0.64.0)
- ReactCommon/turbomodule/core (0.66.0): - ReactCommon/turbomodule/core (0.64.0):
- DoubleConversion - DoubleConversion
- glog - glog
- RCT-Folly (= 2021.06.28.00-v2) - RCT-Folly (= 2020.01.13.00)
- React-callinvoker (= 0.66.0) - React-callinvoker (= 0.64.0)
- React-Core (= 0.66.0) - React-Core (= 0.64.0)
- React-cxxreact (= 0.66.0) - React-cxxreact (= 0.64.0)
- React-jsi (= 0.66.0) - React-jsi (= 0.64.0)
- React-logger (= 0.66.0) - React-perflogger (= 0.64.0)
- React-perflogger (= 0.66.0) - SSZipArchive (2.2.3)
- SSZipArchive (2.4.2)
- Yoga (1.14.0) - Yoga (1.14.0)
- YogaKit (1.18.1): - YogaKit (1.18.1):
- Yoga (~> 1.14) - Yoga (~> 1.14)
DEPENDENCIES: DEPENDENCIES:
- boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
- FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
- Flipper (= 0.99.0) - Flipper (= 0.84.0)
- Flipper-Boost-iOSX (= 1.76.0.1.11)
- Flipper-DoubleConversion (= 1.1.7) - Flipper-DoubleConversion (= 1.1.7)
- Flipper-Fmt (= 7.1.7) - Flipper-Folly (~> 2.5)
- Flipper-Folly (= 2.6.7)
- Flipper-Glog (= 0.3.6) - Flipper-Glog (= 0.3.6)
- Flipper-PeerTalk (= 0.0.4) - Flipper-PeerTalk (~> 0.0.4)
- Flipper-RSocket (= 1.4.3) - Flipper-RSocket (~> 1.3)
- FlipperKit (= 0.99.0) - FlipperKit (= 0.84.0)
- FlipperKit/Core (= 0.99.0) - FlipperKit/Core (= 0.84.0)
- FlipperKit/CppBridge (= 0.99.0) - FlipperKit/CppBridge (= 0.84.0)
- FlipperKit/FBCxxFollyDynamicConvert (= 0.99.0) - FlipperKit/FBCxxFollyDynamicConvert (= 0.84.0)
- FlipperKit/FBDefines (= 0.99.0) - FlipperKit/FBDefines (= 0.84.0)
- FlipperKit/FKPortForwarding (= 0.99.0) - FlipperKit/FKPortForwarding (= 0.84.0)
- FlipperKit/FlipperKitHighlightOverlay (= 0.99.0) - FlipperKit/FlipperKitHighlightOverlay (= 0.84.0)
- FlipperKit/FlipperKitLayoutPlugin (= 0.99.0) - FlipperKit/FlipperKitLayoutPlugin (= 0.84.0)
- FlipperKit/FlipperKitLayoutTextSearchable (= 0.99.0) - FlipperKit/FlipperKitLayoutTextSearchable (= 0.84.0)
- FlipperKit/FlipperKitNetworkPlugin (= 0.99.0) - FlipperKit/FlipperKitNetworkPlugin (= 0.84.0)
- FlipperKit/FlipperKitReactPlugin (= 0.99.0) - FlipperKit/FlipperKitReactPlugin (= 0.84.0)
- FlipperKit/FlipperKitUserDefaultsPlugin (= 0.99.0) - FlipperKit/FlipperKitUserDefaultsPlugin (= 0.84.0)
- FlipperKit/SKIOSNetworkPlugin (= 0.99.0) - FlipperKit/SKIOSNetworkPlugin (= 0.84.0)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
@@ -393,7 +380,6 @@ DEPENDENCIES:
- React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- react-native-update (from `../../..`) - react-native-update (from `../../..`)
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
@@ -411,25 +397,21 @@ DEPENDENCIES:
SPEC REPOS: SPEC REPOS:
trunk: trunk:
- boost-for-react-native
- CocoaAsyncSocket - CocoaAsyncSocket
- Flipper - Flipper
- Flipper-Boost-iOSX
- Flipper-DoubleConversion - Flipper-DoubleConversion
- Flipper-Fmt
- Flipper-Folly - Flipper-Folly
- Flipper-Glog - Flipper-Glog
- Flipper-PeerTalk - Flipper-PeerTalk
- Flipper-RSocket - Flipper-RSocket
- FlipperKit - FlipperKit
- fmt
- libevent - libevent
- OpenSSL-Universal - OpenSSL-Universal
- SSZipArchive - SSZipArchive
- YogaKit - YogaKit
EXTERNAL SOURCES: EXTERNAL SOURCES:
boost:
:podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec"
DoubleConversion: DoubleConversion:
:podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
FBLazyVector: FBLazyVector:
@@ -460,8 +442,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/jsiexecutor" :path: "../node_modules/react-native/ReactCommon/jsiexecutor"
React-jsinspector: React-jsinspector:
:path: "../node_modules/react-native/ReactCommon/jsinspector" :path: "../node_modules/react-native/ReactCommon/jsinspector"
React-logger:
:path: "../node_modules/react-native/ReactCommon/logger"
react-native-update: react-native-update:
:path: "../../.." :path: "../../.."
React-perflogger: React-perflogger:
@@ -492,53 +472,49 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga" :path: "../node_modules/react-native/ReactCommon/yoga"
SPEC CHECKSUMS: SPEC CHECKSUMS:
boost: a7c83b31436843459a1961bfd74b96033dc77234 boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662 DoubleConversion: cde416483dac037923206447da6e1454df403714
FBLazyVector: 6816ca39e1cc8beffd2a96783f518296789d1c48 FBLazyVector: 49cbe4b43e445b06bf29199b6ad2057649e4c8f5
FBReactNativeSpec: 3b1e86618e902743fde35b40cf9ebd100fd655b7 FBReactNativeSpec: 82f183aa413052f325b10b585b747af4823e4b18
Flipper: 30e8eeeed6abdc98edaf32af0cda2f198be4b733 Flipper: 1e9b42d953eb33b2367f372ae25e64f6b86f4361
Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41
Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b Flipper-Folly: f7a3caafbd74bda4827954fd7a6e000e36355489
Flipper-Folly: 83af37379faa69497529e414bd43fbfc7cae259a
Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6 Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6
Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541 Flipper-RSocket: 127954abe8b162fcaf68d2134d34dc2bd7076154
FlipperKit: d8d346844eca5d9120c17d441a2f38596e8ed2b9 FlipperKit: 3970c0e7566160eda3defc580980c55f4ad585e8
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
glog: 5337263514dd6f09803962437687240c5dc39aa4
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
RCT-Folly: a21c126816d8025b547704b777a2ba552f3d9fa9 RCT-Folly: ec7a233ccc97cc556cf7237f0db1ff65b986f27c
RCTRequired: e4a18a90004e0ed97bba9081099104fd0f658dc9 RCTRequired: 2f8cb5b7533219bf4218a045f92768129cf7050a
RCTTypeSafety: 8a3c31d38de58e1a6a7df6e4e643644a60b00e22 RCTTypeSafety: 512728b73549e72ad7330b92f3d42936f2a4de5b
React: 2b1d0dc3c23e01b754588a74a5b265282d9eb61e React: 98eac01574128a790f0bbbafe2d1a8607291ac24
React-callinvoker: 57c195e780695285fa56e61efdbc0ca0e9204484 React-callinvoker: def3f7fae16192df68d9b69fd4bbb59092ee36bc
React-Core: 45e4b3c57b0b5fdbb24bc6a63a964870c0405955 React-Core: 70a52aa5dbe9b83befae82038451a7df9fd54c5a
React-CoreModules: d7bb1ae3436eddd85a7eb6d5e928f8c1655d87db React-CoreModules: 052edef46117862e2570eb3a0f06d81c61d2c4b8
React-cxxreact: 60c850e9997b21ee302757c36a460efc944183e7 React-cxxreact: c1dc71b30653cfb4770efdafcbdc0ad6d388baab
React-jsi: 38d68cb1b53843703100830d530342b32f8e0878 React-jsi: 74341196d9547cbcbcfa4b3bbbf03af56431d5a1
React-jsiexecutor: 6a05173dc0142abc582bd4edd2d23146b8cc218a React-jsiexecutor: 06a9c77b56902ae7ffcdd7a4905f664adc5d237b
React-jsinspector: be95ad424ba9f7b817aff22732eb9b1b810a000a React-jsinspector: 0ae35a37b20d5e031eb020a69cc5afdbd6406301
React-logger: 9a9cd87d4ea681ae929b32ef580638ff1b50fb24 react-native-update: a4ff51ac2ffc0e1950690b9a304a5efa5a9869b2
react-native-update: 0fc93e720f09bf7b465292dcd2fb8d8db3aef763 React-perflogger: 9c547d8f06b9bf00cb447f2b75e8d7f19b7e02af
React-perflogger: 1f554c2b684e2f484f9edcdfdaeedab039fbaca8 React-RCTActionSheet: 3080b6e12e0e1a5b313c8c0050699b5c794a1b11
React-RCTActionSheet: 610d5a5d71ab4808734782c8bca6a12ec3563672 React-RCTAnimation: 3f96f21a497ae7dabf4d2f150ee43f906aaf516f
React-RCTAnimation: ec6ed97370ace32724c253f29f0586cafcab8126 React-RCTBlob: 283b8e5025e7f954176bc48164f846909002f3ed
React-RCTBlob: b3270d498ff240f49c50e1bc950b6e5fd48886ba React-RCTImage: 5088a484faac78f2d877e1b79125d3bb1ea94a16
React-RCTImage: 23d5e26669b31230bea3fd99eb703af699e5d61a React-RCTLinking: 5e8fbb3e9a8bc2e4e3eb15b1eb8bda5fcac27b8c
React-RCTLinking: edaaee9dee82b79e90e7b903d8913fa72284fbba React-RCTNetwork: 38ec277217b1e841d5e6a1fa78da65b9212ccb28
React-RCTNetwork: e8825053dd1b5c2a0e1aa3cf1127750b624f90c0 React-RCTSettings: 242d6e692108c3de4f3bb74b7586a8799e9ab070
React-RCTSettings: 40d7ae987031c5dc561d11cd3a15cc1245a11d42 React-RCTText: 8746736ac8eb5a4a74719aa695b7a236a93a83d2
React-RCTText: 6e104479d4f0bb593b4cf90b6fc6e5390c12ccde React-RCTVibration: 0fd6b21751a33cb72fce1a4a33ab9678416d307a
React-RCTVibration: 53b92d54b923283638cb0186da7a5c2d2b70a49b React-runtimeexecutor: cad74a1eaa53ee6e7a3620231939d8fe2c6afcf0
React-runtimeexecutor: 4bb657a97aa74568d9ed634c8bd478299bb8a3a6 ReactCommon: cfe2b7fd20e0dbd2d1185cd7d8f99633fbc5ff05
ReactCommon: eb059748e842a1a86025ebbd4ac9d99e74492f88 SSZipArchive: 62d4947b08730e4cda640473b0066d209ff033c9
SSZipArchive: e7b4f3d9e780c2acc1764cd88fbf2de28f26e5b2 Yoga: 8c8436d4171c87504c648ae23b1d81242bdf3bbf
Yoga: c11abbf5809216c91fcd62f5571078b83d9b6720
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
PODFILE CHECKSUM: a26b18e70d6c4725e0254b56751afbc7620020ff PODFILE CHECKSUM: 519089f4194b2734ec99f1355a2d6fa8ed4aefbd
COCOAPODS: 1.11.2 COCOAPODS: 1.10.1

View File

@@ -17,6 +17,7 @@
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = "<group>"; }; 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; }; 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>"; }; 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>"; }; 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = testHotUpdate/AppDelegate.m; sourceTree = "<group>"; };
@@ -26,8 +27,17 @@
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = testHotUpdate/main.m; sourceTree = "<group>"; }; 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>"; }; 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; }; 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>"; }; 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; }; 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>"; }; 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>"; }; F1CBCFD624FE1CF80019170D /* dummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dummy.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
@@ -49,6 +59,12 @@
children = ( children = (
84EBA9C1A760F4136B306391 /* Pods-testHotUpdate.debug.xcconfig */, 84EBA9C1A760F4136B306391 /* Pods-testHotUpdate.debug.xcconfig */,
1A3E77317B15A5C3816ACE3A /* Pods-testHotUpdate.release.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; path = Pods;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -73,7 +89,11 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */, ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
28C264AEBE1E206870F9D871 /* libPods-testHotUpdate.a */, 28C264AEBE1E206870F9D871 /* libPods-testHotUpdate.a */,
8D1BC055E138B80CD38184D9 /* libPods-testHotUpdate-tvOS.a */,
A210EF57CA3ECCF4BA22ACD7 /* libPods-testHotUpdate-tvOSTests.a */,
95A532A9388B822764C95FE7 /* libPods-testHotUpdateTests.a */,
); );
name = Frameworks; name = Frameworks;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -242,7 +262,7 @@
); );
inputPaths = ( inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-testHotUpdate/Pods-testHotUpdate-frameworks.sh", "${PODS_ROOT}/Target Support Files/Pods-testHotUpdate/Pods-testHotUpdate-frameworks.sh",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework/OpenSSL", "${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL/OpenSSL.framework/OpenSSL",
); );
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputPaths = ( outputPaths = (
@@ -310,7 +330,6 @@
DEAD_CODE_STRIPPING = NO; DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = JD75Q9JJL2; DEVELOPMENT_TEAM = JD75Q9JJL2;
INFOPLIST_FILE = testHotUpdate/Info.plist; INFOPLIST_FILE = testHotUpdate/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
@@ -335,7 +354,6 @@
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = JD75Q9JJL2; DEVELOPMENT_TEAM = JD75Q9JJL2;
INFOPLIST_FILE = testHotUpdate/Info.plist; INFOPLIST_FILE = testHotUpdate/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",

View File

@@ -2,52 +2,37 @@
"images" : [ "images" : [
{ {
"idiom" : "iphone", "idiom" : "iphone",
"scale" : "2x", "size" : "29x29",
"size" : "20x20" "scale" : "2x"
}, },
{ {
"idiom" : "iphone", "idiom" : "iphone",
"scale" : "3x", "size" : "29x29",
"size" : "20x20" "scale" : "3x"
}, },
{ {
"idiom" : "iphone", "idiom" : "iphone",
"scale" : "2x", "size" : "40x40",
"size" : "29x29" "scale" : "2x"
}, },
{ {
"idiom" : "iphone", "idiom" : "iphone",
"scale" : "3x", "size" : "40x40",
"size" : "29x29" "scale" : "3x"
}, },
{ {
"idiom" : "iphone", "idiom" : "iphone",
"scale" : "2x", "size" : "60x60",
"size" : "40x40" "scale" : "2x"
}, },
{ {
"idiom" : "iphone", "idiom" : "iphone",
"scale" : "3x", "size" : "60x60",
"size" : "40x40" "scale" : "3x"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
} }
], ],
"info" : { "info" : {
"author" : "xcode", "version" : 1,
"version" : 1 "author" : "xcode"
} }
} }

View File

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

View File

@@ -22,7 +22,6 @@ export default function TestConsole({visible}) {
<Text>调试Pushy方法方法名参数值换行</Text> <Text>调试Pushy方法方法名参数值换行</Text>
<TextInput <TextInput
autoCorrect={false} autoCorrect={false}
autoCapitalize="none"
style={{ style={{
borderWidth: StyleSheet.hairlineWidth * 4, borderWidth: StyleSheet.hairlineWidth * 4,
borderColor: 'black', borderColor: 'black',

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

@@ -2,8 +2,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cn.reactnative.modules.update"> package="cn.reactnative.modules.update">
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application> <application>
<meta-data android:name="pushy_build_time" android:value="@string/pushy_build_time" /> <meta-data android:name="pushy_build_time" android:value="@string/pushy_build_time" />
<provider <provider

View File

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

View File

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

View File

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

View File

@@ -4,10 +4,7 @@ import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Environment;
import android.util.Log; import android.util.Log;
import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactInstanceManager;
import java.util.HashMap; import java.util.HashMap;
@@ -16,7 +13,11 @@ import java.util.concurrent.Executor;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.io.File; import java.io.File;
import java.net.URL;
/**
* Created by tdzl2003 on 3/31/16.
*/
public class UpdateContext { public class UpdateContext {
private Context context; private Context context;
private File rootDir; private File rootDir;
@@ -69,6 +70,10 @@ public class UpdateContext {
return context.getString(R.string.pushy_build_time); return context.getString(R.string.pushy_build_time);
} }
public String getUuid() {
return sp.getString("uuid", null);
}
public Map getBlockUpdate() { public Map getBlockUpdate() {
return new HashMap<String, Object>() {{ return new HashMap<String, Object>() {{
put("until", sp.getInt("blockUntil", 0)); put("until", sp.getInt("blockUntil", 0));
@@ -102,14 +107,7 @@ public class UpdateContext {
params.url = url; params.url = url;
params.hash = hash; params.hash = hash;
params.listener = listener; params.listener = listener;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N && fileName.equals("update.apk")) {
params.targetFile = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "pushy_update.apk");
} else {
params.targetFile = new File(rootDir, fileName); params.targetFile = new File(rootDir, fileName);
}
// params.unzipDirectory = new File(rootDir, hash); // params.unzipDirectory = new File(rootDir, hash);
new DownloadTask(context).executeOnExecutor(this.executor, params); new DownloadTask(context).executeOnExecutor(this.executor, params);
} }
@@ -147,25 +145,21 @@ public class UpdateContext {
String lastVersion = getCurrentVersion(); String lastVersion = getCurrentVersion();
SharedPreferences.Editor editor = sp.edit(); SharedPreferences.Editor editor = sp.edit();
editor.putString("currentVersion", hash); editor.putString("currentVersion", hash);
if (lastVersion != null && !lastVersion.equals(hash)) { if (lastVersion != null) {
editor.putString("lastVersion", lastVersion); editor.putString("lastVersion", lastVersion);
} }
editor.putBoolean("firstTime", true); editor.putBoolean("firstTime", true);
editor.putBoolean("firstTimeOk", false); editor.putBoolean("firstTimeOk", false);
editor.putString("rolledBackVersion", null); editor.putBoolean("rolledBack", false);
editor.apply(); editor.apply();
} }
public void setKv(String key, String value) { public void setUuid(String uuid) {
SharedPreferences.Editor editor = sp.edit(); SharedPreferences.Editor editor = sp.edit();
editor.putString(key, value); editor.putString("uuid", uuid);
editor.apply(); editor.apply();
} }
public String getKv(String key) {
return sp.getString(key, null);
}
public void setBlockUpdate(int until, String reason) { public void setBlockUpdate(int until, String reason) {
SharedPreferences.Editor editor = sp.edit(); SharedPreferences.Editor editor = sp.edit();
editor.putInt("blockUntil", until); editor.putInt("blockUntil", until);
@@ -181,19 +175,14 @@ public class UpdateContext {
return sp.getBoolean("firstTime", false); return sp.getBoolean("firstTime", false);
} }
public String rolledBackVersion() { public boolean isRolledBack() {
return sp.getString("rolledBackVersion", null); return sp.getBoolean("rolledBack", false);
} }
public void markSuccess() { public void markSuccess() {
SharedPreferences.Editor editor = sp.edit(); SharedPreferences.Editor editor = sp.edit();
editor.putBoolean("firstTimeOk", true); editor.putBoolean("firstTimeOk", true);
String lastVersion = sp.getString("lastVersion", null);
String curVersion = sp.getString("currentVersion", null);
if (lastVersion != null && !lastVersion.equals(curVersion)) {
editor.remove("lastVersion"); editor.remove("lastVersion");
editor.remove("hash_" + lastVersion);
}
editor.apply(); editor.apply();
this.cleanUp(); this.cleanUp();
@@ -209,7 +198,7 @@ public class UpdateContext {
public void clearRollbackMark() { public void clearRollbackMark() {
SharedPreferences.Editor editor = sp.edit(); SharedPreferences.Editor editor = sp.edit();
editor.putString("rolledBackVersion", null); editor.putBoolean("rolledBack", false);
editor.apply(); editor.apply();
this.cleanUp(); this.cleanUp();
@@ -265,7 +254,6 @@ public class UpdateContext {
private String rollBack() { private String rollBack() {
String lastVersion = sp.getString("lastVersion", null); String lastVersion = sp.getString("lastVersion", null);
String currentVersion = sp.getString("currentVersion", null);
SharedPreferences.Editor editor = sp.edit(); SharedPreferences.Editor editor = sp.edit();
if (lastVersion == null) { if (lastVersion == null) {
editor.remove("currentVersion"); editor.remove("currentVersion");
@@ -274,7 +262,7 @@ public class UpdateContext {
} }
editor.putBoolean("firstTimeOk", true); editor.putBoolean("firstTimeOk", true);
editor.putBoolean("firstTime", false); editor.putBoolean("firstTime", false);
editor.putString("rolledBackVersion", currentVersion); editor.putBoolean("rolledBack", true);
editor.apply(); editor.apply();
return lastVersion; return lastVersion;
} }

View File

@@ -22,11 +22,15 @@ import com.facebook.react.modules.core.DeviceEventManagerModule;
import java.io.File; import java.io.File;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import static androidx.core.content.FileProvider.getUriForFile; import static android.support.v4.content.FileProvider.getUriForFile;
/**
* Created by tdzl2003 on 3/31/16.
*/
public class UpdateModule extends ReactContextBaseJavaModule { public class UpdateModule extends ReactContextBaseJavaModule {
UpdateContext updateContext; UpdateContext updateContext;
public static ReactApplicationContext mContext; public static ReactApplicationContext mContext;
@@ -54,13 +58,13 @@ public class UpdateModule extends ReactContextBaseJavaModule {
if (isFirstTime) { if (isFirstTime) {
updateContext.clearFirstTime(); updateContext.clearFirstTime();
} }
String rolledBackVersion = updateContext.rolledBackVersion(); boolean isRolledBack = updateContext.isRolledBack();
constants.put("rolledBackVersion", rolledBackVersion); constants.put("isRolledBack", isRolledBack);
if (rolledBackVersion != null) { if (isRolledBack) {
updateContext.clearRollbackMark(); updateContext.clearRollbackMark();
} }
constants.put("blockUpdate", updateContext.getBlockUpdate()); constants.put("blockUpdate", updateContext.getBlockUpdate());
constants.put("uuid", updateContext.getKv("uuid")); constants.put("uuid", updateContext.getUuid());
return constants; return constants;
} }
@@ -121,20 +125,23 @@ public class UpdateModule extends ReactContextBaseJavaModule {
intent.setData(apkUri); intent.setData(apkUri);
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
} else { } else {
apkUri = Uri.fromFile(toInstall); apkUri = Uri.fromFile(toInstall);
intent = new Intent(Intent.ACTION_VIEW); intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(apkUri, "application/vnd.android.package-archive"); intent.setDataAndType(apkUri, "application/vnd.android.package-archive");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
mContext.startActivity(intent); mContext.startActivity(intent);
} }
}
@ReactMethod @ReactMethod
private void downloadPatchFromPackage(ReadableMap options, final Promise promise) { private void downloadPatchFromPackage(ReadableMap options, final Promise promise) {
String url = options.getString("updateUrl"); String url = options.getString("updateUrl");
String hash = options.getString("hash"); String hash = options.getString("hash");
if (hash == null) {
hash = options.getString("hashName");
}
updateContext.downloadPatchFromApk(url, hash, new UpdateContext.DownloadFileListener() { updateContext.downloadPatchFromApk(url, hash, new UpdateContext.DownloadFileListener() {
@Override @Override
public void onDownloadCompleted(DownloadTaskParams params) { public void onDownloadCompleted(DownloadTaskParams params) {
@@ -152,9 +159,13 @@ public class UpdateModule extends ReactContextBaseJavaModule {
private void downloadPatchFromPpk(ReadableMap options, final Promise promise) { private void downloadPatchFromPpk(ReadableMap options, final Promise promise) {
String url = options.getString("updateUrl"); String url = options.getString("updateUrl");
String hash = options.getString("hash"); String hash = options.getString("hash");
if (hash == null) {
hash = options.getString("hashName");
}
String originHash = options.getString("originHash"); String originHash = options.getString("originHash");
if (originHash == null) {
originHash = options.getString(("originHashName"));
}
updateContext.downloadPatchFromPpk(url, hash, originHash, new UpdateContext.DownloadFileListener() { updateContext.downloadPatchFromPpk(url, hash, originHash, new UpdateContext.DownloadFileListener() {
@Override @Override
public void onDownloadCompleted(DownloadTaskParams params) { public void onDownloadCompleted(DownloadTaskParams params) {
@@ -170,7 +181,8 @@ public class UpdateModule extends ReactContextBaseJavaModule {
@ReactMethod @ReactMethod
public void reloadUpdate(ReadableMap options) { public void reloadUpdate(ReadableMap options) {
final String hash = options.getString("hash"); final String hash = options.getString("hash") == null ?
options.getString("hashName") : options.getString("hash");
UiThreadUtil.runOnUiThread(new Runnable() { UiThreadUtil.runOnUiThread(new Runnable() {
@Override @Override
@@ -211,7 +223,8 @@ public class UpdateModule extends ReactContextBaseJavaModule {
@ReactMethod @ReactMethod
public void setNeedUpdate(ReadableMap options) { public void setNeedUpdate(ReadableMap options) {
final String hash = options.getString("hash"); final String hash = options.getString("hash") == null ?
options.getString("hashName") : options.getString("hash");
UiThreadUtil.runOnUiThread(new Runnable() { UiThreadUtil.runOnUiThread(new Runnable() {
@Override @Override
@@ -252,36 +265,11 @@ public class UpdateModule extends ReactContextBaseJavaModule {
UiThreadUtil.runOnUiThread(new Runnable() { UiThreadUtil.runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
updateContext.setKv("uuid", uuid); updateContext.setUuid(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) { public static void sendEvent(String eventName, WritableMap params) {
((ReactContext) mContext).getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit(eventName, ((ReactContext) mContext).getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit(eventName,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

11
lib/index.d.ts vendored
View File

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

View File

@@ -1,2 +1,218 @@
export * from './main'; import {
export * from './simpleUpdate'; tryBackupEndpoints,
getCheckUrl,
setCustomEndpoints,
} from './endpoint';
import { NativeEventEmitter, NativeModules, Platform } 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: (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');
await Pushy.downloadPatchFromPpk({
updateUrl: options.diffUrl,
hash: options.hash,
originHash: currentVersion,
});
} else if (options.pdiffUrl) {
logger('downloading pdiff');
await Pushy.downloadPatchFromPackage({
updateUrl: options.pdiffUrl,
hash: options.hash,
});
}
progressHandler && progressHandler.remove();
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');
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();
}

View File

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

View File

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

View File

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

View File

@@ -18,7 +18,7 @@ Pod::Spec.new do |s|
s.vendored_libraries = 'RCTPushy/libRCTPushy.a' s.vendored_libraries = 'RCTPushy/libRCTPushy.a'
s.pod_target_xcconfig = { 'USER_HEADER_SEARCH_PATHS' => '"$(SRCROOT)/../node_modules/react-native-update/ios"' } s.pod_target_xcconfig = { 'USER_HEADER_SEARCH_PATHS' => '"$(SRCROOT)/../node_modules/react-native-update/ios"' }
s.resource = 'ios/pushy_build_time.txt' s.resource = 'ios/pushy_build_time.txt'
s.script_phase = { :name => 'Generate build time', :script => 'set -x;date +%s > $(SRCROOT)/../node_modules/react-native-update/ios/pushy_build_time.txt', :execution_position => :before_compile } s.script_phase = { :name => 'Generate build time', :script => 'set -x;date +%s > ${PODS_ROOT}/../../node_modules/react-native-update/ios/pushy_build_time.txt', :execution_position => :before_compile }
s.dependency 'React' s.dependency 'React'
s.dependency 'SSZipArchive' s.dependency 'SSZipArchive'

View File

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