mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-17 19:56:10 +08:00
Compare commits
21 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
49e585a561 | ||
![]() |
0e89b270cc | ||
![]() |
7c8e75587b | ||
![]() |
84fee71df6 | ||
![]() |
db548d03dd | ||
![]() |
fc82addd75 | ||
![]() |
90e7c00cf6 | ||
![]() |
eea7ff26f2 | ||
![]() |
684dc8267d | ||
![]() |
5786bf8132 | ||
![]() |
1bd5fbbc94 | ||
![]() |
cd2eb9417a | ||
![]() |
7d8730f590 | ||
![]() |
e3081a02db | ||
![]() |
ec8c475c54 | ||
![]() |
ac18785e50 | ||
![]() |
e80317415c | ||
![]() |
f5c307deca | ||
![]() |
b4feae292d | ||
![]() |
a1c2679427 | ||
![]() |
17ff366f51 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -42,3 +42,4 @@ node_modules/
|
|||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
|
||||||
Example/**/update.json
|
Example/**/update.json
|
||||||
|
yarn-error.log
|
||||||
|
@@ -156,6 +156,7 @@ android {
|
|||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.debug
|
||||||
}
|
}
|
||||||
release {
|
release {
|
||||||
|
crunchPngs false
|
||||||
// Caution! In production, you need to generate your own keystore file.
|
// Caution! In production, you need to generate your own keystore file.
|
||||||
// see https://reactnative.dev/docs/signed-apk-android.
|
// see https://reactnative.dev/docs/signed-apk-android.
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.debug
|
||||||
|
@@ -3,14 +3,14 @@ PODS:
|
|||||||
- CocoaAsyncSocket (7.6.4)
|
- CocoaAsyncSocket (7.6.4)
|
||||||
- CocoaLibEvent (1.0.0)
|
- CocoaLibEvent (1.0.0)
|
||||||
- DoubleConversion (1.1.6)
|
- DoubleConversion (1.1.6)
|
||||||
- FBLazyVector (0.63.2)
|
- FBLazyVector (0.63.3)
|
||||||
- FBReactNativeSpec (0.63.2):
|
- FBReactNativeSpec (0.63.3):
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- RCTRequired (= 0.63.2)
|
- RCTRequired (= 0.63.3)
|
||||||
- RCTTypeSafety (= 0.63.2)
|
- RCTTypeSafety (= 0.63.3)
|
||||||
- React-Core (= 0.63.2)
|
- React-Core (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- ReactCommon/turbomodule/core (= 0.63.2)
|
- ReactCommon/turbomodule/core (= 0.63.3)
|
||||||
- Flipper (0.54.0):
|
- Flipper (0.54.0):
|
||||||
- Flipper-Folly (~> 2.2)
|
- Flipper-Folly (~> 2.2)
|
||||||
- Flipper-RSocket (~> 1.1)
|
- Flipper-RSocket (~> 1.1)
|
||||||
@@ -70,243 +70,245 @@ PODS:
|
|||||||
- OpenSSL-Universal (1.0.2.19):
|
- OpenSSL-Universal (1.0.2.19):
|
||||||
- OpenSSL-Universal/Static (= 1.0.2.19)
|
- OpenSSL-Universal/Static (= 1.0.2.19)
|
||||||
- OpenSSL-Universal/Static (1.0.2.19)
|
- OpenSSL-Universal/Static (1.0.2.19)
|
||||||
- RCTRequired (0.63.2)
|
- RCTRequired (0.63.3)
|
||||||
- RCTTypeSafety (0.63.2):
|
- RCTTypeSafety (0.63.3):
|
||||||
- FBLazyVector (= 0.63.2)
|
- FBLazyVector (= 0.63.3)
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- RCTRequired (= 0.63.2)
|
- RCTRequired (= 0.63.3)
|
||||||
- React-Core (= 0.63.2)
|
- React-Core (= 0.63.3)
|
||||||
- React (0.63.2):
|
- React (0.63.3):
|
||||||
- React-Core (= 0.63.2)
|
- React-Core (= 0.63.3)
|
||||||
- React-Core/DevSupport (= 0.63.2)
|
- React-Core/DevSupport (= 0.63.3)
|
||||||
- React-Core/RCTWebSocket (= 0.63.2)
|
- React-Core/RCTWebSocket (= 0.63.3)
|
||||||
- React-RCTActionSheet (= 0.63.2)
|
- React-RCTActionSheet (= 0.63.3)
|
||||||
- React-RCTAnimation (= 0.63.2)
|
- React-RCTAnimation (= 0.63.3)
|
||||||
- React-RCTBlob (= 0.63.2)
|
- React-RCTBlob (= 0.63.3)
|
||||||
- React-RCTImage (= 0.63.2)
|
- React-RCTImage (= 0.63.3)
|
||||||
- React-RCTLinking (= 0.63.2)
|
- React-RCTLinking (= 0.63.3)
|
||||||
- React-RCTNetwork (= 0.63.2)
|
- React-RCTNetwork (= 0.63.3)
|
||||||
- React-RCTSettings (= 0.63.2)
|
- React-RCTSettings (= 0.63.3)
|
||||||
- React-RCTText (= 0.63.2)
|
- React-RCTText (= 0.63.3)
|
||||||
- React-RCTVibration (= 0.63.2)
|
- React-RCTVibration (= 0.63.3)
|
||||||
- React-callinvoker (0.63.2)
|
- React-callinvoker (0.63.3)
|
||||||
- React-Core (0.63.2):
|
- React-Core (0.63.3):
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default (= 0.63.2)
|
- React-Core/Default (= 0.63.3)
|
||||||
- React-cxxreact (= 0.63.2)
|
- React-cxxreact (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- React-jsiexecutor (= 0.63.2)
|
- React-jsiexecutor (= 0.63.3)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/CoreModulesHeaders (0.63.2):
|
- React-Core/CoreModulesHeaders (0.63.3):
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.63.2)
|
- React-cxxreact (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- React-jsiexecutor (= 0.63.2)
|
- React-jsiexecutor (= 0.63.3)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/Default (0.63.2):
|
- React-Core/Default (0.63.3):
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- glog
|
- glog
|
||||||
- React-cxxreact (= 0.63.2)
|
- React-cxxreact (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- React-jsiexecutor (= 0.63.2)
|
- React-jsiexecutor (= 0.63.3)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/DevSupport (0.63.2):
|
- React-Core/DevSupport (0.63.3):
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default (= 0.63.2)
|
- React-Core/Default (= 0.63.3)
|
||||||
- React-Core/RCTWebSocket (= 0.63.2)
|
- React-Core/RCTWebSocket (= 0.63.3)
|
||||||
- React-cxxreact (= 0.63.2)
|
- React-cxxreact (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- React-jsiexecutor (= 0.63.2)
|
- React-jsiexecutor (= 0.63.3)
|
||||||
- React-jsinspector (= 0.63.2)
|
- React-jsinspector (= 0.63.3)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTActionSheetHeaders (0.63.2):
|
- React-Core/RCTActionSheetHeaders (0.63.3):
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.63.2)
|
- React-cxxreact (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- React-jsiexecutor (= 0.63.2)
|
- React-jsiexecutor (= 0.63.3)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTAnimationHeaders (0.63.2):
|
- React-Core/RCTAnimationHeaders (0.63.3):
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.63.2)
|
- React-cxxreact (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- React-jsiexecutor (= 0.63.2)
|
- React-jsiexecutor (= 0.63.3)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTBlobHeaders (0.63.2):
|
- React-Core/RCTBlobHeaders (0.63.3):
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.63.2)
|
- React-cxxreact (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- React-jsiexecutor (= 0.63.2)
|
- React-jsiexecutor (= 0.63.3)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTImageHeaders (0.63.2):
|
- React-Core/RCTImageHeaders (0.63.3):
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.63.2)
|
- React-cxxreact (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- React-jsiexecutor (= 0.63.2)
|
- React-jsiexecutor (= 0.63.3)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTLinkingHeaders (0.63.2):
|
- React-Core/RCTLinkingHeaders (0.63.3):
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.63.2)
|
- React-cxxreact (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- React-jsiexecutor (= 0.63.2)
|
- React-jsiexecutor (= 0.63.3)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTNetworkHeaders (0.63.2):
|
- React-Core/RCTNetworkHeaders (0.63.3):
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.63.2)
|
- React-cxxreact (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- React-jsiexecutor (= 0.63.2)
|
- React-jsiexecutor (= 0.63.3)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTSettingsHeaders (0.63.2):
|
- React-Core/RCTSettingsHeaders (0.63.3):
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.63.2)
|
- React-cxxreact (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- React-jsiexecutor (= 0.63.2)
|
- React-jsiexecutor (= 0.63.3)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTTextHeaders (0.63.2):
|
- React-Core/RCTTextHeaders (0.63.3):
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.63.2)
|
- React-cxxreact (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- React-jsiexecutor (= 0.63.2)
|
- React-jsiexecutor (= 0.63.3)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTVibrationHeaders (0.63.2):
|
- React-Core/RCTVibrationHeaders (0.63.3):
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.63.2)
|
- React-cxxreact (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- React-jsiexecutor (= 0.63.2)
|
- React-jsiexecutor (= 0.63.3)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTWebSocket (0.63.2):
|
- React-Core/RCTWebSocket (0.63.3):
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default (= 0.63.2)
|
- React-Core/Default (= 0.63.3)
|
||||||
- React-cxxreact (= 0.63.2)
|
- React-cxxreact (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- React-jsiexecutor (= 0.63.2)
|
- React-jsiexecutor (= 0.63.3)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-CoreModules (0.63.2):
|
- React-CoreModules (0.63.3):
|
||||||
- FBReactNativeSpec (= 0.63.2)
|
- FBReactNativeSpec (= 0.63.3)
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- RCTTypeSafety (= 0.63.2)
|
- RCTTypeSafety (= 0.63.3)
|
||||||
- React-Core/CoreModulesHeaders (= 0.63.2)
|
- React-Core/CoreModulesHeaders (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- React-RCTImage (= 0.63.2)
|
- React-RCTImage (= 0.63.3)
|
||||||
- ReactCommon/turbomodule/core (= 0.63.2)
|
- ReactCommon/turbomodule/core (= 0.63.3)
|
||||||
- React-cxxreact (0.63.2):
|
- React-cxxreact (0.63.3):
|
||||||
- boost-for-react-native (= 1.63.0)
|
- boost-for-react-native (= 1.63.0)
|
||||||
- DoubleConversion
|
- DoubleConversion
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- glog
|
- glog
|
||||||
- React-callinvoker (= 0.63.2)
|
- React-callinvoker (= 0.63.3)
|
||||||
- React-jsinspector (= 0.63.2)
|
- React-jsinspector (= 0.63.3)
|
||||||
- React-jsi (0.63.2):
|
- React-jsi (0.63.3):
|
||||||
- boost-for-react-native (= 1.63.0)
|
- boost-for-react-native (= 1.63.0)
|
||||||
- DoubleConversion
|
- DoubleConversion
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- glog
|
- glog
|
||||||
- React-jsi/Default (= 0.63.2)
|
- React-jsi/Default (= 0.63.3)
|
||||||
- React-jsi/Default (0.63.2):
|
- React-jsi/Default (0.63.3):
|
||||||
- boost-for-react-native (= 1.63.0)
|
- boost-for-react-native (= 1.63.0)
|
||||||
- DoubleConversion
|
- DoubleConversion
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- glog
|
- glog
|
||||||
- React-jsiexecutor (0.63.2):
|
- React-jsiexecutor (0.63.3):
|
||||||
- DoubleConversion
|
- DoubleConversion
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- glog
|
- glog
|
||||||
- React-cxxreact (= 0.63.2)
|
- React-cxxreact (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- React-jsinspector (0.63.2)
|
- React-jsinspector (0.63.3)
|
||||||
- react-native-update (5.7.2):
|
- react-native-update (5.9.1):
|
||||||
- React
|
- React
|
||||||
- react-native-update/BSDiff (= 5.7.2)
|
- react-native-update/BSDiff (= 5.9.1)
|
||||||
- react-native-update/RCTPushy (= 5.7.2)
|
- react-native-update/RCTPushy (= 5.9.1)
|
||||||
- SSZipArchive
|
- SSZipArchive
|
||||||
- react-native-update/BSDiff (5.7.2):
|
- react-native-update/BSDiff (5.9.1):
|
||||||
- React
|
- React
|
||||||
- SSZipArchive
|
- SSZipArchive
|
||||||
- react-native-update/RCTPushy (5.7.2):
|
- react-native-update/RCTPushy (5.9.1):
|
||||||
- React
|
- React
|
||||||
- SSZipArchive
|
- SSZipArchive
|
||||||
- React-RCTActionSheet (0.63.2):
|
- react-native-webview (10.9.2):
|
||||||
- React-Core/RCTActionSheetHeaders (= 0.63.2)
|
- React-Core
|
||||||
- React-RCTAnimation (0.63.2):
|
- React-RCTActionSheet (0.63.3):
|
||||||
- FBReactNativeSpec (= 0.63.2)
|
- React-Core/RCTActionSheetHeaders (= 0.63.3)
|
||||||
|
- React-RCTAnimation (0.63.3):
|
||||||
|
- FBReactNativeSpec (= 0.63.3)
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- RCTTypeSafety (= 0.63.2)
|
- RCTTypeSafety (= 0.63.3)
|
||||||
- React-Core/RCTAnimationHeaders (= 0.63.2)
|
- React-Core/RCTAnimationHeaders (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- ReactCommon/turbomodule/core (= 0.63.2)
|
- ReactCommon/turbomodule/core (= 0.63.3)
|
||||||
- React-RCTBlob (0.63.2):
|
- React-RCTBlob (0.63.3):
|
||||||
- FBReactNativeSpec (= 0.63.2)
|
- FBReactNativeSpec (= 0.63.3)
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- React-Core/RCTBlobHeaders (= 0.63.2)
|
- React-Core/RCTBlobHeaders (= 0.63.3)
|
||||||
- React-Core/RCTWebSocket (= 0.63.2)
|
- React-Core/RCTWebSocket (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- React-RCTNetwork (= 0.63.2)
|
- React-RCTNetwork (= 0.63.3)
|
||||||
- ReactCommon/turbomodule/core (= 0.63.2)
|
- ReactCommon/turbomodule/core (= 0.63.3)
|
||||||
- React-RCTImage (0.63.2):
|
- React-RCTImage (0.63.3):
|
||||||
- FBReactNativeSpec (= 0.63.2)
|
- FBReactNativeSpec (= 0.63.3)
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- RCTTypeSafety (= 0.63.2)
|
- RCTTypeSafety (= 0.63.3)
|
||||||
- React-Core/RCTImageHeaders (= 0.63.2)
|
- React-Core/RCTImageHeaders (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- React-RCTNetwork (= 0.63.2)
|
- React-RCTNetwork (= 0.63.3)
|
||||||
- ReactCommon/turbomodule/core (= 0.63.2)
|
- ReactCommon/turbomodule/core (= 0.63.3)
|
||||||
- React-RCTLinking (0.63.2):
|
- React-RCTLinking (0.63.3):
|
||||||
- FBReactNativeSpec (= 0.63.2)
|
- FBReactNativeSpec (= 0.63.3)
|
||||||
- React-Core/RCTLinkingHeaders (= 0.63.2)
|
- React-Core/RCTLinkingHeaders (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- ReactCommon/turbomodule/core (= 0.63.2)
|
- ReactCommon/turbomodule/core (= 0.63.3)
|
||||||
- React-RCTNetwork (0.63.2):
|
- React-RCTNetwork (0.63.3):
|
||||||
- FBReactNativeSpec (= 0.63.2)
|
- FBReactNativeSpec (= 0.63.3)
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- RCTTypeSafety (= 0.63.2)
|
- RCTTypeSafety (= 0.63.3)
|
||||||
- React-Core/RCTNetworkHeaders (= 0.63.2)
|
- React-Core/RCTNetworkHeaders (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- ReactCommon/turbomodule/core (= 0.63.2)
|
- ReactCommon/turbomodule/core (= 0.63.3)
|
||||||
- React-RCTSettings (0.63.2):
|
- React-RCTSettings (0.63.3):
|
||||||
- FBReactNativeSpec (= 0.63.2)
|
- FBReactNativeSpec (= 0.63.3)
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- RCTTypeSafety (= 0.63.2)
|
- RCTTypeSafety (= 0.63.3)
|
||||||
- React-Core/RCTSettingsHeaders (= 0.63.2)
|
- React-Core/RCTSettingsHeaders (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- ReactCommon/turbomodule/core (= 0.63.2)
|
- ReactCommon/turbomodule/core (= 0.63.3)
|
||||||
- React-RCTText (0.63.2):
|
- React-RCTText (0.63.3):
|
||||||
- React-Core/RCTTextHeaders (= 0.63.2)
|
- React-Core/RCTTextHeaders (= 0.63.3)
|
||||||
- React-RCTVibration (0.63.2):
|
- React-RCTVibration (0.63.3):
|
||||||
- FBReactNativeSpec (= 0.63.2)
|
- FBReactNativeSpec (= 0.63.3)
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- React-Core/RCTVibrationHeaders (= 0.63.2)
|
- React-Core/RCTVibrationHeaders (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- ReactCommon/turbomodule/core (= 0.63.2)
|
- ReactCommon/turbomodule/core (= 0.63.3)
|
||||||
- ReactCommon/turbomodule/core (0.63.2):
|
- ReactCommon/turbomodule/core (0.63.3):
|
||||||
- DoubleConversion
|
- DoubleConversion
|
||||||
- Folly (= 2020.01.13.00)
|
- Folly (= 2020.01.13.00)
|
||||||
- glog
|
- glog
|
||||||
- React-callinvoker (= 0.63.2)
|
- React-callinvoker (= 0.63.3)
|
||||||
- React-Core (= 0.63.2)
|
- React-Core (= 0.63.3)
|
||||||
- React-cxxreact (= 0.63.2)
|
- React-cxxreact (= 0.63.3)
|
||||||
- React-jsi (= 0.63.2)
|
- React-jsi (= 0.63.3)
|
||||||
- SSZipArchive (2.2.3)
|
- SSZipArchive (2.2.3)
|
||||||
- Yoga (1.14.0)
|
- Yoga (1.14.0)
|
||||||
- YogaKit (1.18.1):
|
- YogaKit (1.18.1):
|
||||||
@@ -350,6 +352,7 @@ DEPENDENCIES:
|
|||||||
- 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-native-update (from `../../..`)
|
- react-native-update (from `../../..`)
|
||||||
|
- react-native-webview (from `../node_modules/react-native-webview`)
|
||||||
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
|
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
|
||||||
- React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
|
- React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
|
||||||
- React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
|
- React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
|
||||||
@@ -411,6 +414,8 @@ EXTERNAL SOURCES:
|
|||||||
:path: "../node_modules/react-native/ReactCommon/jsinspector"
|
:path: "../node_modules/react-native/ReactCommon/jsinspector"
|
||||||
react-native-update:
|
react-native-update:
|
||||||
:path: "../../.."
|
:path: "../../.."
|
||||||
|
react-native-webview:
|
||||||
|
:path: "../node_modules/react-native-webview"
|
||||||
React-RCTActionSheet:
|
React-RCTActionSheet:
|
||||||
:path: "../node_modules/react-native/Libraries/ActionSheetIOS"
|
:path: "../node_modules/react-native/Libraries/ActionSheetIOS"
|
||||||
React-RCTAnimation:
|
React-RCTAnimation:
|
||||||
@@ -439,8 +444,8 @@ SPEC CHECKSUMS:
|
|||||||
CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845
|
CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845
|
||||||
CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f
|
CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f
|
||||||
DoubleConversion: cde416483dac037923206447da6e1454df403714
|
DoubleConversion: cde416483dac037923206447da6e1454df403714
|
||||||
FBLazyVector: 3ef4a7f62e7db01092f9d517d2ebc0d0677c4a37
|
FBLazyVector: 878b59e31113e289e275165efbe4b54fa614d43d
|
||||||
FBReactNativeSpec: dc7fa9088f0f2a998503a352b0554d69a4391c5a
|
FBReactNativeSpec: 7da9338acfb98d4ef9e5536805a0704572d33c2f
|
||||||
Flipper: be611d4b742d8c87fbae2ca5f44603a02539e365
|
Flipper: be611d4b742d8c87fbae2ca5f44603a02539e365
|
||||||
Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41
|
Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41
|
||||||
Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3
|
Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3
|
||||||
@@ -451,29 +456,30 @@ SPEC CHECKSUMS:
|
|||||||
Folly: b73c3869541e86821df3c387eb0af5f65addfab4
|
Folly: b73c3869541e86821df3c387eb0af5f65addfab4
|
||||||
glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
|
glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
|
||||||
OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355
|
OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355
|
||||||
RCTRequired: f13f25e7b12f925f1f6a6a8c69d929a03c0129fe
|
RCTRequired: 48884c74035a0b5b76dbb7a998bd93bcfc5f2047
|
||||||
RCTTypeSafety: 44982c5c8e43ff4141eb519a8ddc88059acd1f3a
|
RCTTypeSafety: edf4b618033c2f1c5b7bc3d90d8e085ed95ba2ab
|
||||||
React: e1c65dd41cb9db13b99f24608e47dd595f28ca9a
|
React: f36e90f3ceb976546e97df3403e37d226f79d0e3
|
||||||
React-callinvoker: 552a6a6bc8b3bb794cf108ad59e5a9e2e3b4fc98
|
React-callinvoker: 18874f621eb96625df7a24a7dc8d6e07391affcd
|
||||||
React-Core: 9d341e725dc9cd2f49e4c49ad1fc4e8776aa2639
|
React-Core: ac3d816b8e3493970153f4aaf0cff18af0bb95e6
|
||||||
React-CoreModules: 5335e168165da7f7083ce7147768d36d3e292318
|
React-CoreModules: 4016d3a4e518bcfc4f5a51252b5a05692ca6f0e1
|
||||||
React-cxxreact: d3261ec5f7d11743fbf21e263a34ea51d1f13ebc
|
React-cxxreact: ffc9129013b87cb36cf3f30a86695a3c397b0f99
|
||||||
React-jsi: 54245e1d5f4b690dec614a73a3795964eeef13a8
|
React-jsi: df07aa95b39c5be3e41199921509bfa929ed2b9d
|
||||||
React-jsiexecutor: 8ca588cc921e70590820ce72b8789b02c67cce38
|
React-jsiexecutor: b56c03e61c0dd5f5801255f2160a815f4a53d451
|
||||||
React-jsinspector: b14e62ebe7a66e9231e9581279909f2fc3db6606
|
React-jsinspector: 8e68ffbfe23880d3ee9bafa8be2777f60b25cbe2
|
||||||
react-native-update: 7602220eccf4ccac05bc90035a541300f2c0189a
|
react-native-update: 74ae0ad726a7cd5194b377361b7a3e921a65201c
|
||||||
React-RCTActionSheet: 910163b6b09685a35c4ebbc52b66d1bfbbe39fc5
|
react-native-webview: 4e96d493f9f90ba4f03b28933f30b2964df07e39
|
||||||
React-RCTAnimation: 9a883bbe1e9d2e158d4fb53765ed64c8dc2200c6
|
React-RCTActionSheet: 53ea72699698b0b47a6421cb1c8b4ab215a774aa
|
||||||
React-RCTBlob: 39cf0ece1927996c4466510e25d2105f67010e13
|
React-RCTAnimation: 1befece0b5183c22ae01b966f5583f42e69a83c2
|
||||||
React-RCTImage: de355d738727b09ad3692f2a979affbd54b5f378
|
React-RCTBlob: 0b284339cbe4b15705a05e2313a51c6d8b51fa40
|
||||||
React-RCTLinking: 8122f221d395a63364b2c0078ce284214bd04575
|
React-RCTImage: d1756599ebd4dc2cb19d1682fe67c6b976658387
|
||||||
React-RCTNetwork: 8f96c7b49ea6a0f28f98258f347b6ad218bc0830
|
React-RCTLinking: 9af0a51c6d6a4dd1674daadafffc6d03033a6d18
|
||||||
React-RCTSettings: 8a49622aff9c1925f5455fa340b6fe4853d64ab6
|
React-RCTNetwork: 332c83929cc5eae0b3bbca4add1d668e1fc18bda
|
||||||
React-RCTText: 1b6773e776e4b33f90468c20fe3b16ca3e224bb8
|
React-RCTSettings: d6953772cfd55f2c68ad72b7ef29efc7ec49f773
|
||||||
React-RCTVibration: 4d2e726957f4087449739b595f107c0d4b6c2d2d
|
React-RCTText: 65a6de06a7389098ce24340d1d3556015c38f746
|
||||||
ReactCommon: a0a1edbebcac5e91338371b72ffc66aa822792ce
|
React-RCTVibration: 8e9fb25724a0805107fc1acc9075e26f814df454
|
||||||
|
ReactCommon: 4167844018c9ed375cc01a843e9ee564399e53c3
|
||||||
SSZipArchive: 62d4947b08730e4cda640473b0066d209ff033c9
|
SSZipArchive: 62d4947b08730e4cda640473b0066d209ff033c9
|
||||||
Yoga: 7740b94929bbacbddda59bf115b5317e9a161598
|
Yoga: 7d13633d129fd179e01b8953d38d47be90db185a
|
||||||
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
|
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
|
||||||
|
|
||||||
PODFILE CHECKSUM: 449e295f5242b426c8459fd24a8812cc985916d0
|
PODFILE CHECKSUM: 449e295f5242b426c8459fd24a8812cc985916d0
|
||||||
|
@@ -7,12 +7,14 @@
|
|||||||
"ios": "react-native run-ios",
|
"ios": "react-native run-ios",
|
||||||
"start": "react-native start",
|
"start": "react-native start",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"lint": "eslint ."
|
"lint": "eslint .",
|
||||||
|
"apk": "(cd android && ./gradlew aR)"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react": "16.13.1",
|
"react": "16.13.1",
|
||||||
"react-native": "0.63.2",
|
"react-native": "0.63.3",
|
||||||
"react-native-update": "link:../.."
|
"react-native-update": "link:../..",
|
||||||
|
"react-native-webview": "^10.9.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.8.4",
|
"@babel/core": "^7.8.4",
|
||||||
|
@@ -8,7 +8,6 @@ import {
|
|||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
Linking,
|
Linking,
|
||||||
Image,
|
Image,
|
||||||
NativeModules,
|
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -21,6 +20,7 @@ import {
|
|||||||
switchVersion,
|
switchVersion,
|
||||||
switchVersionLater,
|
switchVersionLater,
|
||||||
markSuccess,
|
markSuccess,
|
||||||
|
downloadAndInstallApk,
|
||||||
} from 'react-native-update';
|
} from 'react-native-update';
|
||||||
|
|
||||||
import _updateConfig from '../update.json';
|
import _updateConfig from '../update.json';
|
||||||
@@ -94,11 +94,29 @@ export default class App extends Component {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (info.expired) {
|
if (info.expired) {
|
||||||
Alert.alert('提示', '您的应用版本已更新,请前往应用商店下载新的版本', [
|
Alert.alert('提示', '您的应用版本已更新,点击确定下载安装新版本', [
|
||||||
{
|
{
|
||||||
text: '确定',
|
text: '确定',
|
||||||
onPress: () => {
|
onPress: () => {
|
||||||
info.downloadUrl && Linking.openURL(info.downloadUrl);
|
if (info.downloadUrl) {
|
||||||
|
// apk可直接下载安装
|
||||||
|
if (
|
||||||
|
Platform.OS === 'android' &&
|
||||||
|
info.downloadUrl.endsWith('.apk')
|
||||||
|
) {
|
||||||
|
downloadAndInstallApk({
|
||||||
|
url: info.downloadUrl,
|
||||||
|
onDownloadProgress: ({received, total}) => {
|
||||||
|
this.setState({
|
||||||
|
received,
|
||||||
|
total,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Linking.openURL(info.downloadUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
@@ -144,6 +162,7 @@ export default class App extends Component {
|
|||||||
<TouchableOpacity onPress={this.checkUpdate}>
|
<TouchableOpacity onPress={this.checkUpdate}>
|
||||||
<Text style={styles.instructions}>点击这里检查更新</Text>
|
<Text style={styles.instructions}>点击这里检查更新</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
{/* <WebView style={{flex:1}} source={{uri: require('../www/index.html')}}/> */}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
22
Example/testHotUpdate/src/www/echarts.min.js
vendored
Executable file
22
Example/testHotUpdate/src/www/echarts.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
39
Example/testHotUpdate/src/www/index.html
Normal file
39
Example/testHotUpdate/src/www/index.html
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<!-- 引入 ECharts 文件 -->
|
||||||
|
<script src="echarts.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- 为 ECharts 准备一个具备大小(宽高)的 DOM -->
|
||||||
|
<div id="main" style="width: 600px;height:400px;"></div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
// 基于准备好的dom,初始化echarts实例
|
||||||
|
var myChart = echarts.init(document.getElementById('main'));
|
||||||
|
|
||||||
|
// 指定图表的配置项和数据
|
||||||
|
var option = {
|
||||||
|
title: {
|
||||||
|
text: 'ECharts 入门示例'
|
||||||
|
},
|
||||||
|
tooltip: {},
|
||||||
|
legend: {
|
||||||
|
data:['销量']
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
|
||||||
|
},
|
||||||
|
yAxis: {},
|
||||||
|
series: [{
|
||||||
|
name: '销量',
|
||||||
|
type: 'bar',
|
||||||
|
data: [5, 20, 36, 10, 10, 20]
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
|
||||||
|
// 使用刚指定的配置项和数据显示图表。
|
||||||
|
myChart.setOption(option);
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -1242,12 +1242,23 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
serve-static "^1.13.1"
|
serve-static "^1.13.1"
|
||||||
|
|
||||||
"@react-native-community/cli-platform-android@^4.7.0":
|
"@react-native-community/cli-hermes@^4.13.0":
|
||||||
version "4.11.0"
|
version "4.13.0"
|
||||||
resolved "https://registry.npm.taobao.org/@react-native-community/cli-platform-android/download/@react-native-community/cli-platform-android-4.11.0.tgz#0ce9b88ed8b6b0ef962af49d980eb53433c17a84"
|
resolved "https://registry.yarnpkg.com/@react-native-community/cli-hermes/-/cli-hermes-4.13.0.tgz#6243ed9c709dad5e523f1ccd7d21066b32f2899d"
|
||||||
integrity sha1-DOm4jti2sO+WKvSdmA61NDPBeoQ=
|
integrity sha512-oG+w0Uby6rSGsUkJGLvMQctZ5eVRLLfhf84lLyz942OEDxFRa9U19YJxOe9FmgCKtotbYiM3P/XhK+SVCuerPQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@react-native-community/cli-tools" "^4.11.0"
|
"@react-native-community/cli-platform-android" "^4.13.0"
|
||||||
|
"@react-native-community/cli-tools" "^4.13.0"
|
||||||
|
chalk "^3.0.0"
|
||||||
|
hermes-profile-transformer "^0.0.6"
|
||||||
|
ip "^1.1.5"
|
||||||
|
|
||||||
|
"@react-native-community/cli-platform-android@^4.10.0", "@react-native-community/cli-platform-android@^4.13.0":
|
||||||
|
version "4.13.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-android/-/cli-platform-android-4.13.0.tgz#922681ec82ee1aadd993598b814df1152118be02"
|
||||||
|
integrity sha512-3i8sX8GklEytUZwPnojuoFbCjIRzMugCdzDIdZ9UNmi/OhD4/8mLGO0dgXfT4sMWjZwu3qjy45sFfk2zOAgHbA==
|
||||||
|
dependencies:
|
||||||
|
"@react-native-community/cli-tools" "^4.13.0"
|
||||||
chalk "^3.0.0"
|
chalk "^3.0.0"
|
||||||
execa "^1.0.0"
|
execa "^1.0.0"
|
||||||
fs-extra "^8.1.0"
|
fs-extra "^8.1.0"
|
||||||
@@ -1258,12 +1269,12 @@
|
|||||||
slash "^3.0.0"
|
slash "^3.0.0"
|
||||||
xmldoc "^1.1.2"
|
xmldoc "^1.1.2"
|
||||||
|
|
||||||
"@react-native-community/cli-platform-ios@^4.7.0":
|
"@react-native-community/cli-platform-ios@^4.10.0":
|
||||||
version "4.11.0"
|
version "4.13.0"
|
||||||
resolved "https://registry.npm.taobao.org/@react-native-community/cli-platform-ios/download/@react-native-community/cli-platform-ios-4.11.0.tgz#5870bf5f2b3c01a0aa672a7c1f7f0fe13337c6b5"
|
resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-ios/-/cli-platform-ios-4.13.0.tgz#a738915c68cac86df54e578b59a1311ea62b1aef"
|
||||||
integrity sha1-WHC/Xys8AaCqZyp8H38P4TM3xrU=
|
integrity sha512-6THlTu8zp62efkzimfGr3VIuQJ2514o+vScZERJCV1xgEi8XtV7mb/ZKt9o6Y9WGxKKkc0E0b/aVAtgy+L27CA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@react-native-community/cli-tools" "^4.11.0"
|
"@react-native-community/cli-tools" "^4.13.0"
|
||||||
chalk "^3.0.0"
|
chalk "^3.0.0"
|
||||||
glob "^7.1.3"
|
glob "^7.1.3"
|
||||||
js-yaml "^3.13.1"
|
js-yaml "^3.13.1"
|
||||||
@@ -1271,13 +1282,13 @@
|
|||||||
plist "^3.0.1"
|
plist "^3.0.1"
|
||||||
xcode "^2.0.0"
|
xcode "^2.0.0"
|
||||||
|
|
||||||
"@react-native-community/cli-server-api@^4.11.0":
|
"@react-native-community/cli-server-api@^4.13.0":
|
||||||
version "4.11.0"
|
version "4.13.0"
|
||||||
resolved "https://registry.npm.taobao.org/@react-native-community/cli-server-api/download/@react-native-community/cli-server-api-4.11.0.tgz#93887ab8496c9d89b53817297974670184be1191"
|
resolved "https://registry.yarnpkg.com/@react-native-community/cli-server-api/-/cli-server-api-4.13.0.tgz#ef0e53fe0edc7356d62bca725ca47cb368f748a5"
|
||||||
integrity sha1-k4h6uElsnYm1OBcpeXRnAYS+EZE=
|
integrity sha512-ER138ChLc1YYX7j9yE6fDm4DdNdsHThr+pla/B6iZoKje1r7TwymDdKaUvOsYalG7sWG9glW3bofcCq+Yh0Dvw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@react-native-community/cli-debugger-ui" "^4.9.0"
|
"@react-native-community/cli-debugger-ui" "^4.9.0"
|
||||||
"@react-native-community/cli-tools" "^4.11.0"
|
"@react-native-community/cli-tools" "^4.13.0"
|
||||||
compression "^1.7.1"
|
compression "^1.7.1"
|
||||||
connect "^3.6.5"
|
connect "^3.6.5"
|
||||||
errorhandler "^1.5.0"
|
errorhandler "^1.5.0"
|
||||||
@@ -1285,10 +1296,10 @@
|
|||||||
serve-static "^1.13.1"
|
serve-static "^1.13.1"
|
||||||
ws "^1.1.0"
|
ws "^1.1.0"
|
||||||
|
|
||||||
"@react-native-community/cli-tools@^4.11.0":
|
"@react-native-community/cli-tools@^4.13.0":
|
||||||
version "4.11.0"
|
version "4.13.0"
|
||||||
resolved "https://registry.npm.taobao.org/@react-native-community/cli-tools/download/@react-native-community/cli-tools-4.11.0.tgz#a53a51da76468a37f89ef7db808acc1d3c5f9cea"
|
resolved "https://registry.yarnpkg.com/@react-native-community/cli-tools/-/cli-tools-4.13.0.tgz#b406463d33af16cedc4305a9a9257ed32845cf1b"
|
||||||
integrity sha1-pTpR2nZGijf4nvfbgIrMHTxfnOo=
|
integrity sha512-s4f489h5+EJksn4CfheLgv5PGOM0CDmK1UEBLw2t/ncWs3cW2VI7vXzndcd/WJHTv3GntJhXDcJMuL+Z2IAOgg==
|
||||||
dependencies:
|
dependencies:
|
||||||
chalk "^3.0.0"
|
chalk "^3.0.0"
|
||||||
lodash "^4.17.15"
|
lodash "^4.17.15"
|
||||||
@@ -1302,15 +1313,16 @@
|
|||||||
resolved "https://registry.npm.taobao.org/@react-native-community/cli-types/download/@react-native-community/cli-types-4.10.1.tgz#d68a2dcd1649d3b3774823c64e5e9ce55bfbe1c9"
|
resolved "https://registry.npm.taobao.org/@react-native-community/cli-types/download/@react-native-community/cli-types-4.10.1.tgz#d68a2dcd1649d3b3774823c64e5e9ce55bfbe1c9"
|
||||||
integrity sha1-1ootzRZJ07N3SCPGTl6c5Vv74ck=
|
integrity sha1-1ootzRZJ07N3SCPGTl6c5Vv74ck=
|
||||||
|
|
||||||
"@react-native-community/cli@^4.7.0":
|
"@react-native-community/cli@^4.10.0":
|
||||||
version "4.12.0"
|
version "4.13.0"
|
||||||
resolved "https://registry.npm.taobao.org/@react-native-community/cli/download/@react-native-community/cli-4.12.0.tgz#42ca3eacd4b4ba2bd5126aba6a032952e66835b5"
|
resolved "https://registry.yarnpkg.com/@react-native-community/cli/-/cli-4.13.0.tgz#04d5032f9b2b423c61ceef6be83b1bcc8a37db75"
|
||||||
integrity sha1-Qso+rNS0uivVEmq6agMpUuZoNbU=
|
integrity sha512-R+1VehIQ6VTLf+e7YOwzJk0F9tstfeSC4xy7oT6GSgB3FnXbTJGHFUp4siyO68Ae/gzGqt8SiUO145teWkP+ZA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@hapi/joi" "^15.0.3"
|
"@hapi/joi" "^15.0.3"
|
||||||
"@react-native-community/cli-debugger-ui" "^4.9.0"
|
"@react-native-community/cli-debugger-ui" "^4.9.0"
|
||||||
"@react-native-community/cli-server-api" "^4.11.0"
|
"@react-native-community/cli-hermes" "^4.13.0"
|
||||||
"@react-native-community/cli-tools" "^4.11.0"
|
"@react-native-community/cli-server-api" "^4.13.0"
|
||||||
|
"@react-native-community/cli-tools" "^4.13.0"
|
||||||
"@react-native-community/cli-types" "^4.10.1"
|
"@react-native-community/cli-types" "^4.10.1"
|
||||||
chalk "^3.0.0"
|
chalk "^3.0.0"
|
||||||
command-exists "^1.2.8"
|
command-exists "^1.2.8"
|
||||||
@@ -2746,6 +2758,11 @@ escape-html@~1.0.3:
|
|||||||
resolved "https://registry.npm.taobao.org/escape-html/download/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
|
resolved "https://registry.npm.taobao.org/escape-html/download/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
|
||||||
integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=
|
integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=
|
||||||
|
|
||||||
|
escape-string-regexp@2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-2.0.0.tgz?cache=0&sync_timestamp=1587627212242&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fescape-string-regexp%2Fdownload%2Fescape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344"
|
||||||
|
integrity sha1-owME6Z2qMuI7L9IPUbq9B8/8o0Q=
|
||||||
|
|
||||||
escape-string-regexp@^1.0.5:
|
escape-string-regexp@^1.0.5:
|
||||||
version "1.0.5"
|
version "1.0.5"
|
||||||
resolved "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
resolved "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||||
@@ -3518,6 +3535,13 @@ hermes-engine@~0.5.0:
|
|||||||
resolved "https://registry.npm.taobao.org/hermes-engine/download/hermes-engine-0.5.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhermes-engine%2Fdownload%2Fhermes-engine-0.5.1.tgz#601115e4b1e0a17d9aa91243b96277de4e926e09"
|
resolved "https://registry.npm.taobao.org/hermes-engine/download/hermes-engine-0.5.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhermes-engine%2Fdownload%2Fhermes-engine-0.5.1.tgz#601115e4b1e0a17d9aa91243b96277de4e926e09"
|
||||||
integrity sha1-YBEV5LHgoX2aqRJDuWJ33k6Sbgk=
|
integrity sha1-YBEV5LHgoX2aqRJDuWJ33k6Sbgk=
|
||||||
|
|
||||||
|
hermes-profile-transformer@^0.0.6:
|
||||||
|
version "0.0.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/hermes-profile-transformer/-/hermes-profile-transformer-0.0.6.tgz#bd0f5ecceda80dd0ddaae443469ab26fb38fc27b"
|
||||||
|
integrity sha512-cnN7bQUm65UWOy6cbGcCcZ3rpwW8Q/j4OP5aWRhEry4Z2t2aR1cjrbp0BS+KiBN0smvP1caBgAuxutvyvJILzQ==
|
||||||
|
dependencies:
|
||||||
|
source-map "^0.7.3"
|
||||||
|
|
||||||
hosted-git-info@^2.1.4:
|
hosted-git-info@^2.1.4:
|
||||||
version "2.8.5"
|
version "2.8.5"
|
||||||
resolved "https://registry.npm.taobao.org/hosted-git-info/download/hosted-git-info-2.8.5.tgz#759cfcf2c4d156ade59b0b2dfabddc42a6b9c70c"
|
resolved "https://registry.npm.taobao.org/hosted-git-info/download/hosted-git-info-2.8.5.tgz#759cfcf2c4d156ade59b0b2dfabddc42a6b9c70c"
|
||||||
@@ -3684,7 +3708,7 @@ internal-slot@^1.0.2:
|
|||||||
has "^1.0.3"
|
has "^1.0.3"
|
||||||
side-channel "^1.0.2"
|
side-channel "^1.0.2"
|
||||||
|
|
||||||
invariant@^2.2.4:
|
invariant@2.2.4, invariant@^2.2.4:
|
||||||
version "2.2.4"
|
version "2.2.4"
|
||||||
resolved "https://registry.npm.taobao.org/invariant/download/invariant-2.2.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Finvariant%2Fdownload%2Finvariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
|
resolved "https://registry.npm.taobao.org/invariant/download/invariant-2.2.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Finvariant%2Fdownload%2Finvariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
|
||||||
integrity sha1-YQ88ksk1nOHbYW5TgAjSP/NRWOY=
|
integrity sha1-YQ88ksk1nOHbYW5TgAjSP/NRWOY=
|
||||||
@@ -3696,6 +3720,11 @@ ip-regex@^2.1.0:
|
|||||||
resolved "https://registry.npm.taobao.org/ip-regex/download/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9"
|
resolved "https://registry.npm.taobao.org/ip-regex/download/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9"
|
||||||
integrity sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=
|
integrity sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=
|
||||||
|
|
||||||
|
ip@^1.1.5:
|
||||||
|
version "1.1.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a"
|
||||||
|
integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=
|
||||||
|
|
||||||
is-accessor-descriptor@^0.1.6:
|
is-accessor-descriptor@^0.1.6:
|
||||||
version "0.1.6"
|
version "0.1.6"
|
||||||
resolved "https://registry.npm.taobao.org/is-accessor-descriptor/download/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6"
|
resolved "https://registry.npm.taobao.org/is-accessor-descriptor/download/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6"
|
||||||
@@ -5936,15 +5965,23 @@ react-is@^16.8.1, react-is@^16.8.4:
|
|||||||
version "0.0.0"
|
version "0.0.0"
|
||||||
uid ""
|
uid ""
|
||||||
|
|
||||||
react-native@0.63.2:
|
react-native-webview@^10.9.2:
|
||||||
version "0.63.2"
|
version "10.9.2"
|
||||||
resolved "https://registry.npm.taobao.org/react-native/download/react-native-0.63.2.tgz#eaebf3430577b37fbd66ef228a86b3408259ef8e"
|
resolved "https://registry.npm.taobao.org/react-native-webview/download/react-native-webview-10.9.2.tgz#6dbfcfefb0684a6665e346c0eca8040cbdb5fb75"
|
||||||
integrity sha1-6uvzQwV3s3+9Zu8iioazQIJZ744=
|
integrity sha1-bb/P77BoSmZl40bA7KgEDL21+3U=
|
||||||
|
dependencies:
|
||||||
|
escape-string-regexp "2.0.0"
|
||||||
|
invariant "2.2.4"
|
||||||
|
|
||||||
|
react-native@0.63.3:
|
||||||
|
version "0.63.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.63.3.tgz#4a7f6540e049ff41810887bbd1125abc4672f3bf"
|
||||||
|
integrity sha512-71wq13uNo5W8QVQnFlnzZ3AD+XgUBYGhpsxysQFW/hJ8GAt/J5o+Bvhy81FXichp6IBDJDh/JgfHH2gNji8dFA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/runtime" "^7.0.0"
|
"@babel/runtime" "^7.0.0"
|
||||||
"@react-native-community/cli" "^4.7.0"
|
"@react-native-community/cli" "^4.10.0"
|
||||||
"@react-native-community/cli-platform-android" "^4.7.0"
|
"@react-native-community/cli-platform-android" "^4.10.0"
|
||||||
"@react-native-community/cli-platform-ios" "^4.7.0"
|
"@react-native-community/cli-platform-ios" "^4.10.0"
|
||||||
abort-controller "^3.0.0"
|
abort-controller "^3.0.0"
|
||||||
anser "^1.4.9"
|
anser "^1.4.9"
|
||||||
base64-js "^1.1.2"
|
base64-js "^1.1.2"
|
||||||
|
@@ -1,7 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<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" />
|
||||||
<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
|
||||||
|
android:name=".PushyFileProvider"
|
||||||
|
android:authorities="${applicationId}.pushy.fileprovider"
|
||||||
|
android:exported="false"
|
||||||
|
android:grantUriPermissions="true">
|
||||||
|
<meta-data
|
||||||
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||||
|
android:resource="@xml/pushy_file_paths" />
|
||||||
|
</provider>
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@@ -72,7 +72,7 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
|||||||
|
|
||||||
private void downloadFile(DownloadTaskParams param) throws IOException {
|
private void downloadFile(DownloadTaskParams param) throws IOException {
|
||||||
String url = param.url;
|
String url = param.url;
|
||||||
File writePath = param.zipFilePath;
|
File writePath = param.targetFile;
|
||||||
this.hash = param.hash;
|
this.hash = param.hash;
|
||||||
OkHttpClient client = new OkHttpClient();
|
OkHttpClient client = new OkHttpClient();
|
||||||
Request request = new Request.Builder().url(url)
|
Request request = new Request.Builder().url(url)
|
||||||
@@ -243,10 +243,10 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
|||||||
copyFilesWithBlacklist("", from, to, blackList);
|
copyFilesWithBlacklist("", from, to, blackList);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doDownload(DownloadTaskParams param) throws IOException {
|
private void doFullPatch(DownloadTaskParams param) throws IOException {
|
||||||
downloadFile(param);
|
downloadFile(param);
|
||||||
|
|
||||||
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(new FileInputStream(param.zipFilePath)));
|
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(new FileInputStream(param.targetFile)));
|
||||||
ZipEntry ze;
|
ZipEntry ze;
|
||||||
String filename;
|
String filename;
|
||||||
|
|
||||||
@@ -277,12 +277,12 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void copyFromResource(HashMap<String, ArrayList<File> > map) throws IOException {
|
private void copyFromResource(HashMap<String, ArrayList<File> > resToCopy) throws IOException {
|
||||||
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(new FileInputStream(context.getPackageResourcePath())));
|
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(new FileInputStream(context.getPackageResourcePath())));
|
||||||
ZipEntry ze;
|
ZipEntry ze;
|
||||||
while ((ze = zis.getNextEntry()) != null) {
|
while ((ze = zis.getNextEntry()) != null) {
|
||||||
String fn = ze.getName();
|
String fn = ze.getName();
|
||||||
ArrayList<File> targets = map.get(fn);
|
ArrayList<File> targets = resToCopy.get(fn);
|
||||||
if (targets != null) {
|
if (targets != null) {
|
||||||
File lastTarget = null;
|
File lastTarget = null;
|
||||||
for (File target: targets) {
|
for (File target: targets) {
|
||||||
@@ -303,10 +303,12 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
|||||||
private void doPatchFromApk(DownloadTaskParams param) throws IOException, JSONException {
|
private void doPatchFromApk(DownloadTaskParams param) throws IOException, JSONException {
|
||||||
downloadFile(param);
|
downloadFile(param);
|
||||||
|
|
||||||
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(new FileInputStream(param.zipFilePath)));
|
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(new FileInputStream(param.targetFile)));
|
||||||
ZipEntry ze;
|
ZipEntry ze;
|
||||||
int count;
|
int count;
|
||||||
String filename;
|
String filename;
|
||||||
|
boolean foundDiff = false;
|
||||||
|
boolean foundBundlePatch = false;
|
||||||
|
|
||||||
removeDirectory(param.unzipDirectory);
|
removeDirectory(param.unzipDirectory);
|
||||||
param.unzipDirectory.mkdirs();
|
param.unzipDirectory.mkdirs();
|
||||||
@@ -318,6 +320,7 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
|||||||
String fn = ze.getName();
|
String fn = ze.getName();
|
||||||
|
|
||||||
if (fn.equals("__diff.json")) {
|
if (fn.equals("__diff.json")) {
|
||||||
|
foundDiff = true;
|
||||||
// copy files from assets
|
// copy files from assets
|
||||||
byte[] bytes = readBytes(zis);
|
byte[] bytes = readBytes(zis);
|
||||||
String json = new String(bytes, "UTF-8");
|
String json = new String(bytes, "UTF-8");
|
||||||
@@ -344,6 +347,7 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (fn.equals("index.bundlejs.patch")) {
|
if (fn.equals("index.bundlejs.patch")) {
|
||||||
|
foundBundlePatch = true;
|
||||||
// do bsdiff patch
|
// do bsdiff patch
|
||||||
byte[] patched = bsdiffPatch(readOriginBundle(), readBytes(zis));
|
byte[] patched = bsdiffPatch(readOriginBundle(), readBytes(zis));
|
||||||
|
|
||||||
@@ -367,6 +371,12 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
zis.close();
|
zis.close();
|
||||||
|
if (!foundDiff) {
|
||||||
|
throw new Error("diff.json not found");
|
||||||
|
}
|
||||||
|
if (!foundBundlePatch) {
|
||||||
|
throw new Error("bundle patch not found");
|
||||||
|
}
|
||||||
|
|
||||||
copyFromResource(copyList);
|
copyFromResource(copyList);
|
||||||
|
|
||||||
@@ -379,10 +389,12 @@ 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);
|
||||||
|
|
||||||
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(new FileInputStream(param.zipFilePath)));
|
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(new FileInputStream(param.targetFile)));
|
||||||
ZipEntry ze;
|
ZipEntry ze;
|
||||||
int count;
|
int count;
|
||||||
String filename;
|
String filename;
|
||||||
|
boolean foundDiff = false;
|
||||||
|
boolean foundBundlePatch = false;
|
||||||
|
|
||||||
removeDirectory(param.unzipDirectory);
|
removeDirectory(param.unzipDirectory);
|
||||||
param.unzipDirectory.mkdirs();
|
param.unzipDirectory.mkdirs();
|
||||||
@@ -392,6 +404,7 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
|||||||
String fn = ze.getName();
|
String fn = ze.getName();
|
||||||
|
|
||||||
if (fn.equals("__diff.json")) {
|
if (fn.equals("__diff.json")) {
|
||||||
|
foundDiff = true;
|
||||||
// copy files from assets
|
// copy files from assets
|
||||||
byte[] bytes = readBytes(zis);
|
byte[] bytes = readBytes(zis);
|
||||||
String json = new String(bytes, "UTF-8");
|
String json = new String(bytes, "UTF-8");
|
||||||
@@ -412,6 +425,7 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (fn.equals("index.bundlejs.patch")) {
|
if (fn.equals("index.bundlejs.patch")) {
|
||||||
|
foundBundlePatch = true;
|
||||||
// do bsdiff patch
|
// do bsdiff patch
|
||||||
byte[] patched = bsdiffPatch(readFile(new File(param.originDirectory, "index.bundlejs")), readBytes(zis));
|
byte[] patched = bsdiffPatch(readFile(new File(param.originDirectory, "index.bundlejs")), readBytes(zis));
|
||||||
|
|
||||||
@@ -436,6 +450,12 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
|||||||
|
|
||||||
zis.close();
|
zis.close();
|
||||||
|
|
||||||
|
if (!foundDiff) {
|
||||||
|
throw new Error("diff.json not found");
|
||||||
|
}
|
||||||
|
if (!foundBundlePatch) {
|
||||||
|
throw new Error("bundle patch not found");
|
||||||
|
}
|
||||||
if (UpdateContext.DEBUG) {
|
if (UpdateContext.DEBUG) {
|
||||||
Log.d("RNUpdate", "Unzip finished");
|
Log.d("RNUpdate", "Unzip finished");
|
||||||
}
|
}
|
||||||
@@ -462,10 +482,11 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Void doInBackground(DownloadTaskParams... params) {
|
protected Void doInBackground(DownloadTaskParams... params) {
|
||||||
|
int taskType = params[0].type;
|
||||||
try {
|
try {
|
||||||
switch (params[0].type) {
|
switch (taskType) {
|
||||||
case DownloadTaskParams.TASK_TYPE_FULL_DOWNLOAD:
|
case DownloadTaskParams.TASK_TYPE_PATCH_FULL:
|
||||||
doDownload(params[0]);
|
doFullPatch(params[0]);
|
||||||
break;
|
break;
|
||||||
case DownloadTaskParams.TASK_TYPE_PATCH_FROM_APK:
|
case DownloadTaskParams.TASK_TYPE_PATCH_FROM_APK:
|
||||||
doPatchFromApk(params[0]);
|
doPatchFromApk(params[0]);
|
||||||
@@ -473,16 +494,45 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
|||||||
case DownloadTaskParams.TASK_TYPE_PATCH_FROM_PPK:
|
case DownloadTaskParams.TASK_TYPE_PATCH_FROM_PPK:
|
||||||
doPatchFromPpk(params[0]);
|
doPatchFromPpk(params[0]);
|
||||||
break;
|
break;
|
||||||
case DownloadTaskParams.TASK_TYPE_CLEARUP:
|
case DownloadTaskParams.TASK_TYPE_CLEANUP:
|
||||||
doCleanUp(params[0]);
|
doCleanUp(params[0]);
|
||||||
break;
|
break;
|
||||||
|
case DownloadTaskParams.TASK_TYPE_PLAIN_DOWNLOAD:
|
||||||
|
downloadFile(params[0]);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (params[0].listener != null) {
|
||||||
|
params[0].listener.onDownloadCompleted(params[0]);
|
||||||
}
|
}
|
||||||
params[0].listener.onDownloadCompleted();
|
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
if (UpdateContext.DEBUG) {
|
if (UpdateContext.DEBUG) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
params[0].listener.onDownloadFailed(e);
|
switch (taskType) {
|
||||||
|
case DownloadTaskParams.TASK_TYPE_PATCH_FULL:
|
||||||
|
case DownloadTaskParams.TASK_TYPE_PATCH_FROM_APK:
|
||||||
|
case DownloadTaskParams.TASK_TYPE_PATCH_FROM_PPK:
|
||||||
|
try {
|
||||||
|
removeDirectory(params[0].unzipDirectory);
|
||||||
|
} catch (IOException ioException) {
|
||||||
|
ioException.printStackTrace();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DownloadTaskParams.TASK_TYPE_PLAIN_DOWNLOAD:
|
||||||
|
// if (targetToClean.exists()) {
|
||||||
|
params[0].targetFile.delete();
|
||||||
|
// }
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Log.e("pushy", "download task failed", e);
|
||||||
|
|
||||||
|
if (params[0].listener != null) {
|
||||||
|
params[0].listener.onDownloadFailed(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@@ -8,17 +8,18 @@ import java.io.File;
|
|||||||
* Created by tdzl2003 on 3/31/16.
|
* Created by tdzl2003 on 3/31/16.
|
||||||
*/
|
*/
|
||||||
class DownloadTaskParams {
|
class DownloadTaskParams {
|
||||||
static final int TASK_TYPE_FULL_DOWNLOAD = 1;
|
static final int TASK_TYPE_PATCH_FULL = 1;
|
||||||
static final int TASK_TYPE_PATCH_FROM_APK = 2;
|
static final int TASK_TYPE_PATCH_FROM_APK = 2;
|
||||||
static final int TASK_TYPE_PATCH_FROM_PPK = 3;
|
static final int TASK_TYPE_PATCH_FROM_PPK = 3;
|
||||||
|
static final int TASK_TYPE_PLAIN_DOWNLOAD = 4;
|
||||||
|
|
||||||
static final int TASK_TYPE_CLEARUP = 0; //Keep hash & originHash
|
static final int TASK_TYPE_CLEANUP = 0; //Keep hash & originHash
|
||||||
|
|
||||||
int type;
|
int type;
|
||||||
String url;
|
String url;
|
||||||
String hash;
|
String hash;
|
||||||
String originHash;
|
String originHash;
|
||||||
File zipFilePath;
|
File targetFile;
|
||||||
File unzipDirectory;
|
File unzipDirectory;
|
||||||
File originDirectory;
|
File originDirectory;
|
||||||
UpdateContext.DownloadFileListener listener;
|
UpdateContext.DownloadFileListener listener;
|
||||||
|
@@ -0,0 +1,14 @@
|
|||||||
|
package cn.reactnative.modules.update;
|
||||||
|
|
||||||
|
import android.support.v4.content.FileProvider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Providing a custom {@code FileProvider} prevents manifest {@code <provider>} name collisions.
|
||||||
|
*
|
||||||
|
* See https://developer.android.com/guide/topics/manifest/provider-element.html for details.
|
||||||
|
*/
|
||||||
|
public class PushyFileProvider extends FileProvider {
|
||||||
|
|
||||||
|
// This class intentionally left blank.
|
||||||
|
|
||||||
|
}
|
@@ -46,7 +46,7 @@ public class UpdateContext {
|
|||||||
editor.putString("packageVersion", packageVersion);
|
editor.putString("packageVersion", packageVersion);
|
||||||
editor.apply();
|
editor.apply();
|
||||||
|
|
||||||
this.clearUp();
|
this.cleanUp();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,28 +86,39 @@ public class UpdateContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public interface DownloadFileListener {
|
public interface DownloadFileListener {
|
||||||
void onDownloadCompleted();
|
void onDownloadCompleted(DownloadTaskParams params);
|
||||||
void onDownloadFailed(Throwable error);
|
void onDownloadFailed(Throwable error);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void downloadFile(String url, String hash, DownloadFileListener listener) {
|
public void downloadFullUpdate(String url, String hash, DownloadFileListener listener) {
|
||||||
DownloadTaskParams params = new DownloadTaskParams();
|
DownloadTaskParams params = new DownloadTaskParams();
|
||||||
params.type = DownloadTaskParams.TASK_TYPE_FULL_DOWNLOAD;
|
params.type = DownloadTaskParams.TASK_TYPE_PATCH_FULL;
|
||||||
params.url = url;
|
params.url = url;
|
||||||
params.hash = hash;
|
params.hash = hash;
|
||||||
params.listener = listener;
|
params.listener = listener;
|
||||||
params.zipFilePath = new File(rootDir, hash + ".ppk");
|
params.targetFile = new File(rootDir, hash + ".ppk");
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void downloadFile(String url, String hash, String fileName, DownloadFileListener listener) {
|
||||||
|
DownloadTaskParams params = new DownloadTaskParams();
|
||||||
|
params.type = DownloadTaskParams.TASK_TYPE_PLAIN_DOWNLOAD;
|
||||||
|
params.url = url;
|
||||||
|
params.hash = hash;
|
||||||
|
params.listener = listener;
|
||||||
|
params.targetFile = new File(rootDir, fileName);
|
||||||
|
// params.unzipDirectory = new File(rootDir, hash);
|
||||||
|
new DownloadTask(context).executeOnExecutor(this.executor, params);
|
||||||
|
}
|
||||||
|
|
||||||
public void downloadPatchFromApk(String url, String hash, DownloadFileListener listener) {
|
public void downloadPatchFromApk(String url, String hash, DownloadFileListener listener) {
|
||||||
DownloadTaskParams params = new DownloadTaskParams();
|
DownloadTaskParams params = new DownloadTaskParams();
|
||||||
params.type = DownloadTaskParams.TASK_TYPE_PATCH_FROM_APK;
|
params.type = DownloadTaskParams.TASK_TYPE_PATCH_FROM_APK;
|
||||||
params.url = url;
|
params.url = url;
|
||||||
params.hash = hash;
|
params.hash = hash;
|
||||||
params.listener = listener;
|
params.listener = listener;
|
||||||
params.zipFilePath = new File(rootDir, hash + ".apk.patch");
|
params.targetFile = new File(rootDir, hash + ".apk.patch");
|
||||||
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);
|
||||||
}
|
}
|
||||||
@@ -119,7 +130,7 @@ public class UpdateContext {
|
|||||||
params.hash = hash;
|
params.hash = hash;
|
||||||
params.originHash = originHash;
|
params.originHash = originHash;
|
||||||
params.listener = listener;
|
params.listener = listener;
|
||||||
params.zipFilePath = new File(rootDir, originHash + "-" + hash + ".ppk.patch");
|
params.targetFile = new File(rootDir, originHash + "-" + hash + ".ppk.patch");
|
||||||
params.unzipDirectory = new File(rootDir, hash);
|
params.unzipDirectory = new File(rootDir, hash);
|
||||||
params.originDirectory = new File(rootDir, originHash);
|
params.originDirectory = new File(rootDir, originHash);
|
||||||
new DownloadTask(context).executeOnExecutor(this.executor, params);
|
new DownloadTask(context).executeOnExecutor(this.executor, params);
|
||||||
@@ -174,7 +185,7 @@ public class UpdateContext {
|
|||||||
editor.remove("lastVersion");
|
editor.remove("lastVersion");
|
||||||
editor.apply();
|
editor.apply();
|
||||||
|
|
||||||
this.clearUp();
|
this.cleanUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearFirstTime() {
|
public void clearFirstTime() {
|
||||||
@@ -182,7 +193,7 @@ public class UpdateContext {
|
|||||||
editor.putBoolean("firstTime", false);
|
editor.putBoolean("firstTime", false);
|
||||||
editor.apply();
|
editor.apply();
|
||||||
|
|
||||||
this.clearUp();
|
this.cleanUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearRollbackMark() {
|
public void clearRollbackMark() {
|
||||||
@@ -190,7 +201,7 @@ public class UpdateContext {
|
|||||||
editor.putBoolean("rolledBack", false);
|
editor.putBoolean("rolledBack", false);
|
||||||
editor.apply();
|
editor.apply();
|
||||||
|
|
||||||
this.clearUp();
|
this.cleanUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -256,21 +267,12 @@ public class UpdateContext {
|
|||||||
return lastVersion;
|
return lastVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearUp() {
|
private void cleanUp() {
|
||||||
DownloadTaskParams params = new DownloadTaskParams();
|
DownloadTaskParams params = new DownloadTaskParams();
|
||||||
params.type = DownloadTaskParams.TASK_TYPE_CLEARUP;
|
params.type = DownloadTaskParams.TASK_TYPE_CLEANUP;
|
||||||
params.hash = sp.getString("currentVersion", null);
|
params.hash = sp.getString("currentVersion", null);
|
||||||
params.originHash = sp.getString("lastVersion", null);
|
params.originHash = sp.getString("lastVersion", null);
|
||||||
params.unzipDirectory = rootDir;
|
params.unzipDirectory = rootDir;
|
||||||
params.listener = new DownloadFileListener() {
|
|
||||||
@Override
|
|
||||||
public void onDownloadCompleted() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDownloadFailed(Throwable error) {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
new DownloadTask(context).executeOnExecutor(this.executor, params);
|
new DownloadTask(context).executeOnExecutor(this.executor, params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,6 +3,8 @@ package cn.reactnative.modules.update;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.facebook.react.ReactApplication;
|
import com.facebook.react.ReactApplication;
|
||||||
@@ -18,21 +20,25 @@ import com.facebook.react.bridge.JSBundleLoader;
|
|||||||
import com.facebook.react.bridge.WritableMap;
|
import com.facebook.react.bridge.WritableMap;
|
||||||
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static android.support.v4.content.FileProvider.getUriForFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by tdzl2003 on 3/31/16.
|
* 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;
|
||||||
|
|
||||||
public UpdateModule(ReactApplicationContext reactContext, UpdateContext updateContext) {
|
public UpdateModule(ReactApplicationContext reactContext, UpdateContext updateContext) {
|
||||||
super(reactContext);
|
super(reactContext);
|
||||||
this.updateContext = updateContext;
|
this.updateContext = updateContext;
|
||||||
mContext=reactContext;
|
mContext = reactContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UpdateModule(ReactApplicationContext reactContext) {
|
public UpdateModule(ReactApplicationContext reactContext) {
|
||||||
@@ -68,12 +74,12 @@ public class UpdateModule extends ReactContextBaseJavaModule{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
public void downloadUpdate(ReadableMap options, final Promise promise){
|
public void downloadUpdate(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");
|
||||||
updateContext.downloadFile(url, hash, new UpdateContext.DownloadFileListener() {
|
updateContext.downloadFullUpdate(url, hash, new UpdateContext.DownloadFileListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onDownloadCompleted() {
|
public void onDownloadCompleted(DownloadTaskParams params) {
|
||||||
promise.resolve(null);
|
promise.resolve(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,12 +91,61 @@ public class UpdateModule extends ReactContextBaseJavaModule{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
public void downloadPatchFromPackage(ReadableMap options, final Promise promise){
|
public void downloadAndInstallApk(ReadableMap options, final Promise promise) {
|
||||||
|
String url = options.getString("url");
|
||||||
|
String hash = options.getString("hash");
|
||||||
|
String target = options.getString("target");
|
||||||
|
updateContext.downloadFile(url, hash, target, new UpdateContext.DownloadFileListener() {
|
||||||
|
@Override
|
||||||
|
public void onDownloadCompleted(DownloadTaskParams params) {
|
||||||
|
installApk(params.targetFile);
|
||||||
|
promise.resolve(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDownloadFailed(Throwable error) {
|
||||||
|
promise.reject(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// install downloaded apk
|
||||||
|
@ReactMethod
|
||||||
|
public static void installApk(String url) {
|
||||||
|
File toInstall = new File(url);
|
||||||
|
installApk(toInstall);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void installApk(File toInstall) {
|
||||||
|
Uri apkUri;
|
||||||
|
Intent intent;
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
|
apkUri = getUriForFile(mContext, mContext.getPackageName() + ".pushy.fileprovider", toInstall);
|
||||||
|
intent = new Intent(Intent.ACTION_INSTALL_PACKAGE);
|
||||||
|
intent.setData(apkUri);
|
||||||
|
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
mContext.startActivity(intent);
|
||||||
|
} else {
|
||||||
|
apkUri = Uri.fromFile(toInstall);
|
||||||
|
intent = new Intent(Intent.ACTION_VIEW);
|
||||||
|
intent.setDataAndType(apkUri, "application/vnd.android.package-archive");
|
||||||
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
mContext.startActivity(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ReactMethod
|
||||||
|
public 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() {
|
public void onDownloadCompleted(DownloadTaskParams params) {
|
||||||
promise.resolve(null);
|
promise.resolve(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,13 +157,19 @@ public class UpdateModule extends ReactContextBaseJavaModule{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
public void downloadPatchFromPpk(ReadableMap options, final Promise promise){
|
public 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() {
|
public void onDownloadCompleted(DownloadTaskParams params) {
|
||||||
promise.resolve(null);
|
promise.resolve(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +182,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
|
||||||
@@ -149,7 +211,7 @@ public class UpdateModule extends ReactContextBaseJavaModule{
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
instanceManager.recreateReactContextInBackground();
|
instanceManager.recreateReactContextInBackground();
|
||||||
} catch(Throwable err) {
|
} catch (Throwable err) {
|
||||||
activity.recreate();
|
activity.recreate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,7 +224,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
|
||||||
@@ -209,7 +272,7 @@ public class UpdateModule extends ReactContextBaseJavaModule{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 发送事件*/
|
/* 发送事件*/
|
||||||
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,
|
||||||
params);
|
params);
|
||||||
}
|
}
|
||||||
|
5
android/src/main/res/xml/pushy_file_paths.xml
Normal file
5
android/src/main/res/xml/pushy_file_paths.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<paths xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<files-path
|
||||||
|
name="pushy"
|
||||||
|
path="." />
|
||||||
|
</paths>
|
@@ -84,7 +84,6 @@ RCT_EXPORT_MODULE(RCTPushy);
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
NSString *curVersion = pushyInfo[paramCurrentVersion];
|
NSString *curVersion = pushyInfo[paramCurrentVersion];
|
||||||
NSString *lastVersion = pushyInfo[paramLastVersion];
|
|
||||||
|
|
||||||
BOOL isFirstTime = [pushyInfo[paramIsFirstTime] boolValue];
|
BOOL isFirstTime = [pushyInfo[paramIsFirstTime] boolValue];
|
||||||
BOOL isFirstLoadOK = [pushyInfo[paramIsFirstLoadOk] boolValue];
|
BOOL isFirstLoadOK = [pushyInfo[paramIsFirstLoadOk] boolValue];
|
||||||
@@ -92,23 +91,7 @@ RCT_EXPORT_MODULE(RCTPushy);
|
|||||||
NSString *loadVersion = curVersion;
|
NSString *loadVersion = curVersion;
|
||||||
BOOL needRollback = (!ignoreRollback && isFirstTime == NO && isFirstLoadOK == NO) || loadVersion.length<=0;
|
BOOL needRollback = (!ignoreRollback && isFirstTime == NO && isFirstLoadOK == NO) || loadVersion.length<=0;
|
||||||
if (needRollback) {
|
if (needRollback) {
|
||||||
loadVersion = lastVersion;
|
loadVersion = [self rollback];
|
||||||
|
|
||||||
if (lastVersion.length) {
|
|
||||||
// roll back to last version
|
|
||||||
[defaults setObject:@{paramCurrentVersion:lastVersion,
|
|
||||||
paramIsFirstTime:@(NO),
|
|
||||||
paramIsFirstLoadOk:@(YES),
|
|
||||||
paramPackageVersion:curPackageVersion}
|
|
||||||
forKey:keyPushyInfo];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// roll back to bundle
|
|
||||||
[defaults setObject:nil forKey:keyPushyInfo];
|
|
||||||
}
|
|
||||||
[defaults setObject:@(YES) forKey:keyRolledBackMarked];
|
|
||||||
[defaults synchronize];
|
|
||||||
// ...need clear files later
|
|
||||||
}
|
}
|
||||||
else if (isFirstTime && !ignoreRollback){
|
else if (isFirstTime && !ignoreRollback){
|
||||||
// bundleURL may be called many times, ignore rollbacks before process restarted again.
|
// bundleURL may be called many times, ignore rollbacks before process restarted again.
|
||||||
@@ -121,13 +104,15 @@ RCT_EXPORT_MODULE(RCTPushy);
|
|||||||
[defaults synchronize];
|
[defaults synchronize];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loadVersion.length) {
|
NSString *downloadDir = [RCTPushy downloadDir];
|
||||||
NSString *downloadDir = [RCTPushy downloadDir];
|
while (loadVersion.length) {
|
||||||
|
|
||||||
NSString *bundlePath = [[downloadDir stringByAppendingPathComponent:loadVersion] stringByAppendingPathComponent:BUNDLE_FILE_NAME];
|
NSString *bundlePath = [[downloadDir stringByAppendingPathComponent:loadVersion] stringByAppendingPathComponent:BUNDLE_FILE_NAME];
|
||||||
if ([[NSFileManager defaultManager] fileExistsAtPath:bundlePath isDirectory:NULL]) {
|
if ([[NSFileManager defaultManager] fileExistsAtPath:bundlePath isDirectory:NULL]) {
|
||||||
NSURL *bundleURL = [NSURL fileURLWithPath:bundlePath];
|
NSURL *bundleURL = [NSURL fileURLWithPath:bundlePath];
|
||||||
return bundleURL;
|
return bundleURL;
|
||||||
|
} else {
|
||||||
|
RCTLogError(@"RCTPushy -- bundle version %@ not found", loadVersion);
|
||||||
|
loadVersion = [self rollback];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -136,6 +121,29 @@ RCT_EXPORT_MODULE(RCTPushy);
|
|||||||
return [RCTPushy binaryBundleURL];
|
return [RCTPushy binaryBundleURL];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (NSString *) rollback {
|
||||||
|
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||||
|
|
||||||
|
NSDictionary *pushyInfo = [defaults dictionaryForKey:keyPushyInfo];
|
||||||
|
NSString *lastVersion = pushyInfo[paramLastVersion];
|
||||||
|
NSString *curPackageVersion = [RCTPushy packageVersion];
|
||||||
|
if (lastVersion.length) {
|
||||||
|
// roll back to last version
|
||||||
|
[defaults setObject:@{paramCurrentVersion:lastVersion,
|
||||||
|
paramIsFirstTime:@(NO),
|
||||||
|
paramIsFirstLoadOk:@(YES),
|
||||||
|
paramPackageVersion:curPackageVersion}
|
||||||
|
forKey:keyPushyInfo];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// roll back to bundle
|
||||||
|
[defaults setObject:nil forKey:keyPushyInfo];
|
||||||
|
}
|
||||||
|
[defaults setObject:@(YES) forKey:keyRolledBackMarked];
|
||||||
|
[defaults synchronize];
|
||||||
|
return lastVersion;
|
||||||
|
}
|
||||||
|
|
||||||
+ (BOOL)requiresMainQueueSetup {
|
+ (BOOL)requiresMainQueueSetup {
|
||||||
// only set to YES if your module initialization relies on calling UIKit!
|
// only set to YES if your module initialization relies on calling UIKit!
|
||||||
return NO;
|
return NO;
|
||||||
@@ -248,6 +256,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;
|
||||||
@@ -271,6 +282,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];
|
||||||
|
|
||||||
@@ -327,6 +341,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;
|
||||||
|
14
lib/index.d.ts
vendored
14
lib/index.d.ts
vendored
@@ -5,15 +5,19 @@ export const isFirstTime: boolean;
|
|||||||
export const isRolledBack: boolean;
|
export const isRolledBack: boolean;
|
||||||
|
|
||||||
export interface ExpiredResult {
|
export interface ExpiredResult {
|
||||||
|
upToDate?: false;
|
||||||
expired: true;
|
expired: true;
|
||||||
downloadUrl: string;
|
downloadUrl: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UpTodateResult {
|
export interface UpTodateResult {
|
||||||
|
expired?: false;
|
||||||
upToDate: true;
|
upToDate: true;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UpdateAvailableResult {
|
export interface UpdateAvailableResult {
|
||||||
|
expired?: false;
|
||||||
|
upToDate?: false;
|
||||||
update: true;
|
update: true;
|
||||||
name: string; // version name
|
name: string; // version name
|
||||||
hash: string;
|
hash: string;
|
||||||
@@ -43,6 +47,14 @@ export function switchVersionLater(hash: string): void;
|
|||||||
|
|
||||||
export function markSuccess(): void;
|
export function markSuccess(): void;
|
||||||
|
|
||||||
|
export function downloadAndInstallApk({
|
||||||
|
url,
|
||||||
|
onDownloadProgress,
|
||||||
|
}: {
|
||||||
|
url: string;
|
||||||
|
onDownloadProgress?: (data: ProgressData) => void;
|
||||||
|
}): Promise<void>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} main - The main api endpoint
|
* @param {string} main - The main api endpoint
|
||||||
* @param {string[]} [backups] - The back up endpoints.
|
* @param {string[]} [backups] - The back up endpoints.
|
||||||
@@ -55,7 +67,7 @@ export function setCustomEndpoints({
|
|||||||
backupQueryUrl,
|
backupQueryUrl,
|
||||||
}: {
|
}: {
|
||||||
main: string;
|
main: string;
|
||||||
backUps?: string[];
|
backups?: string[];
|
||||||
backupQueryUrl?: string;
|
backupQueryUrl?: string;
|
||||||
}): void;
|
}): void;
|
||||||
|
|
||||||
|
24
lib/index.js
24
lib/index.js
@@ -143,10 +143,11 @@ export async function downloadUpdate(options, eventListeners) {
|
|||||||
if (!options.update) {
|
if (!options.update) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
let progressHandler;
|
||||||
if (eventListeners) {
|
if (eventListeners) {
|
||||||
if (eventListeners.onDownloadProgress) {
|
if (eventListeners.onDownloadProgress) {
|
||||||
const downloadCallback = eventListeners.onDownloadProgress;
|
const downloadCallback = eventListeners.onDownloadProgress;
|
||||||
eventEmitter.addListener('RCTPushyDownloadProgress', (progressData) => {
|
progressHandler = eventEmitter.addListener('RCTPushyDownloadProgress', (progressData) => {
|
||||||
if (progressData.hash === options.hash) {
|
if (progressData.hash === options.hash) {
|
||||||
downloadCallback(progressData);
|
downloadCallback(progressData);
|
||||||
}
|
}
|
||||||
@@ -167,7 +168,7 @@ export async function downloadUpdate(options, eventListeners) {
|
|||||||
hash: options.hash,
|
hash: options.hash,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
eventEmitter.removeAllListeners('RCTPushyDownloadProgress');
|
progressHandler && progressHandler.remove();
|
||||||
return options.hash;
|
return options.hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,3 +189,22 @@ export function markSuccess() {
|
|||||||
logger('markSuccess');
|
logger('markSuccess');
|
||||||
Pushy.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();
|
||||||
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-native-update",
|
"name": "react-native-update",
|
||||||
"version": "5.8.3",
|
"version": "5.11.0-beta2",
|
||||||
"description": "react-native hot update",
|
"description": "react-native hot update",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Reference in New Issue
Block a user