mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-17 21:56:11 +08:00
Compare commits
59 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7796090e72 | ||
![]() |
f07be8cf0b | ||
![]() |
7c8f2d493f | ||
![]() |
437eb4f10f | ||
![]() |
5053a89cfa | ||
![]() |
4a84622c04 | ||
![]() |
cf812eacda | ||
![]() |
6a031f598f | ||
![]() |
7ecf879ac9 | ||
![]() |
c779befa86 | ||
![]() |
19f060abf5 | ||
![]() |
b9c655312e | ||
![]() |
2ad4635bc6 | ||
![]() |
0d3f95d2bd | ||
![]() |
36568356dc | ||
![]() |
1a3681f308 | ||
![]() |
81f6e57413 | ||
![]() |
46c7aa88dd | ||
![]() |
22a2902f71 | ||
![]() |
e9755392ec | ||
![]() |
c28eec436d | ||
![]() |
c46fb1be3a | ||
![]() |
1d0fb7d260 | ||
![]() |
bdd97ac6ac | ||
![]() |
ba3e92e3b8 | ||
![]() |
3939607f49 | ||
![]() |
8d06235ea3 | ||
![]() |
fa754ef8a2 | ||
![]() |
5a5884c8fa | ||
![]() |
8bd92f2c0e | ||
![]() |
3ac2e3ef05 | ||
![]() |
523cbdd7e1 | ||
![]() |
dece044a54 | ||
![]() |
a35c98ed4d | ||
![]() |
dcea576fff | ||
![]() |
201f11e770 | ||
![]() |
3a86218a48 | ||
![]() |
5a5e27037c | ||
![]() |
9b4016ba0a | ||
![]() |
5202cbec96 | ||
![]() |
d7c7e27eaa | ||
![]() |
e9e60bc5c6 | ||
![]() |
a93875884c | ||
![]() |
f20263b827 | ||
![]() |
8a74678b9c | ||
![]() |
17b7920100 | ||
![]() |
4d44eb858f | ||
![]() |
4d502a4e73 | ||
![]() |
7488a7fb9f | ||
![]() |
74ef45056e | ||
![]() |
6b254582b6 | ||
![]() |
737060e962 | ||
![]() |
b848259905 | ||
![]() |
6c087b473b | ||
![]() |
ddc12186b0 | ||
![]() |
b489199572 | ||
![]() |
1cb974ca61 | ||
![]() |
b44225f9bd | ||
![]() |
7586a5854d |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,8 +1,5 @@
|
|||||||
/.idea
|
/.idea
|
||||||
/node_modules
|
/node_modules
|
||||||
/local-cli/lib
|
|
||||||
/react-native-pushy-cli/node_modules
|
|
||||||
/react-native-pushy-cli/lib
|
|
||||||
/android/build
|
/android/build
|
||||||
/android/obj
|
/android/obj
|
||||||
*.iml
|
*.iml
|
||||||
|
@@ -4,8 +4,6 @@
|
|||||||
/.eslintrc
|
/.eslintrc
|
||||||
/.nvmrc
|
/.nvmrc
|
||||||
/.travis.yml
|
/.travis.yml
|
||||||
/local-cli/src
|
|
||||||
/react-native-pushy-cli
|
|
||||||
/Example
|
/Example
|
||||||
/android/build
|
/android/build
|
||||||
|
|
||||||
@@ -46,3 +44,5 @@ npm-debug.log
|
|||||||
Example
|
Example
|
||||||
yarn.lock
|
yarn.lock
|
||||||
android/jni
|
android/jni
|
||||||
|
|
||||||
|
domains.json
|
@@ -1,5 +1,4 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
printWidth: 120,
|
|
||||||
trailingComma: 'all',
|
trailingComma: 'all',
|
||||||
singleQuote: true,
|
singleQuote: true,
|
||||||
};
|
};
|
||||||
|
@@ -4,6 +4,7 @@
|
|||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
|
android:usesCleartextTraffic="true"
|
||||||
android:name=".MainApplication"
|
android:name=".MainApplication"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
PODS:
|
PODS:
|
||||||
- boost-for-react-native (1.63.0)
|
- boost-for-react-native (1.63.0)
|
||||||
- DoubleConversion (1.1.6)
|
- DoubleConversion (1.1.6)
|
||||||
- FBLazyVector (0.61.2)
|
- FBLazyVector (0.61.4)
|
||||||
- FBReactNativeSpec (0.61.2):
|
- FBReactNativeSpec (0.61.4):
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- RCTRequired (= 0.61.2)
|
- RCTRequired (= 0.61.4)
|
||||||
- RCTTypeSafety (= 0.61.2)
|
- RCTTypeSafety (= 0.61.4)
|
||||||
- React-Core (= 0.61.2)
|
- React-Core (= 0.61.4)
|
||||||
- React-jsi (= 0.61.2)
|
- React-jsi (= 0.61.4)
|
||||||
- ReactCommon/turbomodule/core (= 0.61.2)
|
- ReactCommon/turbomodule/core (= 0.61.4)
|
||||||
- Folly (2018.10.22.00):
|
- Folly (2018.10.22.00):
|
||||||
- boost-for-react-native
|
- boost-for-react-native
|
||||||
- DoubleConversion
|
- DoubleConversion
|
||||||
@@ -19,215 +19,215 @@ PODS:
|
|||||||
- DoubleConversion
|
- DoubleConversion
|
||||||
- glog
|
- glog
|
||||||
- glog (0.3.5)
|
- glog (0.3.5)
|
||||||
- RCTRequired (0.61.2)
|
- RCTRequired (0.61.4)
|
||||||
- RCTTypeSafety (0.61.2):
|
- RCTTypeSafety (0.61.4):
|
||||||
- FBLazyVector (= 0.61.2)
|
- FBLazyVector (= 0.61.4)
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- RCTRequired (= 0.61.2)
|
- RCTRequired (= 0.61.4)
|
||||||
- React-Core (= 0.61.2)
|
- React-Core (= 0.61.4)
|
||||||
- React (0.61.2):
|
- React (0.61.4):
|
||||||
- React-Core (= 0.61.2)
|
- React-Core (= 0.61.4)
|
||||||
- React-Core/DevSupport (= 0.61.2)
|
- React-Core/DevSupport (= 0.61.4)
|
||||||
- React-Core/RCTWebSocket (= 0.61.2)
|
- React-Core/RCTWebSocket (= 0.61.4)
|
||||||
- React-RCTActionSheet (= 0.61.2)
|
- React-RCTActionSheet (= 0.61.4)
|
||||||
- React-RCTAnimation (= 0.61.2)
|
- React-RCTAnimation (= 0.61.4)
|
||||||
- React-RCTBlob (= 0.61.2)
|
- React-RCTBlob (= 0.61.4)
|
||||||
- React-RCTImage (= 0.61.2)
|
- React-RCTImage (= 0.61.4)
|
||||||
- React-RCTLinking (= 0.61.2)
|
- React-RCTLinking (= 0.61.4)
|
||||||
- React-RCTNetwork (= 0.61.2)
|
- React-RCTNetwork (= 0.61.4)
|
||||||
- React-RCTSettings (= 0.61.2)
|
- React-RCTSettings (= 0.61.4)
|
||||||
- React-RCTText (= 0.61.2)
|
- React-RCTText (= 0.61.4)
|
||||||
- React-RCTVibration (= 0.61.2)
|
- React-RCTVibration (= 0.61.4)
|
||||||
- React-Core (0.61.2):
|
- React-Core (0.61.4):
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default (= 0.61.2)
|
- React-Core/Default (= 0.61.4)
|
||||||
- React-cxxreact (= 0.61.2)
|
- React-cxxreact (= 0.61.4)
|
||||||
- React-jsi (= 0.61.2)
|
- React-jsi (= 0.61.4)
|
||||||
- React-jsiexecutor (= 0.61.2)
|
- React-jsiexecutor (= 0.61.4)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/CoreModulesHeaders (0.61.2):
|
- React-Core/CoreModulesHeaders (0.61.4):
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.61.2)
|
- React-cxxreact (= 0.61.4)
|
||||||
- React-jsi (= 0.61.2)
|
- React-jsi (= 0.61.4)
|
||||||
- React-jsiexecutor (= 0.61.2)
|
- React-jsiexecutor (= 0.61.4)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/Default (0.61.2):
|
- React-Core/Default (0.61.4):
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-cxxreact (= 0.61.2)
|
- React-cxxreact (= 0.61.4)
|
||||||
- React-jsi (= 0.61.2)
|
- React-jsi (= 0.61.4)
|
||||||
- React-jsiexecutor (= 0.61.2)
|
- React-jsiexecutor (= 0.61.4)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/DevSupport (0.61.2):
|
- React-Core/DevSupport (0.61.4):
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default (= 0.61.2)
|
- React-Core/Default (= 0.61.4)
|
||||||
- React-Core/RCTWebSocket (= 0.61.2)
|
- React-Core/RCTWebSocket (= 0.61.4)
|
||||||
- React-cxxreact (= 0.61.2)
|
- React-cxxreact (= 0.61.4)
|
||||||
- React-jsi (= 0.61.2)
|
- React-jsi (= 0.61.4)
|
||||||
- React-jsiexecutor (= 0.61.2)
|
- React-jsiexecutor (= 0.61.4)
|
||||||
- React-jsinspector (= 0.61.2)
|
- React-jsinspector (= 0.61.4)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTActionSheetHeaders (0.61.2):
|
- React-Core/RCTActionSheetHeaders (0.61.4):
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.61.2)
|
- React-cxxreact (= 0.61.4)
|
||||||
- React-jsi (= 0.61.2)
|
- React-jsi (= 0.61.4)
|
||||||
- React-jsiexecutor (= 0.61.2)
|
- React-jsiexecutor (= 0.61.4)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTAnimationHeaders (0.61.2):
|
- React-Core/RCTAnimationHeaders (0.61.4):
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.61.2)
|
- React-cxxreact (= 0.61.4)
|
||||||
- React-jsi (= 0.61.2)
|
- React-jsi (= 0.61.4)
|
||||||
- React-jsiexecutor (= 0.61.2)
|
- React-jsiexecutor (= 0.61.4)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTBlobHeaders (0.61.2):
|
- React-Core/RCTBlobHeaders (0.61.4):
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.61.2)
|
- React-cxxreact (= 0.61.4)
|
||||||
- React-jsi (= 0.61.2)
|
- React-jsi (= 0.61.4)
|
||||||
- React-jsiexecutor (= 0.61.2)
|
- React-jsiexecutor (= 0.61.4)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTImageHeaders (0.61.2):
|
- React-Core/RCTImageHeaders (0.61.4):
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.61.2)
|
- React-cxxreact (= 0.61.4)
|
||||||
- React-jsi (= 0.61.2)
|
- React-jsi (= 0.61.4)
|
||||||
- React-jsiexecutor (= 0.61.2)
|
- React-jsiexecutor (= 0.61.4)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTLinkingHeaders (0.61.2):
|
- React-Core/RCTLinkingHeaders (0.61.4):
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.61.2)
|
- React-cxxreact (= 0.61.4)
|
||||||
- React-jsi (= 0.61.2)
|
- React-jsi (= 0.61.4)
|
||||||
- React-jsiexecutor (= 0.61.2)
|
- React-jsiexecutor (= 0.61.4)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTNetworkHeaders (0.61.2):
|
- React-Core/RCTNetworkHeaders (0.61.4):
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.61.2)
|
- React-cxxreact (= 0.61.4)
|
||||||
- React-jsi (= 0.61.2)
|
- React-jsi (= 0.61.4)
|
||||||
- React-jsiexecutor (= 0.61.2)
|
- React-jsiexecutor (= 0.61.4)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTSettingsHeaders (0.61.2):
|
- React-Core/RCTSettingsHeaders (0.61.4):
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.61.2)
|
- React-cxxreact (= 0.61.4)
|
||||||
- React-jsi (= 0.61.2)
|
- React-jsi (= 0.61.4)
|
||||||
- React-jsiexecutor (= 0.61.2)
|
- React-jsiexecutor (= 0.61.4)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTTextHeaders (0.61.2):
|
- React-Core/RCTTextHeaders (0.61.4):
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.61.2)
|
- React-cxxreact (= 0.61.4)
|
||||||
- React-jsi (= 0.61.2)
|
- React-jsi (= 0.61.4)
|
||||||
- React-jsiexecutor (= 0.61.2)
|
- React-jsiexecutor (= 0.61.4)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTVibrationHeaders (0.61.2):
|
- React-Core/RCTVibrationHeaders (0.61.4):
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default
|
- React-Core/Default
|
||||||
- React-cxxreact (= 0.61.2)
|
- React-cxxreact (= 0.61.4)
|
||||||
- React-jsi (= 0.61.2)
|
- React-jsi (= 0.61.4)
|
||||||
- React-jsiexecutor (= 0.61.2)
|
- React-jsiexecutor (= 0.61.4)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-Core/RCTWebSocket (0.61.2):
|
- React-Core/RCTWebSocket (0.61.4):
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core/Default (= 0.61.2)
|
- React-Core/Default (= 0.61.4)
|
||||||
- React-cxxreact (= 0.61.2)
|
- React-cxxreact (= 0.61.4)
|
||||||
- React-jsi (= 0.61.2)
|
- React-jsi (= 0.61.4)
|
||||||
- React-jsiexecutor (= 0.61.2)
|
- React-jsiexecutor (= 0.61.4)
|
||||||
- Yoga
|
- Yoga
|
||||||
- React-CoreModules (0.61.2):
|
- React-CoreModules (0.61.4):
|
||||||
- FBReactNativeSpec (= 0.61.2)
|
- FBReactNativeSpec (= 0.61.4)
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- RCTTypeSafety (= 0.61.2)
|
- RCTTypeSafety (= 0.61.4)
|
||||||
- React-Core/CoreModulesHeaders (= 0.61.2)
|
- React-Core/CoreModulesHeaders (= 0.61.4)
|
||||||
- React-RCTImage (= 0.61.2)
|
- React-RCTImage (= 0.61.4)
|
||||||
- ReactCommon/turbomodule/core (= 0.61.2)
|
- ReactCommon/turbomodule/core (= 0.61.4)
|
||||||
- React-cxxreact (0.61.2):
|
- React-cxxreact (0.61.4):
|
||||||
- boost-for-react-native (= 1.63.0)
|
- boost-for-react-native (= 1.63.0)
|
||||||
- DoubleConversion
|
- DoubleConversion
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-jsinspector (= 0.61.2)
|
- React-jsinspector (= 0.61.4)
|
||||||
- React-jsi (0.61.2):
|
- React-jsi (0.61.4):
|
||||||
- boost-for-react-native (= 1.63.0)
|
- boost-for-react-native (= 1.63.0)
|
||||||
- DoubleConversion
|
- DoubleConversion
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-jsi/Default (= 0.61.2)
|
- React-jsi/Default (= 0.61.4)
|
||||||
- React-jsi/Default (0.61.2):
|
- React-jsi/Default (0.61.4):
|
||||||
- boost-for-react-native (= 1.63.0)
|
- boost-for-react-native (= 1.63.0)
|
||||||
- DoubleConversion
|
- DoubleConversion
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-jsiexecutor (0.61.2):
|
- React-jsiexecutor (0.61.4):
|
||||||
- DoubleConversion
|
- DoubleConversion
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-cxxreact (= 0.61.2)
|
- React-cxxreact (= 0.61.4)
|
||||||
- React-jsi (= 0.61.2)
|
- React-jsi (= 0.61.4)
|
||||||
- React-jsinspector (0.61.2)
|
- React-jsinspector (0.61.4)
|
||||||
- react-native-update (5.3.0):
|
- react-native-update (5.5.0):
|
||||||
- React
|
- React
|
||||||
- react-native-update/BSDiff (= 5.3.0)
|
- react-native-update/BSDiff (= 5.5.0)
|
||||||
- react-native-update/RCTHotUpdate (= 5.3.0)
|
- react-native-update/RCTPushy (= 5.5.0)
|
||||||
- SSZipArchive
|
- SSZipArchive
|
||||||
- react-native-update/BSDiff (5.3.0):
|
- react-native-update/BSDiff (5.5.0):
|
||||||
- React
|
- React
|
||||||
- SSZipArchive
|
- SSZipArchive
|
||||||
- react-native-update/RCTHotUpdate (5.3.0):
|
- react-native-update/RCTPushy (5.5.0):
|
||||||
- React
|
- React
|
||||||
- SSZipArchive
|
- SSZipArchive
|
||||||
- React-RCTActionSheet (0.61.2):
|
- React-RCTActionSheet (0.61.4):
|
||||||
- React-Core/RCTActionSheetHeaders (= 0.61.2)
|
- React-Core/RCTActionSheetHeaders (= 0.61.4)
|
||||||
- React-RCTAnimation (0.61.2):
|
- React-RCTAnimation (0.61.4):
|
||||||
- React-Core/RCTAnimationHeaders (= 0.61.2)
|
- React-Core/RCTAnimationHeaders (= 0.61.4)
|
||||||
- React-RCTBlob (0.61.2):
|
- React-RCTBlob (0.61.4):
|
||||||
- React-Core/RCTBlobHeaders (= 0.61.2)
|
- React-Core/RCTBlobHeaders (= 0.61.4)
|
||||||
- React-Core/RCTWebSocket (= 0.61.2)
|
- React-Core/RCTWebSocket (= 0.61.4)
|
||||||
- React-jsi (= 0.61.2)
|
- React-jsi (= 0.61.4)
|
||||||
- React-RCTNetwork (= 0.61.2)
|
- React-RCTNetwork (= 0.61.4)
|
||||||
- React-RCTImage (0.61.2):
|
- React-RCTImage (0.61.4):
|
||||||
- React-Core/RCTImageHeaders (= 0.61.2)
|
- React-Core/RCTImageHeaders (= 0.61.4)
|
||||||
- React-RCTNetwork (= 0.61.2)
|
- React-RCTNetwork (= 0.61.4)
|
||||||
- React-RCTLinking (0.61.2):
|
- React-RCTLinking (0.61.4):
|
||||||
- React-Core/RCTLinkingHeaders (= 0.61.2)
|
- React-Core/RCTLinkingHeaders (= 0.61.4)
|
||||||
- React-RCTNetwork (0.61.2):
|
- React-RCTNetwork (0.61.4):
|
||||||
- React-Core/RCTNetworkHeaders (= 0.61.2)
|
- React-Core/RCTNetworkHeaders (= 0.61.4)
|
||||||
- React-RCTSettings (0.61.2):
|
- React-RCTSettings (0.61.4):
|
||||||
- React-Core/RCTSettingsHeaders (= 0.61.2)
|
- React-Core/RCTSettingsHeaders (= 0.61.4)
|
||||||
- React-RCTText (0.61.2):
|
- React-RCTText (0.61.4):
|
||||||
- React-Core/RCTTextHeaders (= 0.61.2)
|
- React-Core/RCTTextHeaders (= 0.61.4)
|
||||||
- React-RCTVibration (0.61.2):
|
- React-RCTVibration (0.61.4):
|
||||||
- React-Core/RCTVibrationHeaders (= 0.61.2)
|
- React-Core/RCTVibrationHeaders (= 0.61.4)
|
||||||
- ReactCommon/jscallinvoker (0.61.2):
|
- ReactCommon/jscallinvoker (0.61.4):
|
||||||
- DoubleConversion
|
- DoubleConversion
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-cxxreact (= 0.61.2)
|
- React-cxxreact (= 0.61.4)
|
||||||
- ReactCommon/turbomodule/core (0.61.2):
|
- ReactCommon/turbomodule/core (0.61.4):
|
||||||
- DoubleConversion
|
- DoubleConversion
|
||||||
- Folly (= 2018.10.22.00)
|
- Folly (= 2018.10.22.00)
|
||||||
- glog
|
- glog
|
||||||
- React-Core (= 0.61.2)
|
- React-Core (= 0.61.4)
|
||||||
- React-cxxreact (= 0.61.2)
|
- React-cxxreact (= 0.61.4)
|
||||||
- React-jsi (= 0.61.2)
|
- React-jsi (= 0.61.4)
|
||||||
- ReactCommon/jscallinvoker (= 0.61.2)
|
- ReactCommon/jscallinvoker (= 0.61.4)
|
||||||
- SSZipArchive (2.2.2)
|
- SSZipArchive (2.2.2)
|
||||||
- Yoga (1.14.0)
|
- Yoga (1.14.0)
|
||||||
|
|
||||||
@@ -324,33 +324,33 @@ EXTERNAL SOURCES:
|
|||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
|
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
|
||||||
DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
|
DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
|
||||||
FBLazyVector: 68b6a76960fbd8ecd9fb7ce0aadd3329c3340a99
|
FBLazyVector: feb35a6b7f7b50f367be07f34012f34a79282fa3
|
||||||
FBReactNativeSpec: 5a764c60abdc3336a213e5310c40b74741f32839
|
FBReactNativeSpec: 51477b84b1bf7ab6f9ef307c24e3dd675391be44
|
||||||
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
|
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
|
||||||
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
|
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
|
||||||
RCTRequired: c639d59ed389cfb1f1203f65c2ea946d8ec586e2
|
RCTRequired: f3b3fb6f4723e8e52facb229d0c75fdc76773849
|
||||||
RCTTypeSafety: dc23fb655d6c77667c78e327bf661bc11e3b8aec
|
RCTTypeSafety: 2ec60de6abb1db050b56ecc4b60188026078fd10
|
||||||
React: 7e586e5d7bec12b91c1a096826b0fc9ab1da7865
|
React: 10e0130b57e55a7cd8c3dee37c1261102ce295f4
|
||||||
React-Core: 8ddb9770b4a30a6ab4a754e6ed5ec76454e3d699
|
React-Core: 636212410772d05f3a1eb79d965df2962ca1c70b
|
||||||
React-CoreModules: b3d9eece8ad7df36c917a41f05c1168c52fe0b34
|
React-CoreModules: 6f70d5e41919289c582f88c9ad9923fe5c87400a
|
||||||
React-cxxreact: 1f972757c0bd08d962ef78068e06613c27489a3f
|
React-cxxreact: ddecbe9157ec1743f52ea17bf8d95debc0d6e846
|
||||||
React-jsi: 32285a21b1b24c36060493ed3057a34677d58d09
|
React-jsi: ca921f4041505f9d5197139b2d09eeb020bb12e8
|
||||||
React-jsiexecutor: 8909917ff7d8f21a57e443a866fd8d4560e50c65
|
React-jsiexecutor: 8dfb73b987afa9324e4009bdce62a18ce23d983c
|
||||||
React-jsinspector: 111d7d342b07a904c400592e02a2b958f1098b60
|
React-jsinspector: d15478d0a8ada19864aa4d1cc1c697b41b3fa92f
|
||||||
react-native-update: 5efc26c6af746154a6b7f7c4c073b9ff3f418322
|
react-native-update: 0696134a23c2ad1be899c12b33f9d3521284d458
|
||||||
React-RCTActionSheet: 89b037c0fb7d2671607cb645760164e7e0c013f6
|
React-RCTActionSheet: 7369b7c85f99b6299491333affd9f01f5a130c22
|
||||||
React-RCTAnimation: e3cefa93c38c004c318f7ec04b883eb14b8b8235
|
React-RCTAnimation: d07be15b2bd1d06d89417eb0343f98ffd2b099a7
|
||||||
React-RCTBlob: d26ac0e313fbf14e7203473fd593ccaaeee8329e
|
React-RCTBlob: 8e0b23d95c9baa98f6b0e127e07666aaafd96c34
|
||||||
React-RCTImage: 4bdd9588783fa9e48ef669ccd4f747224e208edf
|
React-RCTImage: 443050d14a66e8c2332e9c055f45689d23e15cc7
|
||||||
React-RCTLinking: 65f0088ff463babd3d5d567964a65b74141eff3b
|
React-RCTLinking: ce9a90ba155aec41be49e75ec721bbae2d48a47e
|
||||||
React-RCTNetwork: 0c1a73576c1cfeafe68396556de1b17d93c0c595
|
React-RCTNetwork: 41fe54bacc67dd00e6e4c4d30dd98a13e4beabc8
|
||||||
React-RCTSettings: 4194f1f0edbddf3fd44d1714dc6578bb20379b60
|
React-RCTSettings: 45e3e0a6470310b2dab2ccc6d1d73121ba3ea936
|
||||||
React-RCTText: e3ef6191cdb627855ff7fe8fa0c1e14094967fb8
|
React-RCTText: 21934e0a51d522abcd0a275407e80af45d6fd9ec
|
||||||
React-RCTVibration: fb54c732fd20405a76598e431aa2f8c2bf527de9
|
React-RCTVibration: 0f76400ee3cec6edb9c125da49fed279340d145a
|
||||||
ReactCommon: 5848032ed2f274fcb40f6b9ec24067787c42d479
|
ReactCommon: a6a294e7028ed67b926d29551aa9394fd989c24c
|
||||||
SSZipArchive: fa16b8cc4cdeceb698e5e5d9f67e9558532fbf23
|
SSZipArchive: fa16b8cc4cdeceb698e5e5d9f67e9558532fbf23
|
||||||
Yoga: 14927e37bd25376d216b150ab2a561773d57911f
|
Yoga: ba3d99dbee6c15ea6bbe3783d1f0cb1ffb79af0f
|
||||||
|
|
||||||
PODFILE CHECKSUM: 244ba888c650d3945bf72a8d01516fb0f1b3b097
|
PODFILE CHECKSUM: 244ba888c650d3945bf72a8d01516fb0f1b3b097
|
||||||
|
|
||||||
COCOAPODS: 1.8.1
|
COCOAPODS: 1.8.4
|
||||||
|
@@ -135,6 +135,7 @@
|
|||||||
13B07F8C1A680F5B00A75B9A /* Frameworks */,
|
13B07F8C1A680F5B00A75B9A /* Frameworks */,
|
||||||
13B07F8E1A680F5B00A75B9A /* Resources */,
|
13B07F8E1A680F5B00A75B9A /* Resources */,
|
||||||
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
|
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
|
||||||
|
1CD78CE8A2E7B88FAE48FCEE /* [CP] Copy Pods Resources */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@@ -200,6 +201,24 @@
|
|||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
|
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
|
||||||
};
|
};
|
||||||
|
1CD78CE8A2E7B88FAE48FCEE /* [CP] Copy Pods Resources */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
"${PODS_ROOT}/Target Support Files/Pods-testHotUpdate/Pods-testHotUpdate-resources.sh",
|
||||||
|
"${PODS_ROOT}/../../../../ios/pushy_build_time.txt",
|
||||||
|
);
|
||||||
|
name = "[CP] Copy Pods Resources";
|
||||||
|
outputPaths = (
|
||||||
|
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/pushy_build_time.txt",
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-testHotUpdate/Pods-testHotUpdate-resources.sh\"\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
C49C562FA1BDE1F80ECD9C13 /* [CP] Check Pods Manifest.lock */ = {
|
C49C562FA1BDE1F80ECD9C13 /* [CP] Check Pods Manifest.lock */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
#import <React/RCTBridge.h>
|
#import <React/RCTBridge.h>
|
||||||
#import <React/RCTBundleURLProvider.h>
|
#import <React/RCTBundleURLProvider.h>
|
||||||
#import <React/RCTRootView.h>
|
#import <React/RCTRootView.h>
|
||||||
#import "RCTHotUpdate.h"
|
#import "RCTPushy.h"
|
||||||
|
|
||||||
@implementation AppDelegate
|
@implementation AppDelegate
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
|
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
|
||||||
#else
|
#else
|
||||||
// 非DEBUG情况下替换为热更新bundle
|
// 非DEBUG情况下替换为热更新bundle
|
||||||
return [RCTHotUpdate bundleURL];
|
return [RCTPushy bundleURL];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react": "16.9.0",
|
"react": "16.9.0",
|
||||||
"react-native": "0.61.2",
|
"react-native": "0.61.4",
|
||||||
"react-native-update": "link:../.."
|
"react-native-update": "link:../.."
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
File diff suppressed because it is too large
Load Diff
52
README.md
52
README.md
@@ -1,31 +1,10 @@
|
|||||||
# react-native-update [](http://badge.fury.io/js/react-native-update)
|
# react-native-update [](http://badge.fury.io/js/react-native-update)
|
||||||
|
|
||||||
本组件是面向 React Native 提供热更新功能的组件,建议结合[Update 服务](https://update.reactnative.cn/)使用。
|
本组件是面向 React Native 提供热更新功能的组件,请结合[Update 服务](https://update.reactnative.cn/)使用。
|
||||||
|
|
||||||
注意,在iOS上使用热更新有被拒的可能。可以按以下步骤屏蔽iOS端:
|
### 快速开始
|
||||||
|
|
||||||
1. 如果RN版本>=0.60,在项目根目录下编辑或创建react-native.config.js,添加如下内容
|
请查看[文档](https://reactnativecn.github.io/react-native-pushy)
|
||||||
```js
|
|
||||||
// react-native.config.js
|
|
||||||
module.exports = {
|
|
||||||
dependencies: {
|
|
||||||
'react-native-update': {
|
|
||||||
platforms: {
|
|
||||||
ios: null, // 阻止ios模块自动链接
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
```
|
|
||||||
2. 如果在原生代码端尚未配置,则跳过下面文档中的ios端的配置。如果已经配置,则按文档的步骤反向操作(添加的ios代码删去)。
|
|
||||||
3. 如果是0.60以上版本或使用了cocoapods,在ios目录中再次运行pod install,确保Podfile和Podfile.lock中都没有'react-native-update'。如果RN版本<0.60,则运行`react-native unlink react-native-update`。
|
|
||||||
4. 在js代码里调用checkUpdate()方法前,判断Platform.OS,如果是ios平台则直接return跳过。
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### 最近更新
|
|
||||||
|
|
||||||
请查阅[最近更新文档](CHANGELOG.md)。
|
|
||||||
|
|
||||||
### 优势
|
### 优势
|
||||||
|
|
||||||
@@ -35,26 +14,6 @@ module.exports = {
|
|||||||
4. meta 信息及开放 API,提供更高扩展性。
|
4. meta 信息及开放 API,提供更高扩展性。
|
||||||
5. 跨越多个版本进行更新时,只需要下载**一个更新包**,不需要逐版本依次更新。
|
5. 跨越多个版本进行更新时,只需要下载**一个更新包**,不需要逐版本依次更新。
|
||||||
|
|
||||||
### 安装与快速入门
|
|
||||||
|
|
||||||
请查阅
|
|
||||||
|
|
||||||
- [文档-快速入门-准备工作](docs/guide.md)。
|
|
||||||
|
|
||||||
- [文档-快速入门-添加热更新功能](docs/guide2.md)。
|
|
||||||
|
|
||||||
- [文档-快速入门-发布版本](docs/guide3.md)。
|
|
||||||
|
|
||||||
- [文档-常见问题与高级指南](docs/faq_advance.md)。
|
|
||||||
|
|
||||||
### 命令行工具
|
|
||||||
|
|
||||||
请查阅[文档-命令行工具](docs/cli.md)。
|
|
||||||
|
|
||||||
### API 接口
|
|
||||||
|
|
||||||
请查阅[文档-API 接口](docs/api.md)。
|
|
||||||
|
|
||||||
### 本地开发
|
### 本地开发
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -64,11 +23,10 @@ $ yarn
|
|||||||
$ yarn start
|
$ yarn start
|
||||||
```
|
```
|
||||||
|
|
||||||
本地库文件使用yarn link链接,因此可直接在源文件中修改,在testHotUpdate项目中调试。
|
本地库文件使用 yarn link 链接,因此可直接在源文件中修改,在 testHotUpdate 项目中调试。
|
||||||
|
|
||||||
|
|
||||||
### 关于我们
|
### 关于我们
|
||||||
|
|
||||||
本组件由[React Native 中文网](https://reactnative.cn/)独家发布,如有定制需求可以[联系我们](https://reactnative.cn/about.html#content)。
|
本组件由[React Native 中文网](https://reactnative.cn/)独家发布,如有定制需求可以[联系我们](https://reactnative.cn/about.html#content)。
|
||||||
|
|
||||||
关于此插件发现任何问题,可以前往[Issues](https://github.com/reactnativecn/react-native-pushy/issues)或者[中文社区](http://bbs.reactnative.cn/category/7)发帖提问。
|
关于此插件发现任何问题,可以前往[Issues](https://github.com/reactnativecn/react-native-pushy/issues)发帖提问。
|
||||||
|
@@ -27,11 +27,9 @@ android {
|
|||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
buildConfigField("String", "PUSHY_BUILD_TIME", "\"${minutesSinceEpoch}\"")
|
|
||||||
resValue("string", "pushy_build_time", "${minutesSinceEpoch}")
|
resValue("string", "pushy_build_time", "${minutesSinceEpoch}")
|
||||||
}
|
}
|
||||||
debug {
|
debug {
|
||||||
buildConfigField("String", "PUSHY_BUILD_TIME", "\"0\"")
|
|
||||||
resValue("string", "pushy_build_time", "0")
|
resValue("string", "pushy_build_time", "0")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
<?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">
|
||||||
|
<application>
|
||||||
|
<meta-data android:name="pushy_build_time" android:value="@string/pushy_build_time" />
|
||||||
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@@ -3,6 +3,8 @@ package cn.reactnative.modules.update;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import com.facebook.react.bridge.Arguments;
|
||||||
|
import com.facebook.react.bridge.WritableMap;
|
||||||
|
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
@@ -31,11 +33,11 @@ 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;
|
||||||
/**
|
/**
|
||||||
* Created by tdzl2003 on 3/31/16.
|
* Created by tdzl2003 on 3/31/16.
|
||||||
*/
|
*/
|
||||||
class DownloadTask extends AsyncTask<DownloadTaskParams, Void, Void> {
|
class DownloadTask extends AsyncTask<DownloadTaskParams, long[], Void> {
|
||||||
final int DOWNLOAD_CHUNK_SIZE = 4096;
|
final int DOWNLOAD_CHUNK_SIZE = 4096;
|
||||||
|
|
||||||
Context context;
|
Context context;
|
||||||
@@ -91,11 +93,18 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, Void, Void> {
|
|||||||
|
|
||||||
long bytesRead = 0;
|
long bytesRead = 0;
|
||||||
long totalRead = 0;
|
long totalRead = 0;
|
||||||
|
double lastProgressValue=0;
|
||||||
while ((bytesRead = source.read(sink.buffer(), DOWNLOAD_CHUNK_SIZE)) != -1) {
|
while ((bytesRead = source.read(sink.buffer(), DOWNLOAD_CHUNK_SIZE)) != -1) {
|
||||||
totalRead += bytesRead;
|
totalRead += bytesRead;
|
||||||
|
sink.emit();
|
||||||
if (UpdateContext.DEBUG) {
|
if (UpdateContext.DEBUG) {
|
||||||
Log.d("RNUpdate", "Progress " + totalRead + "/" + contentLength);
|
Log.d("RNUpdate", "Progress " + totalRead + "/" + contentLength);
|
||||||
}
|
}
|
||||||
|
double progress = Math.round(((double) totalRead * 100) / contentLength);
|
||||||
|
if ((progress != lastProgressValue) || (totalRead == contentLength)) {
|
||||||
|
lastProgressValue = progress;
|
||||||
|
publishProgress(new long[]{(long)progress,totalRead, contentLength});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (totalRead != contentLength) {
|
if (totalRead != contentLength) {
|
||||||
throw new Error("Unexpected eof while reading ppk");
|
throw new Error("Unexpected eof while reading ppk");
|
||||||
@@ -108,6 +117,17 @@ class DownloadTask extends AsyncTask<DownloadTaskParams, Void, Void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onProgressUpdate(long[]... values) {
|
||||||
|
super.onProgressUpdate(values);
|
||||||
|
WritableMap params = Arguments.createMap();
|
||||||
|
params.putDouble("progress", (values[0][0]));
|
||||||
|
params.putDouble("totalRead", (values[0][1]));
|
||||||
|
params.putDouble("contentLength", (values[0][2]));
|
||||||
|
sendEvent("progress", params);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
byte[] buffer = new byte[1024];
|
byte[] buffer = new byte[1024];
|
||||||
|
|
||||||
private static native byte[] bsdiffPatch(byte[] origin, byte[] patch);
|
private static native byte[] bsdiffPatch(byte[] origin, byte[] patch);
|
||||||
|
@@ -4,6 +4,9 @@ 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.util.Log;
|
||||||
|
import com.facebook.react.ReactInstanceManager;
|
||||||
|
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
|
||||||
@@ -19,6 +22,7 @@ public class UpdateContext {
|
|||||||
private Executor executor;
|
private Executor executor;
|
||||||
|
|
||||||
public static boolean DEBUG = false;
|
public static boolean DEBUG = false;
|
||||||
|
private static ReactInstanceManager mReactInstanceManager;
|
||||||
|
|
||||||
public UpdateContext(Context context) {
|
public UpdateContext(Context context) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
@@ -60,7 +64,7 @@ public class UpdateContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getBuildTime() {
|
public String getBuildTime() {
|
||||||
return BuildConfig.PUSHY_BUILD_TIME;
|
return context.getString(R.string.pushy_build_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface DownloadFileListener {
|
public interface DownloadFileListener {
|
||||||
@@ -106,8 +110,8 @@ public class UpdateContext {
|
|||||||
private SharedPreferences sp;
|
private SharedPreferences sp;
|
||||||
|
|
||||||
public void switchVersion(String hashName) {
|
public void switchVersion(String hashName) {
|
||||||
if (!new File(rootDir, hashName).exists()) {
|
if (!new File(rootDir, hashName+"/index.bundlejs").exists()) {
|
||||||
throw new Error("Hash name not found, must download first.");
|
throw new Error("Bundle version " + hashName + " not found.");
|
||||||
}
|
}
|
||||||
String lastVersion = getCurrentVersion();
|
String lastVersion = getCurrentVersion();
|
||||||
SharedPreferences.Editor editor = sp.edit();
|
SharedPreferences.Editor editor = sp.edit();
|
||||||
@@ -158,6 +162,15 @@ public class UpdateContext {
|
|||||||
this.clearUp();
|
this.clearUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void setCustomInstanceManager(ReactInstanceManager instanceManager) {
|
||||||
|
mReactInstanceManager = instanceManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReactInstanceManager getCustomReactInstanceManager() {
|
||||||
|
return mReactInstanceManager;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getBundleUrl(Context context) {
|
public static String getBundleUrl(Context context) {
|
||||||
return new UpdateContext(context.getApplicationContext()).getBundleUrl();
|
return new UpdateContext(context.getApplicationContext()).getBundleUrl();
|
||||||
}
|
}
|
||||||
@@ -182,10 +195,18 @@ public class UpdateContext {
|
|||||||
currentVersion = this.rollBack();
|
currentVersion = this.rollBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (currentVersion == null) {
|
|
||||||
return defaultAssetsUrl;
|
while (currentVersion != null) {
|
||||||
|
File bundleFile = new File(rootDir, currentVersion+"/index.bundlejs");
|
||||||
|
if (!bundleFile.exists()) {
|
||||||
|
Log.e("getBundleUrl", "Bundle version " + currentVersion + " not found.");
|
||||||
|
currentVersion = this.rollBack();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
return bundleFile.toString();
|
||||||
}
|
}
|
||||||
return (new File(rootDir, currentVersion+"/index.bundlejs").toString());
|
|
||||||
|
return defaultAssetsUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String rollBack() {
|
private String rollBack() {
|
||||||
|
@@ -9,11 +9,14 @@ import com.facebook.react.ReactApplication;
|
|||||||
import com.facebook.react.ReactInstanceManager;
|
import com.facebook.react.ReactInstanceManager;
|
||||||
import com.facebook.react.bridge.Promise;
|
import com.facebook.react.bridge.Promise;
|
||||||
import com.facebook.react.bridge.ReactApplicationContext;
|
import com.facebook.react.bridge.ReactApplicationContext;
|
||||||
|
import com.facebook.react.bridge.ReactContext;
|
||||||
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
||||||
import com.facebook.react.bridge.ReactMethod;
|
import com.facebook.react.bridge.ReactMethod;
|
||||||
import com.facebook.react.bridge.ReadableMap;
|
import com.facebook.react.bridge.ReadableMap;
|
||||||
import com.facebook.react.bridge.UiThreadUtil;
|
import com.facebook.react.bridge.UiThreadUtil;
|
||||||
import com.facebook.react.bridge.JSBundleLoader;
|
import com.facebook.react.bridge.JSBundleLoader;
|
||||||
|
import com.facebook.react.bridge.WritableMap;
|
||||||
|
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
@@ -25,10 +28,11 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
public class UpdateModule extends ReactContextBaseJavaModule{
|
public class UpdateModule extends ReactContextBaseJavaModule{
|
||||||
UpdateContext updateContext;
|
UpdateContext updateContext;
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UpdateModule(ReactApplicationContext reactContext) {
|
public UpdateModule(ReactApplicationContext reactContext) {
|
||||||
@@ -57,7 +61,7 @@ public class UpdateModule extends ReactContextBaseJavaModule{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "RCTHotUpdate";
|
return "RCTPushy";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
@@ -119,11 +123,15 @@ public class UpdateModule extends ReactContextBaseJavaModule{
|
|||||||
UiThreadUtil.runOnUiThread(new Runnable() {
|
UiThreadUtil.runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
updateContext.switchVersion(hash);
|
|
||||||
try {
|
try {
|
||||||
|
updateContext.switchVersion(hash);
|
||||||
Activity activity = getCurrentActivity();
|
Activity activity = getCurrentActivity();
|
||||||
Application application = activity.getApplication();
|
Application application = activity.getApplication();
|
||||||
ReactInstanceManager instanceManager = ((ReactApplication) application).getReactNativeHost().getReactInstanceManager();
|
ReactInstanceManager instanceManager = updateContext.getCustomReactInstanceManager();
|
||||||
|
|
||||||
|
if (instanceManager == null) {
|
||||||
|
instanceManager = ((ReactApplication) application).getReactNativeHost().getReactInstanceManager();
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Field jsBundleField = instanceManager.getClass().getDeclaredField("mJSBundleFile");
|
Field jsBundleField = instanceManager.getClass().getDeclaredField("mJSBundleFile");
|
||||||
@@ -143,7 +151,7 @@ public class UpdateModule extends ReactContextBaseJavaModule{
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (Throwable err) {
|
} catch (Throwable err) {
|
||||||
Log.e("pushy", "Failed to restart application", err);
|
Log.e("pushy", "switchVersion failed", err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -156,7 +164,11 @@ public class UpdateModule extends ReactContextBaseJavaModule{
|
|||||||
UiThreadUtil.runOnUiThread(new Runnable() {
|
UiThreadUtil.runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
updateContext.switchVersion(hash);
|
try {
|
||||||
|
updateContext.switchVersion(hash);
|
||||||
|
} catch (Throwable err) {
|
||||||
|
Log.e("pushy", "switchVersionLater failed", err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -170,4 +182,10 @@ public class UpdateModule extends ReactContextBaseJavaModule{
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 发送事件*/
|
||||||
|
public static void sendEvent(String eventName, WritableMap params) {
|
||||||
|
((ReactContext) mContext).getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit(eventName,
|
||||||
|
params);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
0
docs/.nojekyll
Normal file
0
docs/.nojekyll
Normal file
53
docs/README.md
Normal file
53
docs/README.md
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
# react-native-update [](http://badge.fury.io/js/react-native-update)
|
||||||
|
|
||||||
|
本组件是面向 React Native 提供热更新功能的组件,请结合[Update 服务](https://update.reactnative.cn/)使用。
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>
|
||||||
|
注意,在 iOS 上使用热更新有被拒的可能。被拒之后可以按此步骤单独屏蔽 iOS 端(`react-native-update`版本需 >= 5.3.2):
|
||||||
|
</summary>
|
||||||
|
|
||||||
|
1. 如果 RN 版本>=0.60,在项目根目录下编辑或创建 react-native.config.js,添加如下内容
|
||||||
|
|
||||||
|
```js
|
||||||
|
// react-native.config.js
|
||||||
|
module.exports = {
|
||||||
|
dependencies: {
|
||||||
|
'react-native-update': {
|
||||||
|
platforms: {
|
||||||
|
ios: null, // 阻止ios模块自动链接
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
2. 如果在原生代码端尚未配置,则跳过下面文档中的 ios 端的配置。如果已经配置,则按文档的步骤反向操作(添加的 ios 代码删去)。
|
||||||
|
3. 如果是 0.60 以上版本或使用了 cocoapods,在 ios 目录中再次运行 pod install,确保 Podfile 和 Podfile.lock 中都没有'react-native-update'。如果 RN 版本<0.60,则运行`react-native unlink react-native-update`。
|
||||||
|
4. 在 js 代码里调用 checkUpdate()方法前,判断 Platform.OS,如果是 ios 平台则直接 return 跳过。
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### 优势
|
||||||
|
|
||||||
|
1. 命令行工具&网页双端管理,版本发布过程简单便捷,完全可以集成 CI。
|
||||||
|
2. 基于 bsdiff 算法创建的**超小更新包**,通常版本迭代后在 1-10KB 之间,避免数百 KB 的流量消耗。
|
||||||
|
3. 支持崩溃回滚,安全可靠。
|
||||||
|
4. meta 信息及开放 API,提供更高扩展性。
|
||||||
|
5. 跨越多个版本进行更新时,只需要下载**一个更新包**,不需要逐版本依次更新。
|
||||||
|
|
||||||
|
### 本地开发
|
||||||
|
|
||||||
|
```
|
||||||
|
$ git clone git@github.com:reactnativecn/react-native-pushy.git
|
||||||
|
$ cd react-native-pushy/Example/testHotUpdate
|
||||||
|
$ yarn
|
||||||
|
$ yarn start
|
||||||
|
```
|
||||||
|
|
||||||
|
本地库文件使用 yarn link 链接,因此可直接在源文件中修改,在 testHotUpdate 项目中调试。
|
||||||
|
|
||||||
|
### 关于我们
|
||||||
|
|
||||||
|
本组件由[React Native 中文网](https://reactnative.cn/)独家发布,如有定制需求可以[联系我们](https://reactnative.cn/about.html#content)。
|
||||||
|
|
||||||
|
关于此插件发现任何问题,可以前往[Issues](https://github.com/reactnativecn/react-native-pushy/issues)或者[中文社区](http://bbs.reactnative.cn/category/7)发帖提问。
|
10
docs/_sidebar.md
Normal file
10
docs/_sidebar.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
- 安装与快速入门
|
||||||
|
|
||||||
|
- [准备工作](guide.md)
|
||||||
|
- [添加热更新功能](guide2.md)
|
||||||
|
- [发布版本](guide3.md)
|
||||||
|
- [常见问题与高级指南](faq_advance.md)
|
||||||
|
|
||||||
|
- [API接口](api.md)
|
||||||
|
- [命令行工具](cli.md)
|
||||||
|
- [最近更新](changelog.md)
|
@@ -6,11 +6,11 @@
|
|||||||
|
|
||||||
### packageVersion
|
### packageVersion
|
||||||
|
|
||||||
当前应用包的版本名。
|
当前应用原生包的版本。其中android取自`versionName`字段(位于`android/build.gralde`中)。ios取自`CFBundleShortVersionString`字段(位于`ios/项目名/Info.plist`中)。
|
||||||
|
|
||||||
### currentVersion
|
### currentVersion
|
||||||
|
|
||||||
当前版本的Hash号。
|
当前热更新版本(jsbundle文件)的Hash号。
|
||||||
|
|
||||||
### isFirstTime
|
### isFirstTime
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
检查更新,返回值有三种情形:
|
检查更新,返回值有三种情形:
|
||||||
|
|
||||||
1. `{expired: true}`:该应用包(原生部分)已过期,需要前往应用市场下载新的版本。
|
1. `{expired: true}`:该应用原生包已过期,需要前往应用市场下载新的版本。
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
expired: true,
|
expired: true,
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
3. `{update: true}`:当前有新版本可以更新。info的`name`、`description`字段可
|
3. `{update: true}`:当前有新版本可以更新。info的`name`、`description`字段可
|
||||||
以用于提示用户,而`metaInfo`字段则可以根据你的需求自定义其它属性(如是否静默更新、
|
以用于提示用户,而`metaInfo`字段则可以根据你的需求自定义其它属性(如是否静默更新、
|
||||||
是否强制更新等等)。另外还有几个字段,包含了完整更新包或补丁包的下载地址,
|
是否强制更新等等)。另外还有几个字段,包含了热更新文件的下载地址,
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
update: true,
|
update: true,
|
||||||
@@ -43,7 +43,6 @@
|
|||||||
hash: 'hash',
|
hash: 'hash',
|
||||||
description: '添加聊天功能\n修复商城页面BUG',
|
description: '添加聊天功能\n修复商城页面BUG',
|
||||||
metaInfo: '{"silent":true}',
|
metaInfo: '{"silent":true}',
|
||||||
updateUrl: 'http://update-packages.reactnative.cn/hash',
|
|
||||||
pdiffUrl: 'http://update-packages.reactnative.cn/hash',
|
pdiffUrl: 'http://update-packages.reactnative.cn/hash',
|
||||||
diffUrl: 'http://update-packages.reactnative.cn/hash',
|
diffUrl: 'http://update-packages.reactnative.cn/hash',
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,39 @@
|
|||||||
### 最近更新
|
### 最近更新
|
||||||
|
|
||||||
|
## 5.5.6 (2020-02-11)
|
||||||
|
|
||||||
|
1. bundle时清除缓存
|
||||||
|
2. 修复更新包过大时可能出现的崩溃
|
||||||
|
3. publish时检查文件格式
|
||||||
|
|
||||||
|
## 5.5.5 (2020-01-18)
|
||||||
|
|
||||||
|
1. 提升服务健壮性
|
||||||
|
|
||||||
|
## 5.5.4 (2020-01-13)
|
||||||
|
|
||||||
|
1. 防止某些情况下安卓找不到bundle文件引起的崩溃
|
||||||
|
|
||||||
|
## 5.5.3 (2019-12-18)
|
||||||
|
|
||||||
|
1. 忽略hermes的输出避免buffer溢出
|
||||||
|
|
||||||
|
## 5.5.2 (2019-12-06)
|
||||||
|
|
||||||
|
1. 修复使用use_frameworks时无法读取时间戳的问题
|
||||||
|
|
||||||
|
## 5.5.0 (2019-11-24)
|
||||||
|
|
||||||
|
1. 打包时加入时间戳
|
||||||
|
|
||||||
|
## 5.4.0 (2019-11-16)
|
||||||
|
|
||||||
|
1. 修改类名方法名
|
||||||
|
|
||||||
|
## 5.3.2 (2019-10-25)
|
||||||
|
|
||||||
|
1. 可以禁用ios端以避免审核被拒
|
||||||
|
|
||||||
## 5.3.0 (2019-09-19)
|
## 5.3.0 (2019-09-19)
|
||||||
|
|
||||||
1. 替换 apk reader 以避免某些环境读取 apk 版本号报错的问题
|
1. 替换 apk reader 以避免某些环境读取 apk 版本号报错的问题
|
18
docs/cli.md
18
docs/cli.md
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
```
|
```
|
||||||
$ npm install -g react-native-update-cli
|
$ npm install -g react-native-update-cli
|
||||||
$ npm install --save react-native-update
|
$ npm install react-native-update
|
||||||
```
|
```
|
||||||
|
|
||||||
## 使用
|
## 使用
|
||||||
@@ -90,18 +90,18 @@ $ npm install --save react-native-update
|
|||||||
|
|
||||||
#### pushy packages
|
#### pushy packages
|
||||||
|
|
||||||
查看已经上传的包。这项操作也可以在网页管理端进行。
|
查看已经上传的原生包。这项操作也可以在网页管理端进行。
|
||||||
|
|
||||||
- platform: ios|android 对应的平台
|
- platform: ios|android 对应的平台
|
||||||
|
|
||||||
#### pushy publish <ppkFile>
|
#### pushy publish <ppkFile>
|
||||||
|
|
||||||
发布新的更新版本。
|
发布新的热更新版本(ppk文件)。
|
||||||
|
|
||||||
- platform: ios|android 对应的平台
|
- platform: ios|android 对应的平台
|
||||||
- name: 当前版本的名字(版本号)
|
- name: 当前热更新版本的名字(版本号)
|
||||||
- description: 当前版本的描述信息,可以对用户进行展示
|
- description: 当前热更新版本的描述信息,可以对用户进行展示
|
||||||
- metaInfo: 当前版本的元信息,可以用来保存一些额外信息
|
- metaInfo: 当前热更新版本的元信息,可以用来保存一些额外信息
|
||||||
|
|
||||||
#### pushy versions
|
#### pushy versions
|
||||||
|
|
||||||
@@ -111,8 +111,8 @@ $ npm install --save react-native-update
|
|||||||
|
|
||||||
#### pushy update
|
#### pushy update
|
||||||
|
|
||||||
为一个包版本绑定一个更新版本。这项操作也可以在网页管理端进行。
|
为一个原生包版本绑定一个热更新版本。这项操作也可以在网页管理端进行。
|
||||||
|
|
||||||
- platform: ios|android 对应的平台
|
- platform: ios|android 对应的平台
|
||||||
- versionId: 要绑定的版本 ID
|
- versionId: 要绑定的热更新版本 ID
|
||||||
- packageId: 要绑定的包 ID
|
- packageId: 要绑定的原生包 ID
|
||||||
|
@@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
目前我们的热更新服务完全免费,但限制每个账号不超过3个应用;每个应用不超过10个活跃的包和100个活跃的热更新版本;每个应用每个月不超过10000次下载。iOS和Android版本记做不同的应用。
|
目前我们的热更新服务完全免费,但限制每个账号不超过3个应用;每个应用不超过10个活跃的包和100个活跃的热更新版本;每个应用每个月不超过10000次下载。iOS和Android版本记做不同的应用。
|
||||||
|
|
||||||
已经移除的应用、包版本、热更新版本不在统计之列,所以你可以移除测试时产生的和已过期版本来更有效的利用空间。
|
已经移除的应用、原生包版本、热更新版本不在统计之列,所以你可以移除测试时产生的和已过期版本来更有效的利用空间。
|
||||||
|
|
||||||
我们会在将来推出付费的升级版本,针对用户量较大、版本迭代较快的用户提供扩容方案。如果您有急迫的需求,可以[联系我们](https://reactnative.cn/about.html#content)。
|
我们会在将来推出付费的升级版本,针对用户量较大、版本迭代较快的用户提供扩容方案。如果您有急迫的需求,可以[联系我们](https://reactnative.cn/about.html#content)。
|
||||||
|
|
||||||
|
@@ -52,7 +52,7 @@ npm i react-native-update@4.x
|
|||||||
请记得一定要重新编译(react-native run-ios或run-android命令编译,或在Xcode/Android Studio中重新编译)。
|
请记得一定要重新编译(react-native run-ios或run-android命令编译,或在Xcode/Android Studio中重新编译)。
|
||||||
|
|
||||||
|
|
||||||
## 一、手动link
|
## 手动link
|
||||||
|
|
||||||
如果RN版本 >= 0.60则可以跳过此步骤
|
如果RN版本 >= 0.60则可以跳过此步骤
|
||||||
|
|
||||||
@@ -74,10 +74,20 @@ pod 'react-native-update', path: '../node_modules/react-native-update'
|
|||||||
<summary>RN < 0.60且不使用CocoaPods</summary>
|
<summary>RN < 0.60且不使用CocoaPods</summary>
|
||||||
|
|
||||||
1. 在XCode中的Project Navigator里,右键点击`Libraries` ➜ `Add Files to [你的工程名]`
|
1. 在XCode中的Project Navigator里,右键点击`Libraries` ➜ `Add Files to [你的工程名]`
|
||||||
2. 进入`node_modules` ➜ `react-native-update` ➜ `ios 并选中 `RCTHotUpdate.xcodeproj`
|
2. 进入`node_modules` ➜ `react-native-update` ➜ `ios 并选中 `RCTPushy.xcodeproj`
|
||||||
3. 在XCode中的project navigator里,选中你的工程,在 `Build Phases` ➜ `Link Binary With Libraries` 中添加 `libRCTHotUpdate.a`
|
3. 在XCode中的project navigator里,选中你的工程,在 `Build Phases` ➜ `Link Binary With Libraries` 中添加 `libRCTPushy.a`
|
||||||
4. 继续在`Build Settings`里搜索`Header Search Path`,添加$(SRCROOT)/../node_modules/react-native-update/ios
|
4. 继续在`Build Settings`里搜索`Header Search Path`,添加$(SRCROOT)/../node_modules/react-native-update/ios
|
||||||
5. 重新编译
|
5. 在`Build Phases`添加一个`New Run Script Phase`运行脚本,内容如下
|
||||||
|
```
|
||||||
|
#!/bin/bash
|
||||||
|
set -x
|
||||||
|
DEST="../node_modules/react-native-update/ios/"
|
||||||
|
date +%s > "$DEST/pushy_build_time.txt"
|
||||||
|
```
|
||||||
|
编译的时候就会在`../node_modules/react-native-update/ios/`文件夹下面生成一个`pushy_build_time.txt`文件。
|
||||||
|
然后在`Copy Bundle Resources`里把生成的`pushy_build_time.txt`文件添加进去。
|
||||||
|
|
||||||
|
6. 重新编译
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
@@ -102,7 +112,7 @@ pod 'react-native-update', path: '../node_modules/react-native-update'
|
|||||||
- 在`getPackages()` 方法中增加 `new UpdatePackage()`(注意上一行可能要增加一个逗号)
|
- 在`getPackages()` 方法中增加 `new UpdatePackage()`(注意上一行可能要增加一个逗号)
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
## 二、配置Bundle URL
|
## 配置Bundle URL
|
||||||
|
|
||||||
注意此步骤无论任何版本,目前都需要手动配置。
|
注意此步骤无论任何版本,目前都需要手动配置。
|
||||||
|
|
||||||
@@ -115,7 +125,7 @@ pod 'react-native-update', path: '../node_modules/react-native-update'
|
|||||||
```objective-c
|
```objective-c
|
||||||
// ... 其它代码
|
// ... 其它代码
|
||||||
|
|
||||||
#import "RCTHotUpdate.h"
|
#import "RCTPushy.h"
|
||||||
|
|
||||||
// 如果RN版本 >= 0.59,修改sourceURLForBridge
|
// 如果RN版本 >= 0.59,修改sourceURLForBridge
|
||||||
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
||||||
@@ -124,7 +134,7 @@ pod 'react-native-update', path: '../node_modules/react-native-update'
|
|||||||
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
|
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
|
||||||
#else
|
#else
|
||||||
// 非DEBUG情况下替换为热更新bundle
|
// 非DEBUG情况下替换为热更新bundle
|
||||||
return [RCTHotUpdate bundleURL];
|
return [RCTPushy bundleURL];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,7 +146,7 @@ pod 'react-native-update', path: '../node_modules/react-native-update'
|
|||||||
jsCodeLocation = ..........
|
jsCodeLocation = ..........
|
||||||
#else
|
#else
|
||||||
// 非DEBUG情况下替换为热更新bundle
|
// 非DEBUG情况下替换为热更新bundle
|
||||||
jsCodeLocation = [RCTHotUpdate bundleURL];
|
jsCodeLocation = [RCTPushy bundleURL];
|
||||||
#endif
|
#endif
|
||||||
// ... 其它代码
|
// ... 其它代码
|
||||||
}
|
}
|
||||||
@@ -164,7 +174,7 @@ public class MainApplication extends Application implements ReactApplication {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 三、登录与创建应用
|
## 登录与创建应用
|
||||||
|
|
||||||
首先请在<https://update.reactnative.cn>注册帐号,然后在你的项目根目录下运行以下命令:
|
首先请在<https://update.reactnative.cn>注册帐号,然后在你的项目根目录下运行以下命令:
|
||||||
|
|
||||||
|
@@ -25,7 +25,7 @@ const info = await checkUpdate(appKey)
|
|||||||
|
|
||||||
返回的info有三种情况:
|
返回的info有三种情况:
|
||||||
|
|
||||||
1. `{expired: true}`:该应用包(原生部分)已过期,需要前往应用市场下载新的版本。
|
1. `{expired: true}`:该应用原生包已过期(已从pushy服务器中删除),开发者应该在pushy控制台添加一个更新下载链接,并自行提示用户下载。
|
||||||
|
|
||||||
2. `{upToDate: true}`:当前已经更新到最新,无需进行更新。
|
2. `{upToDate: true}`:当前已经更新到最新,无需进行更新。
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ react-native-update会首先尝试耗费流量更少的更新方式。将info对
|
|||||||
|
|
||||||
## 切换版本
|
## 切换版本
|
||||||
|
|
||||||
downloadUpdate的返回值是一个hash字符串,它是当前版本的唯一标识。
|
downloadUpdate的返回值是一个hash字符串,它是当前热更新版本的唯一标识。
|
||||||
|
|
||||||
你可以使用`switchVersion`函数立即切换版本(此时应用会立即重新加载),或者选择调用
|
你可以使用`switchVersion`函数立即切换版本(此时应用会立即重新加载),或者选择调用
|
||||||
`switchVersionLater`,让应用在下一次启动的时候再加载新的版本。
|
`switchVersionLater`,让应用在下一次启动的时候再加载新的版本。
|
||||||
@@ -139,8 +139,8 @@ class MyProject extends Component {
|
|||||||
</Text>
|
</Text>
|
||||||
<Text style={styles.instructions}>
|
<Text style={styles.instructions}>
|
||||||
这是版本一 {'\n'}
|
这是版本一 {'\n'}
|
||||||
当前包版本号: {packageVersion}{'\n'}
|
当前原生包版本号: {packageVersion}{'\n'}
|
||||||
当前版本Hash: {currentVersion||'(空)'}{'\n'}
|
当前热更新版本Hash: {currentVersion||'(空)'}{'\n'}
|
||||||
</Text>
|
</Text>
|
||||||
<TouchableOpacity onPress={this.checkUpdate}>
|
<TouchableOpacity onPress={this.checkUpdate}>
|
||||||
<Text style={styles.instructions}>
|
<Text style={styles.instructions}>
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
$ pushy uploadIpa <your-package.ipa>
|
$ pushy uploadIpa <your-package.ipa>
|
||||||
```
|
```
|
||||||
|
|
||||||
即可上传ipa以供后续版本比对之用。
|
即可上传ipa以供后续版本比对之用。此ipa的`CFBundleShortVersionString`字段(位于`ios/项目名/Info.plist`中)会被记录为原生版本号`packageVersion`。
|
||||||
|
|
||||||
随后你可以选择往AppStore发布这个版本,也可以先通过Test flight等方法进行测试。
|
随后你可以选择往AppStore发布这个版本,也可以先通过Test flight等方法进行测试。
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ $ pushy uploadIpa <your-package.ipa>
|
|||||||
$ pushy uploadApk android/app/build/outputs/apk/release/app-release.apk
|
$ pushy uploadApk android/app/build/outputs/apk/release/app-release.apk
|
||||||
```
|
```
|
||||||
|
|
||||||
即可上传apk以供后续版本比对之用。
|
即可上传apk以供后续版本比对之用。此apk的`versionName`字段(位于`android/build.gralde`中)会被记录为原生版本号`packageVersion`。
|
||||||
|
|
||||||
随后你可以选择往应用市场发布这个版本,也可以先往设备上直接安装这个apk文件以进行测试。
|
随后你可以选择往应用市场发布这个版本,也可以先往设备上直接安装这个apk文件以进行测试。
|
||||||
|
|
||||||
@@ -51,17 +51,17 @@ Would you like to publish it?(Y/N)
|
|||||||
|
|
||||||
```
|
```
|
||||||
Uploading [========================================================] 100% 0.0s
|
Uploading [========================================================] 100% 0.0s
|
||||||
Enter version name: <输入版本名字,如1.0.0-rc>
|
Enter version name: <输入热更新版本名字,如1.0.0-rc>
|
||||||
Enter description: <输入版本描述>
|
Enter description: <输入热更新版本描述>
|
||||||
Enter meta info: {"ok":1}
|
Enter meta info: {"ok":1}
|
||||||
Ok.
|
Ok.
|
||||||
Would you like to bind packages to this version?(Y/N)
|
Would you like to bind packages to this version?(Y/N)
|
||||||
```
|
```
|
||||||
|
|
||||||
此时版本已经提交到update服务,但用户暂时看不到此更新,你需要先将特定的包版本绑定到此热更新版本上。
|
此时版本已经提交到update服务,但用户暂时看不到此更新,你需要先将特定的原生包版本绑定到此热更新版本上。
|
||||||
|
|
||||||
此时输入Y立即绑定,你也可以在将来使用`pushy update --platform <ios|android>`来使得对应包版本的用户更新。
|
此时输入Y立即绑定,你也可以在将来使用`pushy update --platform <ios|android>`来使得对应原生包版本的用户更新。
|
||||||
除此以外,你还可以在网页端操作,简单的将对应的包版本拖到此版本下即可。
|
除此以外,你还可以在网页端操作,简单的将对应的原生包版本拖到此热更新版本下即可。
|
||||||
|
|
||||||
```
|
```
|
||||||
Offset 0
|
Offset 0
|
||||||
@@ -72,7 +72,7 @@ Enter versionId or page Up/page Down/Begin(U/D/B) <输入序号,U/D翻页,B回
|
|||||||
1) 1.0(normal) - 3 FiWYm9lB (未命名)
|
1) 1.0(normal) - 3 FiWYm9lB (未命名)
|
||||||
|
|
||||||
Total 1 packages.
|
Total 1 packages.
|
||||||
Enter packageId: <输入包版本序号,序号就是上面列表中)前面的数字>
|
Enter packageId: <输入原生包版本序号,序号就是上面列表中)前面的数字>
|
||||||
```
|
```
|
||||||
|
|
||||||
版本绑定完毕后,客户端就应当可以检查到更新并进行更新了。
|
版本绑定完毕后,客户端就应当可以检查到更新并进行更新了。
|
||||||
|
25
docs/index.html
Normal file
25
docs/index.html
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>react-native-update - react-native hot update</title>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||||
|
<meta name="description" content="react-native hot update">
|
||||||
|
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||||
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
<script>
|
||||||
|
window.$docsify = {
|
||||||
|
name: 'react-native-update',
|
||||||
|
repo: 'https://github.com/reactnativecn/react-native-pushy',
|
||||||
|
formatUpdated: '{MM}/{DD} {HH}:{mm}',
|
||||||
|
loadSidebar: true,
|
||||||
|
subMaxLevel: 2,
|
||||||
|
auto2top: true
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
1
domains.json
Normal file
1
domains.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
["update.react-native.cn", "update.reactnative.cn"]
|
@@ -1,80 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Scheme
|
|
||||||
LastUpgradeVersion = "0720"
|
|
||||||
version = "1.3">
|
|
||||||
<BuildAction
|
|
||||||
parallelizeBuildables = "YES"
|
|
||||||
buildImplicitDependencies = "YES">
|
|
||||||
<BuildActionEntries>
|
|
||||||
<BuildActionEntry
|
|
||||||
buildForTesting = "YES"
|
|
||||||
buildForRunning = "YES"
|
|
||||||
buildForProfiling = "YES"
|
|
||||||
buildForArchiving = "YES"
|
|
||||||
buildForAnalyzing = "YES">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "91C5EFFE1C76ECA90037E727"
|
|
||||||
BuildableName = "libRCTHotUpdate.a"
|
|
||||||
BlueprintName = "RCTHotUpdate"
|
|
||||||
ReferencedContainer = "container:RCTHotUpdate.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</BuildActionEntry>
|
|
||||||
</BuildActionEntries>
|
|
||||||
</BuildAction>
|
|
||||||
<TestAction
|
|
||||||
buildConfiguration = "Debug"
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
||||||
<Testables>
|
|
||||||
</Testables>
|
|
||||||
<AdditionalOptions>
|
|
||||||
</AdditionalOptions>
|
|
||||||
</TestAction>
|
|
||||||
<LaunchAction
|
|
||||||
buildConfiguration = "Debug"
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
launchStyle = "0"
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
ignoresPersistentStateOnLaunch = "NO"
|
|
||||||
debugDocumentVersioning = "YES"
|
|
||||||
debugServiceExtension = "internal"
|
|
||||||
allowLocationSimulation = "YES">
|
|
||||||
<MacroExpansion>
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "91C5EFFE1C76ECA90037E727"
|
|
||||||
BuildableName = "libRCTHotUpdate.a"
|
|
||||||
BlueprintName = "RCTHotUpdate"
|
|
||||||
ReferencedContainer = "container:RCTHotUpdate.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</MacroExpansion>
|
|
||||||
<AdditionalOptions>
|
|
||||||
</AdditionalOptions>
|
|
||||||
</LaunchAction>
|
|
||||||
<ProfileAction
|
|
||||||
buildConfiguration = "Release"
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
||||||
savedToolIdentifier = ""
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
debugDocumentVersioning = "YES">
|
|
||||||
<MacroExpansion>
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "91C5EFFE1C76ECA90037E727"
|
|
||||||
BuildableName = "libRCTHotUpdate.a"
|
|
||||||
BlueprintName = "RCTHotUpdate"
|
|
||||||
ReferencedContainer = "container:RCTHotUpdate.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</MacroExpansion>
|
|
||||||
</ProfileAction>
|
|
||||||
<AnalyzeAction
|
|
||||||
buildConfiguration = "Debug">
|
|
||||||
</AnalyzeAction>
|
|
||||||
<ArchiveAction
|
|
||||||
buildConfiguration = "Release"
|
|
||||||
revealArchiveInOrganizer = "YES">
|
|
||||||
</ArchiveAction>
|
|
||||||
</Scheme>
|
|
@@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>SchemeUserState</key>
|
|
||||||
<dict>
|
|
||||||
<key>RCTHotUpdate.xcscheme</key>
|
|
||||||
<dict>
|
|
||||||
<key>orderHint</key>
|
|
||||||
<integer>22</integer>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
<key>SuppressBuildableAutocreation</key>
|
|
||||||
<dict>
|
|
||||||
<key>91C5EFFE1C76ECA90037E727</key>
|
|
||||||
<dict>
|
|
||||||
<key>primary</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@@ -1,80 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Scheme
|
|
||||||
LastUpgradeVersion = "0720"
|
|
||||||
version = "1.3">
|
|
||||||
<BuildAction
|
|
||||||
parallelizeBuildables = "YES"
|
|
||||||
buildImplicitDependencies = "YES">
|
|
||||||
<BuildActionEntries>
|
|
||||||
<BuildActionEntry
|
|
||||||
buildForTesting = "YES"
|
|
||||||
buildForRunning = "YES"
|
|
||||||
buildForProfiling = "YES"
|
|
||||||
buildForArchiving = "YES"
|
|
||||||
buildForAnalyzing = "YES">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "91C5EFFE1C76ECA90037E727"
|
|
||||||
BuildableName = "libRCTHotUpdate.a"
|
|
||||||
BlueprintName = "RCTHotUpdate"
|
|
||||||
ReferencedContainer = "container:RCTHotUpdate.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</BuildActionEntry>
|
|
||||||
</BuildActionEntries>
|
|
||||||
</BuildAction>
|
|
||||||
<TestAction
|
|
||||||
buildConfiguration = "Debug"
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
||||||
<Testables>
|
|
||||||
</Testables>
|
|
||||||
<AdditionalOptions>
|
|
||||||
</AdditionalOptions>
|
|
||||||
</TestAction>
|
|
||||||
<LaunchAction
|
|
||||||
buildConfiguration = "Debug"
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
launchStyle = "0"
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
ignoresPersistentStateOnLaunch = "NO"
|
|
||||||
debugDocumentVersioning = "YES"
|
|
||||||
debugServiceExtension = "internal"
|
|
||||||
allowLocationSimulation = "YES">
|
|
||||||
<MacroExpansion>
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "91C5EFFE1C76ECA90037E727"
|
|
||||||
BuildableName = "libRCTHotUpdate.a"
|
|
||||||
BlueprintName = "RCTHotUpdate"
|
|
||||||
ReferencedContainer = "container:RCTHotUpdate.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</MacroExpansion>
|
|
||||||
<AdditionalOptions>
|
|
||||||
</AdditionalOptions>
|
|
||||||
</LaunchAction>
|
|
||||||
<ProfileAction
|
|
||||||
buildConfiguration = "Release"
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
||||||
savedToolIdentifier = ""
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
debugDocumentVersioning = "YES">
|
|
||||||
<MacroExpansion>
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "91C5EFFE1C76ECA90037E727"
|
|
||||||
BuildableName = "libRCTHotUpdate.a"
|
|
||||||
BlueprintName = "RCTHotUpdate"
|
|
||||||
ReferencedContainer = "container:RCTHotUpdate.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</MacroExpansion>
|
|
||||||
</ProfileAction>
|
|
||||||
<AnalyzeAction
|
|
||||||
buildConfiguration = "Debug">
|
|
||||||
</AnalyzeAction>
|
|
||||||
<ArchiveAction
|
|
||||||
buildConfiguration = "Release"
|
|
||||||
revealArchiveInOrganizer = "YES">
|
|
||||||
</ArchiveAction>
|
|
||||||
</Scheme>
|
|
@@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>SchemeUserState</key>
|
|
||||||
<dict>
|
|
||||||
<key>RCTHotUpdate.xcscheme</key>
|
|
||||||
<dict>
|
|
||||||
<key>orderHint</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
<key>SuppressBuildableAutocreation</key>
|
|
||||||
<dict>
|
|
||||||
<key>91C5EFFE1C76ECA90037E727</key>
|
|
||||||
<dict>
|
|
||||||
<key>primary</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@@ -7,12 +7,12 @@
|
|||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
91C5F0031C76ECA90037E727 /* RCTHotUpdate.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 91C5F0021C76ECA90037E727 /* RCTHotUpdate.h */; };
|
91C5F0031C76ECA90037E727 /* RCTPushy.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 91C5F0021C76ECA90037E727 /* RCTPushy.h */; };
|
||||||
91C5F0051C76ECA90037E727 /* RCTHotUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 91C5F0041C76ECA90037E727 /* RCTHotUpdate.m */; };
|
91C5F0051C76ECA90037E727 /* RCTPushy.m in Sources */ = {isa = PBXBuildFile; fileRef = 91C5F0041C76ECA90037E727 /* RCTPushy.m */; };
|
||||||
9F1BCB1D1CAE5937000EF2CB /* RCTHotUpdateManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F1BCB1C1CAE5937000EF2CB /* RCTHotUpdateManager.m */; };
|
9F1BCB1D1CAE5937000EF2CB /* RCTPushyManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F1BCB1C1CAE5937000EF2CB /* RCTPushyManager.m */; };
|
||||||
9F1BCB461CAF6B3E000EF2CB /* bspatch.c in Sources */ = {isa = PBXBuildFile; fileRef = 9F1BCB3B1CAF6B3E000EF2CB /* bspatch.c */; };
|
9F1BCB461CAF6B3E000EF2CB /* bspatch.c in Sources */ = {isa = PBXBuildFile; fileRef = 9F1BCB3B1CAF6B3E000EF2CB /* bspatch.c */; };
|
||||||
9F1BCB4F1CAF6B68000EF2CB /* BSDiff.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F1BCB4E1CAF6B68000EF2CB /* BSDiff.m */; };
|
9F1BCB4F1CAF6B68000EF2CB /* BSDiff.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F1BCB4E1CAF6B68000EF2CB /* BSDiff.m */; };
|
||||||
9F292F7D1C7C44290095945D /* RCTHotUpdateDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F292F7C1C7C44290095945D /* RCTHotUpdateDownloader.m */; };
|
9F292F7D1C7C44290095945D /* RCTPushyDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F292F7C1C7C44290095945D /* RCTPushyDownloader.m */; };
|
||||||
9F394D7D1C7C25DC00C794C0 /* aescrypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 9F394D5B1C7C25DC00C794C0 /* aescrypt.c */; };
|
9F394D7D1C7C25DC00C794C0 /* aescrypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 9F394D5B1C7C25DC00C794C0 /* aescrypt.c */; };
|
||||||
9F394D7E1C7C25DC00C794C0 /* aeskey.c in Sources */ = {isa = PBXBuildFile; fileRef = 9F394D5C1C7C25DC00C794C0 /* aeskey.c */; };
|
9F394D7E1C7C25DC00C794C0 /* aeskey.c in Sources */ = {isa = PBXBuildFile; fileRef = 9F394D5C1C7C25DC00C794C0 /* aeskey.c */; };
|
||||||
9F394D7F1C7C25DC00C794C0 /* aestab.c in Sources */ = {isa = PBXBuildFile; fileRef = 9F394D5E1C7C25DC00C794C0 /* aestab.c */; };
|
9F394D7F1C7C25DC00C794C0 /* aestab.c in Sources */ = {isa = PBXBuildFile; fileRef = 9F394D5E1C7C25DC00C794C0 /* aestab.c */; };
|
||||||
@@ -36,24 +36,24 @@
|
|||||||
dstPath = "include/$(PRODUCT_NAME)";
|
dstPath = "include/$(PRODUCT_NAME)";
|
||||||
dstSubfolderSpec = 16;
|
dstSubfolderSpec = 16;
|
||||||
files = (
|
files = (
|
||||||
91C5F0031C76ECA90037E727 /* RCTHotUpdate.h in CopyFiles */,
|
91C5F0031C76ECA90037E727 /* RCTPushy.h in CopyFiles */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
/* End PBXCopyFilesBuildPhase section */
|
/* End PBXCopyFilesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
91C5EFFF1C76ECA90037E727 /* libRCTHotUpdate.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTHotUpdate.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
91C5EFFF1C76ECA90037E727 /* libRCTPushy.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTPushy.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
91C5F0021C76ECA90037E727 /* RCTHotUpdate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTHotUpdate.h; sourceTree = "<group>"; };
|
91C5F0021C76ECA90037E727 /* RCTPushy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTPushy.h; sourceTree = "<group>"; };
|
||||||
91C5F0041C76ECA90037E727 /* RCTHotUpdate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCTHotUpdate.m; sourceTree = "<group>"; };
|
91C5F0041C76ECA90037E727 /* RCTPushy.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCTPushy.m; sourceTree = "<group>"; };
|
||||||
9F1BCB1B1CAE5937000EF2CB /* RCTHotUpdateManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTHotUpdateManager.h; sourceTree = "<group>"; };
|
9F1BCB1B1CAE5937000EF2CB /* RCTPushyManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPushyManager.h; sourceTree = "<group>"; };
|
||||||
9F1BCB1C1CAE5937000EF2CB /* RCTHotUpdateManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTHotUpdateManager.m; sourceTree = "<group>"; };
|
9F1BCB1C1CAE5937000EF2CB /* RCTPushyManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPushyManager.m; sourceTree = "<group>"; };
|
||||||
9F1BCB3B1CAF6B3E000EF2CB /* bspatch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bspatch.c; sourceTree = "<group>"; };
|
9F1BCB3B1CAF6B3E000EF2CB /* bspatch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bspatch.c; sourceTree = "<group>"; };
|
||||||
9F1BCB3C1CAF6B3E000EF2CB /* bspatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bspatch.h; sourceTree = "<group>"; };
|
9F1BCB3C1CAF6B3E000EF2CB /* bspatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bspatch.h; sourceTree = "<group>"; };
|
||||||
9F1BCB4D1CAF6B68000EF2CB /* BSDiff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSDiff.h; sourceTree = "<group>"; };
|
9F1BCB4D1CAF6B68000EF2CB /* BSDiff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSDiff.h; sourceTree = "<group>"; };
|
||||||
9F1BCB4E1CAF6B68000EF2CB /* BSDiff.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSDiff.m; sourceTree = "<group>"; };
|
9F1BCB4E1CAF6B68000EF2CB /* BSDiff.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSDiff.m; sourceTree = "<group>"; };
|
||||||
9F292F7B1C7C44290095945D /* RCTHotUpdateDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTHotUpdateDownloader.h; sourceTree = "<group>"; };
|
9F292F7B1C7C44290095945D /* RCTPushyDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPushyDownloader.h; sourceTree = "<group>"; };
|
||||||
9F292F7C1C7C44290095945D /* RCTHotUpdateDownloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTHotUpdateDownloader.m; sourceTree = "<group>"; };
|
9F292F7C1C7C44290095945D /* RCTPushyDownloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPushyDownloader.m; sourceTree = "<group>"; };
|
||||||
9F394D591C7C25DC00C794C0 /* aes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aes.h; sourceTree = "<group>"; };
|
9F394D591C7C25DC00C794C0 /* aes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aes.h; sourceTree = "<group>"; };
|
||||||
9F394D5A1C7C25DC00C794C0 /* aes_via_ace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aes_via_ace.h; sourceTree = "<group>"; };
|
9F394D5A1C7C25DC00C794C0 /* aes_via_ace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aes_via_ace.h; sourceTree = "<group>"; };
|
||||||
9F394D5B1C7C25DC00C794C0 /* aescrypt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = aescrypt.c; sourceTree = "<group>"; };
|
9F394D5B1C7C25DC00C794C0 /* aescrypt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = aescrypt.c; sourceTree = "<group>"; };
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
91C5EFF61C76ECA90037E727 = {
|
91C5EFF61C76ECA90037E727 = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
91C5F0011C76ECA90037E727 /* RCTHotUpdate */,
|
91C5F0011C76ECA90037E727 /* RCTPushy */,
|
||||||
91C5F0001C76ECA90037E727 /* Products */,
|
91C5F0001C76ECA90037E727 /* Products */,
|
||||||
);
|
);
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -113,24 +113,24 @@
|
|||||||
91C5F0001C76ECA90037E727 /* Products */ = {
|
91C5F0001C76ECA90037E727 /* Products */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
91C5EFFF1C76ECA90037E727 /* libRCTHotUpdate.a */,
|
91C5EFFF1C76ECA90037E727 /* libRCTPushy.a */,
|
||||||
);
|
);
|
||||||
name = Products;
|
name = Products;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
91C5F0011C76ECA90037E727 /* RCTHotUpdate */ = {
|
91C5F0011C76ECA90037E727 /* RCTPushy */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
9F1BCB381CAF6B3E000EF2CB /* BSDiff */,
|
9F1BCB381CAF6B3E000EF2CB /* BSDiff */,
|
||||||
9F394D571C7C25DC00C794C0 /* SSZipArchive */,
|
9F394D571C7C25DC00C794C0 /* SSZipArchive */,
|
||||||
91C5F0021C76ECA90037E727 /* RCTHotUpdate.h */,
|
91C5F0021C76ECA90037E727 /* RCTPushy.h */,
|
||||||
91C5F0041C76ECA90037E727 /* RCTHotUpdate.m */,
|
91C5F0041C76ECA90037E727 /* RCTPushy.m */,
|
||||||
9F1BCB1B1CAE5937000EF2CB /* RCTHotUpdateManager.h */,
|
9F1BCB1B1CAE5937000EF2CB /* RCTPushyManager.h */,
|
||||||
9F1BCB1C1CAE5937000EF2CB /* RCTHotUpdateManager.m */,
|
9F1BCB1C1CAE5937000EF2CB /* RCTPushyManager.m */,
|
||||||
9F292F7B1C7C44290095945D /* RCTHotUpdateDownloader.h */,
|
9F292F7B1C7C44290095945D /* RCTPushyDownloader.h */,
|
||||||
9F292F7C1C7C44290095945D /* RCTHotUpdateDownloader.m */,
|
9F292F7C1C7C44290095945D /* RCTPushyDownloader.m */,
|
||||||
);
|
);
|
||||||
path = RCTHotUpdate;
|
path = RCTPushy;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
9F1BCB381CAF6B3E000EF2CB /* BSDiff */ = {
|
9F1BCB381CAF6B3E000EF2CB /* BSDiff */ = {
|
||||||
@@ -213,9 +213,9 @@
|
|||||||
/* End PBXGroup section */
|
/* End PBXGroup section */
|
||||||
|
|
||||||
/* Begin PBXNativeTarget section */
|
/* Begin PBXNativeTarget section */
|
||||||
91C5EFFE1C76ECA90037E727 /* RCTHotUpdate */ = {
|
91C5EFFE1C76ECA90037E727 /* RCTPushy */ = {
|
||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 91C5F0081C76ECA90037E727 /* Build configuration list for PBXNativeTarget "RCTHotUpdate" */;
|
buildConfigurationList = 91C5F0081C76ECA90037E727 /* Build configuration list for PBXNativeTarget "RCTPushy" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
91C5EFFB1C76ECA90037E727 /* Sources */,
|
91C5EFFB1C76ECA90037E727 /* Sources */,
|
||||||
91C5EFFC1C76ECA90037E727 /* Frameworks */,
|
91C5EFFC1C76ECA90037E727 /* Frameworks */,
|
||||||
@@ -225,9 +225,9 @@
|
|||||||
);
|
);
|
||||||
dependencies = (
|
dependencies = (
|
||||||
);
|
);
|
||||||
name = RCTHotUpdate;
|
name = RCTPushy;
|
||||||
productName = RCTHotUpdate;
|
productName = RCTPushy;
|
||||||
productReference = 91C5EFFF1C76ECA90037E727 /* libRCTHotUpdate.a */;
|
productReference = 91C5EFFF1C76ECA90037E727 /* libRCTPushy.a */;
|
||||||
productType = "com.apple.product-type.library.static";
|
productType = "com.apple.product-type.library.static";
|
||||||
};
|
};
|
||||||
/* End PBXNativeTarget section */
|
/* End PBXNativeTarget section */
|
||||||
@@ -244,11 +244,12 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
buildConfigurationList = 91C5EFFA1C76ECA90037E727 /* Build configuration list for PBXProject "RCTHotUpdate" */;
|
buildConfigurationList = 91C5EFFA1C76ECA90037E727 /* Build configuration list for PBXProject "RCTPushy" */;
|
||||||
compatibilityVersion = "Xcode 3.2";
|
compatibilityVersion = "Xcode 3.2";
|
||||||
developmentRegion = English;
|
developmentRegion = English;
|
||||||
hasScannedForEncodings = 0;
|
hasScannedForEncodings = 0;
|
||||||
knownRegions = (
|
knownRegions = (
|
||||||
|
English,
|
||||||
en,
|
en,
|
||||||
);
|
);
|
||||||
mainGroup = 91C5EFF61C76ECA90037E727;
|
mainGroup = 91C5EFF61C76ECA90037E727;
|
||||||
@@ -256,7 +257,7 @@
|
|||||||
projectDirPath = "";
|
projectDirPath = "";
|
||||||
projectRoot = "";
|
projectRoot = "";
|
||||||
targets = (
|
targets = (
|
||||||
91C5EFFE1C76ECA90037E727 /* RCTHotUpdate */,
|
91C5EFFE1C76ECA90037E727 /* RCTPushy */,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
/* End PBXProject section */
|
/* End PBXProject section */
|
||||||
@@ -271,20 +272,20 @@
|
|||||||
9F394D871C7C25DC00C794C0 /* mztools.c in Sources */,
|
9F394D871C7C25DC00C794C0 /* mztools.c in Sources */,
|
||||||
9F394D821C7C25DC00C794C0 /* hmac.c in Sources */,
|
9F394D821C7C25DC00C794C0 /* hmac.c in Sources */,
|
||||||
9F394D881C7C25DC00C794C0 /* unzip.c in Sources */,
|
9F394D881C7C25DC00C794C0 /* unzip.c in Sources */,
|
||||||
9F1BCB1D1CAE5937000EF2CB /* RCTHotUpdateManager.m in Sources */,
|
9F1BCB1D1CAE5937000EF2CB /* RCTPushyManager.m in Sources */,
|
||||||
9F1BCB4F1CAF6B68000EF2CB /* BSDiff.m in Sources */,
|
9F1BCB4F1CAF6B68000EF2CB /* BSDiff.m in Sources */,
|
||||||
9F394D7E1C7C25DC00C794C0 /* aeskey.c in Sources */,
|
9F394D7E1C7C25DC00C794C0 /* aeskey.c in Sources */,
|
||||||
9F394D7F1C7C25DC00C794C0 /* aestab.c in Sources */,
|
9F394D7F1C7C25DC00C794C0 /* aestab.c in Sources */,
|
||||||
9F394D7D1C7C25DC00C794C0 /* aescrypt.c in Sources */,
|
9F394D7D1C7C25DC00C794C0 /* aescrypt.c in Sources */,
|
||||||
9F394D801C7C25DC00C794C0 /* entropy.c in Sources */,
|
9F394D801C7C25DC00C794C0 /* entropy.c in Sources */,
|
||||||
9F292F7D1C7C44290095945D /* RCTHotUpdateDownloader.m in Sources */,
|
9F292F7D1C7C44290095945D /* RCTPushyDownloader.m in Sources */,
|
||||||
9F394D831C7C25DC00C794C0 /* prng.c in Sources */,
|
9F394D831C7C25DC00C794C0 /* prng.c in Sources */,
|
||||||
9F394D861C7C25DC00C794C0 /* ioapi.c in Sources */,
|
9F394D861C7C25DC00C794C0 /* ioapi.c in Sources */,
|
||||||
9F1BCB461CAF6B3E000EF2CB /* bspatch.c in Sources */,
|
9F1BCB461CAF6B3E000EF2CB /* bspatch.c in Sources */,
|
||||||
9F394D8A1C7C25DC00C794C0 /* SSZipArchive.m in Sources */,
|
9F394D8A1C7C25DC00C794C0 /* SSZipArchive.m in Sources */,
|
||||||
9F394D891C7C25DC00C794C0 /* zip.c in Sources */,
|
9F394D891C7C25DC00C794C0 /* zip.c in Sources */,
|
||||||
9F394D841C7C25DC00C794C0 /* pwd2key.c in Sources */,
|
9F394D841C7C25DC00C794C0 /* pwd2key.c in Sources */,
|
||||||
91C5F0051C76ECA90037E727 /* RCTHotUpdate.m in Sources */,
|
91C5F0051C76ECA90037E727 /* RCTPushy.m in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -400,7 +401,7 @@
|
|||||||
/* End XCBuildConfiguration section */
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
/* Begin XCConfigurationList section */
|
/* Begin XCConfigurationList section */
|
||||||
91C5EFFA1C76ECA90037E727 /* Build configuration list for PBXProject "RCTHotUpdate" */ = {
|
91C5EFFA1C76ECA90037E727 /* Build configuration list for PBXProject "RCTPushy" */ = {
|
||||||
isa = XCConfigurationList;
|
isa = XCConfigurationList;
|
||||||
buildConfigurations = (
|
buildConfigurations = (
|
||||||
91C5F0061C76ECA90037E727 /* Debug */,
|
91C5F0061C76ECA90037E727 /* Debug */,
|
||||||
@@ -409,7 +410,7 @@
|
|||||||
defaultConfigurationIsVisible = 0;
|
defaultConfigurationIsVisible = 0;
|
||||||
defaultConfigurationName = Release;
|
defaultConfigurationName = Release;
|
||||||
};
|
};
|
||||||
91C5F0081C76ECA90037E727 /* Build configuration list for PBXNativeTarget "RCTHotUpdate" */ = {
|
91C5F0081C76ECA90037E727 /* Build configuration list for PBXNativeTarget "RCTPushy" */ = {
|
||||||
isa = XCConfigurationList;
|
isa = XCConfigurationList;
|
||||||
buildConfigurations = (
|
buildConfigurations = (
|
||||||
91C5F0091C76ECA90037E727 /* Debug */,
|
91C5F0091C76ECA90037E727 /* Debug */,
|
@@ -1,6 +1,6 @@
|
|||||||
//
|
//
|
||||||
// BSDiff.h
|
// BSDiff.h
|
||||||
// RCTHotUpdate
|
// RCTPushy
|
||||||
//
|
//
|
||||||
// Created by lvbingru on 16/4/2.
|
// Created by lvbingru on 16/4/2.
|
||||||
// Copyright © 2016年 erica. All rights reserved.
|
// Copyright © 2016年 erica. All rights reserved.
|
@@ -1,6 +1,6 @@
|
|||||||
//
|
//
|
||||||
// BSDiff.m
|
// BSDiff.m
|
||||||
// RCTHotUpdate
|
// RCTPushy
|
||||||
//
|
//
|
||||||
// Created by lvbingru on 16/4/2.
|
// Created by lvbingru on 16/4/2.
|
||||||
// Copyright © 2016年 erica. All rights reserved.
|
// Copyright © 2016年 erica. All rights reserved.
|
@@ -1,6 +1,6 @@
|
|||||||
//
|
//
|
||||||
// RCTHotUpdate.h
|
// RCTPushy.h
|
||||||
// RCTHotUpdate
|
// RCTPushy
|
||||||
//
|
//
|
||||||
// Created by LvBingru on 2/19/16.
|
// Created by LvBingru on 2/19/16.
|
||||||
// Copyright © 2016 erica. All rights reserved.
|
// Copyright © 2016 erica. All rights reserved.
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
#import "RCTBridgeModule.h"
|
#import "RCTBridgeModule.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@interface RCTHotUpdate : NSObject<RCTBridgeModule>
|
@interface RCTPushy : NSObject<RCTBridgeModule>
|
||||||
|
|
||||||
+ (NSURL *)bundleURL;
|
+ (NSURL *)bundleURL;
|
||||||
|
|
@@ -1,14 +1,14 @@
|
|||||||
//
|
//
|
||||||
// RCTHotUpdate.m
|
// RCTPushy.m
|
||||||
// RCTHotUpdate
|
// RCTPushy
|
||||||
//
|
//
|
||||||
// Created by LvBingru on 2/19/16.
|
// Created by LvBingru on 2/19/16.
|
||||||
// Copyright © 2016 erica. All rights reserved.
|
// Copyright © 2016 erica. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "RCTHotUpdate.h"
|
#import "RCTPushy.h"
|
||||||
#import "RCTHotUpdateDownloader.h"
|
#import "RCTPushyDownloader.h"
|
||||||
#import "RCTHotUpdateManager.h"
|
#import "RCTPushyManager.h"
|
||||||
|
|
||||||
#if __has_include(<React/RCTBridge.h>)
|
#if __has_include(<React/RCTBridge.h>)
|
||||||
#import "React/RCTEventDispatcher.h"
|
#import "React/RCTEventDispatcher.h"
|
||||||
@@ -21,15 +21,15 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
static NSString *const keyUpdateInfo = @"REACTNATIVECN_HOTUPDATE_INFO_KEY";
|
static NSString *const keyPushyInfo = @"REACTNATIVECN_PUSHY_INFO_KEY";
|
||||||
static NSString *const paramPackageVersion = @"packageVersion";
|
static NSString *const paramPackageVersion = @"packageVersion";
|
||||||
static NSString *const paramLastVersion = @"lastVersion";
|
static NSString *const paramLastVersion = @"lastVersion";
|
||||||
static NSString *const paramCurrentVersion = @"currentVersion";
|
static NSString *const paramCurrentVersion = @"currentVersion";
|
||||||
static NSString *const paramIsFirstTime = @"isFirstTime";
|
static NSString *const paramIsFirstTime = @"isFirstTime";
|
||||||
static NSString *const paramIsFirstLoadOk = @"isFirstLoadOK";
|
static NSString *const paramIsFirstLoadOk = @"isFirstLoadOK";
|
||||||
static NSString *const keyFirstLoadMarked = @"REACTNATIVECN_HOTUPDATE_FIRSTLOADMARKED_KEY";
|
static NSString *const keyFirstLoadMarked = @"REACTNATIVECN_PUSHY_FIRSTLOADMARKED_KEY";
|
||||||
static NSString *const keyRolledBackMarked = @"REACTNATIVECN_HOTUPDATE_ROLLEDBACKMARKED_KEY";
|
static NSString *const keyRolledBackMarked = @"REACTNATIVECN_PUSHY_ROLLEDBACKMARKED_KEY";
|
||||||
static NSString *const KeyPackageUpdatedMarked = @"REACTNATIVECN_HOTUPDATE_ISPACKAGEUPDATEDMARKED_KEY";
|
static NSString *const KeyPackageUpdatedMarked = @"REACTNATIVECN_PUSHY_ISPACKAGEUPDATEDMARKED_KEY";
|
||||||
|
|
||||||
// app info
|
// app info
|
||||||
static NSString * const AppVersionKey = @"appVersion";
|
static NSString * const AppVersionKey = @"appVersion";
|
||||||
@@ -46,52 +46,52 @@ static NSString * const ERROR_BSDIFF = @"bsdiff error";
|
|||||||
static NSString * const ERROR_FILE_OPERATION = @"file operation error";
|
static NSString * const ERROR_FILE_OPERATION = @"file operation error";
|
||||||
|
|
||||||
// event def
|
// event def
|
||||||
static NSString * const EVENT_PROGRESS_DOWNLOAD = @"RCTHotUpdateDownloadProgress";
|
static NSString * const EVENT_PROGRESS_DOWNLOAD = @"RCTPushyDownloadProgress";
|
||||||
static NSString * const EVENT_PROGRESS_UNZIP = @"RCTHotUpdateUnzipProgress";
|
static NSString * const EVENT_PROGRESS_UNZIP = @"RCTPushyUnzipProgress";
|
||||||
static NSString * const PARAM_PROGRESS_HASHNAME = @"hashname";
|
static NSString * const PARAM_PROGRESS_HASHNAME = @"hashname";
|
||||||
static NSString * const PARAM_PROGRESS_RECEIVED = @"received";
|
static NSString * const PARAM_PROGRESS_RECEIVED = @"received";
|
||||||
static NSString * const PARAM_PROGRESS_TOTAL = @"total";
|
static NSString * const PARAM_PROGRESS_TOTAL = @"total";
|
||||||
|
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, HotUpdateType) {
|
typedef NS_ENUM(NSInteger, PushyType) {
|
||||||
HotUpdateTypeFullDownload = 1,
|
PushyTypeFullDownload = 1,
|
||||||
HotUpdateTypePatchFromPackage = 2,
|
PushyTypePatchFromPackage = 2,
|
||||||
HotUpdateTypePatchFromPpk = 3,
|
PushyTypePatchFromPpk = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
static BOOL ignoreRollback = false;
|
static BOOL ignoreRollback = false;
|
||||||
|
|
||||||
@implementation RCTHotUpdate {
|
@implementation RCTPushy {
|
||||||
RCTHotUpdateManager *_fileManager;
|
RCTPushyManager *_fileManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@synthesize bridge = _bridge;
|
@synthesize bridge = _bridge;
|
||||||
@synthesize methodQueue = _methodQueue;
|
@synthesize methodQueue = _methodQueue;
|
||||||
|
|
||||||
RCT_EXPORT_MODULE(RCTHotUpdate);
|
RCT_EXPORT_MODULE(RCTPushy);
|
||||||
|
|
||||||
+ (NSURL *)bundleURL
|
+ (NSURL *)bundleURL
|
||||||
{
|
{
|
||||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||||
|
|
||||||
NSDictionary *updateInfo = [defaults dictionaryForKey:keyUpdateInfo];
|
NSDictionary *pushyInfo = [defaults dictionaryForKey:keyPushyInfo];
|
||||||
if (updateInfo) {
|
if (pushyInfo) {
|
||||||
NSString *curPackageVersion = [RCTHotUpdate packageVersion];
|
NSString *curPackageVersion = [RCTPushy packageVersion];
|
||||||
NSString *packageVersion = [updateInfo objectForKey:paramPackageVersion];
|
NSString *packageVersion = [pushyInfo objectForKey:paramPackageVersion];
|
||||||
|
|
||||||
BOOL needClearUpdateInfo = ![curPackageVersion isEqualToString:packageVersion];
|
BOOL needClearPushyInfo = ![curPackageVersion isEqualToString:packageVersion];
|
||||||
if (needClearUpdateInfo) {
|
if (needClearPushyInfo) {
|
||||||
[defaults setObject:nil forKey:keyUpdateInfo];
|
[defaults setObject:nil forKey:keyPushyInfo];
|
||||||
[defaults setObject:@(YES) forKey:KeyPackageUpdatedMarked];
|
[defaults setObject:@(YES) forKey:KeyPackageUpdatedMarked];
|
||||||
[defaults synchronize];
|
[defaults synchronize];
|
||||||
// ...need clear files later
|
// ...need clear files later
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
NSString *curVersion = updateInfo[paramCurrentVersion];
|
NSString *curVersion = pushyInfo[paramCurrentVersion];
|
||||||
NSString *lastVersion = updateInfo[paramLastVersion];
|
NSString *lastVersion = pushyInfo[paramLastVersion];
|
||||||
|
|
||||||
BOOL isFirstTime = [updateInfo[paramIsFirstTime] boolValue];
|
BOOL isFirstTime = [pushyInfo[paramIsFirstTime] boolValue];
|
||||||
BOOL isFirstLoadOK = [updateInfo[paramIsFirstLoadOk] boolValue];
|
BOOL isFirstLoadOK = [pushyInfo[paramIsFirstLoadOk] boolValue];
|
||||||
|
|
||||||
NSString *loadVersioin = curVersion;
|
NSString *loadVersioin = curVersion;
|
||||||
BOOL needRollback = (!ignoreRollback && isFirstTime == NO && isFirstLoadOK == NO) || loadVersioin.length<=0;
|
BOOL needRollback = (!ignoreRollback && isFirstTime == NO && isFirstLoadOK == NO) || loadVersioin.length<=0;
|
||||||
@@ -104,11 +104,11 @@ RCT_EXPORT_MODULE(RCTHotUpdate);
|
|||||||
paramIsFirstTime:@(NO),
|
paramIsFirstTime:@(NO),
|
||||||
paramIsFirstLoadOk:@(YES),
|
paramIsFirstLoadOk:@(YES),
|
||||||
paramPackageVersion:curPackageVersion}
|
paramPackageVersion:curPackageVersion}
|
||||||
forKey:keyUpdateInfo];
|
forKey:keyPushyInfo];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// roll back to bundle
|
// roll back to bundle
|
||||||
[defaults setObject:nil forKey:keyUpdateInfo];
|
[defaults setObject:nil forKey:keyPushyInfo];
|
||||||
}
|
}
|
||||||
[defaults setObject:@(YES) forKey:keyRolledBackMarked];
|
[defaults setObject:@(YES) forKey:keyRolledBackMarked];
|
||||||
[defaults synchronize];
|
[defaults synchronize];
|
||||||
@@ -118,15 +118,15 @@ RCT_EXPORT_MODULE(RCTHotUpdate);
|
|||||||
// bundleURL may be called many times, ignore rollbacks before process restarted again.
|
// bundleURL may be called many times, ignore rollbacks before process restarted again.
|
||||||
ignoreRollback = true;
|
ignoreRollback = true;
|
||||||
|
|
||||||
NSMutableDictionary *newInfo = [[NSMutableDictionary alloc] initWithDictionary:updateInfo];
|
NSMutableDictionary *newInfo = [[NSMutableDictionary alloc] initWithDictionary:pushyInfo];
|
||||||
newInfo[paramIsFirstTime] = @(NO);
|
newInfo[paramIsFirstTime] = @(NO);
|
||||||
[defaults setObject:newInfo forKey:keyUpdateInfo];
|
[defaults setObject:newInfo forKey:keyPushyInfo];
|
||||||
[defaults setObject:@(YES) forKey:keyFirstLoadMarked];
|
[defaults setObject:@(YES) forKey:keyFirstLoadMarked];
|
||||||
[defaults synchronize];
|
[defaults synchronize];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loadVersioin.length) {
|
if (loadVersioin.length) {
|
||||||
NSString *downloadDir = [RCTHotUpdate downloadDir];
|
NSString *downloadDir = [RCTPushy downloadDir];
|
||||||
|
|
||||||
NSString *bundlePath = [[downloadDir stringByAppendingPathComponent:loadVersioin] stringByAppendingPathComponent:BUNDLE_FILE_NAME];
|
NSString *bundlePath = [[downloadDir stringByAppendingPathComponent:loadVersioin] stringByAppendingPathComponent:BUNDLE_FILE_NAME];
|
||||||
if ([[NSFileManager defaultManager] fileExistsAtPath:bundlePath isDirectory:NULL]) {
|
if ([[NSFileManager defaultManager] fileExistsAtPath:bundlePath isDirectory:NULL]) {
|
||||||
@@ -137,7 +137,7 @@ RCT_EXPORT_MODULE(RCTHotUpdate);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return [RCTHotUpdate binaryBundleURL];
|
return [RCTPushy binaryBundleURL];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (BOOL)requiresMainQueueSetup {
|
+ (BOOL)requiresMainQueueSetup {
|
||||||
@@ -150,13 +150,13 @@ RCT_EXPORT_MODULE(RCTHotUpdate);
|
|||||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||||
|
|
||||||
NSMutableDictionary *ret = [NSMutableDictionary new];
|
NSMutableDictionary *ret = [NSMutableDictionary new];
|
||||||
ret[@"downloadRootDir"] = [RCTHotUpdate downloadDir];
|
ret[@"downloadRootDir"] = [RCTPushy downloadDir];
|
||||||
ret[@"packageVersion"] = [RCTHotUpdate packageVersion];
|
ret[@"packageVersion"] = [RCTPushy packageVersion];
|
||||||
ret[@"buildTime"] = [RCTHotUpdate buildTime];
|
ret[@"buildTime"] = [RCTPushy buildTime];
|
||||||
ret[@"isRolledBack"] = [defaults objectForKey:keyRolledBackMarked];
|
ret[@"isRolledBack"] = [defaults objectForKey:keyRolledBackMarked];
|
||||||
ret[@"isFirstTime"] = [defaults objectForKey:keyFirstLoadMarked];
|
ret[@"isFirstTime"] = [defaults objectForKey:keyFirstLoadMarked];
|
||||||
NSDictionary *updateInfo = [defaults dictionaryForKey:keyUpdateInfo];
|
NSDictionary *pushyInfo = [defaults dictionaryForKey:keyPushyInfo];
|
||||||
ret[@"currentVersion"] = [updateInfo objectForKey:paramCurrentVersion];
|
ret[@"currentVersion"] = [pushyInfo objectForKey:paramCurrentVersion];
|
||||||
|
|
||||||
// clear isFirstTimemarked
|
// clear isFirstTimemarked
|
||||||
if ([[defaults objectForKey:keyFirstLoadMarked] boolValue]) {
|
if ([[defaults objectForKey:keyFirstLoadMarked] boolValue]) {
|
||||||
@@ -183,7 +183,7 @@ RCT_EXPORT_MODULE(RCTHotUpdate);
|
|||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self) {
|
if (self) {
|
||||||
_fileManager = [RCTHotUpdateManager new];
|
_fileManager = [RCTPushyManager new];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -192,7 +192,7 @@ RCT_EXPORT_METHOD(downloadUpdate:(NSDictionary *)options
|
|||||||
resolver:(RCTPromiseResolveBlock)resolve
|
resolver:(RCTPromiseResolveBlock)resolve
|
||||||
rejecter:(RCTPromiseRejectBlock)reject)
|
rejecter:(RCTPromiseRejectBlock)reject)
|
||||||
{
|
{
|
||||||
[self hotUpdate:HotUpdateTypeFullDownload options:options callback:^(NSError *error) {
|
[self doPushy:PushyTypeFullDownload options:options callback:^(NSError *error) {
|
||||||
if (error) {
|
if (error) {
|
||||||
reject([NSString stringWithFormat: @"%lu", (long)error.code], error.localizedDescription, error);
|
reject([NSString stringWithFormat: @"%lu", (long)error.code], error.localizedDescription, error);
|
||||||
}
|
}
|
||||||
@@ -206,7 +206,7 @@ RCT_EXPORT_METHOD(downloadPatchFromPackage:(NSDictionary *)options
|
|||||||
resolver:(RCTPromiseResolveBlock)resolve
|
resolver:(RCTPromiseResolveBlock)resolve
|
||||||
rejecter:(RCTPromiseRejectBlock)reject)
|
rejecter:(RCTPromiseRejectBlock)reject)
|
||||||
{
|
{
|
||||||
[self hotUpdate:HotUpdateTypePatchFromPackage options:options callback:^(NSError *error) {
|
[self doPushy:PushyTypePatchFromPackage options:options callback:^(NSError *error) {
|
||||||
if (error) {
|
if (error) {
|
||||||
reject([NSString stringWithFormat: @"%lu", (long)error.code], error.localizedDescription, error);
|
reject([NSString stringWithFormat: @"%lu", (long)error.code], error.localizedDescription, error);
|
||||||
}
|
}
|
||||||
@@ -220,7 +220,7 @@ RCT_EXPORT_METHOD(downloadPatchFromPpk:(NSDictionary *)options
|
|||||||
resolver:(RCTPromiseResolveBlock)resolve
|
resolver:(RCTPromiseResolveBlock)resolve
|
||||||
rejecter:(RCTPromiseRejectBlock)reject)
|
rejecter:(RCTPromiseRejectBlock)reject)
|
||||||
{
|
{
|
||||||
[self hotUpdate:HotUpdateTypePatchFromPpk options:options callback:^(NSError *error) {
|
[self doPushy:PushyTypePatchFromPpk options:options callback:^(NSError *error) {
|
||||||
if (error) {
|
if (error) {
|
||||||
reject([NSString stringWithFormat: @"%lu", (long)error.code], error.localizedDescription, error);
|
reject([NSString stringWithFormat: @"%lu", (long)error.code], error.localizedDescription, error);
|
||||||
}
|
}
|
||||||
@@ -236,9 +236,9 @@ RCT_EXPORT_METHOD(setNeedUpdate:(NSDictionary *)options)
|
|||||||
if (hashName.length) {
|
if (hashName.length) {
|
||||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||||
NSString *lastVersion = nil;
|
NSString *lastVersion = nil;
|
||||||
if ([defaults objectForKey:keyUpdateInfo]) {
|
if ([defaults objectForKey:keyPushyInfo]) {
|
||||||
NSDictionary *updateInfo = [defaults objectForKey:keyUpdateInfo];
|
NSDictionary *pushyInfo = [defaults objectForKey:keyPushyInfo];
|
||||||
lastVersion = updateInfo[paramCurrentVersion];
|
lastVersion = pushyInfo[paramCurrentVersion];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSMutableDictionary *newInfo = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary *newInfo = [[NSMutableDictionary alloc] init];
|
||||||
@@ -246,8 +246,8 @@ RCT_EXPORT_METHOD(setNeedUpdate:(NSDictionary *)options)
|
|||||||
newInfo[paramLastVersion] = lastVersion;
|
newInfo[paramLastVersion] = lastVersion;
|
||||||
newInfo[paramIsFirstTime] = @(YES);
|
newInfo[paramIsFirstTime] = @(YES);
|
||||||
newInfo[paramIsFirstLoadOk] = @(NO);
|
newInfo[paramIsFirstLoadOk] = @(NO);
|
||||||
newInfo[paramPackageVersion] = [RCTHotUpdate packageVersion];
|
newInfo[paramPackageVersion] = [RCTPushy packageVersion];
|
||||||
[defaults setObject:newInfo forKey:keyUpdateInfo];
|
[defaults setObject:newInfo forKey:keyPushyInfo];
|
||||||
|
|
||||||
[defaults synchronize];
|
[defaults synchronize];
|
||||||
}
|
}
|
||||||
@@ -269,12 +269,12 @@ RCT_EXPORT_METHOD(reloadUpdate:(NSDictionary *)options)
|
|||||||
|
|
||||||
RCT_EXPORT_METHOD(markSuccess)
|
RCT_EXPORT_METHOD(markSuccess)
|
||||||
{
|
{
|
||||||
// update package info
|
// up package info
|
||||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||||
NSMutableDictionary *packageInfo = [[NSMutableDictionary alloc] initWithDictionary:[defaults objectForKey:keyUpdateInfo]];
|
NSMutableDictionary *packageInfo = [[NSMutableDictionary alloc] initWithDictionary:[defaults objectForKey:keyPushyInfo]];
|
||||||
[packageInfo setObject:@(NO) forKey:paramIsFirstTime];
|
[packageInfo setObject:@(NO) forKey:paramIsFirstTime];
|
||||||
[packageInfo setObject:@(YES) forKey:paramIsFirstLoadOk];
|
[packageInfo setObject:@(YES) forKey:paramIsFirstLoadOk];
|
||||||
[defaults setObject:packageInfo forKey:keyUpdateInfo];
|
[defaults setObject:packageInfo forKey:keyPushyInfo];
|
||||||
[defaults synchronize];
|
[defaults synchronize];
|
||||||
|
|
||||||
// clear other package dir
|
// clear other package dir
|
||||||
@@ -282,7 +282,7 @@ RCT_EXPORT_METHOD(markSuccess)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - private
|
#pragma mark - private
|
||||||
- (void)hotUpdate:(HotUpdateType)type options:(NSDictionary *)options callback:(void (^)(NSError *error))callback
|
- (void)doPushy:(PushyType)type options:(NSDictionary *)options callback:(void (^)(NSError *error))callback
|
||||||
{
|
{
|
||||||
NSString *updateUrl = [RCTConvert NSString:options[@"updateUrl"]];
|
NSString *updateUrl = [RCTConvert NSString:options[@"updateUrl"]];
|
||||||
NSString *hashName = [RCTConvert NSString:options[@"hashName"]];
|
NSString *hashName = [RCTConvert NSString:options[@"hashName"]];
|
||||||
@@ -291,12 +291,12 @@ RCT_EXPORT_METHOD(markSuccess)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
NSString *originHashName = [RCTConvert NSString:options[@"originHashName"]];
|
NSString *originHashName = [RCTConvert NSString:options[@"originHashName"]];
|
||||||
if (type == HotUpdateTypePatchFromPpk && originHashName<=0) {
|
if (type == PushyTypePatchFromPpk && originHashName<=0) {
|
||||||
callback([self errorWithMessage:ERROR_OPTIONS]);
|
callback([self errorWithMessage:ERROR_OPTIONS]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSString *dir = [RCTHotUpdate downloadDir];
|
NSString *dir = [RCTPushy downloadDir];
|
||||||
BOOL success = [_fileManager createDir:dir];
|
BOOL success = [_fileManager createDir:dir];
|
||||||
if (!success) {
|
if (!success) {
|
||||||
callback([self errorWithMessage:ERROR_FILE_OPERATION]);
|
callback([self errorWithMessage:ERROR_FILE_OPERATION]);
|
||||||
@@ -306,8 +306,8 @@ RCT_EXPORT_METHOD(markSuccess)
|
|||||||
NSString *zipFilePath = [dir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@%@",hashName, [self zipExtension:type]]];
|
NSString *zipFilePath = [dir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@%@",hashName, [self zipExtension:type]]];
|
||||||
NSString *unzipDir = [dir stringByAppendingPathComponent:hashName];
|
NSString *unzipDir = [dir stringByAppendingPathComponent:hashName];
|
||||||
|
|
||||||
RCTLogInfo(@"RNUpdate -- download file %@", updateUrl);
|
RCTLogInfo(@"RCTPushy -- download file %@", updateUrl);
|
||||||
[RCTHotUpdateDownloader download:updateUrl savePath:zipFilePath progressHandler:^(long long receivedBytes, long long totalBytes) {
|
[RCTPushyDownloader download:updateUrl savePath:zipFilePath progressHandler:^(long long receivedBytes, long long totalBytes) {
|
||||||
[self.bridge.eventDispatcher sendAppEventWithName:EVENT_PROGRESS_DOWNLOAD
|
[self.bridge.eventDispatcher sendAppEventWithName:EVENT_PROGRESS_DOWNLOAD
|
||||||
body:@{
|
body:@{
|
||||||
PARAM_PROGRESS_HASHNAME:hashName,
|
PARAM_PROGRESS_HASHNAME:hashName,
|
||||||
@@ -319,7 +319,7 @@ RCT_EXPORT_METHOD(markSuccess)
|
|||||||
callback(error);
|
callback(error);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
RCTLogInfo(@"RNUpdate -- unzip file %@", zipFilePath);
|
RCTLogInfo(@"RCTPushy -- unzip file %@", zipFilePath);
|
||||||
NSString *unzipFilePath = [dir stringByAppendingPathComponent:hashName];
|
NSString *unzipFilePath = [dir stringByAppendingPathComponent:hashName];
|
||||||
[_fileManager unzipFileAtPath:zipFilePath toDestination:unzipFilePath progressHandler:^(NSString *entry,long entryNumber, long total) {
|
[_fileManager unzipFileAtPath:zipFilePath toDestination:unzipFilePath progressHandler:^(NSString *entry,long entryNumber, long total) {
|
||||||
[self.bridge.eventDispatcher sendAppEventWithName:EVENT_PROGRESS_UNZIP
|
[self.bridge.eventDispatcher sendAppEventWithName:EVENT_PROGRESS_UNZIP
|
||||||
@@ -336,14 +336,14 @@ RCT_EXPORT_METHOD(markSuccess)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case HotUpdateTypePatchFromPackage:
|
case PushyTypePatchFromPackage:
|
||||||
{
|
{
|
||||||
NSString *sourceOrigin = [[NSBundle mainBundle] resourcePath];
|
NSString *sourceOrigin = [[NSBundle mainBundle] resourcePath];
|
||||||
NSString *bundleOrigin = [[RCTHotUpdate binaryBundleURL] path];
|
NSString *bundleOrigin = [[RCTPushy binaryBundleURL] path];
|
||||||
[self patch:hashName fromBundle:bundleOrigin source:sourceOrigin callback:callback];
|
[self patch:hashName fromBundle:bundleOrigin source:sourceOrigin callback:callback];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case HotUpdateTypePatchFromPpk:
|
case PushyTypePatchFromPpk:
|
||||||
{
|
{
|
||||||
NSString *lastVertionDir = [dir stringByAppendingPathComponent:originHashName];
|
NSString *lastVertionDir = [dir stringByAppendingPathComponent:originHashName];
|
||||||
|
|
||||||
@@ -365,7 +365,7 @@ RCT_EXPORT_METHOD(markSuccess)
|
|||||||
|
|
||||||
- (void)patch:(NSString *)hashName fromBundle:(NSString *)bundleOrigin source:(NSString *)sourceOrigin callback:(void (^)(NSError *error))callback
|
- (void)patch:(NSString *)hashName fromBundle:(NSString *)bundleOrigin source:(NSString *)sourceOrigin callback:(void (^)(NSError *error))callback
|
||||||
{
|
{
|
||||||
NSString *unzipDir = [[RCTHotUpdate downloadDir] stringByAppendingPathComponent:hashName];
|
NSString *unzipDir = [[RCTPushy downloadDir] stringByAppendingPathComponent:hashName];
|
||||||
NSString *sourcePatch = [unzipDir stringByAppendingPathComponent:SOURCE_PATCH_NAME];
|
NSString *sourcePatch = [unzipDir stringByAppendingPathComponent:SOURCE_PATCH_NAME];
|
||||||
NSString *bundlePatch = [unzipDir stringByAppendingPathComponent:BUNDLE_PATCH_NAME];
|
NSString *bundlePatch = [unzipDir stringByAppendingPathComponent:BUNDLE_PATCH_NAME];
|
||||||
|
|
||||||
@@ -401,10 +401,10 @@ RCT_EXPORT_METHOD(markSuccess)
|
|||||||
- (void)clearInvalidFiles
|
- (void)clearInvalidFiles
|
||||||
{
|
{
|
||||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||||
NSDictionary *updateInfo = [defaults objectForKey:keyUpdateInfo];
|
NSDictionary *pushyInfo = [defaults objectForKey:keyPushyInfo];
|
||||||
NSString *curVersion = [updateInfo objectForKey:paramCurrentVersion];
|
NSString *curVersion = [pushyInfo objectForKey:paramCurrentVersion];
|
||||||
|
|
||||||
NSString *downloadDir = [RCTHotUpdate downloadDir];
|
NSString *downloadDir = [RCTPushy downloadDir];
|
||||||
NSError *error = nil;
|
NSError *error = nil;
|
||||||
NSArray *list = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:downloadDir error:&error];
|
NSArray *list = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:downloadDir error:&error];
|
||||||
if (error) {
|
if (error) {
|
||||||
@@ -418,14 +418,14 @@ RCT_EXPORT_METHOD(markSuccess)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)zipExtension:(HotUpdateType)type
|
- (NSString *)zipExtension:(PushyType)type
|
||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case HotUpdateTypeFullDownload:
|
case PushyTypeFullDownload:
|
||||||
return @".ppk";
|
return @".ppk";
|
||||||
case HotUpdateTypePatchFromPackage:
|
case PushyTypePatchFromPackage:
|
||||||
return @".apk.patch";
|
return @".ipa.patch";
|
||||||
case HotUpdateTypePatchFromPpk:
|
case PushyTypePatchFromPpk:
|
||||||
return @".ppk.patch";
|
return @".ppk.patch";
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -434,7 +434,7 @@ RCT_EXPORT_METHOD(markSuccess)
|
|||||||
|
|
||||||
- (NSError *)errorWithMessage:(NSString *)errorMessage
|
- (NSError *)errorWithMessage:(NSString *)errorMessage
|
||||||
{
|
{
|
||||||
return [NSError errorWithDomain:@"cn.reactnative.hotupdate"
|
return [NSError errorWithDomain:@"cn.reactnative.pushy"
|
||||||
code:-1
|
code:-1
|
||||||
userInfo:@{ NSLocalizedDescriptionKey: errorMessage}];
|
userInfo:@{ NSLocalizedDescriptionKey: errorMessage}];
|
||||||
}
|
}
|
||||||
@@ -442,7 +442,7 @@ RCT_EXPORT_METHOD(markSuccess)
|
|||||||
+ (NSString *)downloadDir
|
+ (NSString *)downloadDir
|
||||||
{
|
{
|
||||||
NSString *directory = [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) firstObject];
|
NSString *directory = [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) firstObject];
|
||||||
NSString *downloadDir = [directory stringByAppendingPathComponent:@"reactnativecnhotupdate"];
|
NSString *downloadDir = [directory stringByAppendingPathComponent:@"rctpushy"];
|
||||||
|
|
||||||
return downloadDir;
|
return downloadDir;
|
||||||
}
|
}
|
@@ -1,6 +1,6 @@
|
|||||||
//
|
//
|
||||||
// RCTHotUpdateDownloader.h
|
// RCTPushyDownloader.h
|
||||||
// RCTHotUpdate
|
// RCTPushy
|
||||||
//
|
//
|
||||||
// Created by lvbingru on 16/2/23.
|
// Created by lvbingru on 16/2/23.
|
||||||
// Copyright © 2016年 erica. All rights reserved.
|
// Copyright © 2016年 erica. All rights reserved.
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
@interface RCTHotUpdateDownloader : NSObject
|
@interface RCTPushyDownloader : NSObject
|
||||||
|
|
||||||
+ (void)download:(NSString *)downloadPath savePath:(NSString *)savePath
|
+ (void)download:(NSString *)downloadPath savePath:(NSString *)savePath
|
||||||
progressHandler:(void (^)(long long, long long))progressHandler
|
progressHandler:(void (^)(long long, long long))progressHandler
|
@@ -1,21 +1,21 @@
|
|||||||
//
|
//
|
||||||
// RCTHotUpdateDownloader.m
|
// RCTPushyDownloader.m
|
||||||
// RCTHotUpdate
|
// RCTPushy
|
||||||
//
|
//
|
||||||
// Created by lvbingru on 16/2/23.
|
// Created by lvbingru on 16/2/23.
|
||||||
// Copyright © 2016年 erica. All rights reserved.
|
// Copyright © 2016年 erica. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "RCTHotUpdateDownloader.h"
|
#import "RCTPushyDownloader.h"
|
||||||
|
|
||||||
@interface RCTHotUpdateDownloader()<NSURLSessionDelegate>
|
@interface RCTPushyDownloader()<NSURLSessionDelegate>
|
||||||
|
|
||||||
@property (copy) void (^progressHandler)(long long, long long);
|
@property (copy) void (^progressHandler)(long long, long long);
|
||||||
@property (copy) void (^completionHandler)(NSString*, NSError*);
|
@property (copy) void (^completionHandler)(NSString*, NSError*);
|
||||||
@property (copy) NSString *savePath;
|
@property (copy) NSString *savePath;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation RCTHotUpdateDownloader
|
@implementation RCTPushyDownloader
|
||||||
|
|
||||||
+ (void)download:(NSString *)downloadPath savePath:(NSString *)savePath
|
+ (void)download:(NSString *)downloadPath savePath:(NSString *)savePath
|
||||||
progressHandler:(void (^)(long long receivedBytes, long long totalBytes))progressHandler
|
progressHandler:(void (^)(long long receivedBytes, long long totalBytes))progressHandler
|
||||||
@@ -24,7 +24,7 @@ completionHandler:(void (^)(NSString *path, NSError *error))completionHandler
|
|||||||
NSAssert(downloadPath, @"no download path");
|
NSAssert(downloadPath, @"no download path");
|
||||||
NSAssert(savePath, @"no save path");
|
NSAssert(savePath, @"no save path");
|
||||||
|
|
||||||
RCTHotUpdateDownloader *downloader = [RCTHotUpdateDownloader new];
|
RCTPushyDownloader *downloader = [RCTPushyDownloader new];
|
||||||
downloader.progressHandler = progressHandler;
|
downloader.progressHandler = progressHandler;
|
||||||
downloader.completionHandler = completionHandler;
|
downloader.completionHandler = completionHandler;
|
||||||
downloader.savePath = savePath;
|
downloader.savePath = savePath;
|
@@ -1,6 +1,6 @@
|
|||||||
//
|
//
|
||||||
// RCTHotUpdateManager.h
|
// RCTPushyManager.h
|
||||||
// RCTHotUpdate
|
// RCTPushy
|
||||||
//
|
//
|
||||||
// Created by lvbingru on 16/4/1.
|
// Created by lvbingru on 16/4/1.
|
||||||
// Copyright © 2016年 erica. All rights reserved.
|
// Copyright © 2016年 erica. All rights reserved.
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
@interface RCTHotUpdateManager : NSObject
|
@interface RCTPushyManager : NSObject
|
||||||
|
|
||||||
|
|
||||||
- (BOOL)createDir:(NSString *)dir;
|
- (BOOL)createDir:(NSString *)dir;
|
@@ -1,17 +1,17 @@
|
|||||||
//
|
//
|
||||||
// RCTHotUpdateManager.m
|
// RCTPushyManager.m
|
||||||
// RCTHotUpdate
|
// RCTPushy
|
||||||
//
|
//
|
||||||
// Created by lvbingru on 16/4/1.
|
// Created by lvbingru on 16/4/1.
|
||||||
// Copyright © 2016年 erica. All rights reserved.
|
// Copyright © 2016年 erica. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "RCTHotUpdateManager.h"
|
#import "RCTPushyManager.h"
|
||||||
#import "ZipArchive.h"
|
#import "ZipArchive.h"
|
||||||
#import "BSDiff.h"
|
#import "BSDiff.h"
|
||||||
#import "bspatch.h"
|
#import "bspatch.h"
|
||||||
|
|
||||||
@implementation RCTHotUpdateManager {
|
@implementation RCTPushyManager {
|
||||||
dispatch_queue_t _opQueue;
|
dispatch_queue_t _opQueue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self) {
|
if (self) {
|
||||||
_opQueue = dispatch_queue_create("cn.reactnative.hotupdate", DISPATCH_QUEUE_SERIAL);
|
_opQueue = dispatch_queue_create("cn.reactnative.pushy", DISPATCH_QUEUE_SERIAL);
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
@@ -1 +1 @@
|
|||||||
1570371472
|
1574665292
|
||||||
|
57
lib/getHost.js
Normal file
57
lib/getHost.js
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
let availableDomain = 'update.react-native.cn';
|
||||||
|
|
||||||
|
function ping(domain, rejectImmediate) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const xhr = new XMLHttpRequest();
|
||||||
|
xhr.onreadystatechange = e => {
|
||||||
|
if (xhr.readyState !== 4) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (xhr.status === 200) {
|
||||||
|
resolve(domain);
|
||||||
|
} else {
|
||||||
|
rejectImmediate ? reject() : setTimeout(reject, 5000);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
xhr.open('HEAD', `https://${domain}`);
|
||||||
|
xhr.send();
|
||||||
|
xhr.timeout = 5000;
|
||||||
|
xhr.ontimeout = reject;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function logger(...args) {
|
||||||
|
// console.warn('pushy', ...args);
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function tryBackupDomains() {
|
||||||
|
try {
|
||||||
|
await ping(availableDomain, true);
|
||||||
|
logger('main domain ok');
|
||||||
|
return;
|
||||||
|
} catch (e) {
|
||||||
|
logger('main domain failed');
|
||||||
|
}
|
||||||
|
let backupDomains = [];
|
||||||
|
try {
|
||||||
|
const resp = await fetch(
|
||||||
|
'https://cdn.jsdelivr.net/gh/reactnativecn/react-native-pushy@master/domains.json',
|
||||||
|
);
|
||||||
|
backupDomains = await resp.json();
|
||||||
|
logger('get remote domains:', backupDomains);
|
||||||
|
} catch (e) {
|
||||||
|
logger('get remote domains failed');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const fastestDomain = await Promise.race(backupDomains.map(ping));
|
||||||
|
if (typeof fastestDomain === 'string') {
|
||||||
|
logger(`pick domain: ${fastestDomain}`);
|
||||||
|
availableDomain = fastestDomain;
|
||||||
|
} else {
|
||||||
|
logger('all remote domains failed');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function getHost() {
|
||||||
|
return `https://${availableDomain}/api`;
|
||||||
|
}
|
1
lib/index.d.ts
vendored
1
lib/index.d.ts
vendored
@@ -19,7 +19,6 @@ export interface UpdateAvailableResult {
|
|||||||
hash: string;
|
hash: string;
|
||||||
description: string;
|
description: string;
|
||||||
metaInfo: string;
|
metaInfo: string;
|
||||||
updateUrl: string;
|
|
||||||
pdiffUrl: string;
|
pdiffUrl: string;
|
||||||
diffUrl: string;
|
diffUrl: string;
|
||||||
}
|
}
|
||||||
|
69
lib/index.js
69
lib/index.js
@@ -1,14 +1,14 @@
|
|||||||
|
import getHost, { tryBackupDomains } from './getHost';
|
||||||
import { NativeAppEventEmitter, NativeModules } from 'react-native';
|
import { NativeAppEventEmitter, NativeModules } from 'react-native';
|
||||||
const { HotUpdate = {} } = NativeModules;
|
|
||||||
|
|
||||||
const host = 'https://update.reactnative.cn/api';
|
const Pushy = NativeModules.Pushy || {};
|
||||||
|
|
||||||
export const downloadRootDir = HotUpdate.downloadRootDir;
|
export const downloadRootDir = Pushy.downloadRootDir;
|
||||||
export const packageVersion = HotUpdate.packageVersion;
|
export const packageVersion = Pushy.packageVersion;
|
||||||
export const currentVersion = HotUpdate.currentVersion;
|
export const currentVersion = Pushy.currentVersion;
|
||||||
export const isFirstTime = HotUpdate.isFirstTime;
|
export const isFirstTime = Pushy.isFirstTime;
|
||||||
export const isRolledBack = HotUpdate.isRolledBack;
|
export const isRolledBack = Pushy.isRolledBack;
|
||||||
export const buildTime = HotUpdate.buildTime;
|
export const buildTime = Pushy.buildTime;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Return json:
|
Return json:
|
||||||
@@ -28,7 +28,6 @@ There is available update:
|
|||||||
hash: 'hash',
|
hash: 'hash',
|
||||||
description: '添加聊天功能\n修复商城页面BUG',
|
description: '添加聊天功能\n修复商城页面BUG',
|
||||||
metaInfo: '{"silent":true}',
|
metaInfo: '{"silent":true}',
|
||||||
updateUrl: 'http://update-packages.reactnative.cn/hash',
|
|
||||||
pdiffUrl: 'http://update-packages.reactnative.cn/hash',
|
pdiffUrl: 'http://update-packages.reactnative.cn/hash',
|
||||||
diffUrl: 'http://update-packages.reactnative.cn/hash',
|
diffUrl: 'http://update-packages.reactnative.cn/hash',
|
||||||
}
|
}
|
||||||
@@ -40,21 +39,29 @@ function assertRelease() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function checkUpdate(APPKEY, isRetry) {
|
||||||
export async function checkUpdate(APPKEY) {
|
|
||||||
assertRelease();
|
assertRelease();
|
||||||
const resp = await fetch(`${host}/checkUpdate/${APPKEY}`, {
|
let resp;
|
||||||
method: 'POST',
|
try {
|
||||||
headers: {
|
resp = await fetch(`${getHost()}/checkUpdate/${APPKEY}`, {
|
||||||
Accept: 'application/json',
|
method: 'POST',
|
||||||
'Content-Type': 'application/json',
|
headers: {
|
||||||
},
|
Accept: 'application/json',
|
||||||
body: JSON.stringify({
|
'Content-Type': 'application/json',
|
||||||
packageVersion,
|
},
|
||||||
hash: currentVersion,
|
body: JSON.stringify({
|
||||||
buildTime,
|
packageVersion,
|
||||||
}),
|
hash: currentVersion,
|
||||||
});
|
buildTime,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
if (isRetry) {
|
||||||
|
throw new Error('Could not connect to pushy server');
|
||||||
|
}
|
||||||
|
await tryBackupDomains();
|
||||||
|
return checkUpdate(APPKEY, true);
|
||||||
|
}
|
||||||
|
|
||||||
if (resp.status !== 200) {
|
if (resp.status !== 200) {
|
||||||
throw new Error((await resp.json()).message);
|
throw new Error((await resp.json()).message);
|
||||||
@@ -70,18 +77,18 @@ export async function downloadUpdate(options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (options.diffUrl) {
|
if (options.diffUrl) {
|
||||||
await HotUpdate.downloadPatchFromPpk({
|
await Pushy.downloadPatchFromPpk({
|
||||||
updateUrl: options.diffUrl,
|
updateUrl: options.diffUrl,
|
||||||
hashName: options.hash,
|
hashName: options.hash,
|
||||||
originHashName: currentVersion,
|
originHashName: currentVersion,
|
||||||
});
|
});
|
||||||
} else if (options.pdiffUrl) {
|
} else if (options.pdiffUrl) {
|
||||||
await HotUpdate.downloadPatchFromPackage({
|
await Pushy.downloadPatchFromPackage({
|
||||||
updateUrl: options.pdiffUrl,
|
updateUrl: options.pdiffUrl,
|
||||||
hashName: options.hash,
|
hashName: options.hash,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
await HotUpdate.downloadUpdate({
|
await Pushy.downloadUpdate({
|
||||||
updateUrl: options.updateUrl,
|
updateUrl: options.updateUrl,
|
||||||
hashName: options.hash,
|
hashName: options.hash,
|
||||||
});
|
});
|
||||||
@@ -91,19 +98,19 @@ export async function downloadUpdate(options) {
|
|||||||
|
|
||||||
export function switchVersion(hash) {
|
export function switchVersion(hash) {
|
||||||
assertRelease();
|
assertRelease();
|
||||||
HotUpdate.reloadUpdate({ hashName: hash });
|
Pushy.reloadUpdate({ hashName: hash });
|
||||||
}
|
}
|
||||||
|
|
||||||
export function switchVersionLater(hash) {
|
export function switchVersionLater(hash) {
|
||||||
assertRelease();
|
assertRelease();
|
||||||
HotUpdate.setNeedUpdate({ hashName: hash });
|
Pushy.setNeedUpdate({ hashName: hash });
|
||||||
}
|
}
|
||||||
|
|
||||||
export function markSuccess() {
|
export function markSuccess() {
|
||||||
assertRelease();
|
assertRelease();
|
||||||
HotUpdate.markSuccess();
|
Pushy.markSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
NativeAppEventEmitter.addListener('RCTHotUpdateDownloadProgress', params => {});
|
NativeAppEventEmitter.addListener('RCTPushyDownloadProgress', params => {});
|
||||||
|
|
||||||
NativeAppEventEmitter.addListener('RCTHotUpdateUnzipProgress', params => {});
|
NativeAppEventEmitter.addListener('RCTPushyUnzipProgress', params => {});
|
||||||
|
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"plugins": [
|
|
||||||
"syntax-object-rest-spread",
|
|
||||||
"syntax-async-functions",
|
|
||||||
"transform-es2015-arrow-functions",
|
|
||||||
"transform-async-to-generator",
|
|
||||||
"transform-es2015-modules-commonjs",
|
|
||||||
"transform-es2015-destructuring",
|
|
||||||
"transform-es2015-spread",
|
|
||||||
"transform-object-rest-spread",
|
|
||||||
"transform-es2015-parameters",
|
|
||||||
"transform-strict-mode"
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,162 +0,0 @@
|
|||||||
{
|
|
||||||
"useCommand": true,
|
|
||||||
"defaultCommand": "help",
|
|
||||||
"commands": {
|
|
||||||
"help": {
|
|
||||||
},
|
|
||||||
|
|
||||||
"login":{
|
|
||||||
},
|
|
||||||
"logout": {
|
|
||||||
},
|
|
||||||
"me": {
|
|
||||||
},
|
|
||||||
|
|
||||||
"createApp": {
|
|
||||||
"options": {
|
|
||||||
"name": {
|
|
||||||
"hasValue": true
|
|
||||||
},
|
|
||||||
"platform": {
|
|
||||||
"hasValue": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"apps": {
|
|
||||||
"options": {
|
|
||||||
"platform": {
|
|
||||||
"hasValue": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"deleteApp": {
|
|
||||||
},
|
|
||||||
"selectApp": {
|
|
||||||
"options": {
|
|
||||||
"platform": {
|
|
||||||
"hasValue": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
"uploadIpa": {
|
|
||||||
},
|
|
||||||
"uploadApk": {
|
|
||||||
},
|
|
||||||
"packages": {
|
|
||||||
"options": {
|
|
||||||
"platform": {
|
|
||||||
"hasValue": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
"publish": {
|
|
||||||
"options": {
|
|
||||||
"platform": {
|
|
||||||
"hasValue": true
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"hasValue": true
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"hasValue": true
|
|
||||||
},
|
|
||||||
"metaInfo": {
|
|
||||||
"hasValue": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"versions": {
|
|
||||||
"options": {
|
|
||||||
"platform": {
|
|
||||||
"hasValue": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
"update": {
|
|
||||||
"options": {
|
|
||||||
"platform": {
|
|
||||||
"hasValue": true
|
|
||||||
},
|
|
||||||
"versionId": {
|
|
||||||
"hasValue": true
|
|
||||||
},
|
|
||||||
"packageId": {
|
|
||||||
"hasValue": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
"build": {
|
|
||||||
"description": "Bundle javascript and copy assets."
|
|
||||||
},
|
|
||||||
"bundle": {
|
|
||||||
"description": "Bundle javascript code only.",
|
|
||||||
"options": {
|
|
||||||
"dev": {
|
|
||||||
"default": "false",
|
|
||||||
"hasValue": true
|
|
||||||
},
|
|
||||||
"platform": {
|
|
||||||
"hasValue": true
|
|
||||||
},
|
|
||||||
"bundleName":{
|
|
||||||
"default": "index.bundlejs",
|
|
||||||
"hasValue": true
|
|
||||||
},
|
|
||||||
"entryFile": {
|
|
||||||
"default": "index.js",
|
|
||||||
"hasValue": true
|
|
||||||
},
|
|
||||||
"intermediaDir": {
|
|
||||||
"default": "build/intermedia/${platform}",
|
|
||||||
"hasValue": true
|
|
||||||
},
|
|
||||||
"output": {
|
|
||||||
"default": "build/output/${platform}.${time}.ppk",
|
|
||||||
"hasValue": true
|
|
||||||
},
|
|
||||||
"verbose": {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"release": {
|
|
||||||
"description": "Push builded file to server."
|
|
||||||
},
|
|
||||||
"diff": {
|
|
||||||
"description": "Create diff patch",
|
|
||||||
"options": {
|
|
||||||
"output": {
|
|
||||||
"default": "build/output/diff",
|
|
||||||
"hasValue": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"diffFromApk": {
|
|
||||||
"description": "Create diff patch from a Android package(.apk)",
|
|
||||||
"options": {
|
|
||||||
"output": {
|
|
||||||
"default": "build/output/diff-${time}.apk-patch",
|
|
||||||
"hasValue": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"diffFromIpa": {
|
|
||||||
"description": "Create diff patch from a iOS package(.ipa)",
|
|
||||||
"options": {
|
|
||||||
"output": {
|
|
||||||
"default": "build/output/diff-${time}.ipa-patch",
|
|
||||||
"hasValue": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"globalOptions":{
|
|
||||||
"no-interactive": {
|
|
||||||
"default": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,4 +0,0 @@
|
|||||||
/**
|
|
||||||
* Created by tdzl2003 on 2/22/16.
|
|
||||||
*/
|
|
||||||
module.exports = require('./lib');
|
|
@@ -1,132 +0,0 @@
|
|||||||
/**
|
|
||||||
* Created by tdzl2003 on 2/13/16.
|
|
||||||
*/
|
|
||||||
|
|
||||||
const fetch = require('isomorphic-fetch');
|
|
||||||
let host = process.env.PUSHY_REGISTRY || 'https://update.reactnative.cn/api';
|
|
||||||
const fs = require('fs-extra');
|
|
||||||
import request from 'request';
|
|
||||||
import ProgressBar from 'progress';
|
|
||||||
|
|
||||||
let session = undefined;
|
|
||||||
let savedSession = undefined;
|
|
||||||
|
|
||||||
exports.loadSession = async function() {
|
|
||||||
if (fs.existsSync('.update')) {
|
|
||||||
try {
|
|
||||||
exports.replaceSession(JSON.parse(fs.readFileSync('.update', 'utf8')));
|
|
||||||
savedSession = session;
|
|
||||||
} catch (e) {
|
|
||||||
console.error('Failed to parse file `.update`. Try to remove it manually.');
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.getSession = function() {
|
|
||||||
return session;
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.replaceSession = function(newSession) {
|
|
||||||
session = newSession;
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.saveSession = function() {
|
|
||||||
// Only save on change.
|
|
||||||
if (session !== savedSession) {
|
|
||||||
const current = session;
|
|
||||||
const data = JSON.stringify(current, null, 4);
|
|
||||||
fs.writeFileSync('.update', data, 'utf8');
|
|
||||||
savedSession = current;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.closeSession = function() {
|
|
||||||
if (fs.existsSync('.update')) {
|
|
||||||
fs.unlinkSync('.update');
|
|
||||||
savedSession = undefined;
|
|
||||||
}
|
|
||||||
session = undefined;
|
|
||||||
host = process.env.PUSHY_REGISTRY || 'https://update.reactnative.cn';
|
|
||||||
};
|
|
||||||
|
|
||||||
async function query(url, options) {
|
|
||||||
const resp = await fetch(url, options);
|
|
||||||
const json = await resp.json();
|
|
||||||
if (resp.status !== 200) {
|
|
||||||
throw Object.assign(new Error(json.message || json.error), { status: resp.status });
|
|
||||||
}
|
|
||||||
return json;
|
|
||||||
}
|
|
||||||
|
|
||||||
function queryWithoutBody(method) {
|
|
||||||
return function(api) {
|
|
||||||
return query(host + api, {
|
|
||||||
method,
|
|
||||||
headers: {
|
|
||||||
'X-AccessToken': session ? session.token : '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function queryWithBody(method) {
|
|
||||||
return function(api, body) {
|
|
||||||
return query(host + api, {
|
|
||||||
method,
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'X-AccessToken': session ? session.token : '',
|
|
||||||
},
|
|
||||||
body: JSON.stringify(body),
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.get = queryWithoutBody('GET');
|
|
||||||
exports.post = queryWithBody('POST');
|
|
||||||
exports.put = queryWithBody('PUT');
|
|
||||||
exports.doDelete = queryWithBody('DELETE');
|
|
||||||
|
|
||||||
async function uploadFile(fn) {
|
|
||||||
const { url, fieldName, formData } = await exports.post('/upload', {});
|
|
||||||
let realUrl = url;
|
|
||||||
|
|
||||||
if (!/^https?\:\/\//.test(url)) {
|
|
||||||
realUrl = host + url;
|
|
||||||
}
|
|
||||||
|
|
||||||
const fileSize = fs.statSync(fn).size;
|
|
||||||
|
|
||||||
const bar = new ProgressBar(' Uploading [:bar] :percent :etas', {
|
|
||||||
complete: '=',
|
|
||||||
incomplete: ' ',
|
|
||||||
total: fileSize,
|
|
||||||
});
|
|
||||||
|
|
||||||
const info = await new Promise((resolve, reject) => {
|
|
||||||
formData.file = fs.createReadStream(fn);
|
|
||||||
|
|
||||||
formData.file.on('data', function(data) {
|
|
||||||
bar.tick(data.length);
|
|
||||||
});
|
|
||||||
request.post(
|
|
||||||
realUrl,
|
|
||||||
{
|
|
||||||
formData,
|
|
||||||
},
|
|
||||||
(err, resp, body) => {
|
|
||||||
if (err) {
|
|
||||||
return reject(err);
|
|
||||||
}
|
|
||||||
if (resp.statusCode > 299) {
|
|
||||||
return reject(Object.assign(new Error(body), { status: resp.statusCode }));
|
|
||||||
}
|
|
||||||
resolve(JSON.parse(body));
|
|
||||||
},
|
|
||||||
);
|
|
||||||
});
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.uploadFile = uploadFile;
|
|
@@ -1,110 +0,0 @@
|
|||||||
/**
|
|
||||||
* Created by tdzl2003 on 2/13/16.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import {question} from './utils';
|
|
||||||
import * as fs from 'fs-extra';
|
|
||||||
|
|
||||||
const {
|
|
||||||
post,
|
|
||||||
get,
|
|
||||||
doDelete,
|
|
||||||
} = require('./api');
|
|
||||||
|
|
||||||
const validPlatforms = {
|
|
||||||
ios: 1,
|
|
||||||
android: 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
export function checkPlatform(platform) {
|
|
||||||
if (!validPlatforms[platform]) {
|
|
||||||
throw new Error(`Invalid platform '${platform}'`);
|
|
||||||
}
|
|
||||||
return platform
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getSelectedApp(platform) {
|
|
||||||
checkPlatform(platform);
|
|
||||||
|
|
||||||
if (!fs.existsSync('update.json')){
|
|
||||||
throw new Error(`App not selected. run 'pushy selectApp --platform ${platform}' first!`);
|
|
||||||
}
|
|
||||||
const updateInfo = JSON.parse(fs.readFileSync('update.json', 'utf8'));
|
|
||||||
if (!updateInfo[platform]) {
|
|
||||||
throw new Error(`App not selected. run 'pushy selectApp --platform ${platform}' first!`);
|
|
||||||
}
|
|
||||||
return updateInfo[platform];
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function listApp(platform){
|
|
||||||
const {data} = await get('/app/list');
|
|
||||||
const list = platform?data.filter(v=>v.platform===platform):data;
|
|
||||||
for (const app of list) {
|
|
||||||
console.log(`${app.id}) ${app.name}(${app.platform})`);
|
|
||||||
}
|
|
||||||
if (platform) {
|
|
||||||
console.log(`\nTotal ${list.length} ${platform} apps`);
|
|
||||||
} else {
|
|
||||||
console.log(`\nTotal ${list.length} apps`);
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function chooseApp(platform) {
|
|
||||||
const list = await listApp(platform);
|
|
||||||
|
|
||||||
while (true) {
|
|
||||||
const id = await question('Enter appId:');
|
|
||||||
const app = list.find(v=>v.id === (id|0));
|
|
||||||
if (app) {
|
|
||||||
return app;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const commands = {
|
|
||||||
createApp: async function ({options}) {
|
|
||||||
const name = options.name || await question('App Name:');
|
|
||||||
const {downloadUrl} = options;
|
|
||||||
const platform = checkPlatform(options.platform || await question('Platform(ios/android):'));
|
|
||||||
const {id} = await post('/app/create', {name, platform});
|
|
||||||
console.log(`Created app ${id}`);
|
|
||||||
await this.selectApp({
|
|
||||||
args: [id],
|
|
||||||
options: {platform, downloadUrl},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
deleteApp: async function ({args, options}) {
|
|
||||||
const {platform} = options;
|
|
||||||
const id = args[0] || chooseApp(platform);
|
|
||||||
if (!id) {
|
|
||||||
console.log('Canceled');
|
|
||||||
}
|
|
||||||
await doDelete(`/app/${id}`);
|
|
||||||
console.log('Ok.');
|
|
||||||
},
|
|
||||||
apps: async function ({options}){
|
|
||||||
const {platform} = options;
|
|
||||||
listApp(platform);
|
|
||||||
},
|
|
||||||
selectApp: async function({args, options}) {
|
|
||||||
const platform = checkPlatform(options.platform || await question('Platform(ios/android):'));
|
|
||||||
const id = args[0] || (await chooseApp(platform)).id;
|
|
||||||
|
|
||||||
let updateInfo = {};
|
|
||||||
if (fs.existsSync('update.json')) {
|
|
||||||
try {
|
|
||||||
updateInfo = JSON.parse(fs.readFileSync('update.json', 'utf8'));
|
|
||||||
} catch (e) {
|
|
||||||
console.error('Failed to parse file `update.json`. Try to remove it manually.');
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const {appKey} = await get(`/app/${id}`);
|
|
||||||
updateInfo[platform] = {
|
|
||||||
appId: id,
|
|
||||||
appKey,
|
|
||||||
};
|
|
||||||
fs.writeFileSync('update.json', JSON.stringify(updateInfo, null, 4), 'utf8');
|
|
||||||
},
|
|
||||||
}
|
|
@@ -1,506 +0,0 @@
|
|||||||
/**
|
|
||||||
* Created by tdzl2003 on 2/22/16.
|
|
||||||
*/
|
|
||||||
|
|
||||||
const path = require('path');
|
|
||||||
import { getRNVersion, translateOptions } from './utils';
|
|
||||||
import * as fs from 'fs-extra';
|
|
||||||
import { ZipFile } from 'yazl';
|
|
||||||
import { open as openZipFile } from 'yauzl';
|
|
||||||
import { question } from './utils';
|
|
||||||
import { checkPlatform } from './app';
|
|
||||||
const { spawn, spawnSync, execSync } = require('child_process');
|
|
||||||
const g2js = require('gradle-to-js/lib/parser');
|
|
||||||
const os = require('os');
|
|
||||||
|
|
||||||
var diff;
|
|
||||||
try {
|
|
||||||
var bsdiff = require('node-bsdiff');
|
|
||||||
diff = typeof bsdiff != 'function' ? bsdiff.diff : bsdiff;
|
|
||||||
} catch (e) {
|
|
||||||
diff = function() {
|
|
||||||
console.warn(
|
|
||||||
'This function needs "node-bsdiff". Please run "npm i node-bsdiff" from your project directory first!',
|
|
||||||
);
|
|
||||||
throw new Error('This function needs module "node-bsdiff". Please install it first.');
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function exec(command) {
|
|
||||||
const commandResult = spawnSync(command, {
|
|
||||||
shell: true,
|
|
||||||
stdio: 'inherit',
|
|
||||||
});
|
|
||||||
if (commandResult.error) {
|
|
||||||
throw commandResult.error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function runReactNativeBundleCommand(
|
|
||||||
bundleName,
|
|
||||||
development,
|
|
||||||
entryFile,
|
|
||||||
outputFolder,
|
|
||||||
platform,
|
|
||||||
sourcemapOutput,
|
|
||||||
config,
|
|
||||||
) {
|
|
||||||
let reactNativeBundleArgs = [];
|
|
||||||
|
|
||||||
let envArgs = process.env.PUSHY_ENV_ARGS;
|
|
||||||
|
|
||||||
if (envArgs) {
|
|
||||||
Array.prototype.push.apply(reactNativeBundleArgs, envArgs.trim().split(/\s+/));
|
|
||||||
}
|
|
||||||
|
|
||||||
fs.emptyDirSync(outputFolder);
|
|
||||||
|
|
||||||
Array.prototype.push.apply(reactNativeBundleArgs, [
|
|
||||||
path.join("node_modules", "react-native", "local-cli", "cli.js"),
|
|
||||||
"bundle",
|
|
||||||
'--assets-dest',
|
|
||||||
outputFolder,
|
|
||||||
'--bundle-output',
|
|
||||||
path.join(outputFolder, bundleName),
|
|
||||||
'--dev',
|
|
||||||
development,
|
|
||||||
'--entry-file',
|
|
||||||
entryFile,
|
|
||||||
'--platform',
|
|
||||||
platform,
|
|
||||||
]);
|
|
||||||
|
|
||||||
if (sourcemapOutput) {
|
|
||||||
reactNativeBundleArgs.push('--sourcemap-output', sourcemapOutput);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config) {
|
|
||||||
reactNativeBundleArgs.push('--config', config);
|
|
||||||
}
|
|
||||||
|
|
||||||
const reactNativeBundleProcess = spawn('node', reactNativeBundleArgs);
|
|
||||||
console.log(`Running bundle command: node ${reactNativeBundleArgs.join(' ')}`);
|
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
reactNativeBundleProcess.stdout.on('data', data => {
|
|
||||||
console.log(data.toString().trim());
|
|
||||||
});
|
|
||||||
|
|
||||||
reactNativeBundleProcess.stderr.on('data', data => {
|
|
||||||
console.error(data.toString().trim());
|
|
||||||
});
|
|
||||||
|
|
||||||
reactNativeBundleProcess.on('close', async exitCode => {
|
|
||||||
if (exitCode) {
|
|
||||||
reject(new Error(`"react-native bundle" command exited with code ${exitCode}.`));
|
|
||||||
} else {
|
|
||||||
if (platform === 'android') {
|
|
||||||
await compileHermesByteCode(bundleName, outputFolder);
|
|
||||||
}
|
|
||||||
resolve(null);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function getHermesOSBin() {
|
|
||||||
if (os.platform() === 'win32') return 'win64-bin';
|
|
||||||
if (os.platform() === 'darwin') return 'osx-bin';
|
|
||||||
if (os.platform() === 'linux') return 'linux64-bin';
|
|
||||||
}
|
|
||||||
|
|
||||||
async function compileHermesByteCode(bundleName, outputFolder) {
|
|
||||||
let enableHermes = false;
|
|
||||||
try {
|
|
||||||
const gradleConfig = await g2js.parseFile('android/app/build.gradle');
|
|
||||||
const projectConfig = gradleConfig['project.ext.react'];
|
|
||||||
for (const packagerConfig of projectConfig) {
|
|
||||||
if (packagerConfig.includes('enableHermes') && packagerConfig.includes('true')) {
|
|
||||||
enableHermes = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e) {}
|
|
||||||
if (enableHermes) {
|
|
||||||
console.log(`Hermes enabled, now compiling to hermes bytecode:\n`);
|
|
||||||
const hermesPath = fs.existsSync('node_modules/hermes-engine')
|
|
||||||
? 'node_modules/hermes-engine'
|
|
||||||
: 'node_modules/hermesvm';
|
|
||||||
execSync(
|
|
||||||
`${hermesPath}/${getHermesOSBin()}/hermes -emit-binary -out ${outputFolder}/${bundleName} ${outputFolder}/${bundleName} -O`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function pack(dir, output) {
|
|
||||||
console.log('Packing');
|
|
||||||
fs.ensureDirSync(path.dirname(output));
|
|
||||||
await new Promise((resolve, reject) => {
|
|
||||||
var zipfile = new ZipFile();
|
|
||||||
|
|
||||||
function addDirectory(root, rel) {
|
|
||||||
if (rel) {
|
|
||||||
zipfile.addEmptyDirectory(rel);
|
|
||||||
}
|
|
||||||
const childs = fs.readdirSync(root);
|
|
||||||
for (const name of childs) {
|
|
||||||
if (name === '.' || name === '..') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
const fullPath = path.join(root, name);
|
|
||||||
const stat = fs.statSync(fullPath);
|
|
||||||
if (stat.isFile()) {
|
|
||||||
//console.log('adding: ' + rel+name);
|
|
||||||
zipfile.addFile(fullPath, rel + name);
|
|
||||||
} else if (stat.isDirectory()) {
|
|
||||||
//console.log('adding: ' + rel+name+'/');
|
|
||||||
addDirectory(fullPath, rel + name + '/');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
addDirectory(dir, '');
|
|
||||||
|
|
||||||
zipfile.outputStream.on('error', err => reject(err));
|
|
||||||
zipfile.outputStream.pipe(fs.createWriteStream(output)).on('close', function() {
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
zipfile.end();
|
|
||||||
});
|
|
||||||
console.log('Bundled saved to: ' + output);
|
|
||||||
}
|
|
||||||
|
|
||||||
function readEntire(entry, zipFile) {
|
|
||||||
const buffers = [];
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
zipFile.openReadStream(entry, (err, stream) => {
|
|
||||||
stream.pipe({
|
|
||||||
write(chunk) {
|
|
||||||
buffers.push(chunk);
|
|
||||||
},
|
|
||||||
end() {
|
|
||||||
resolve(Buffer.concat(buffers));
|
|
||||||
},
|
|
||||||
prependListener() {},
|
|
||||||
on() {},
|
|
||||||
once() {},
|
|
||||||
emit() {},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function basename(fn) {
|
|
||||||
const m = /^(.+\/)[^\/]+\/?$/.exec(fn);
|
|
||||||
return m && m[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
async function diffFromPPK(origin, next, output) {
|
|
||||||
fs.ensureDirSync(path.dirname(output));
|
|
||||||
|
|
||||||
const originEntries = {};
|
|
||||||
const originMap = {};
|
|
||||||
|
|
||||||
let originSource;
|
|
||||||
|
|
||||||
await enumZipEntries(origin, (entry, zipFile) => {
|
|
||||||
originEntries[entry.fileName] = entry;
|
|
||||||
if (!/\/$/.test(entry.fileName)) {
|
|
||||||
// isFile
|
|
||||||
originMap[entry.crc32] = entry.fileName;
|
|
||||||
|
|
||||||
if (entry.fileName === 'index.bundlejs') {
|
|
||||||
// This is source.
|
|
||||||
return readEntire(entry, zipFile).then(v => (originSource = v));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
originSource = originSource || new Buffer(0);
|
|
||||||
|
|
||||||
const copies = {};
|
|
||||||
|
|
||||||
var zipfile = new ZipFile();
|
|
||||||
|
|
||||||
const writePromise = new Promise((resolve, reject) => {
|
|
||||||
zipfile.outputStream.on('error', err => {
|
|
||||||
throw err;
|
|
||||||
});
|
|
||||||
zipfile.outputStream.pipe(fs.createWriteStream(output)).on('close', function() {
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
const addedEntry = {};
|
|
||||||
|
|
||||||
function addEntry(fn) {
|
|
||||||
//console.log(fn);
|
|
||||||
if (!fn || addedEntry[fn]) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const base = basename(fn);
|
|
||||||
if (base) {
|
|
||||||
addEntry(base);
|
|
||||||
}
|
|
||||||
zipfile.addEmptyDirectory(fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
const newEntries = {};
|
|
||||||
|
|
||||||
await enumZipEntries(next, (entry, nextZipfile) => {
|
|
||||||
newEntries[entry.fileName] = entry;
|
|
||||||
|
|
||||||
if (/\/$/.test(entry.fileName)) {
|
|
||||||
// Directory
|
|
||||||
if (!originEntries[entry.fileName]) {
|
|
||||||
addEntry(entry.fileName);
|
|
||||||
}
|
|
||||||
} else if (entry.fileName === 'index.bundlejs') {
|
|
||||||
//console.log('Found bundle');
|
|
||||||
return readEntire(entry, nextZipfile).then(newSource => {
|
|
||||||
//console.log('Begin diff');
|
|
||||||
zipfile.addBuffer(diff(originSource, newSource), 'index.bundlejs.patch');
|
|
||||||
//console.log('End diff');
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// If same file.
|
|
||||||
const originEntry = originEntries[entry.fileName];
|
|
||||||
if (originEntry && originEntry.crc32 === entry.crc32) {
|
|
||||||
// ignore
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If moved from other place
|
|
||||||
if (originMap[entry.crc32]) {
|
|
||||||
const base = basename(entry.fileName);
|
|
||||||
if (!originEntries[base]) {
|
|
||||||
addEntry(base);
|
|
||||||
}
|
|
||||||
copies[entry.fileName] = originMap[entry.crc32];
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// New file.
|
|
||||||
addEntry(basename(entry.fileName));
|
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
nextZipfile.openReadStream(entry, function(err, readStream) {
|
|
||||||
if (err) {
|
|
||||||
return reject(err);
|
|
||||||
}
|
|
||||||
zipfile.addReadStream(readStream, entry.fileName);
|
|
||||||
readStream.on('end', () => {
|
|
||||||
//console.log('add finished');
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const deletes = {};
|
|
||||||
|
|
||||||
for (var k in originEntries) {
|
|
||||||
if (!newEntries[k]) {
|
|
||||||
console.log('Delete ' + k);
|
|
||||||
deletes[k] = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//console.log({copies, deletes});
|
|
||||||
zipfile.addBuffer(new Buffer(JSON.stringify({ copies, deletes })), '__diff.json');
|
|
||||||
zipfile.end();
|
|
||||||
await writePromise;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function diffFromPackage(origin, next, output, originBundleName, transformPackagePath = v => v) {
|
|
||||||
fs.ensureDirSync(path.dirname(output));
|
|
||||||
|
|
||||||
const originEntries = {};
|
|
||||||
const originMap = {};
|
|
||||||
|
|
||||||
let originSource;
|
|
||||||
|
|
||||||
await enumZipEntries(origin, (entry, zipFile) => {
|
|
||||||
if (!/\/$/.test(entry.fileName)) {
|
|
||||||
const fn = transformPackagePath(entry.fileName);
|
|
||||||
if (!fn) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//console.log(fn);
|
|
||||||
// isFile
|
|
||||||
originEntries[fn] = entry.crc32;
|
|
||||||
originMap[entry.crc32] = fn;
|
|
||||||
|
|
||||||
if (fn === originBundleName) {
|
|
||||||
// This is source.
|
|
||||||
return readEntire(entry, zipFile).then(v => (originSource = v));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
originSource = originSource || new Buffer(0);
|
|
||||||
|
|
||||||
const copies = {};
|
|
||||||
|
|
||||||
var zipfile = new ZipFile();
|
|
||||||
|
|
||||||
const writePromise = new Promise((resolve, reject) => {
|
|
||||||
zipfile.outputStream.on('error', err => {
|
|
||||||
throw err;
|
|
||||||
});
|
|
||||||
zipfile.outputStream.pipe(fs.createWriteStream(output)).on('close', function() {
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
await enumZipEntries(next, (entry, nextZipfile) => {
|
|
||||||
if (/\/$/.test(entry.fileName)) {
|
|
||||||
// Directory
|
|
||||||
zipfile.addEmptyDirectory(entry.fileName);
|
|
||||||
} else if (entry.fileName === 'index.bundlejs') {
|
|
||||||
//console.log('Found bundle');
|
|
||||||
return readEntire(entry, nextZipfile).then(newSource => {
|
|
||||||
//console.log('Begin diff');
|
|
||||||
zipfile.addBuffer(diff(originSource, newSource), 'index.bundlejs.patch');
|
|
||||||
//console.log('End diff');
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// If same file.
|
|
||||||
if (originEntries[entry.fileName] === entry.crc32) {
|
|
||||||
copies[entry.fileName] = '';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// If moved from other place
|
|
||||||
if (originMap[entry.crc32]) {
|
|
||||||
copies[entry.fileName] = originMap[entry.crc32];
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
nextZipfile.openReadStream(entry, function(err, readStream) {
|
|
||||||
if (err) {
|
|
||||||
return reject(err);
|
|
||||||
}
|
|
||||||
zipfile.addReadStream(readStream, entry.fileName);
|
|
||||||
readStream.on('end', () => {
|
|
||||||
//console.log('add finished');
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
zipfile.addBuffer(new Buffer(JSON.stringify({ copies })), '__diff.json');
|
|
||||||
zipfile.end();
|
|
||||||
await writePromise;
|
|
||||||
}
|
|
||||||
|
|
||||||
function enumZipEntries(zipFn, callback) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
openZipFile(zipFn, { lazyEntries: true }, (err, zipfile) => {
|
|
||||||
if (err) {
|
|
||||||
return reject(err);
|
|
||||||
}
|
|
||||||
zipfile.on('end', resolve);
|
|
||||||
zipfile.on('error', reject);
|
|
||||||
zipfile.on('entry', entry => {
|
|
||||||
const result = callback(entry, zipfile);
|
|
||||||
if (result && typeof result.then === 'function') {
|
|
||||||
result.then(() => zipfile.readEntry());
|
|
||||||
} else {
|
|
||||||
zipfile.readEntry();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
zipfile.readEntry();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export const commands = {
|
|
||||||
bundle: async function({ options }) {
|
|
||||||
const platform = checkPlatform(options.platform || (await question('Platform(ios/android):')));
|
|
||||||
|
|
||||||
let { bundleName, entryFile, intermediaDir, output, dev, verbose } = translateOptions({
|
|
||||||
...options,
|
|
||||||
platform,
|
|
||||||
});
|
|
||||||
|
|
||||||
// const sourcemapOutput = path.join(intermediaDir, bundleName + ".map");
|
|
||||||
|
|
||||||
const realOutput = output.replace(/\$\{time\}/g, '' + Date.now());
|
|
||||||
|
|
||||||
if (!platform) {
|
|
||||||
throw new Error('Platform must be specified.');
|
|
||||||
}
|
|
||||||
|
|
||||||
const { version, major, minor } = getRNVersion();
|
|
||||||
|
|
||||||
console.log('Bundling with React Native version: ', version);
|
|
||||||
|
|
||||||
await runReactNativeBundleCommand(bundleName, dev, entryFile, intermediaDir, platform);
|
|
||||||
|
|
||||||
await pack(path.resolve(intermediaDir), realOutput);
|
|
||||||
|
|
||||||
const v = await question('Would you like to publish it?(Y/N)');
|
|
||||||
if (v.toLowerCase() === 'y') {
|
|
||||||
await this.publish({
|
|
||||||
args: [realOutput],
|
|
||||||
options: {
|
|
||||||
platform,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
async diff({ args, options }) {
|
|
||||||
const [origin, next] = args;
|
|
||||||
const { output } = options;
|
|
||||||
|
|
||||||
const realOutput = output.replace(/\$\{time\}/g, '' + Date.now());
|
|
||||||
|
|
||||||
if (!origin || !next) {
|
|
||||||
console.error('pushy diff <origin> <next>');
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
await diffFromPPK(origin, next, realOutput, 'index.bundlejs');
|
|
||||||
console.log(`${realOutput} generated.`);
|
|
||||||
},
|
|
||||||
|
|
||||||
async diffFromApk({ args, options }) {
|
|
||||||
const [origin, next] = args;
|
|
||||||
const { output } = options;
|
|
||||||
|
|
||||||
const realOutput = output.replace(/\$\{time\}/g, '' + Date.now());
|
|
||||||
|
|
||||||
if (!origin || !next) {
|
|
||||||
console.error('pushy diffFromApk <origin> <next>');
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
await diffFromPackage(origin, next, realOutput, 'assets/index.android.bundle');
|
|
||||||
console.log(`${realOutput} generated.`);
|
|
||||||
},
|
|
||||||
|
|
||||||
async diffFromIpa({ args, options }) {
|
|
||||||
const [origin, next] = args;
|
|
||||||
const { output } = options;
|
|
||||||
|
|
||||||
const realOutput = output.replace(/\$\{time\}/g, '' + Date.now());
|
|
||||||
|
|
||||||
if (!origin || !next) {
|
|
||||||
console.error('pushy diffFromIpa <origin> <next>');
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
await diffFromPackage(origin, next, realOutput, 'main.jsbundle', v => {
|
|
||||||
const m = /^Payload\/[^/]+\/(.+)$/.exec(v);
|
|
||||||
return m && m[1];
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`${realOutput} generated.`);
|
|
||||||
},
|
|
||||||
};
|
|
@@ -1,39 +0,0 @@
|
|||||||
/**
|
|
||||||
* Created by tdzl2003 on 2/13/16.
|
|
||||||
*/
|
|
||||||
|
|
||||||
const {loadSession} = require('./api');
|
|
||||||
|
|
||||||
function printUsage({args}) {
|
|
||||||
// const commandName = args[0];
|
|
||||||
// TODO: print usage of commandName, or print global usage.
|
|
||||||
|
|
||||||
console.log('Usage is under development now.')
|
|
||||||
console.log('Visit `https://github.com/reactnativecn/react-native-pushy` for early document.');
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
const commands = {
|
|
||||||
...require('./user').commands,
|
|
||||||
...require('./bundle').commands,
|
|
||||||
...require('./app').commands,
|
|
||||||
...require('./package').commands,
|
|
||||||
...require('./versions').commands,
|
|
||||||
help: printUsage,
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.run = function () {
|
|
||||||
const argv = require('cli-arguments').parse(require('../cli.json'));
|
|
||||||
global.NO_INTERACTIVE = argv.options['no-interactive'];
|
|
||||||
|
|
||||||
loadSession()
|
|
||||||
.then(()=>commands[argv.command](argv))
|
|
||||||
.catch(err=>{
|
|
||||||
if (err.status === 401) {
|
|
||||||
console.log('Not loggined.\nRun `pushy login` at your project directory to login.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
console.error(err.stack);
|
|
||||||
process.exit(-1);
|
|
||||||
});
|
|
||||||
};
|
|
@@ -1,85 +0,0 @@
|
|||||||
/**
|
|
||||||
* Created by tdzl2003 on 4/2/16.
|
|
||||||
*/
|
|
||||||
|
|
||||||
const { get, post, uploadFile } = require('./api');
|
|
||||||
import { question } from './utils';
|
|
||||||
|
|
||||||
import { checkPlatform, getSelectedApp } from './app';
|
|
||||||
|
|
||||||
import { getIPAVersion, getApkVersion } from './utils';
|
|
||||||
const Table = require('tty-table');
|
|
||||||
|
|
||||||
export async function listPackage(appId) {
|
|
||||||
const { data } = await get(`/app/${appId}/package/list?limit=1000`);
|
|
||||||
|
|
||||||
const header = [{ value: 'Package Id' }, { value: 'Version' }];
|
|
||||||
const rows = [];
|
|
||||||
for (const pkg of data) {
|
|
||||||
const { version } = pkg;
|
|
||||||
let versionInfo = '';
|
|
||||||
if (version) {
|
|
||||||
versionInfo = ` - ${version.id} ${version.hash.slice(0, 8)} ${version.name}`;
|
|
||||||
} else {
|
|
||||||
versionInfo = ' (newest)';
|
|
||||||
}
|
|
||||||
|
|
||||||
rows.push([pkg.id, `${pkg.name}(${pkg.status})${versionInfo}`]);
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(Table(header, rows).render());
|
|
||||||
console.log(`\nTotal ${data.length} package(s).`);
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function choosePackage(appId) {
|
|
||||||
const list = await listPackage(appId);
|
|
||||||
|
|
||||||
while (true) {
|
|
||||||
const id = await question('Enter Package Id:');
|
|
||||||
const app = list.find(v => v.id === (id | 0));
|
|
||||||
if (app) {
|
|
||||||
return app;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const commands = {
|
|
||||||
uploadIpa: async function({ args }) {
|
|
||||||
const fn = args[0];
|
|
||||||
if (!fn) {
|
|
||||||
throw new Error('Usage: pushy uploadIpa <ipaFile>');
|
|
||||||
}
|
|
||||||
const name = await getIPAVersion(fn);
|
|
||||||
const { appId } = await getSelectedApp('ios');
|
|
||||||
|
|
||||||
const { hash } = await uploadFile(fn);
|
|
||||||
|
|
||||||
const { id } = await post(`/app/${appId}/package/create`, {
|
|
||||||
name,
|
|
||||||
hash,
|
|
||||||
});
|
|
||||||
console.log(`Ipa uploaded: ${id}`);
|
|
||||||
},
|
|
||||||
uploadApk: async function({ args }) {
|
|
||||||
const fn = args[0];
|
|
||||||
if (!fn) {
|
|
||||||
throw new Error('Usage: pushy uploadApk <apkFile>');
|
|
||||||
}
|
|
||||||
const name = await getApkVersion(fn);
|
|
||||||
const { appId } = await getSelectedApp('android');
|
|
||||||
|
|
||||||
const { hash } = await uploadFile(fn);
|
|
||||||
|
|
||||||
const { id } = await post(`/app/${appId}/package/create`, {
|
|
||||||
name,
|
|
||||||
hash,
|
|
||||||
});
|
|
||||||
console.log(`Apk uploaded: ${id}`);
|
|
||||||
},
|
|
||||||
packages: async function({ options }) {
|
|
||||||
const platform = checkPlatform(options.platform || (await question('Platform(ios/android):')));
|
|
||||||
const { appId } = await getSelectedApp(platform);
|
|
||||||
await listPackage(appId);
|
|
||||||
},
|
|
||||||
};
|
|
@@ -1,43 +0,0 @@
|
|||||||
/**
|
|
||||||
* Created by tdzl2003 on 2/13/16.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import {question} from './utils';
|
|
||||||
const {
|
|
||||||
post,
|
|
||||||
get,
|
|
||||||
replaceSession,
|
|
||||||
saveSession,
|
|
||||||
closeSession,
|
|
||||||
} = require('./api');
|
|
||||||
const crypto = require('crypto');
|
|
||||||
|
|
||||||
function md5(str) {
|
|
||||||
return crypto.createHash('md5').update(str).digest('hex');
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.commands = {
|
|
||||||
login: async function ({args}){
|
|
||||||
const email = args[0] || await question('email:');
|
|
||||||
const pwd = args[1] || await question('password:', true);
|
|
||||||
const {token, info} = await post('/user/login', {
|
|
||||||
email,
|
|
||||||
pwd: md5(pwd),
|
|
||||||
});
|
|
||||||
replaceSession({token});
|
|
||||||
await saveSession();
|
|
||||||
console.log(`Welcome, ${info.name}.`);
|
|
||||||
},
|
|
||||||
logout: async function (){
|
|
||||||
await closeSession();
|
|
||||||
console.log('Logged out.');
|
|
||||||
},
|
|
||||||
me: async function (){
|
|
||||||
const me = await get('/user/me');
|
|
||||||
for (const k in me) {
|
|
||||||
if (k !== 'ok') {
|
|
||||||
console.log(`${k}: ${me[k]}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
@@ -1,67 +0,0 @@
|
|||||||
/**
|
|
||||||
* Created by tdzl2003 on 2/13/16.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as path from 'path';
|
|
||||||
import * as fs from 'fs-extra';
|
|
||||||
const ApkReader = require('adbkit-apkreader');
|
|
||||||
import ipaReader from './ipaReader';
|
|
||||||
|
|
||||||
var read = require('read');
|
|
||||||
|
|
||||||
export function question(query, password) {
|
|
||||||
if (NO_INTERACTIVE) {
|
|
||||||
return Promise.resolve('');
|
|
||||||
}
|
|
||||||
return new Promise((resolve, reject) =>
|
|
||||||
read(
|
|
||||||
{
|
|
||||||
prompt: query,
|
|
||||||
silent: password,
|
|
||||||
replace: password ? '*' : undefined,
|
|
||||||
},
|
|
||||||
(err, result) => (err ? reject(err) : resolve(result)),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function translateOptions(options) {
|
|
||||||
const ret = {};
|
|
||||||
for (let key in options) {
|
|
||||||
const v = options[key];
|
|
||||||
if (typeof v === 'string') {
|
|
||||||
ret[key] = v.replace(/\$\{(\w+)\}/g, function(v, n) {
|
|
||||||
return options[n] || process.env[n] || v;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
ret[key] = v;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getRNVersion() {
|
|
||||||
const version = JSON.parse(fs.readFileSync(path.resolve('node_modules/react-native/package.json'))).version;
|
|
||||||
|
|
||||||
// We only care about major and minor version.
|
|
||||||
const match = /^(\d+)\.(\d+)\./.exec(version);
|
|
||||||
return {
|
|
||||||
version,
|
|
||||||
major: match[1] | 0,
|
|
||||||
minor: match[2] | 0,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getApkVersion(fn) {
|
|
||||||
const reader = await ApkReader.open(fn);
|
|
||||||
const manifest = await reader.readManifest();
|
|
||||||
return manifest.versionName;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getIPAVersion(fn) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
ipaReader(fn, (err, data) => {
|
|
||||||
err ? reject(err) : resolve(data.metadata.CFBundleShortVersionString);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
@@ -1,58 +0,0 @@
|
|||||||
// var async = require('async');
|
|
||||||
var plist = require('simple-plist');
|
|
||||||
var decompress = require('decompress-zip');
|
|
||||||
// var provisioning = require('provisioning');
|
|
||||||
// var entitlements = require('entitlements');
|
|
||||||
|
|
||||||
var rimraf = require('rimraf');
|
|
||||||
var tmp = require('temporary');
|
|
||||||
var glob = require('glob');
|
|
||||||
|
|
||||||
var output = new tmp.Dir();
|
|
||||||
|
|
||||||
module.exports = function(file, callback) {
|
|
||||||
var data = {};
|
|
||||||
|
|
||||||
var unzipper = new decompress(file);
|
|
||||||
unzipper.extract({
|
|
||||||
path: output.path
|
|
||||||
});
|
|
||||||
|
|
||||||
unzipper.on('error', cleanUp);
|
|
||||||
unzipper.on('extract', function() {
|
|
||||||
var path = glob.sync(output.path + '/Payload/*/')[0];
|
|
||||||
|
|
||||||
data.metadata = plist.readFileSync(path + 'Info.plist');
|
|
||||||
|
|
||||||
cleanUp();
|
|
||||||
/*
|
|
||||||
var tasks = [async.apply(provisioning, path + 'embedded.mobileprovision')];
|
|
||||||
|
|
||||||
// `entitlements` relies on a OS X only CLI tool called `codesign`
|
|
||||||
if (process.platform === 'darwin') {
|
|
||||||
tasks.push(async.apply(entitlements, path));
|
|
||||||
}
|
|
||||||
|
|
||||||
async.parallel(tasks, function(error, results) {
|
|
||||||
if (error) {
|
|
||||||
return cleanUp(error);
|
|
||||||
}
|
|
||||||
|
|
||||||
data.provisioning = results[0];
|
|
||||||
|
|
||||||
// Hard to serialize and it looks messy in output
|
|
||||||
delete data.provisioning.DeveloperCertificates;
|
|
||||||
|
|
||||||
// Will be undefined on non-OSX platforms
|
|
||||||
data.entitlements = results[1];
|
|
||||||
|
|
||||||
return cleanUp();
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
});
|
|
||||||
|
|
||||||
function cleanUp(error) {
|
|
||||||
rimraf.sync(output.path);
|
|
||||||
return callback(error, data);
|
|
||||||
}
|
|
||||||
};
|
|
@@ -1,111 +0,0 @@
|
|||||||
/**
|
|
||||||
* Created by tdzl2003 on 4/2/16.
|
|
||||||
*/
|
|
||||||
|
|
||||||
const {
|
|
||||||
get,
|
|
||||||
post,
|
|
||||||
put,
|
|
||||||
uploadFile,
|
|
||||||
} = require('./api');
|
|
||||||
import { question } from './utils';
|
|
||||||
|
|
||||||
import { checkPlatform, getSelectedApp } from './app';
|
|
||||||
import { choosePackage } from './package';
|
|
||||||
|
|
||||||
async function showVersion(appId, offset) {
|
|
||||||
const { data, count } = await get(`/app/${appId}/version/list`);
|
|
||||||
console.log(`Offset ${offset}`);
|
|
||||||
for (const version of data) {
|
|
||||||
let packageInfo = version.packages.slice(0, 3).map(v=>v.name).join(', ');
|
|
||||||
const count = version.packages.length;
|
|
||||||
if (count > 3) {
|
|
||||||
packageInfo += `...and ${count-3} more`;
|
|
||||||
}
|
|
||||||
if (count === 0) {
|
|
||||||
packageInfo = `(no package)`;
|
|
||||||
} else {
|
|
||||||
packageInfo = `[${packageInfo}]`;
|
|
||||||
}
|
|
||||||
console.log(`${version.id}) ${version.hash.slice(0, 8)} ${version.name} ${packageInfo}`);
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function listVersions(appId) {
|
|
||||||
let offset = 0;
|
|
||||||
while (true) {
|
|
||||||
await showVersion(appId, offset);
|
|
||||||
const cmd = await question('page Up/page Down/Begin/Quit(U/D/B/Q)');
|
|
||||||
switch (cmd.toLowerCase()) {
|
|
||||||
case 'u': offset = Math.max(0, offset - 10); break;
|
|
||||||
case 'd': offset += 10; break;
|
|
||||||
case 'b': offset = 0; break;
|
|
||||||
case 'q': return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function chooseVersion(appId) {
|
|
||||||
let offset = 0;
|
|
||||||
while (true) {
|
|
||||||
const data = await showVersion(appId, offset);
|
|
||||||
const cmd = await question('Enter versionId or page Up/page Down/Begin(U/D/B)');
|
|
||||||
switch (cmd.toLowerCase()) {
|
|
||||||
case 'U': offset = Math.max(0, offset - 10); break;
|
|
||||||
case 'D': offset += 10; break;
|
|
||||||
case 'B': offset = 0; break;
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
const v = data.find(v=>v.id === (cmd | 0));
|
|
||||||
if (v) {
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const commands = {
|
|
||||||
publish: async function({args, options}) {
|
|
||||||
const fn = args[0];
|
|
||||||
const {name, description, metaInfo } = options;
|
|
||||||
|
|
||||||
if (!fn) {
|
|
||||||
throw new Error('Usage: pushy publish <ppkFile> --platform ios|android');
|
|
||||||
}
|
|
||||||
|
|
||||||
const platform = checkPlatform(options.platform || await question('Platform(ios/android):'));
|
|
||||||
const { appId } = await getSelectedApp(platform);
|
|
||||||
|
|
||||||
const { hash } = await uploadFile(fn);
|
|
||||||
|
|
||||||
const { id } = await post(`/app/${appId}/version/create`, {
|
|
||||||
name: name || await question('Enter version name:') || '(未命名)',
|
|
||||||
hash,
|
|
||||||
description: description || await question('Enter description:'),
|
|
||||||
metaInfo: metaInfo || await question('Enter meta info:'),
|
|
||||||
});
|
|
||||||
console.log(`Version published: ${id}`);
|
|
||||||
|
|
||||||
const v = await question('Would you like to bind packages to this version?(Y/N)');
|
|
||||||
if (v.toLowerCase() === 'y') {
|
|
||||||
await this.update({args:[], options:{versionId: id, platform}});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
versions: async function({options}) {
|
|
||||||
const platform = checkPlatform(options.platform || await question('Platform(ios/android):'));
|
|
||||||
const { appId } = await getSelectedApp(platform);
|
|
||||||
await listVersions(appId);
|
|
||||||
},
|
|
||||||
update: async function({args, options}) {
|
|
||||||
const platform = checkPlatform(options.platform || await question('Platform(ios/android):'));
|
|
||||||
const { appId } = await getSelectedApp(platform);
|
|
||||||
const versionId = options.versionId || (await chooseVersion(appId)).id;
|
|
||||||
const pkgId = options.packageId || (await choosePackage(appId)).id;
|
|
||||||
await put(`/app/${appId}/package/${pkgId}`, {
|
|
||||||
versionId,
|
|
||||||
});
|
|
||||||
console.log('Ok.');
|
|
||||||
}
|
|
||||||
};
|
|
37
package.json
37
package.json
@@ -1,12 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "react-native-update",
|
"name": "react-native-update",
|
||||||
"version": "5.3.1",
|
"version": "5.5.8",
|
||||||
"description": "react-native hot update",
|
"description": "react-native hot update",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"build-lib": "$ANDROID_HOME/ndk-bundle/ndk-build NDK_PROJECT_PATH=android APP_BUILD_SCRIPT=android/jni/Android.mk NDK_LIBS_OUT=android/lib",
|
"build-lib": "$ANDROID_HOME/ndk-bundle/ndk-build NDK_PROJECT_PATH=android APP_BUILD_SCRIPT=android/jni/Android.mk NDK_LIBS_OUT=android/lib"
|
||||||
"prepare": "node_modules/.bin/babel local-cli/src --out-dir local-cli/lib"
|
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -27,35 +26,5 @@
|
|||||||
"react-native": ">=0.27.0"
|
"react-native": ">=0.27.0"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/reactnativecn/react-native-pushy#readme",
|
"homepage": "https://github.com/reactnativecn/react-native-pushy#readme",
|
||||||
"dependencies": {
|
"dependencies": {}
|
||||||
"adbkit-apkreader": "^3.1.2",
|
|
||||||
"cli-arguments": "^0.2.1",
|
|
||||||
"decompress-zip": "^0.3.1",
|
|
||||||
"fs-extra": "^8.1.0",
|
|
||||||
"glob": "^7.1.2",
|
|
||||||
"gradle-to-js": "^2.0.0",
|
|
||||||
"isomorphic-fetch": "^2.2.1",
|
|
||||||
"progress": "^1.1.8",
|
|
||||||
"read": "^1.0.7",
|
|
||||||
"request": "^2.69.0",
|
|
||||||
"simple-plist": "^0.3.0",
|
|
||||||
"temporary": "^0.0.8",
|
|
||||||
"tty-table": "^2.7.0",
|
|
||||||
"yauzl": "2.4.1",
|
|
||||||
"yazl": "2.3.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"babel-cli": "^6.5.1",
|
|
||||||
"babel-eslint": "^4.1.6",
|
|
||||||
"babel-plugin-syntax-async-functions": "^6.5.0",
|
|
||||||
"babel-plugin-syntax-object-rest-spread": "^6.5.0",
|
|
||||||
"babel-plugin-transform-async-to-generator": "^6.3.13",
|
|
||||||
"babel-plugin-transform-es2015-arrow-functions": "^6.5.2",
|
|
||||||
"babel-plugin-transform-es2015-destructuring": "^6.3.15",
|
|
||||||
"babel-plugin-transform-es2015-modules-commonjs": "^6.3.16",
|
|
||||||
"babel-plugin-transform-es2015-parameters": "^6.5.0",
|
|
||||||
"babel-plugin-transform-es2015-spread": "^6.5.2",
|
|
||||||
"babel-plugin-transform-object-rest-spread": "^6.5.0",
|
|
||||||
"babel-plugin-transform-strict-mode": "^6.5.2"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"plugins": [
|
|
||||||
"transform-es2015-modules-commonjs",
|
|
||||||
"transform-strict-mode"
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,7 +0,0 @@
|
|||||||
/.idea
|
|
||||||
/src
|
|
||||||
/.babelrc
|
|
||||||
/.npmignore
|
|
||||||
/.eslintrc
|
|
||||||
/.nvmrc
|
|
||||||
/.travis.yml
|
|
@@ -1,37 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "react-native-update-cli",
|
|
||||||
"version": "0.1.0",
|
|
||||||
"description": "Command tools for javaScript updater with `pushy` service for react native apps.",
|
|
||||||
"main": "index.js",
|
|
||||||
"bin": {
|
|
||||||
"pushy": "lib/cli.js"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
|
||||||
"prepublish": "node_modules/.bin/babel src --out-dir lib"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/reactnativecn/react-native-pushy.git"
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"react-native",
|
|
||||||
"ios",
|
|
||||||
"android",
|
|
||||||
"update"
|
|
||||||
],
|
|
||||||
"author": "reactnativecn",
|
|
||||||
"license": "BSD-3-Clause",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/reactnativecn/react-native-pushy/issues"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"fs-promise": "^0.4.1"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/reactnativecn/react-native-pushy/tree/master/react-native-pushy-cli",
|
|
||||||
"devDependencies": {
|
|
||||||
"babel-cli": "^6.5.1",
|
|
||||||
"babel-plugin-transform-es2015-modules-commonjs": "^6.5.2",
|
|
||||||
"babel-plugin-transform-strict-mode": "^6.5.2"
|
|
||||||
}
|
|
||||||
}
|
|
53
react-native-pushy-cli/src/cli.js
vendored
53
react-native-pushy-cli/src/cli.js
vendored
@@ -1,53 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
/**
|
|
||||||
* Created by tdzl2003 on 2/13/16.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as path from 'path';
|
|
||||||
import * as fs from 'fs-extra';
|
|
||||||
|
|
||||||
const CLI_MODULE_PATH = function() {
|
|
||||||
return path.resolve(
|
|
||||||
process.cwd(),
|
|
||||||
'node_modules',
|
|
||||||
'react-native-update',
|
|
||||||
'local-cli'
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const PACKAGE_JSON_PATH = function() {
|
|
||||||
return path.resolve(
|
|
||||||
process.cwd(),
|
|
||||||
'node_modules',
|
|
||||||
'react-native-update',
|
|
||||||
'package.json'
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
checkForVersionCommand();
|
|
||||||
|
|
||||||
let cli;
|
|
||||||
const cliPath = CLI_MODULE_PATH();
|
|
||||||
if (fs.existsSync(cliPath)) {
|
|
||||||
cli = require(cliPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cli) {
|
|
||||||
cli.run();
|
|
||||||
} else {
|
|
||||||
console.error('Are you at home directory of a react-native project?');
|
|
||||||
console.error('`pushy install` is under development, please run `npm install react-native-update` to install pushy manually.');
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
function checkForVersionCommand() {
|
|
||||||
if (process.argv.indexOf('-v') >= 0 || process.argv[2] === 'version') {
|
|
||||||
console.log('react-native-update-cli: ' + require('../package.json').version);
|
|
||||||
try {
|
|
||||||
console.log('react-native-update: ' + require(PACKAGE_JSON_PATH()).version);
|
|
||||||
} catch (e) {
|
|
||||||
console.log('react-native-update: n/a - not inside a React Native project directory')
|
|
||||||
}
|
|
||||||
process.exit();
|
|
||||||
}
|
|
||||||
}
|
|
@@ -11,24 +11,25 @@ Pod::Spec.new do |s|
|
|||||||
s.authors = package['author']
|
s.authors = package['author']
|
||||||
s.homepage = package['homepage']
|
s.homepage = package['homepage']
|
||||||
|
|
||||||
s.platform = :ios, "7.0"
|
s.cocoapods_version = '>= 1.6.0'
|
||||||
|
s.platform = :ios, "8.0"
|
||||||
s.source = { :git => 'https://github.com/reactnativecn/react-native-pushy.git', :tag => '#{s.version}' }
|
s.source = { :git => 'https://github.com/reactnativecn/react-native-pushy.git', :tag => '#{s.version}' }
|
||||||
s.libraries = 'bz2', 'z'
|
s.libraries = 'bz2', 'z'
|
||||||
s.vendored_libraries = 'RCTHotUpdate/libRCTHotUpdate.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 => '../../node_modules/react-native-update/scripts/generateiOSBuildTime.sh', :execution_position => :before_compile }
|
s.script_phase = { :name => 'Generate build time', :script => '"$(SRCROOT)/../node_modules/react-native-update/scripts/generateiOSBuildTime.sh"', :execution_position => :before_compile }
|
||||||
|
|
||||||
s.dependency 'React'
|
s.dependency 'React'
|
||||||
s.dependency 'SSZipArchive'
|
s.dependency 'SSZipArchive'
|
||||||
|
|
||||||
s.subspec 'RCTHotUpdate' do |ss|
|
s.subspec 'RCTPushy' do |ss|
|
||||||
ss.source_files = 'ios/RCTHotUpdate/*.{h,m}'
|
ss.source_files = 'ios/RCTPushy/*.{h,m}'
|
||||||
ss.public_header_files = ['ios/RCTHotUpdate/RCTHotUpdate.h']
|
ss.public_header_files = ['ios/RCTPushy/RCTPushy.h']
|
||||||
end
|
end
|
||||||
|
|
||||||
s.subspec 'BSDiff' do |ss|
|
s.subspec 'BSDiff' do |ss|
|
||||||
ss.source_files = 'ios/RCTHotUpdate/BSDiff/**/*.{h,m,c}'
|
ss.source_files = 'ios/RCTPushy/BSDiff/**/*.{h,m,c}'
|
||||||
ss.private_header_files = 'ios/RCTHotUpdate/BSDiff/**/*.h'
|
ss.private_header_files = 'ios/RCTPushy/BSDiff/**/*.h'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
279
yarn.lock
279
yarn.lock
@@ -14,15 +14,6 @@ acorn@^3.1.0:
|
|||||||
version "3.3.0"
|
version "3.3.0"
|
||||||
resolved "http://registry.npm.taobao.org/acorn/download/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a"
|
resolved "http://registry.npm.taobao.org/acorn/download/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a"
|
||||||
|
|
||||||
adbkit-apkreader@^3.1.2:
|
|
||||||
version "3.1.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/adbkit-apkreader/-/adbkit-apkreader-3.1.2.tgz#86a0c676870aba2f16d0f0948d2c94af58417bd5"
|
|
||||||
integrity sha512-xFlRkjEuJ8+hEo6BfUWXyaxDm54RtLCBBC4TzYc1S0SQqrE7r31QWfYaUlJH+eJiPGTUzUCd+SUs1cJaCkATnQ==
|
|
||||||
dependencies:
|
|
||||||
bluebird "^3.4.7"
|
|
||||||
debug "~0.7.4"
|
|
||||||
yauzl "^2.7.0"
|
|
||||||
|
|
||||||
align-text@^0.1.1, align-text@^0.1.3:
|
align-text@^0.1.1, align-text@^0.1.3:
|
||||||
version "0.1.4"
|
version "0.1.4"
|
||||||
resolved "http://registry.npm.taobao.org/align-text/download/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117"
|
resolved "http://registry.npm.taobao.org/align-text/download/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117"
|
||||||
@@ -73,6 +64,17 @@ anymatch@^1.3.0:
|
|||||||
arrify "^1.0.0"
|
arrify "^1.0.0"
|
||||||
micromatch "^2.1.5"
|
micromatch "^2.1.5"
|
||||||
|
|
||||||
|
app-info-parser@^0.3.5:
|
||||||
|
version "0.3.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/app-info-parser/-/app-info-parser-0.3.5.tgz#93bec9a635b9e971f89ea9fcb71f32d771a1988d"
|
||||||
|
integrity sha512-VFUr4jGtwEwg1c+sNeJKiDLCSl2mqw6lrJBnvL1wEYdhiDTd0sqmJvxOpnB7Zh/g2P0n04ExBSJ4JHCcp4WP3g==
|
||||||
|
dependencies:
|
||||||
|
bplist-parser "^0.2.0"
|
||||||
|
bytebuffer "^5.0.1"
|
||||||
|
cgbi-to-png "^1.0.7"
|
||||||
|
isomorphic-unzip "^1.1.5"
|
||||||
|
plist "^3.0.1"
|
||||||
|
|
||||||
aproba@^1.0.3:
|
aproba@^1.0.3:
|
||||||
version "1.1.1"
|
version "1.1.1"
|
||||||
resolved "http://registry.npm.taobao.org/aproba/download/aproba-1.1.1.tgz#95d3600f07710aa0e9298c726ad5ecf2eacbabab"
|
resolved "http://registry.npm.taobao.org/aproba/download/aproba-1.1.1.tgz#95d3600f07710aa0e9298c726ad5ecf2eacbabab"
|
||||||
@@ -524,17 +526,15 @@ babylon@^6.11.0, babylon@^6.15.0:
|
|||||||
version "6.16.1"
|
version "6.16.1"
|
||||||
resolved "http://registry.npm.taobao.org/babylon/download/babylon-6.16.1.tgz#30c5a22f481978a9e7f8cdfdf496b11d94b404d3"
|
resolved "http://registry.npm.taobao.org/babylon/download/babylon-6.16.1.tgz#30c5a22f481978a9e7f8cdfdf496b11d94b404d3"
|
||||||
|
|
||||||
balanced-match@^0.4.1:
|
|
||||||
version "0.4.2"
|
|
||||||
resolved "http://registry.npm.taobao.org/balanced-match/download/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838"
|
|
||||||
|
|
||||||
balanced-match@^1.0.0:
|
balanced-match@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "http://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
||||||
|
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
|
||||||
|
|
||||||
base64-js@1.2.0:
|
base64-js@^1.0.2, base64-js@^1.2.3:
|
||||||
version "1.2.0"
|
version "1.3.1"
|
||||||
resolved "http://registry.npm.taobao.org/base64-js/download/base64-js-1.2.0.tgz#a39992d723584811982be5e290bb6a53d86700f1"
|
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1"
|
||||||
|
integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==
|
||||||
|
|
||||||
bcrypt-pbkdf@^1.0.0:
|
bcrypt-pbkdf@^1.0.0:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
@@ -542,21 +542,15 @@ bcrypt-pbkdf@^1.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
tweetnacl "^0.14.3"
|
tweetnacl "^0.14.3"
|
||||||
|
|
||||||
big-integer@^1.6.7:
|
big-integer@^1.6.44:
|
||||||
version "1.6.32"
|
version "1.6.48"
|
||||||
resolved "http://registry.npm.taobao.org/big-integer/download/big-integer-1.6.32.tgz#5867458b25ecd5bcb36b627c30bb501a13c07e89"
|
resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.48.tgz#8fd88bd1632cba4a1c8c3e3d7159f08bb95b4b9e"
|
||||||
|
integrity sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==
|
||||||
|
|
||||||
binary-extensions@^1.0.0:
|
binary-extensions@^1.0.0:
|
||||||
version "1.8.0"
|
version "1.8.0"
|
||||||
resolved "http://registry.npm.taobao.org/binary-extensions/download/binary-extensions-1.8.0.tgz#48ec8d16df4377eae5fa5884682480af4d95c774"
|
resolved "http://registry.npm.taobao.org/binary-extensions/download/binary-extensions-1.8.0.tgz#48ec8d16df4377eae5fa5884682480af4d95c774"
|
||||||
|
|
||||||
binary@^0.3.0:
|
|
||||||
version "0.3.0"
|
|
||||||
resolved "http://registry.npm.taobao.org/binary/download/binary-0.3.0.tgz#9f60553bc5ce8c3386f3b553cff47462adecaa79"
|
|
||||||
dependencies:
|
|
||||||
buffers "~0.1.1"
|
|
||||||
chainsaw "~0.1.0"
|
|
||||||
|
|
||||||
block-stream@*:
|
block-stream@*:
|
||||||
version "0.0.9"
|
version "0.0.9"
|
||||||
resolved "http://registry.npm.taobao.org/block-stream/download/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a"
|
resolved "http://registry.npm.taobao.org/block-stream/download/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a"
|
||||||
@@ -567,39 +561,23 @@ bluebird@^2.9.33:
|
|||||||
version "2.11.0"
|
version "2.11.0"
|
||||||
resolved "http://registry.npm.taobao.org/bluebird/download/bluebird-2.11.0.tgz#534b9033c022c9579c56ba3b3e5a5caafbb650e1"
|
resolved "http://registry.npm.taobao.org/bluebird/download/bluebird-2.11.0.tgz#534b9033c022c9579c56ba3b3e5a5caafbb650e1"
|
||||||
|
|
||||||
bluebird@^3.4.7:
|
|
||||||
version "3.5.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.5.tgz#a8d0afd73251effbbd5fe384a77d73003c17a71f"
|
|
||||||
integrity sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==
|
|
||||||
|
|
||||||
boom@2.x.x:
|
boom@2.x.x:
|
||||||
version "2.10.1"
|
version "2.10.1"
|
||||||
resolved "http://registry.npm.taobao.org/boom/download/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f"
|
resolved "http://registry.npm.taobao.org/boom/download/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f"
|
||||||
dependencies:
|
dependencies:
|
||||||
hoek "2.x.x"
|
hoek "2.x.x"
|
||||||
|
|
||||||
bplist-creator@0.0.7:
|
bplist-parser@^0.2.0:
|
||||||
version "0.0.7"
|
version "0.2.0"
|
||||||
resolved "http://registry.npm.taobao.org/bplist-creator/download/bplist-creator-0.0.7.tgz#37df1536092824b87c42f957b01344117372ae45"
|
resolved "https://registry.yarnpkg.com/bplist-parser/-/bplist-parser-0.2.0.tgz#43a9d183e5bf9d545200ceac3e712f79ebbe8d0e"
|
||||||
|
integrity sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==
|
||||||
dependencies:
|
dependencies:
|
||||||
stream-buffers "~2.2.0"
|
big-integer "^1.6.44"
|
||||||
|
|
||||||
bplist-parser@0.1.1:
|
|
||||||
version "0.1.1"
|
|
||||||
resolved "http://registry.npm.taobao.org/bplist-parser/download/bplist-parser-0.1.1.tgz#d60d5dcc20cba6dc7e1f299b35d3e1f95dafbae6"
|
|
||||||
dependencies:
|
|
||||||
big-integer "^1.6.7"
|
|
||||||
|
|
||||||
brace-expansion@^1.0.0:
|
brace-expansion@^1.0.0:
|
||||||
version "1.1.6"
|
|
||||||
resolved "http://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9"
|
|
||||||
dependencies:
|
|
||||||
balanced-match "^0.4.1"
|
|
||||||
concat-map "0.0.1"
|
|
||||||
|
|
||||||
brace-expansion@^1.1.7:
|
|
||||||
version "1.1.11"
|
version "1.1.11"
|
||||||
resolved "http://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
||||||
|
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
|
||||||
dependencies:
|
dependencies:
|
||||||
balanced-match "^1.0.0"
|
balanced-match "^1.0.0"
|
||||||
concat-map "0.0.1"
|
concat-map "0.0.1"
|
||||||
@@ -631,9 +609,25 @@ buffer-shims@^1.0.0:
|
|||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "http://registry.npm.taobao.org/buffer-shims/download/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51"
|
resolved "http://registry.npm.taobao.org/buffer-shims/download/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51"
|
||||||
|
|
||||||
buffers@~0.1.1:
|
buffer@^5.0.7, buffer@^5.1.0:
|
||||||
version "0.1.1"
|
version "5.4.3"
|
||||||
resolved "http://registry.npm.taobao.org/buffers/download/buffers-0.1.1.tgz#b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb"
|
resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.4.3.tgz#3fbc9c69eb713d323e3fc1a895eee0710c072115"
|
||||||
|
integrity sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A==
|
||||||
|
dependencies:
|
||||||
|
base64-js "^1.0.2"
|
||||||
|
ieee754 "^1.1.4"
|
||||||
|
|
||||||
|
bufferpack@0.0.6:
|
||||||
|
version "0.0.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/bufferpack/-/bufferpack-0.0.6.tgz#fb3d8738a0e1e4e03bcff99f9a75f9ec18a9d73e"
|
||||||
|
integrity sha1-+z2HOKDh5OA7z/mfmnX57Bip1z4=
|
||||||
|
|
||||||
|
bytebuffer@^5.0.1:
|
||||||
|
version "5.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd"
|
||||||
|
integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0=
|
||||||
|
dependencies:
|
||||||
|
long "~3"
|
||||||
|
|
||||||
camelcase@^1.2.1:
|
camelcase@^1.2.1:
|
||||||
version "1.2.1"
|
version "1.2.1"
|
||||||
@@ -655,11 +649,15 @@ center-align@^0.1.1:
|
|||||||
align-text "^0.1.3"
|
align-text "^0.1.3"
|
||||||
lazy-cache "^1.0.3"
|
lazy-cache "^1.0.3"
|
||||||
|
|
||||||
chainsaw@~0.1.0:
|
cgbi-to-png@^1.0.7:
|
||||||
version "0.1.0"
|
version "1.0.7"
|
||||||
resolved "http://registry.npm.taobao.org/chainsaw/download/chainsaw-0.1.0.tgz#5eab50b28afe58074d0d58291388828b5e5fbc98"
|
resolved "https://registry.yarnpkg.com/cgbi-to-png/-/cgbi-to-png-1.0.7.tgz#c7497580f76f87c2f5d825748a9d902b4072c004"
|
||||||
|
integrity sha512-YR80kxTPuq9oRpZUdQmNEQWrmTKLINk1cfLVfyrV7Rfr9KLtLJdcockPKbreIr4JYAq+DhHBR7w+WA/tF5VDaQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
traverse ">=0.3.0 <0.4"
|
bufferpack "0.0.6"
|
||||||
|
crc "^3.3.0"
|
||||||
|
stream-to-buffer "^0.1.0"
|
||||||
|
streamifier "^0.1.1"
|
||||||
|
|
||||||
chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1:
|
chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1:
|
||||||
version "1.1.3"
|
version "1.1.3"
|
||||||
@@ -765,7 +763,8 @@ commoner@~0.10.3:
|
|||||||
|
|
||||||
concat-map@0.0.1:
|
concat-map@0.0.1:
|
||||||
version "0.0.1"
|
version "0.0.1"
|
||||||
resolved "http://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||||
|
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
|
||||||
|
|
||||||
console-control-strings@^1.0.0, console-control-strings@~1.1.0:
|
console-control-strings@^1.0.0, console-control-strings@~1.1.0:
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
@@ -787,6 +786,13 @@ core-util-is@~1.0.0:
|
|||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "http://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
resolved "http://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||||
|
|
||||||
|
crc@^3.3.0:
|
||||||
|
version "3.8.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/crc/-/crc-3.8.0.tgz#ad60269c2c856f8c299e2c4cc0de4556914056c6"
|
||||||
|
integrity sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==
|
||||||
|
dependencies:
|
||||||
|
buffer "^5.1.0"
|
||||||
|
|
||||||
cross-spawn@^6.0.0:
|
cross-spawn@^6.0.0:
|
||||||
version "6.0.5"
|
version "6.0.5"
|
||||||
resolved "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
|
resolved "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
|
||||||
@@ -843,10 +849,6 @@ debug@^2.1.1, debug@^2.2.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
ms "0.7.2"
|
ms "0.7.2"
|
||||||
|
|
||||||
debug@~0.7.4:
|
|
||||||
version "0.7.4"
|
|
||||||
resolved "http://registry.npm.taobao.org/debug/download/debug-0.7.4.tgz#06e1ea8082c2cb14e39806e22e2f6f757f92af39"
|
|
||||||
|
|
||||||
debug@~2.2.0:
|
debug@~2.2.0:
|
||||||
version "2.2.0"
|
version "2.2.0"
|
||||||
resolved "http://registry.npm.taobao.org/debug/download/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da"
|
resolved "http://registry.npm.taobao.org/debug/download/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da"
|
||||||
@@ -857,18 +859,6 @@ decamelize@^1.0.0, decamelize@^1.2.0:
|
|||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "http://registry.npm.taobao.org/decamelize/download/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
resolved "http://registry.npm.taobao.org/decamelize/download/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
||||||
|
|
||||||
decompress-zip@^0.3.1:
|
|
||||||
version "0.3.1"
|
|
||||||
resolved "http://registry.npm.taobao.org/decompress-zip/download/decompress-zip-0.3.1.tgz#3e4c6972fe80d89bb0fa9542e30044019ae6f626"
|
|
||||||
dependencies:
|
|
||||||
binary "^0.3.0"
|
|
||||||
graceful-fs "^4.1.3"
|
|
||||||
mkpath "^0.1.0"
|
|
||||||
nopt "^3.0.1"
|
|
||||||
q "^1.1.2"
|
|
||||||
readable-stream "^1.1.8"
|
|
||||||
touch "0.0.3"
|
|
||||||
|
|
||||||
deep-extend@~0.4.0:
|
deep-extend@~0.4.0:
|
||||||
version "0.4.1"
|
version "0.4.1"
|
||||||
resolved "http://registry.npm.taobao.org/deep-extend/download/deep-extend-0.4.1.tgz#efe4113d08085f4e6f9687759810f807469e2253"
|
resolved "http://registry.npm.taobao.org/deep-extend/download/deep-extend-0.4.1.tgz#efe4113d08085f4e6f9687759810f807469e2253"
|
||||||
@@ -1006,12 +996,6 @@ extsprintf@1.0.2:
|
|||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "http://registry.npm.taobao.org/extsprintf/download/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550"
|
resolved "http://registry.npm.taobao.org/extsprintf/download/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550"
|
||||||
|
|
||||||
fd-slicer@~1.0.1:
|
|
||||||
version "1.0.1"
|
|
||||||
resolved "http://registry.npm.taobao.org/fd-slicer/download/fd-slicer-1.0.1.tgz#8b5bcbd9ec327c5041bf9ab023fd6750f1177e65"
|
|
||||||
dependencies:
|
|
||||||
pend "~1.2.0"
|
|
||||||
|
|
||||||
fd-slicer@~1.1.0:
|
fd-slicer@~1.1.0:
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e"
|
resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e"
|
||||||
@@ -1186,17 +1170,6 @@ glob@^7.0.0, glob@^7.0.5:
|
|||||||
once "^1.3.0"
|
once "^1.3.0"
|
||||||
path-is-absolute "^1.0.0"
|
path-is-absolute "^1.0.0"
|
||||||
|
|
||||||
glob@^7.1.2:
|
|
||||||
version "7.1.2"
|
|
||||||
resolved "http://registry.npm.taobao.org/glob/download/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
|
|
||||||
dependencies:
|
|
||||||
fs.realpath "^1.0.0"
|
|
||||||
inflight "^1.0.4"
|
|
||||||
inherits "2"
|
|
||||||
minimatch "^3.0.4"
|
|
||||||
once "^1.3.0"
|
|
||||||
path-is-absolute "^1.0.0"
|
|
||||||
|
|
||||||
globals@^6.4.0:
|
globals@^6.4.0:
|
||||||
version "6.4.1"
|
version "6.4.1"
|
||||||
resolved "http://registry.npm.taobao.org/globals/download/globals-6.4.1.tgz#8498032b3b6d1cc81eebc5f79690d8fe29fabf4f"
|
resolved "http://registry.npm.taobao.org/globals/download/globals-6.4.1.tgz#8498032b3b6d1cc81eebc5f79690d8fe29fabf4f"
|
||||||
@@ -1205,7 +1178,7 @@ globals@^9.0.0:
|
|||||||
version "9.16.0"
|
version "9.16.0"
|
||||||
resolved "http://registry.npm.taobao.org/globals/download/globals-9.16.0.tgz#63e903658171ec2d9f51b1d31de5e2b8dc01fb80"
|
resolved "http://registry.npm.taobao.org/globals/download/globals-9.16.0.tgz#63e903658171ec2d9f51b1d31de5e2b8dc01fb80"
|
||||||
|
|
||||||
graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.4:
|
graceful-fs@^4.1.2, graceful-fs@^4.1.4:
|
||||||
version "4.1.11"
|
version "4.1.11"
|
||||||
resolved "http://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
|
resolved "http://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
|
||||||
|
|
||||||
@@ -1288,6 +1261,11 @@ iconv-lite@^0.4.5, iconv-lite@~0.4.13:
|
|||||||
version "0.4.15"
|
version "0.4.15"
|
||||||
resolved "http://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb"
|
resolved "http://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb"
|
||||||
|
|
||||||
|
ieee754@^1.1.4:
|
||||||
|
version "1.1.13"
|
||||||
|
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84"
|
||||||
|
integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==
|
||||||
|
|
||||||
inflight@^1.0.4:
|
inflight@^1.0.4:
|
||||||
version "1.0.6"
|
version "1.0.6"
|
||||||
resolved "http://registry.npm.taobao.org/inflight/download/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
resolved "http://registry.npm.taobao.org/inflight/download/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||||
@@ -1410,10 +1388,6 @@ is-typedarray@~1.0.0:
|
|||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "http://registry.npm.taobao.org/is-typedarray/download/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
|
resolved "http://registry.npm.taobao.org/is-typedarray/download/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
|
||||||
|
|
||||||
isarray@0.0.1:
|
|
||||||
version "0.0.1"
|
|
||||||
resolved "http://registry.npm.taobao.org/isarray/download/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
|
|
||||||
|
|
||||||
isarray@1.0.0, isarray@~1.0.0:
|
isarray@1.0.0, isarray@~1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "http://registry.npm.taobao.org/isarray/download/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
|
resolved "http://registry.npm.taobao.org/isarray/download/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
|
||||||
@@ -1436,6 +1410,14 @@ isomorphic-fetch@^2.2.1:
|
|||||||
node-fetch "^1.0.1"
|
node-fetch "^1.0.1"
|
||||||
whatwg-fetch ">=0.10.0"
|
whatwg-fetch ">=0.10.0"
|
||||||
|
|
||||||
|
isomorphic-unzip@^1.1.5:
|
||||||
|
version "1.1.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/isomorphic-unzip/-/isomorphic-unzip-1.1.5.tgz#9e5a18e77e3e760b631ee451f643c784b4f880dd"
|
||||||
|
integrity sha512-2McA51lWhmO3Kk438jxVcYeh6L+AOqVnl9XdX1yI7GlLA9RwEyTBgGem1rNuRIU2abAmOiv+IagThdUxASY4IA==
|
||||||
|
dependencies:
|
||||||
|
buffer "^5.0.7"
|
||||||
|
yauzl "^2.8.0"
|
||||||
|
|
||||||
isstream@~0.1.2:
|
isstream@~0.1.2:
|
||||||
version "0.1.2"
|
version "0.1.2"
|
||||||
resolved "http://registry.npm.taobao.org/isstream/download/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
|
resolved "http://registry.npm.taobao.org/isstream/download/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
|
||||||
@@ -1652,6 +1634,11 @@ lodash@^4.2.0:
|
|||||||
version "4.17.4"
|
version "4.17.4"
|
||||||
resolved "http://registry.npm.taobao.org/lodash/download/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
|
resolved "http://registry.npm.taobao.org/lodash/download/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
|
||||||
|
|
||||||
|
long@~3:
|
||||||
|
version "3.2.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b"
|
||||||
|
integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=
|
||||||
|
|
||||||
longest@^1.0.1:
|
longest@^1.0.1:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "http://registry.npm.taobao.org/longest/download/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
|
resolved "http://registry.npm.taobao.org/longest/download/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
|
||||||
@@ -1723,12 +1710,6 @@ minimatch@^2.0.3:
|
|||||||
dependencies:
|
dependencies:
|
||||||
brace-expansion "^1.0.0"
|
brace-expansion "^1.0.0"
|
||||||
|
|
||||||
minimatch@^3.0.4:
|
|
||||||
version "3.0.4"
|
|
||||||
resolved "http://registry.npm.taobao.org/minimatch/download/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
|
||||||
dependencies:
|
|
||||||
brace-expansion "^1.1.7"
|
|
||||||
|
|
||||||
minimist@0.0.8:
|
minimist@0.0.8:
|
||||||
version "0.0.8"
|
version "0.0.8"
|
||||||
resolved "http://registry.npm.taobao.org/minimist/download/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
|
resolved "http://registry.npm.taobao.org/minimist/download/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
|
||||||
@@ -1743,10 +1724,6 @@ minimist@^1.1.0, minimist@^1.2.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
minimist "0.0.8"
|
minimist "0.0.8"
|
||||||
|
|
||||||
mkpath@^0.1.0:
|
|
||||||
version "0.1.0"
|
|
||||||
resolved "http://registry.npm.taobao.org/mkpath/download/mkpath-0.1.0.tgz#7554a6f8d871834cc97b5462b122c4c124d6de91"
|
|
||||||
|
|
||||||
ms@0.7.1:
|
ms@0.7.1:
|
||||||
version "0.7.1"
|
version "0.7.1"
|
||||||
resolved "http://registry.npm.taobao.org/ms/download/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098"
|
resolved "http://registry.npm.taobao.org/ms/download/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098"
|
||||||
@@ -1789,18 +1766,12 @@ node-pre-gyp@^0.6.29:
|
|||||||
tar "~2.2.1"
|
tar "~2.2.1"
|
||||||
tar-pack "~3.3.0"
|
tar-pack "~3.3.0"
|
||||||
|
|
||||||
nopt@^3.0.1, nopt@~3.0.6:
|
nopt@~3.0.6:
|
||||||
version "3.0.6"
|
version "3.0.6"
|
||||||
resolved "http://registry.npm.taobao.org/nopt/download/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9"
|
resolved "http://registry.npm.taobao.org/nopt/download/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9"
|
||||||
dependencies:
|
dependencies:
|
||||||
abbrev "1"
|
abbrev "1"
|
||||||
|
|
||||||
nopt@~1.0.10:
|
|
||||||
version "1.0.10"
|
|
||||||
resolved "http://registry.npm.taobao.org/nopt/download/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee"
|
|
||||||
dependencies:
|
|
||||||
abbrev "1"
|
|
||||||
|
|
||||||
normalize-path@^2.0.1:
|
normalize-path@^2.0.1:
|
||||||
version "2.0.1"
|
version "2.0.1"
|
||||||
resolved "http://registry.npm.taobao.org/normalize-path/download/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a"
|
resolved "http://registry.npm.taobao.org/normalize-path/download/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a"
|
||||||
@@ -1917,10 +1888,6 @@ p-try@^2.0.0:
|
|||||||
resolved "https://registry.npm.taobao.org/p-try/download/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
|
resolved "https://registry.npm.taobao.org/p-try/download/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
|
||||||
integrity sha1-yyhoVA4xPWHeWPr741zpAE1VQOY=
|
integrity sha1-yyhoVA4xPWHeWPr741zpAE1VQOY=
|
||||||
|
|
||||||
"package@>= 1.0.0 < 1.2.0":
|
|
||||||
version "1.0.1"
|
|
||||||
resolved "http://registry.npm.taobao.org/package/download/package-1.0.1.tgz#d25a1f99e2506dcb27d6704b83dca8a312e4edcc"
|
|
||||||
|
|
||||||
parse-glob@^3.0.4:
|
parse-glob@^3.0.4:
|
||||||
version "3.0.4"
|
version "3.0.4"
|
||||||
resolved "http://registry.npm.taobao.org/parse-glob/download/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c"
|
resolved "http://registry.npm.taobao.org/parse-glob/download/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c"
|
||||||
@@ -1966,12 +1933,13 @@ pinkie@^2.0.0:
|
|||||||
version "2.0.4"
|
version "2.0.4"
|
||||||
resolved "http://registry.npm.taobao.org/pinkie/download/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
|
resolved "http://registry.npm.taobao.org/pinkie/download/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
|
||||||
|
|
||||||
plist@2.1.0:
|
plist@^3.0.1:
|
||||||
version "2.1.0"
|
version "3.0.1"
|
||||||
resolved "http://registry.npm.taobao.org/plist/download/plist-2.1.0.tgz#57ccdb7a0821df21831217a3cad54e3e146a1025"
|
resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.1.tgz#a9b931d17c304e8912ef0ba3bdd6182baf2e1f8c"
|
||||||
|
integrity sha512-GpgvHHocGRyQm74b6FWEZZVRroHKE1I0/BTjAmySaohK+cUn+hZpbqXkc3KWgW3gQYkqcQej35FohcT0FRlkRQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
base64-js "1.2.0"
|
base64-js "^1.2.3"
|
||||||
xmlbuilder "8.2.2"
|
xmlbuilder "^9.0.7"
|
||||||
xmldom "0.1.x"
|
xmldom "0.1.x"
|
||||||
|
|
||||||
preserve@^0.2.0:
|
preserve@^0.2.0:
|
||||||
@@ -2032,15 +2000,6 @@ read@^1.0.7:
|
|||||||
dependencies:
|
dependencies:
|
||||||
mute-stream "~0.0.4"
|
mute-stream "~0.0.4"
|
||||||
|
|
||||||
readable-stream@^1.1.8:
|
|
||||||
version "1.1.14"
|
|
||||||
resolved "http://registry.npm.taobao.org/readable-stream/download/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9"
|
|
||||||
dependencies:
|
|
||||||
core-util-is "~1.0.0"
|
|
||||||
inherits "~2.0.1"
|
|
||||||
isarray "0.0.1"
|
|
||||||
string_decoder "~0.10.x"
|
|
||||||
|
|
||||||
"readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2:
|
"readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2:
|
||||||
version "2.2.3"
|
version "2.2.3"
|
||||||
resolved "http://registry.npm.taobao.org/readable-stream/download/readable-stream-2.2.3.tgz#9cf49463985df016c8ae8813097a9293a9b33729"
|
resolved "http://registry.npm.taobao.org/readable-stream/download/readable-stream-2.2.3.tgz#9cf49463985df016c8ae8813097a9293a9b33729"
|
||||||
@@ -2257,14 +2216,6 @@ simple-is@~0.2.0:
|
|||||||
version "0.2.0"
|
version "0.2.0"
|
||||||
resolved "http://registry.npm.taobao.org/simple-is/download/simple-is-0.2.0.tgz#2abb75aade39deb5cc815ce10e6191164850baf0"
|
resolved "http://registry.npm.taobao.org/simple-is/download/simple-is-0.2.0.tgz#2abb75aade39deb5cc815ce10e6191164850baf0"
|
||||||
|
|
||||||
simple-plist@^0.3.0:
|
|
||||||
version "0.3.0"
|
|
||||||
resolved "http://registry.npm.taobao.org/simple-plist/download/simple-plist-0.3.0.tgz#929b0e81e826b47929f7561c324a3d348e700a09"
|
|
||||||
dependencies:
|
|
||||||
bplist-creator "0.0.7"
|
|
||||||
bplist-parser "0.1.1"
|
|
||||||
plist "2.1.0"
|
|
||||||
|
|
||||||
slash@^1.0.0:
|
slash@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "http://registry.npm.taobao.org/slash/download/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"
|
resolved "http://registry.npm.taobao.org/slash/download/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"
|
||||||
@@ -2325,15 +2276,28 @@ stable@~0.1.3:
|
|||||||
version "0.1.5"
|
version "0.1.5"
|
||||||
resolved "http://registry.npm.taobao.org/stable/download/stable-0.1.5.tgz#08232f60c732e9890784b5bed0734f8b32a887b9"
|
resolved "http://registry.npm.taobao.org/stable/download/stable-0.1.5.tgz#08232f60c732e9890784b5bed0734f8b32a887b9"
|
||||||
|
|
||||||
stream-buffers@~2.2.0:
|
stream-to-buffer@^0.1.0:
|
||||||
version "2.2.0"
|
version "0.1.0"
|
||||||
resolved "http://registry.npm.taobao.org/stream-buffers/download/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4"
|
resolved "https://registry.yarnpkg.com/stream-to-buffer/-/stream-to-buffer-0.1.0.tgz#26799d903ab2025c9bd550ac47171b00f8dd80a9"
|
||||||
|
integrity sha1-JnmdkDqyAlyb1VCsRxcbAPjdgKk=
|
||||||
|
dependencies:
|
||||||
|
stream-to "~0.2.0"
|
||||||
|
|
||||||
|
stream-to@~0.2.0:
|
||||||
|
version "0.2.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/stream-to/-/stream-to-0.2.2.tgz#84306098d85fdb990b9fa300b1b3ccf55e8ef01d"
|
||||||
|
integrity sha1-hDBgmNhf25kLn6MAsbPM9V6O8B0=
|
||||||
|
|
||||||
stream-transform@^1.0.7:
|
stream-transform@^1.0.7:
|
||||||
version "1.0.8"
|
version "1.0.8"
|
||||||
resolved "https://registry.npm.taobao.org/stream-transform/download/stream-transform-1.0.8.tgz#54f721122d310eca855a16c97939881ab5bbb76c"
|
resolved "https://registry.npm.taobao.org/stream-transform/download/stream-transform-1.0.8.tgz#54f721122d310eca855a16c97939881ab5bbb76c"
|
||||||
integrity sha1-VPchEi0xDsqFWhbJeTmIGrW7t2w=
|
integrity sha1-VPchEi0xDsqFWhbJeTmIGrW7t2w=
|
||||||
|
|
||||||
|
streamifier@^0.1.1:
|
||||||
|
version "0.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/streamifier/-/streamifier-0.1.1.tgz#97e98d8fa4d105d62a2691d1dc07e820db8dfc4f"
|
||||||
|
integrity sha1-l+mNj6TRBdYqJpHR3AfoINuN/E8=
|
||||||
|
|
||||||
string-width@^1.0.1:
|
string-width@^1.0.1:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "http://registry.npm.taobao.org/string-width/download/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
|
resolved "http://registry.npm.taobao.org/string-width/download/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
|
||||||
@@ -2427,12 +2391,6 @@ tar@~2.2.1:
|
|||||||
fstream "^1.0.2"
|
fstream "^1.0.2"
|
||||||
inherits "2"
|
inherits "2"
|
||||||
|
|
||||||
temporary@^0.0.8:
|
|
||||||
version "0.0.8"
|
|
||||||
resolved "http://registry.npm.taobao.org/temporary/download/temporary-0.0.8.tgz#a18a981d28ba8ca36027fb3c30538c3ecb740ac0"
|
|
||||||
dependencies:
|
|
||||||
package ">= 1.0.0 < 1.2.0"
|
|
||||||
|
|
||||||
through@~2.3.8:
|
through@~2.3.8:
|
||||||
version "2.3.8"
|
version "2.3.8"
|
||||||
resolved "http://registry.npm.taobao.org/through/download/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
|
resolved "http://registry.npm.taobao.org/through/download/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
|
||||||
@@ -2441,22 +2399,12 @@ to-fast-properties@^1.0.0, to-fast-properties@^1.0.1:
|
|||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "http://registry.npm.taobao.org/to-fast-properties/download/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320"
|
resolved "http://registry.npm.taobao.org/to-fast-properties/download/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320"
|
||||||
|
|
||||||
touch@0.0.3:
|
|
||||||
version "0.0.3"
|
|
||||||
resolved "http://registry.npm.taobao.org/touch/download/touch-0.0.3.tgz#51aef3d449571d4f287a5d87c9c8b49181a0db1d"
|
|
||||||
dependencies:
|
|
||||||
nopt "~1.0.10"
|
|
||||||
|
|
||||||
tough-cookie@~2.3.0:
|
tough-cookie@~2.3.0:
|
||||||
version "2.3.2"
|
version "2.3.2"
|
||||||
resolved "http://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a"
|
resolved "http://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a"
|
||||||
dependencies:
|
dependencies:
|
||||||
punycode "^1.4.1"
|
punycode "^1.4.1"
|
||||||
|
|
||||||
"traverse@>=0.3.0 <0.4":
|
|
||||||
version "0.3.9"
|
|
||||||
resolved "http://registry.npm.taobao.org/traverse/download/traverse-0.3.9.tgz#717b8f220cc0bb7b44e40514c22b2e8bbc70d8b9"
|
|
||||||
|
|
||||||
trim-right@^1.0.0, trim-right@^1.0.1:
|
trim-right@^1.0.0, trim-right@^1.0.1:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "http://registry.npm.taobao.org/trim-right/download/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
|
resolved "http://registry.npm.taobao.org/trim-right/download/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
|
||||||
@@ -2571,9 +2519,10 @@ wrappy@1:
|
|||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "http://registry.npm.taobao.org/wrappy/download/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
resolved "http://registry.npm.taobao.org/wrappy/download/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||||
|
|
||||||
xmlbuilder@8.2.2:
|
xmlbuilder@^9.0.7:
|
||||||
version "8.2.2"
|
version "9.0.7"
|
||||||
resolved "http://registry.npm.taobao.org/xmlbuilder/download/xmlbuilder-8.2.2.tgz#69248673410b4ba42e1a6136551d2922335aa773"
|
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d"
|
||||||
|
integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=
|
||||||
|
|
||||||
xmldom@0.1.x:
|
xmldom@0.1.x:
|
||||||
version "0.1.27"
|
version "0.1.27"
|
||||||
@@ -2629,13 +2578,7 @@ yargs@~3.27.0:
|
|||||||
window-size "^0.1.2"
|
window-size "^0.1.2"
|
||||||
y18n "^3.2.0"
|
y18n "^3.2.0"
|
||||||
|
|
||||||
yauzl@2.4.1:
|
yauzl@^2.10.0, yauzl@^2.8.0:
|
||||||
version "2.4.1"
|
|
||||||
resolved "http://registry.npm.taobao.org/yauzl/download/yauzl-2.4.1.tgz#9528f442dab1b2284e58b4379bb194e22e0c4005"
|
|
||||||
dependencies:
|
|
||||||
fd-slicer "~1.0.1"
|
|
||||||
|
|
||||||
yauzl@^2.7.0:
|
|
||||||
version "2.10.0"
|
version "2.10.0"
|
||||||
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9"
|
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9"
|
||||||
integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=
|
integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=
|
||||||
|
Reference in New Issue
Block a user