Compare commits
284 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
229c422801 | ||
![]() |
f9d90ebff9 | ||
![]() |
20dfa0461c | ||
![]() |
55aaf4fa45 | ||
![]() |
6d0a31d749 | ||
![]() |
c03c8bcaf3 | ||
![]() |
3ea6b1d08d | ||
![]() |
ea1a8dfad2 | ||
![]() |
ead8f8cac5 | ||
![]() |
b424fc6041 | ||
![]() |
d76e8052f5 | ||
![]() |
3ebf6e95c9 | ||
![]() |
2ae4180840 | ||
![]() |
ec0a9e0a3e | ||
![]() |
b34b70ed01 | ||
![]() |
fddae3d79a | ||
![]() |
7fc0d717d5 | ||
![]() |
686209d50e | ||
![]() |
80b0401b02 | ||
![]() |
786d32d92f | ||
![]() |
27327dbe12 | ||
![]() |
96a81cc36d | ||
![]() |
0aa063c584 | ||
![]() |
4d72d49fe4 | ||
![]() |
53d07406ef | ||
![]() |
d0804cfe15 | ||
![]() |
35939286d0 | ||
![]() |
f49ce30cef | ||
![]() |
e6cd25a2d8 | ||
![]() |
0cc96ee59c | ||
![]() |
6dd71a36e8 | ||
![]() |
8db8d2162e | ||
![]() |
2bf25f37f0 | ||
![]() |
ca3c3d86b5 | ||
![]() |
3edb3cca57 | ||
![]() |
d80531dbcc | ||
![]() |
07003a4767 | ||
![]() |
ee7be88542 | ||
![]() |
cac92b43c7 | ||
![]() |
e66d102e85 | ||
![]() |
94d52bb415 | ||
![]() |
775e567062 | ||
![]() |
bf1701031b | ||
![]() |
d32d395a2a | ||
![]() |
3bc63acad4 | ||
![]() |
898ed85b8c | ||
![]() |
3a526d1b15 | ||
![]() |
05563c3393 | ||
![]() |
b193b4b1df | ||
![]() |
451e298ba5 | ||
![]() |
1b5c07be9e | ||
![]() |
13cf53974e | ||
![]() |
2a1915c50c | ||
![]() |
3de78a9dbd | ||
![]() |
ef065e4072 | ||
![]() |
ff67829a27 | ||
![]() |
206a04b331 | ||
![]() |
d087c167f1 | ||
![]() |
f4c62cc3d1 | ||
![]() |
431940a423 | ||
![]() |
2dc9243bb8 | ||
![]() |
dba4a98fd0 | ||
![]() |
d4d12e1889 | ||
![]() |
daf870fd75 | ||
![]() |
33641fcbef | ||
![]() |
a02ca4fa71 | ||
![]() |
c5a2a10f9d | ||
![]() |
da7e9c6498 | ||
![]() |
30425db7b2 | ||
![]() |
61077bbc38 | ||
![]() |
29648ff56f | ||
![]() |
9080c5f325 | ||
![]() |
58c2248686 | ||
![]() |
cb736d7ec5 | ||
![]() |
f82be5a68c | ||
![]() |
df903f4a0e | ||
![]() |
8e60956af0 | ||
![]() |
6f5d12594b | ||
![]() |
bb2bf06369 | ||
![]() |
ab1250ff5c | ||
![]() |
f720f290d9 | ||
![]() |
0ccacc2f7b | ||
![]() |
1201315bd1 | ||
![]() |
ca7878a9db | ||
![]() |
f545d654dc | ||
![]() |
f8fec9b5f0 | ||
![]() |
116d9959c2 | ||
![]() |
50d98a941c | ||
![]() |
4226865970 | ||
![]() |
736b82aac6 | ||
![]() |
d9e307659f | ||
![]() |
ed135f7b4e | ||
![]() |
94cda441b2 | ||
![]() |
2097ce3128 | ||
![]() |
c4d2523a92 | ||
![]() |
48e0849804 | ||
![]() |
9d9fbd3315 | ||
![]() |
e6a8855502 | ||
![]() |
8678a748fd | ||
![]() |
6f222fcc99 | ||
![]() |
7782025e38 | ||
![]() |
69aed18b78 | ||
![]() |
29e258c131 | ||
![]() |
49e585a561 | ||
![]() |
0e89b270cc | ||
![]() |
7c8e75587b | ||
![]() |
84fee71df6 | ||
![]() |
db548d03dd | ||
![]() |
fc82addd75 | ||
![]() |
90e7c00cf6 | ||
![]() |
eea7ff26f2 | ||
![]() |
684dc8267d | ||
![]() |
5786bf8132 | ||
![]() |
1bd5fbbc94 | ||
![]() |
cd2eb9417a | ||
![]() |
7d8730f590 | ||
![]() |
e3081a02db | ||
![]() |
ec8c475c54 | ||
![]() |
ac18785e50 | ||
![]() |
e80317415c | ||
![]() |
f5c307deca | ||
![]() |
b4feae292d | ||
![]() |
a1c2679427 | ||
![]() |
17ff366f51 | ||
![]() |
3c5792423e | ||
![]() |
d071fbfc2b | ||
![]() |
17dffa1eb5 | ||
![]() |
bcd61315e9 | ||
![]() |
f626cc1933 | ||
![]() |
4ba3f25972 | ||
![]() |
cd695b1ffb | ||
![]() |
37a1a5a18b | ||
![]() |
5a2ebf8df7 | ||
![]() |
95ba5f364b | ||
![]() |
841228c341 | ||
![]() |
93049f1e54 | ||
![]() |
a966655faf | ||
![]() |
a4052091e0 | ||
![]() |
ebb5defb10 | ||
![]() |
a509ff8e30 | ||
![]() |
59fcba15ee | ||
![]() |
c6f9bb20a1 | ||
![]() |
9e6c7ea769 | ||
![]() |
f461c8ddd2 | ||
![]() |
4cbeb7bec4 | ||
![]() |
ed7f5ac606 | ||
![]() |
6abb2c7a5d | ||
![]() |
a4a372f17e | ||
![]() |
48693e3b45 | ||
![]() |
2d805fb38e | ||
![]() |
92c421b30f | ||
![]() |
dbd0880295 | ||
![]() |
f110df1206 | ||
![]() |
d17eac48f0 | ||
![]() |
8e1a639dda | ||
![]() |
5999670917 | ||
![]() |
0f6875d8d5 | ||
![]() |
3752ad4e5d | ||
![]() |
a2f01b6213 | ||
![]() |
c2499f799b | ||
![]() |
680f77a8d8 | ||
![]() |
eaae1286f4 | ||
![]() |
20a21ae894 | ||
![]() |
5abe7b181b | ||
![]() |
e859238d97 | ||
![]() |
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 | ||
![]() |
13b260b323 | ||
![]() |
a69b81502a | ||
![]() |
eb67431567 | ||
![]() |
f9ff690157 | ||
![]() |
f1178ce8a2 | ||
![]() |
c638cd45ac | ||
![]() |
6eb731b6fb | ||
![]() |
a87763fdd0 | ||
![]() |
92ec598d2a | ||
![]() |
af9b500260 | ||
![]() |
4f41e428cb | ||
![]() |
e463b32709 | ||
![]() |
08ac354ba5 | ||
![]() |
c40bf71032 | ||
![]() |
e59841c074 | ||
![]() |
e26aca2e5c | ||
![]() |
8ec528124f | ||
![]() |
f010f6183a | ||
![]() |
679b02ea73 | ||
![]() |
3b69156c4a | ||
![]() |
5a13f82f2e | ||
![]() |
617fb0c1a2 | ||
![]() |
00c1eac457 | ||
![]() |
84ffaa7f5a | ||
![]() |
1e5d73c0d3 | ||
![]() |
df98736c3b | ||
![]() |
c654022300 | ||
![]() |
8a237845e2 | ||
![]() |
8b31779b07 | ||
![]() |
84fde13a79 | ||
![]() |
1e9650478d | ||
![]() |
7e11356cb9 | ||
![]() |
0eaf27aea9 | ||
![]() |
3353c16fa3 | ||
![]() |
93d2a6cccb | ||
![]() |
cfdc26f71d | ||
![]() |
b6a08a19c8 | ||
![]() |
ef53716df3 | ||
![]() |
551cbc33cc | ||
![]() |
56e6d790c1 | ||
![]() |
976cc5f218 | ||
![]() |
6fd04a1cc3 | ||
![]() |
31a0eadbbf | ||
![]() |
6f0755e571 | ||
![]() |
4099986a9c | ||
![]() |
48101bbd51 | ||
![]() |
1c2507e631 | ||
![]() |
b5e273deef | ||
![]() |
b55a40c92c | ||
![]() |
d23178a851 | ||
![]() |
b639f3619f | ||
![]() |
e905476551 | ||
![]() |
ee1a48b0d5 | ||
![]() |
851f14e258 | ||
![]() |
34d10973a7 | ||
![]() |
5ab361ed54 | ||
![]() |
a7f3d23439 | ||
![]() |
6b5ee3dd46 | ||
![]() |
f4c6991b0b | ||
![]() |
f6ad543854 |
18
.gitignore
vendored
@@ -1,9 +1,6 @@
|
|||||||
/.idea
|
.vscode
|
||||||
/node_modules
|
android/build
|
||||||
/local-cli/lib
|
android/obj
|
||||||
/react-native-pushy-cli/node_modules
|
|
||||||
/react-native-pushy-cli/lib
|
|
||||||
/android/build
|
|
||||||
*.iml
|
*.iml
|
||||||
|
|
||||||
# OSX
|
# OSX
|
||||||
@@ -35,8 +32,15 @@ project.xcworkspace
|
|||||||
.idea
|
.idea
|
||||||
.gradle
|
.gradle
|
||||||
local.properties
|
local.properties
|
||||||
|
**/.project
|
||||||
|
**/.settings
|
||||||
|
**/.classpath
|
||||||
|
|
||||||
# node.js
|
# node.js
|
||||||
#
|
#
|
||||||
node_modules/
|
node_modules/
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
|
||||||
|
Example/**/update.json
|
||||||
|
yarn-error.log
|
||||||
|
Example/testHotUpdate/.pushy
|
||||||
|
6
.gitmodules
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[submodule "android/jni/lzma"]
|
||||||
|
path = android/jni/lzma
|
||||||
|
url = https://github.com/sisong/lzma.git
|
||||||
|
[submodule "android/jni/HDiffPatch"]
|
||||||
|
path = android/jni/HDiffPatch
|
||||||
|
url = https://github.com/sisong/HDiffPatch.git
|
24
.npmignore
@@ -1,13 +1,11 @@
|
|||||||
/.idea
|
.babelrc
|
||||||
/.babelrc
|
.npmignore
|
||||||
/.npmignore
|
.eslintrc
|
||||||
/.eslintrc
|
.nvmrc
|
||||||
/.nvmrc
|
.travis.yml
|
||||||
/.travis.yml
|
Example
|
||||||
/local-cli/src
|
android/build
|
||||||
/react-native-pushy-cli
|
.vscode
|
||||||
/Example
|
|
||||||
/android/build
|
|
||||||
|
|
||||||
# OSX
|
# OSX
|
||||||
#
|
#
|
||||||
@@ -38,6 +36,8 @@ project.xcworkspace
|
|||||||
.idea
|
.idea
|
||||||
.gradle
|
.gradle
|
||||||
local.properties
|
local.properties
|
||||||
|
android/build
|
||||||
|
android/obj
|
||||||
|
|
||||||
# node.js
|
# node.js
|
||||||
#
|
#
|
||||||
@@ -45,4 +45,6 @@ node_modules/
|
|||||||
npm-debug.log
|
npm-debug.log
|
||||||
Example
|
Example
|
||||||
yarn.lock
|
yarn.lock
|
||||||
android/jni
|
|
||||||
|
domains.json
|
||||||
|
endpoints.json
|
@@ -1,5 +1,4 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
printWidth: 120,
|
|
||||||
trailingComma: 'all',
|
trailingComma: 'all',
|
||||||
singleQuote: true,
|
singleQuote: true,
|
||||||
};
|
};
|
||||||
|
6
Example/testHotUpdate/.buckconfig
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
[android]
|
||||||
|
target = Google Inc.:Google APIs:23
|
||||||
|
|
||||||
|
[maven_repositories]
|
||||||
|
central = https://repo1.maven.org/maven2
|
2
Example/testHotUpdate/.bundle/config
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
BUNDLE_PATH: "vendor/bundle"
|
||||||
|
BUNDLE_FORCE_RUBY_PLATFORM: 1
|
4
Example/testHotUpdate/.eslintrc.js
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: '@react-native-community',
|
||||||
|
};
|
67
Example/testHotUpdate/.flowconfig
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
[ignore]
|
||||||
|
; We fork some components by platform
|
||||||
|
.*/*[.]android.js
|
||||||
|
|
||||||
|
; Ignore "BUCK" generated dirs
|
||||||
|
<PROJECT_ROOT>/\.buckd/
|
||||||
|
|
||||||
|
; Ignore polyfills
|
||||||
|
node_modules/react-native/Libraries/polyfills/.*
|
||||||
|
|
||||||
|
; Flow doesn't support platforms
|
||||||
|
.*/Libraries/Utilities/LoadingView.js
|
||||||
|
|
||||||
|
.*/node_modules/resolve/test/resolver/malformed_package_json/package\.json$
|
||||||
|
|
||||||
|
[untyped]
|
||||||
|
.*/node_modules/@react-native-community/cli/.*/.*
|
||||||
|
|
||||||
|
[include]
|
||||||
|
|
||||||
|
[libs]
|
||||||
|
node_modules/react-native/interface.js
|
||||||
|
node_modules/react-native/flow/
|
||||||
|
|
||||||
|
[options]
|
||||||
|
emoji=true
|
||||||
|
|
||||||
|
exact_by_default=true
|
||||||
|
|
||||||
|
format.bracket_spacing=false
|
||||||
|
|
||||||
|
module.file_ext=.js
|
||||||
|
module.file_ext=.json
|
||||||
|
module.file_ext=.ios.js
|
||||||
|
|
||||||
|
munge_underscores=true
|
||||||
|
|
||||||
|
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
|
||||||
|
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'
|
||||||
|
|
||||||
|
suppress_type=$FlowIssue
|
||||||
|
suppress_type=$FlowFixMe
|
||||||
|
suppress_type=$FlowFixMeProps
|
||||||
|
suppress_type=$FlowFixMeState
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
sketchy-null-number=warn
|
||||||
|
sketchy-null-mixed=warn
|
||||||
|
sketchy-number=warn
|
||||||
|
untyped-type-import=warn
|
||||||
|
nonstrict-import=warn
|
||||||
|
deprecated-type=warn
|
||||||
|
unsafe-getters-setters=warn
|
||||||
|
unnecessary-invariant=warn
|
||||||
|
signature-verification-failure=warn
|
||||||
|
|
||||||
|
[strict]
|
||||||
|
deprecated-type
|
||||||
|
nonstrict-import
|
||||||
|
sketchy-null
|
||||||
|
unclear-type
|
||||||
|
unsafe-getters-setters
|
||||||
|
untyped-import
|
||||||
|
untyped-type-import
|
||||||
|
|
||||||
|
[version]
|
||||||
|
^0.170.0
|
31
Example/testHotUpdate/.gitignore
vendored
@@ -20,15 +20,42 @@ DerivedData
|
|||||||
*.hmap
|
*.hmap
|
||||||
*.ipa
|
*.ipa
|
||||||
*.xcuserstate
|
*.xcuserstate
|
||||||
project.xcworkspace
|
|
||||||
|
|
||||||
# Android/IJ
|
# Android/IntelliJ
|
||||||
#
|
#
|
||||||
|
build/
|
||||||
.idea
|
.idea
|
||||||
.gradle
|
.gradle
|
||||||
local.properties
|
local.properties
|
||||||
|
*.iml
|
||||||
|
*.hprof
|
||||||
|
|
||||||
# node.js
|
# node.js
|
||||||
#
|
#
|
||||||
node_modules/
|
node_modules/
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
|
||||||
|
# BUCK
|
||||||
|
buck-out/
|
||||||
|
\.buckd/
|
||||||
|
*.keystore
|
||||||
|
!debug.keystore
|
||||||
|
|
||||||
|
# fastlane
|
||||||
|
#
|
||||||
|
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
|
||||||
|
# screenshots whenever they are needed.
|
||||||
|
# For more information about the recommended setup visit:
|
||||||
|
# https://docs.fastlane.tools/best-practices/source-control/
|
||||||
|
|
||||||
|
*/fastlane/report.xml
|
||||||
|
*/fastlane/Preview.html
|
||||||
|
*/fastlane/screenshots
|
||||||
|
|
||||||
|
# Bundle artifact
|
||||||
|
*.jsbundle
|
||||||
|
|
||||||
|
# Ruby / CocoaPods
|
||||||
|
/ios/Pods/
|
||||||
|
/vendor/bundle/
|
||||||
|
7
Example/testHotUpdate/.prettierrc.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
module.exports = {
|
||||||
|
arrowParens: 'avoid',
|
||||||
|
bracketSameLine: true,
|
||||||
|
bracketSpacing: false,
|
||||||
|
singleQuote: true,
|
||||||
|
trailingComma: 'all',
|
||||||
|
};
|
1
Example/testHotUpdate/.ruby-version
Normal file
@@ -0,0 +1 @@
|
|||||||
|
2.7.4
|
1
Example/testHotUpdate/.watchmanconfig
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{}
|
112
Example/testHotUpdate/App.js
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
/**
|
||||||
|
* Sample React Native App
|
||||||
|
* https://github.com/facebook/react-native
|
||||||
|
*
|
||||||
|
* @format
|
||||||
|
* @flow strict-local
|
||||||
|
*/
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import type {Node} from 'react';
|
||||||
|
import {
|
||||||
|
SafeAreaView,
|
||||||
|
ScrollView,
|
||||||
|
StatusBar,
|
||||||
|
StyleSheet,
|
||||||
|
Text,
|
||||||
|
useColorScheme,
|
||||||
|
View,
|
||||||
|
} from 'react-native';
|
||||||
|
|
||||||
|
import {
|
||||||
|
Colors,
|
||||||
|
DebugInstructions,
|
||||||
|
Header,
|
||||||
|
LearnMoreLinks,
|
||||||
|
ReloadInstructions,
|
||||||
|
} from 'react-native/Libraries/NewAppScreen';
|
||||||
|
|
||||||
|
const Section = ({children, title}): Node => {
|
||||||
|
const isDarkMode = useColorScheme() === 'dark';
|
||||||
|
return (
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<Text
|
||||||
|
style={[
|
||||||
|
styles.sectionTitle,
|
||||||
|
{
|
||||||
|
color: isDarkMode ? Colors.white : Colors.black,
|
||||||
|
},
|
||||||
|
]}>
|
||||||
|
{title}
|
||||||
|
</Text>
|
||||||
|
<Text
|
||||||
|
style={[
|
||||||
|
styles.sectionDescription,
|
||||||
|
{
|
||||||
|
color: isDarkMode ? Colors.light : Colors.dark,
|
||||||
|
},
|
||||||
|
]}>
|
||||||
|
{children}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const App: () => Node = () => {
|
||||||
|
const isDarkMode = useColorScheme() === 'dark';
|
||||||
|
|
||||||
|
const backgroundStyle = {
|
||||||
|
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<SafeAreaView style={backgroundStyle}>
|
||||||
|
<StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
|
||||||
|
<ScrollView
|
||||||
|
contentInsetAdjustmentBehavior="automatic"
|
||||||
|
style={backgroundStyle}>
|
||||||
|
<Header />
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
backgroundColor: isDarkMode ? Colors.black : Colors.white,
|
||||||
|
}}>
|
||||||
|
<Section title="Step One">
|
||||||
|
Edit <Text style={styles.highlight}>App.js</Text> to change this
|
||||||
|
screen and then come back to see your edits.
|
||||||
|
</Section>
|
||||||
|
<Section title="See Your Changes">
|
||||||
|
<ReloadInstructions />
|
||||||
|
</Section>
|
||||||
|
<Section title="Debug">
|
||||||
|
<DebugInstructions />
|
||||||
|
</Section>
|
||||||
|
<Section title="Learn More">
|
||||||
|
Read the docs to discover what to do next:
|
||||||
|
</Section>
|
||||||
|
<LearnMoreLinks />
|
||||||
|
</View>
|
||||||
|
</ScrollView>
|
||||||
|
</SafeAreaView>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
sectionContainer: {
|
||||||
|
marginTop: 32,
|
||||||
|
paddingHorizontal: 24,
|
||||||
|
},
|
||||||
|
sectionTitle: {
|
||||||
|
fontSize: 24,
|
||||||
|
fontWeight: '600',
|
||||||
|
},
|
||||||
|
sectionDescription: {
|
||||||
|
marginTop: 8,
|
||||||
|
fontSize: 18,
|
||||||
|
fontWeight: '400',
|
||||||
|
},
|
||||||
|
highlight: {
|
||||||
|
fontWeight: '700',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default App;
|
6
Example/testHotUpdate/Gemfile
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
|
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
|
||||||
|
ruby '2.7.4'
|
||||||
|
|
||||||
|
gem 'cocoapods', '~> 1.11', '>= 1.11.2'
|
100
Example/testHotUpdate/Gemfile.lock
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
GEM
|
||||||
|
remote: https://rubygems.org/
|
||||||
|
specs:
|
||||||
|
CFPropertyList (3.0.5)
|
||||||
|
rexml
|
||||||
|
activesupport (6.1.5.1)
|
||||||
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
|
i18n (>= 1.6, < 2)
|
||||||
|
minitest (>= 5.1)
|
||||||
|
tzinfo (~> 2.0)
|
||||||
|
zeitwerk (~> 2.3)
|
||||||
|
addressable (2.8.0)
|
||||||
|
public_suffix (>= 2.0.2, < 5.0)
|
||||||
|
algoliasearch (1.27.5)
|
||||||
|
httpclient (~> 2.8, >= 2.8.3)
|
||||||
|
json (>= 1.5.1)
|
||||||
|
atomos (0.1.3)
|
||||||
|
claide (1.1.0)
|
||||||
|
cocoapods (1.11.3)
|
||||||
|
addressable (~> 2.8)
|
||||||
|
claide (>= 1.0.2, < 2.0)
|
||||||
|
cocoapods-core (= 1.11.3)
|
||||||
|
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
||||||
|
cocoapods-downloader (>= 1.4.0, < 2.0)
|
||||||
|
cocoapods-plugins (>= 1.0.0, < 2.0)
|
||||||
|
cocoapods-search (>= 1.0.0, < 2.0)
|
||||||
|
cocoapods-trunk (>= 1.4.0, < 2.0)
|
||||||
|
cocoapods-try (>= 1.1.0, < 2.0)
|
||||||
|
colored2 (~> 3.1)
|
||||||
|
escape (~> 0.0.4)
|
||||||
|
fourflusher (>= 2.3.0, < 3.0)
|
||||||
|
gh_inspector (~> 1.0)
|
||||||
|
molinillo (~> 0.8.0)
|
||||||
|
nap (~> 1.0)
|
||||||
|
ruby-macho (>= 1.0, < 3.0)
|
||||||
|
xcodeproj (>= 1.21.0, < 2.0)
|
||||||
|
cocoapods-core (1.11.3)
|
||||||
|
activesupport (>= 5.0, < 7)
|
||||||
|
addressable (~> 2.8)
|
||||||
|
algoliasearch (~> 1.0)
|
||||||
|
concurrent-ruby (~> 1.1)
|
||||||
|
fuzzy_match (~> 2.0.4)
|
||||||
|
nap (~> 1.0)
|
||||||
|
netrc (~> 0.11)
|
||||||
|
public_suffix (~> 4.0)
|
||||||
|
typhoeus (~> 1.0)
|
||||||
|
cocoapods-deintegrate (1.0.5)
|
||||||
|
cocoapods-downloader (1.6.3)
|
||||||
|
cocoapods-plugins (1.0.0)
|
||||||
|
nap
|
||||||
|
cocoapods-search (1.0.1)
|
||||||
|
cocoapods-trunk (1.6.0)
|
||||||
|
nap (>= 0.8, < 2.0)
|
||||||
|
netrc (~> 0.11)
|
||||||
|
cocoapods-try (1.2.0)
|
||||||
|
colored2 (3.1.2)
|
||||||
|
concurrent-ruby (1.1.10)
|
||||||
|
escape (0.0.4)
|
||||||
|
ethon (0.15.0)
|
||||||
|
ffi (>= 1.15.0)
|
||||||
|
ffi (1.15.5)
|
||||||
|
fourflusher (2.3.1)
|
||||||
|
fuzzy_match (2.0.4)
|
||||||
|
gh_inspector (1.1.3)
|
||||||
|
httpclient (2.8.3)
|
||||||
|
i18n (1.10.0)
|
||||||
|
concurrent-ruby (~> 1.0)
|
||||||
|
json (2.6.1)
|
||||||
|
minitest (5.15.0)
|
||||||
|
molinillo (0.8.0)
|
||||||
|
nanaimo (0.3.0)
|
||||||
|
nap (1.1.0)
|
||||||
|
netrc (0.11.0)
|
||||||
|
public_suffix (4.0.7)
|
||||||
|
rexml (3.2.5)
|
||||||
|
ruby-macho (2.5.1)
|
||||||
|
typhoeus (1.4.0)
|
||||||
|
ethon (>= 0.9.0)
|
||||||
|
tzinfo (2.0.4)
|
||||||
|
concurrent-ruby (~> 1.0)
|
||||||
|
xcodeproj (1.21.0)
|
||||||
|
CFPropertyList (>= 2.3.3, < 4.0)
|
||||||
|
atomos (~> 0.1.3)
|
||||||
|
claide (>= 1.0.2, < 2.0)
|
||||||
|
colored2 (~> 3.1)
|
||||||
|
nanaimo (~> 0.3.0)
|
||||||
|
rexml (~> 3.2.4)
|
||||||
|
zeitwerk (2.5.4)
|
||||||
|
|
||||||
|
PLATFORMS
|
||||||
|
ruby
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
cocoapods (~> 1.11, >= 1.11.2)
|
||||||
|
|
||||||
|
RUBY VERSION
|
||||||
|
ruby 2.7.4p191
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
2.2.27
|
14
Example/testHotUpdate/__tests__/App-test.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
/**
|
||||||
|
* @format
|
||||||
|
*/
|
||||||
|
|
||||||
|
import 'react-native';
|
||||||
|
import React from 'react';
|
||||||
|
import App from '../App';
|
||||||
|
|
||||||
|
// Note: test renderer must be required after react-native.
|
||||||
|
import renderer from 'react-test-renderer';
|
||||||
|
|
||||||
|
it('renders correctly', () => {
|
||||||
|
renderer.create(<App />);
|
||||||
|
});
|
55
Example/testHotUpdate/android/app/_BUCK
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# To learn about Buck see [Docs](https://buckbuild.com/).
|
||||||
|
# To run your application with Buck:
|
||||||
|
# - install Buck
|
||||||
|
# - `npm start` - to start the packager
|
||||||
|
# - `cd android`
|
||||||
|
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
|
||||||
|
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
|
||||||
|
# - `buck install -r android/app` - compile, install and run application
|
||||||
|
#
|
||||||
|
|
||||||
|
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
|
||||||
|
|
||||||
|
lib_deps = []
|
||||||
|
|
||||||
|
create_aar_targets(glob(["libs/*.aar"]))
|
||||||
|
|
||||||
|
create_jar_targets(glob(["libs/*.jar"]))
|
||||||
|
|
||||||
|
android_library(
|
||||||
|
name = "all-libs",
|
||||||
|
exported_deps = lib_deps,
|
||||||
|
)
|
||||||
|
|
||||||
|
android_library(
|
||||||
|
name = "app-code",
|
||||||
|
srcs = glob([
|
||||||
|
"src/main/java/**/*.java",
|
||||||
|
]),
|
||||||
|
deps = [
|
||||||
|
":all-libs",
|
||||||
|
":build_config",
|
||||||
|
":res",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
android_build_config(
|
||||||
|
name = "build_config",
|
||||||
|
package = "com.testhotupdate",
|
||||||
|
)
|
||||||
|
|
||||||
|
android_resource(
|
||||||
|
name = "res",
|
||||||
|
package = "com.testhotupdate",
|
||||||
|
res = "src/main/res",
|
||||||
|
)
|
||||||
|
|
||||||
|
android_binary(
|
||||||
|
name = "app",
|
||||||
|
keystore = "//android/keystores:debug",
|
||||||
|
manifest = "src/main/AndroidManifest.xml",
|
||||||
|
package_type = "debug",
|
||||||
|
deps = [
|
||||||
|
":app-code",
|
||||||
|
],
|
||||||
|
)
|
@@ -1,6 +1,7 @@
|
|||||||
apply plugin: "com.android.application"
|
apply plugin: "com.android.application"
|
||||||
|
|
||||||
import com.android.build.OutputFile
|
import com.android.build.OutputFile
|
||||||
|
import org.apache.tools.ant.taskdefs.condition.Os
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
|
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
|
||||||
@@ -9,15 +10,20 @@ import com.android.build.OutputFile
|
|||||||
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
|
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
|
||||||
* bundle directly from the development server. Below you can see all the possible configurations
|
* bundle directly from the development server. Below you can see all the possible configurations
|
||||||
* and their defaults. If you decide to add a configuration block, make sure to add it before the
|
* and their defaults. If you decide to add a configuration block, make sure to add it before the
|
||||||
* `apply from: "react.gradle"` line.
|
* `apply from: "../../node_modules/react-native/react.gradle"` line.
|
||||||
*
|
*
|
||||||
* project.ext.react = [
|
* project.ext.react = [
|
||||||
* // the name of the generated asset file containing your JS bundle
|
* // the name of the generated asset file containing your JS bundle
|
||||||
* bundleAssetName: "index.android.bundle",
|
* bundleAssetName: "index.android.bundle",
|
||||||
*
|
*
|
||||||
* // the entry file for bundle generation
|
* // the entry file for bundle generation. If none specified and
|
||||||
|
* // "index.android.js" exists, it will be used. Otherwise "index.js" is
|
||||||
|
* // default. Can be overridden with ENTRY_FILE environment variable.
|
||||||
* entryFile: "index.android.js",
|
* entryFile: "index.android.js",
|
||||||
*
|
*
|
||||||
|
* // https://reactnative.dev/docs/performance#enable-the-ram-format
|
||||||
|
* bundleCommand: "ram-bundle",
|
||||||
|
*
|
||||||
* // whether to bundle JS and assets in debug mode
|
* // whether to bundle JS and assets in debug mode
|
||||||
* bundleInDebug: false,
|
* bundleInDebug: false,
|
||||||
*
|
*
|
||||||
@@ -26,11 +32,20 @@ import com.android.build.OutputFile
|
|||||||
*
|
*
|
||||||
* // whether to bundle JS and assets in another build variant (if configured).
|
* // whether to bundle JS and assets in another build variant (if configured).
|
||||||
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
|
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
|
||||||
* // The configuration property is in the format 'bundleIn${productFlavor}${buildType}'
|
* // The configuration property can be in the following formats
|
||||||
|
* // 'bundleIn${productFlavor}${buildType}'
|
||||||
|
* // 'bundleIn${buildType}'
|
||||||
* // bundleInFreeDebug: true,
|
* // bundleInFreeDebug: true,
|
||||||
* // bundleInPaidRelease: true,
|
* // bundleInPaidRelease: true,
|
||||||
* // bundleInBeta: true,
|
* // bundleInBeta: true,
|
||||||
*
|
*
|
||||||
|
* // whether to disable dev mode in custom build variants (by default only disabled in release)
|
||||||
|
* // for example: to disable dev mode in the staging build type (if configured)
|
||||||
|
* devDisabledInStaging: true,
|
||||||
|
* // The configuration property can be in the following formats
|
||||||
|
* // 'devDisabledIn${productFlavor}${buildType}'
|
||||||
|
* // 'devDisabledIn${buildType}'
|
||||||
|
*
|
||||||
* // the root of your project, i.e. where "package.json" lives
|
* // the root of your project, i.e. where "package.json" lives
|
||||||
* root: "../../",
|
* root: "../../",
|
||||||
*
|
*
|
||||||
@@ -53,15 +68,24 @@ import com.android.build.OutputFile
|
|||||||
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
|
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
|
||||||
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
|
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
|
||||||
* // for example, you might want to remove it from here.
|
* // for example, you might want to remove it from here.
|
||||||
* inputExcludes: ["android/**", "ios/**"]
|
* inputExcludes: ["android/**", "ios/**"],
|
||||||
|
*
|
||||||
|
* // override which node gets called and with what additional arguments
|
||||||
|
* nodeExecutableAndArgs: ["node"],
|
||||||
|
*
|
||||||
|
* // supply additional arguments to the packager
|
||||||
|
* extraPackagerArgs: []
|
||||||
* ]
|
* ]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
apply from: "react.gradle"
|
project.ext.react = [
|
||||||
|
enableHermes: false, // clean and rebuild if changing
|
||||||
|
]
|
||||||
|
|
||||||
|
apply from: "../../node_modules/react-native/react.gradle"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set this to true to create three separate APKs instead of one:
|
* Set this to true to create two separate APKs instead of one:
|
||||||
* - A universal APK that works on all devices
|
|
||||||
* - An APK that only works on ARM devices
|
* - An APK that only works on ARM devices
|
||||||
* - An APK that only works on x86 devices
|
* - An APK that only works on x86 devices
|
||||||
* The advantage is the size of the APK is reduced by about 4MB.
|
* The advantage is the size of the APK is reduced by about 4MB.
|
||||||
@@ -75,52 +99,221 @@ def enableSeparateBuildPerCPUArchitecture = false
|
|||||||
*/
|
*/
|
||||||
def enableProguardInReleaseBuilds = false
|
def enableProguardInReleaseBuilds = false
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The preferred build flavor of JavaScriptCore.
|
||||||
|
*
|
||||||
|
* For example, to use the international variant, you can use:
|
||||||
|
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
|
||||||
|
*
|
||||||
|
* The international variant includes ICU i18n library and necessary data
|
||||||
|
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
|
||||||
|
* give correct results when using with locales other than en-US. Note that
|
||||||
|
* this variant is about 6MiB larger per architecture than default.
|
||||||
|
*/
|
||||||
|
def jscFlavor = 'org.webkit:android-jsc:+'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to enable the Hermes VM.
|
||||||
|
*
|
||||||
|
* This should be set on project.ext.react and that value will be read here. If it is not set
|
||||||
|
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
|
||||||
|
* and the benefits of using Hermes will therefore be sharply reduced.
|
||||||
|
*/
|
||||||
|
def enableHermes = project.ext.react.get("enableHermes", false);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Architectures to build native code for.
|
||||||
|
*/
|
||||||
|
def reactNativeArchitectures() {
|
||||||
|
def value = project.getProperties().get("reactNativeArchitectures")
|
||||||
|
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 23
|
ndkVersion rootProject.ext.ndkVersion
|
||||||
buildToolsVersion "23.0.1"
|
|
||||||
|
compileSdkVersion rootProject.ext.compileSdkVersion
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.testhotupdate"
|
applicationId "com.testhotupdate"
|
||||||
minSdkVersion 16
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion 22
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
ndk {
|
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
||||||
abiFilters "armeabi-v7a", "x86"
|
|
||||||
|
if (isNewArchitectureEnabled()) {
|
||||||
|
// We configure the NDK build only if you decide to opt-in for the New Architecture.
|
||||||
|
externalNativeBuild {
|
||||||
|
ndkBuild {
|
||||||
|
arguments "APP_PLATFORM=android-21",
|
||||||
|
"APP_STL=c++_shared",
|
||||||
|
"NDK_TOOLCHAIN_VERSION=clang",
|
||||||
|
"GENERATED_SRC_DIR=$buildDir/generated/source",
|
||||||
|
"PROJECT_BUILD_DIR=$buildDir",
|
||||||
|
"REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
|
||||||
|
"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build"
|
||||||
|
cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
|
||||||
|
cppFlags "-std=c++17"
|
||||||
|
// Make sure this target name is the same you specify inside the
|
||||||
|
// src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
|
||||||
|
targets "testhotupdate_appmodules"
|
||||||
|
// Fix for windows limit on number of character in file paths and in command lines
|
||||||
|
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
||||||
|
arguments "NDK_APP_SHORT_COMMANDS=true"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!enableSeparateBuildPerCPUArchitecture) {
|
||||||
|
ndk {
|
||||||
|
abiFilters (*reactNativeArchitectures())
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isNewArchitectureEnabled()) {
|
||||||
|
// We configure the NDK build only if you decide to opt-in for the New Architecture.
|
||||||
|
externalNativeBuild {
|
||||||
|
ndkBuild {
|
||||||
|
path "$projectDir/src/main/jni/Android.mk"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
def reactAndroidProjectDir = project(':ReactAndroid').projectDir
|
||||||
|
def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) {
|
||||||
|
dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck")
|
||||||
|
from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
|
||||||
|
into("$buildDir/react-ndk/exported")
|
||||||
|
}
|
||||||
|
def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) {
|
||||||
|
dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck")
|
||||||
|
from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
|
||||||
|
into("$buildDir/react-ndk/exported")
|
||||||
|
}
|
||||||
|
afterEvaluate {
|
||||||
|
// If you wish to add a custom TurboModule or component locally,
|
||||||
|
// you should uncomment this line.
|
||||||
|
// preBuild.dependsOn("generateCodegenArtifactsFromSchema")
|
||||||
|
preDebugBuild.dependsOn(packageReactNdkDebugLibs)
|
||||||
|
preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)
|
||||||
|
|
||||||
|
// Due to a bug inside AGP, we have to explicitly set a dependency
|
||||||
|
// between configureNdkBuild* tasks and the preBuild tasks.
|
||||||
|
// This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
|
||||||
|
configureNdkBuildRelease.dependsOn(preReleaseBuild)
|
||||||
|
configureNdkBuildDebug.dependsOn(preDebugBuild)
|
||||||
|
reactNativeArchitectures().each { architecture ->
|
||||||
|
tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure {
|
||||||
|
dependsOn("preDebugBuild")
|
||||||
|
}
|
||||||
|
tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure {
|
||||||
|
dependsOn("preReleaseBuild")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
splits {
|
splits {
|
||||||
abi {
|
abi {
|
||||||
enable enableSeparateBuildPerCPUArchitecture
|
|
||||||
universalApk false
|
|
||||||
reset()
|
reset()
|
||||||
include "armeabi-v7a", "x86"
|
enable enableSeparateBuildPerCPUArchitecture
|
||||||
|
universalApk false // If true, also generate a universal APK
|
||||||
|
include (*reactNativeArchitectures())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
signingConfigs {
|
||||||
|
debug {
|
||||||
|
storeFile file('debug.keystore')
|
||||||
|
storePassword 'android'
|
||||||
|
keyAlias 'androiddebugkey'
|
||||||
|
keyPassword 'android'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
signingConfig signingConfigs.debug
|
||||||
|
}
|
||||||
release {
|
release {
|
||||||
|
// Caution! In production, you need to generate your own keystore file.
|
||||||
|
// see https://reactnative.dev/docs/signed-apk-android.
|
||||||
|
signingConfig signingConfigs.debug
|
||||||
minifyEnabled enableProguardInReleaseBuilds
|
minifyEnabled enableProguardInReleaseBuilds
|
||||||
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// applicationVariants are e.g. debug, release
|
// applicationVariants are e.g. debug, release
|
||||||
applicationVariants.all { variant ->
|
applicationVariants.all { variant ->
|
||||||
variant.outputs.each { output ->
|
variant.outputs.each { output ->
|
||||||
// For each separate APK per architecture, set a unique version code as described here:
|
// For each separate APK per architecture, set a unique version code as described here:
|
||||||
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
|
// https://developer.android.com/studio/build/configure-apk-splits.html
|
||||||
def versionCodes = ["armeabi-v7a":1, "x86":2]
|
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
|
||||||
|
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
|
||||||
def abi = output.getFilter(OutputFile.ABI)
|
def abi = output.getFilter(OutputFile.ABI)
|
||||||
if (abi != null) { // null for the universal-debug, universal-release variants
|
if (abi != null) { // null for the universal-debug, universal-release variants
|
||||||
output.versionCodeOverride =
|
output.versionCodeOverride =
|
||||||
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
|
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':react-native-update')
|
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||||
compile fileTree(dir: "libs", include: ["*.jar"])
|
|
||||||
compile "com.android.support:appcompat-v7:23.0.1"
|
//noinspection GradleDynamicVersion
|
||||||
compile "com.facebook.react:react-native:0.20.+"
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
||||||
|
|
||||||
|
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
|
||||||
|
|
||||||
|
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
|
||||||
|
exclude group:'com.facebook.fbjni'
|
||||||
|
}
|
||||||
|
|
||||||
|
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
|
||||||
|
exclude group:'com.facebook.flipper'
|
||||||
|
exclude group:'com.squareup.okhttp3', module:'okhttp'
|
||||||
|
}
|
||||||
|
|
||||||
|
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
|
||||||
|
exclude group:'com.facebook.flipper'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (enableHermes) {
|
||||||
|
def hermesPath = "../../node_modules/hermes-engine/android/";
|
||||||
|
debugImplementation files(hermesPath + "hermes-debug.aar")
|
||||||
|
releaseImplementation files(hermesPath + "hermes-release.aar")
|
||||||
|
} else {
|
||||||
|
implementation jscFlavor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isNewArchitectureEnabled()) {
|
||||||
|
// If new architecture is enabled, we let you build RN from source
|
||||||
|
// Otherwise we fallback to a prebuilt .aar bundled in the NPM package.
|
||||||
|
// This will be applied to all the imported transtitive dependency.
|
||||||
|
configurations.all {
|
||||||
|
resolutionStrategy.dependencySubstitution {
|
||||||
|
substitute(module("com.facebook.react:react-native"))
|
||||||
|
.using(project(":ReactAndroid")).because("On New Architecture we're building React Native from source")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Run this once to be able to run the application with BUCK
|
||||||
|
// puts all compile dependencies into folder libs for BUCK to use
|
||||||
|
task copyDownloadableDepsToLibs(type: Copy) {
|
||||||
|
from configurations.implementation
|
||||||
|
into 'libs'
|
||||||
|
}
|
||||||
|
|
||||||
|
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
|
||||||
|
|
||||||
|
def isNewArchitectureEnabled() {
|
||||||
|
// To opt-in for the New Architecture, you can either:
|
||||||
|
// - Set `newArchEnabled` to true inside the `gradle.properties` file
|
||||||
|
// - Invoke gradle with `-newArchEnabled=true`
|
||||||
|
// - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
|
||||||
|
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
|
||||||
}
|
}
|
||||||
|
19
Example/testHotUpdate/android/app/build_defs.bzl
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
"""Helper definitions to glob .aar and .jar targets"""
|
||||||
|
|
||||||
|
def create_aar_targets(aarfiles):
|
||||||
|
for aarfile in aarfiles:
|
||||||
|
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
|
||||||
|
lib_deps.append(":" + name)
|
||||||
|
android_prebuilt_aar(
|
||||||
|
name = name,
|
||||||
|
aar = aarfile,
|
||||||
|
)
|
||||||
|
|
||||||
|
def create_jar_targets(jarfiles):
|
||||||
|
for jarfile in jarfiles:
|
||||||
|
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
|
||||||
|
lib_deps.append(":" + name)
|
||||||
|
prebuilt_jar(
|
||||||
|
name = name,
|
||||||
|
binary_jar = jarfile,
|
||||||
|
)
|
BIN
Example/testHotUpdate/android/app/debug.keystore
Normal file
@@ -8,60 +8,3 @@
|
|||||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
# Add any project specific keep options here:
|
# Add any project specific keep options here:
|
||||||
|
|
||||||
# If your project uses WebView with JS, uncomment the following
|
|
||||||
# and specify the fully qualified class name to the JavaScript interface
|
|
||||||
# class:
|
|
||||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
|
||||||
# public *;
|
|
||||||
#}
|
|
||||||
|
|
||||||
# Disabling obfuscation is useful if you collect stack traces from production crashes
|
|
||||||
# (unless you are using a system that supports de-obfuscate the stack traces).
|
|
||||||
-dontobfuscate
|
|
||||||
|
|
||||||
# React Native
|
|
||||||
|
|
||||||
# Keep our interfaces so they can be used by other ProGuard rules.
|
|
||||||
# See http://sourceforge.net/p/proguard/bugs/466/
|
|
||||||
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
|
|
||||||
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
|
|
||||||
|
|
||||||
# Do not strip any method/class that is annotated with @DoNotStrip
|
|
||||||
-keep @com.facebook.proguard.annotations.DoNotStrip class *
|
|
||||||
-keepclassmembers class * {
|
|
||||||
@com.facebook.proguard.annotations.DoNotStrip *;
|
|
||||||
}
|
|
||||||
|
|
||||||
-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
|
|
||||||
void set*(***);
|
|
||||||
*** get*();
|
|
||||||
}
|
|
||||||
|
|
||||||
-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
|
|
||||||
-keep class * extends com.facebook.react.bridge.NativeModule { *; }
|
|
||||||
-keepclassmembers,includedescriptorclasses class * { native <methods>; }
|
|
||||||
-keepclassmembers class * { @com.facebook.react.uimanager.UIProp <fields>; }
|
|
||||||
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
|
|
||||||
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
|
|
||||||
|
|
||||||
-dontwarn com.facebook.react.**
|
|
||||||
|
|
||||||
# okhttp
|
|
||||||
|
|
||||||
-keepattributes Signature
|
|
||||||
-keepattributes *Annotation*
|
|
||||||
-keep class com.squareup.okhttp.** { *; }
|
|
||||||
-keep interface com.squareup.okhttp.** { *; }
|
|
||||||
-dontwarn com.squareup.okhttp.**
|
|
||||||
|
|
||||||
# okio
|
|
||||||
|
|
||||||
-keep class sun.misc.Unsafe { *; }
|
|
||||||
-dontwarn java.nio.file.*
|
|
||||||
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
|
|
||||||
-dontwarn okio.**
|
|
||||||
|
|
||||||
# stetho
|
|
||||||
|
|
||||||
-dontwarn com.facebook.stetho.**
|
|
||||||
|
@@ -1,96 +0,0 @@
|
|||||||
import org.apache.tools.ant.taskdefs.condition.Os
|
|
||||||
|
|
||||||
def config = project.hasProperty("react") ? project.react : [];
|
|
||||||
|
|
||||||
def bundleAssetName = config.bundleAssetName ?: "index.android.bundle"
|
|
||||||
def entryFile = config.entryFile ?: "index.android.js"
|
|
||||||
|
|
||||||
// because elvis operator
|
|
||||||
def elvisFile(thing) {
|
|
||||||
return thing ? file(thing) : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
def reactRoot = elvisFile(config.root) ?: file("../../")
|
|
||||||
def inputExcludes = config.inputExcludes ?: ["android/**", "ios/**"]
|
|
||||||
|
|
||||||
void runBefore(String dependentTaskName, Task task) {
|
|
||||||
Task dependentTask = tasks.findByPath(dependentTaskName);
|
|
||||||
if (dependentTask != null) {
|
|
||||||
dependentTask.dependsOn task
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gradle.projectsEvaluated {
|
|
||||||
// Grab all build types and product flavors
|
|
||||||
def buildTypes = android.buildTypes.collect { type -> type.name }
|
|
||||||
def productFlavors = android.productFlavors.collect { flavor -> flavor.name }
|
|
||||||
|
|
||||||
// When no product flavors defined, use empty
|
|
||||||
if (!productFlavors) productFlavors.add('')
|
|
||||||
|
|
||||||
productFlavors.each { productFlavorName ->
|
|
||||||
buildTypes.each { buildTypeName ->
|
|
||||||
// Create variant and source names
|
|
||||||
def sourceName = "${buildTypeName}"
|
|
||||||
def targetName = "${sourceName.capitalize()}"
|
|
||||||
if (productFlavorName) {
|
|
||||||
sourceName = "${productFlavorName}${targetName}"
|
|
||||||
}
|
|
||||||
|
|
||||||
// React js bundle directories
|
|
||||||
def jsBundleDirConfigName = "jsBundleDir${targetName}"
|
|
||||||
def jsBundleDir = elvisFile(config."$jsBundleDirConfigName") ?:
|
|
||||||
file("$buildDir/intermediates/assets/${sourceName}")
|
|
||||||
|
|
||||||
def resourcesDirConfigName = "jsBundleDir${targetName}"
|
|
||||||
def resourcesDir = elvisFile(config."${resourcesDirConfigName}") ?:
|
|
||||||
file("$buildDir/intermediates/res/merged/${sourceName}")
|
|
||||||
def jsBundleFile = file("$jsBundleDir/$bundleAssetName")
|
|
||||||
|
|
||||||
// Bundle task name for variant
|
|
||||||
def bundleJsAndAssetsTaskName = "bundle${targetName}JsAndAssets"
|
|
||||||
|
|
||||||
def currentBundleTask = tasks.create(
|
|
||||||
name: bundleJsAndAssetsTaskName,
|
|
||||||
type: Exec) {
|
|
||||||
group = "react"
|
|
||||||
description = "bundle JS and assets for ${targetName}."
|
|
||||||
|
|
||||||
// Create dirs if they are not there (e.g. the "clean" task just ran)
|
|
||||||
doFirst {
|
|
||||||
jsBundleDir.mkdirs()
|
|
||||||
resourcesDir.mkdirs()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set up inputs and outputs so gradle can cache the result
|
|
||||||
inputs.files fileTree(dir: reactRoot, excludes: inputExcludes)
|
|
||||||
outputs.dir jsBundleDir
|
|
||||||
outputs.dir resourcesDir
|
|
||||||
|
|
||||||
// Set up the call to the react-native cli
|
|
||||||
workingDir reactRoot
|
|
||||||
|
|
||||||
// Set up dev mode
|
|
||||||
def devEnabled = !targetName.toLowerCase().contains("release")
|
|
||||||
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
|
||||||
commandLine "cmd", "/c", "react-native", "bundle", "--platform", "android", "--dev", "${devEnabled}",
|
|
||||||
"--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir
|
|
||||||
} else {
|
|
||||||
commandLine "react-native", "bundle", "--platform", "android", "--dev", "${devEnabled}",
|
|
||||||
"--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir
|
|
||||||
}
|
|
||||||
|
|
||||||
enabled config."bundleIn${targetName}" ?: targetName.toLowerCase().contains("release")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hook bundle${productFlavor}${buildType}JsAndAssets into the android build process
|
|
||||||
currentBundleTask.dependsOn("merge${targetName}Resources")
|
|
||||||
currentBundleTask.dependsOn("merge${targetName}Assets")
|
|
||||||
|
|
||||||
runBefore("processArmeabi-v7a${targetName}Resources", currentBundleTask)
|
|
||||||
runBefore("processX86${targetName}Resources", currentBundleTask)
|
|
||||||
runBefore("processUniversal${targetName}Resources", currentBundleTask)
|
|
||||||
runBefore("process${targetName}Resources", currentBundleTask)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:usesCleartextTraffic="true"
|
||||||
|
tools:targetApi="28"
|
||||||
|
tools:ignore="GoogleAppIndexingWarning">
|
||||||
|
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
|
||||||
|
</application>
|
||||||
|
</manifest>
|
@@ -0,0 +1,73 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
*
|
||||||
|
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
|
||||||
|
* directory of this source tree.
|
||||||
|
*/
|
||||||
|
package com.testhotupdate;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import com.facebook.flipper.android.AndroidFlipperClient;
|
||||||
|
import com.facebook.flipper.android.utils.FlipperUtils;
|
||||||
|
import com.facebook.flipper.core.FlipperClient;
|
||||||
|
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
|
||||||
|
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
|
||||||
|
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
|
||||||
|
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
|
||||||
|
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
|
||||||
|
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
|
||||||
|
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
|
||||||
|
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
|
||||||
|
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
|
||||||
|
import com.facebook.react.ReactInstanceEventListener;
|
||||||
|
import com.facebook.react.ReactInstanceManager;
|
||||||
|
import com.facebook.react.bridge.ReactContext;
|
||||||
|
import com.facebook.react.modules.network.NetworkingModule;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
|
||||||
|
public class ReactNativeFlipper {
|
||||||
|
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
|
||||||
|
if (FlipperUtils.shouldEnableFlipper(context)) {
|
||||||
|
final FlipperClient client = AndroidFlipperClient.getInstance(context);
|
||||||
|
|
||||||
|
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
|
||||||
|
client.addPlugin(new ReactFlipperPlugin());
|
||||||
|
client.addPlugin(new DatabasesFlipperPlugin(context));
|
||||||
|
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
|
||||||
|
client.addPlugin(CrashReporterPlugin.getInstance());
|
||||||
|
|
||||||
|
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
|
||||||
|
NetworkingModule.setCustomClientBuilder(
|
||||||
|
new NetworkingModule.CustomClientBuilder() {
|
||||||
|
@Override
|
||||||
|
public void apply(OkHttpClient.Builder builder) {
|
||||||
|
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
client.addPlugin(networkFlipperPlugin);
|
||||||
|
client.start();
|
||||||
|
|
||||||
|
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
|
||||||
|
// Hence we run if after all native modules have been initialized
|
||||||
|
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
|
||||||
|
if (reactContext == null) {
|
||||||
|
reactInstanceManager.addReactInstanceEventListener(
|
||||||
|
new ReactInstanceEventListener() {
|
||||||
|
@Override
|
||||||
|
public void onReactContextInitialized(ReactContext reactContext) {
|
||||||
|
reactInstanceManager.removeReactInstanceEventListener(this);
|
||||||
|
reactContext.runOnNativeModulesQueueThread(
|
||||||
|
new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
client.addPlugin(new FrescoFlipperPlugin());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
client.addPlugin(new FrescoFlipperPlugin());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -1,23 +1,26 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.testhotupdate">
|
package="com.testhotupdate">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:name=".MainApplication"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
|
android:allowBackup="false"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme">
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
|
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
|
||||||
|
android:launchMode="singleTask"
|
||||||
|
android:windowSoftInputMode="adjustResize"
|
||||||
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@@ -1,40 +1,40 @@
|
|||||||
package com.testhotupdate;
|
package com.testhotupdate;
|
||||||
|
|
||||||
import com.facebook.react.ReactActivity;
|
import com.facebook.react.ReactActivity;
|
||||||
import com.facebook.react.ReactPackage;
|
import com.facebook.react.ReactActivityDelegate;
|
||||||
import com.facebook.react.shell.MainReactPackage;
|
import com.facebook.react.ReactRootView;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class MainActivity extends ReactActivity {
|
public class MainActivity extends ReactActivity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the name of the main component registered from JavaScript.
|
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
||||||
* This is used to schedule rendering of the component.
|
* rendering of the component.
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected String getMainComponentName() {
|
|
||||||
return "testHotUpdate";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns whether dev mode should be enabled.
|
|
||||||
* This enables e.g. the dev menu.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected boolean getUseDeveloperSupport() {
|
|
||||||
return BuildConfig.DEBUG;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A list of packages used by the app. If the app uses additional views
|
|
||||||
* or modules besides the default ones, add more packages here.
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected List<ReactPackage> getPackages() {
|
protected String getMainComponentName() {
|
||||||
return Arrays.<ReactPackage>asList(
|
return "testHotupdate";
|
||||||
new MainReactPackage()
|
}
|
||||||
);
|
|
||||||
|
/**
|
||||||
|
* Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and
|
||||||
|
* you can specify the rendered you wish to use (Fabric or the older renderer).
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected ReactActivityDelegate createReactActivityDelegate() {
|
||||||
|
return new MainActivityDelegate(this, getMainComponentName());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class MainActivityDelegate extends ReactActivityDelegate {
|
||||||
|
public MainActivityDelegate(ReactActivity activity, String mainComponentName) {
|
||||||
|
super(activity, mainComponentName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ReactRootView createRootView() {
|
||||||
|
ReactRootView reactRootView = new ReactRootView(getContext());
|
||||||
|
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
|
||||||
|
reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);
|
||||||
|
return reactRootView;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,96 @@
|
|||||||
|
package com.testhotupdate;
|
||||||
|
|
||||||
|
import android.app.Application;
|
||||||
|
import android.content.Context;
|
||||||
|
import com.facebook.react.PackageList;
|
||||||
|
import com.facebook.react.ReactApplication;
|
||||||
|
import com.facebook.react.ReactInstanceManager;
|
||||||
|
import com.facebook.react.ReactNativeHost;
|
||||||
|
import com.facebook.react.ReactPackage;
|
||||||
|
import com.facebook.react.config.ReactFeatureFlags;
|
||||||
|
import com.facebook.soloader.SoLoader;
|
||||||
|
import com.testhotupdate.newarchitecture.MainApplicationReactNativeHost;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class MainApplication extends Application implements ReactApplication {
|
||||||
|
|
||||||
|
private final ReactNativeHost mReactNativeHost =
|
||||||
|
new ReactNativeHost(this) {
|
||||||
|
@Override
|
||||||
|
protected String getJSBundleFile() {
|
||||||
|
return UpdateContext.getBundleUrl(MainApplication.this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getUseDeveloperSupport() {
|
||||||
|
return BuildConfig.DEBUG;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<ReactPackage> getPackages() {
|
||||||
|
@SuppressWarnings("UnnecessaryLocalVariable")
|
||||||
|
List<ReactPackage> packages = new PackageList(this).getPackages();
|
||||||
|
// Packages that cannot be autolinked yet can be added manually here, for example:
|
||||||
|
// packages.add(new MyReactNativePackage());
|
||||||
|
return packages;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getJSMainModuleName() {
|
||||||
|
return "index";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private final ReactNativeHost mNewArchitectureNativeHost =
|
||||||
|
new MainApplicationReactNativeHost(this);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ReactNativeHost getReactNativeHost() {
|
||||||
|
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
||||||
|
return mNewArchitectureNativeHost;
|
||||||
|
} else {
|
||||||
|
return mReactNativeHost;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
// If you opted-in for the New Architecture, we enable the TurboModule system
|
||||||
|
ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
|
||||||
|
SoLoader.init(this, /* native exopackage */ false);
|
||||||
|
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
|
||||||
|
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
||||||
|
*
|
||||||
|
* @param context
|
||||||
|
* @param reactInstanceManager
|
||||||
|
*/
|
||||||
|
private static void initializeFlipper(
|
||||||
|
Context context, ReactInstanceManager reactInstanceManager) {
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
|
try {
|
||||||
|
/*
|
||||||
|
We use reflection here to pick up the class that initializes Flipper,
|
||||||
|
since Flipper library is not available in release mode
|
||||||
|
*/
|
||||||
|
Class<?> aClass = Class.forName("com.testhotupdate.ReactNativeFlipper");
|
||||||
|
aClass
|
||||||
|
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
|
||||||
|
.invoke(null, context, reactInstanceManager);
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (InvocationTargetException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,116 @@
|
|||||||
|
package com.testhotupdate.newarchitecture;
|
||||||
|
|
||||||
|
import android.app.Application;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import com.facebook.react.PackageList;
|
||||||
|
import com.facebook.react.ReactInstanceManager;
|
||||||
|
import com.facebook.react.ReactNativeHost;
|
||||||
|
import com.facebook.react.ReactPackage;
|
||||||
|
import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
|
||||||
|
import com.facebook.react.bridge.JSIModulePackage;
|
||||||
|
import com.facebook.react.bridge.JSIModuleProvider;
|
||||||
|
import com.facebook.react.bridge.JSIModuleSpec;
|
||||||
|
import com.facebook.react.bridge.JSIModuleType;
|
||||||
|
import com.facebook.react.bridge.JavaScriptContextHolder;
|
||||||
|
import com.facebook.react.bridge.ReactApplicationContext;
|
||||||
|
import com.facebook.react.bridge.UIManager;
|
||||||
|
import com.facebook.react.fabric.ComponentFactory;
|
||||||
|
import com.facebook.react.fabric.CoreComponentsRegistry;
|
||||||
|
import com.facebook.react.fabric.EmptyReactNativeConfig;
|
||||||
|
import com.facebook.react.fabric.FabricJSIModuleProvider;
|
||||||
|
import com.facebook.react.uimanager.ViewManagerRegistry;
|
||||||
|
import com.testhotupdate.BuildConfig;
|
||||||
|
import com.testhotupdate.newarchitecture.components.MainComponentsRegistry;
|
||||||
|
import com.testhotupdate.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both
|
||||||
|
* TurboModule delegates and the Fabric Renderer.
|
||||||
|
*
|
||||||
|
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
|
||||||
|
* `newArchEnabled` property). Is ignored otherwise.
|
||||||
|
*/
|
||||||
|
public class MainApplicationReactNativeHost extends ReactNativeHost {
|
||||||
|
public MainApplicationReactNativeHost(Application application) {
|
||||||
|
super(application);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getUseDeveloperSupport() {
|
||||||
|
return BuildConfig.DEBUG;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<ReactPackage> getPackages() {
|
||||||
|
List<ReactPackage> packages = new PackageList(this).getPackages();
|
||||||
|
// Packages that cannot be autolinked yet can be added manually here, for example:
|
||||||
|
// packages.add(new MyReactNativePackage());
|
||||||
|
// TurboModules must also be loaded here providing a valid TurboReactPackage implementation:
|
||||||
|
// packages.add(new TurboReactPackage() { ... });
|
||||||
|
// If you have custom Fabric Components, their ViewManagers should also be loaded here
|
||||||
|
// inside a ReactPackage.
|
||||||
|
return packages;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getJSMainModuleName() {
|
||||||
|
return "index";
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
protected ReactPackageTurboModuleManagerDelegate.Builder
|
||||||
|
getReactPackageTurboModuleManagerDelegateBuilder() {
|
||||||
|
// Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary
|
||||||
|
// for the new architecture and to use TurboModules correctly.
|
||||||
|
return new MainApplicationTurboModuleManagerDelegate.Builder();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected JSIModulePackage getJSIModulePackage() {
|
||||||
|
return new JSIModulePackage() {
|
||||||
|
@Override
|
||||||
|
public List<JSIModuleSpec> getJSIModules(
|
||||||
|
final ReactApplicationContext reactApplicationContext,
|
||||||
|
final JavaScriptContextHolder jsContext) {
|
||||||
|
final List<JSIModuleSpec> specs = new ArrayList<>();
|
||||||
|
|
||||||
|
// Here we provide a new JSIModuleSpec that will be responsible of providing the
|
||||||
|
// custom Fabric Components.
|
||||||
|
specs.add(
|
||||||
|
new JSIModuleSpec() {
|
||||||
|
@Override
|
||||||
|
public JSIModuleType getJSIModuleType() {
|
||||||
|
return JSIModuleType.UIManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSIModuleProvider<UIManager> getJSIModuleProvider() {
|
||||||
|
final ComponentFactory componentFactory = new ComponentFactory();
|
||||||
|
CoreComponentsRegistry.register(componentFactory);
|
||||||
|
|
||||||
|
// Here we register a Components Registry.
|
||||||
|
// The one that is generated with the template contains no components
|
||||||
|
// and just provides you the one from React Native core.
|
||||||
|
MainComponentsRegistry.register(componentFactory);
|
||||||
|
|
||||||
|
final ReactInstanceManager reactInstanceManager = getReactInstanceManager();
|
||||||
|
|
||||||
|
ViewManagerRegistry viewManagerRegistry =
|
||||||
|
new ViewManagerRegistry(
|
||||||
|
reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));
|
||||||
|
|
||||||
|
return new FabricJSIModuleProvider(
|
||||||
|
reactApplicationContext,
|
||||||
|
componentFactory,
|
||||||
|
new EmptyReactNativeConfig(),
|
||||||
|
viewManagerRegistry);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return specs;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,36 @@
|
|||||||
|
package com.testhotupdate.newarchitecture.components;
|
||||||
|
|
||||||
|
import com.facebook.jni.HybridData;
|
||||||
|
import com.facebook.proguard.annotations.DoNotStrip;
|
||||||
|
import com.facebook.react.fabric.ComponentFactory;
|
||||||
|
import com.facebook.soloader.SoLoader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class responsible to load the custom Fabric Components. This class has native methods and needs a
|
||||||
|
* corresponding C++ implementation/header file to work correctly (already placed inside the jni/
|
||||||
|
* folder for you).
|
||||||
|
*
|
||||||
|
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
|
||||||
|
* `newArchEnabled` property). Is ignored otherwise.
|
||||||
|
*/
|
||||||
|
@DoNotStrip
|
||||||
|
public class MainComponentsRegistry {
|
||||||
|
static {
|
||||||
|
SoLoader.loadLibrary("fabricjni");
|
||||||
|
}
|
||||||
|
|
||||||
|
@DoNotStrip private final HybridData mHybridData;
|
||||||
|
|
||||||
|
@DoNotStrip
|
||||||
|
private native HybridData initHybrid(ComponentFactory componentFactory);
|
||||||
|
|
||||||
|
@DoNotStrip
|
||||||
|
private MainComponentsRegistry(ComponentFactory componentFactory) {
|
||||||
|
mHybridData = initHybrid(componentFactory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DoNotStrip
|
||||||
|
public static MainComponentsRegistry register(ComponentFactory componentFactory) {
|
||||||
|
return new MainComponentsRegistry(componentFactory);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,48 @@
|
|||||||
|
package com.testhotupdate.newarchitecture.modules;
|
||||||
|
|
||||||
|
import com.facebook.jni.HybridData;
|
||||||
|
import com.facebook.react.ReactPackage;
|
||||||
|
import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
|
||||||
|
import com.facebook.react.bridge.ReactApplicationContext;
|
||||||
|
import com.facebook.soloader.SoLoader;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class responsible to load the TurboModules. This class has native methods and needs a
|
||||||
|
* corresponding C++ implementation/header file to work correctly (already placed inside the jni/
|
||||||
|
* folder for you).
|
||||||
|
*
|
||||||
|
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
|
||||||
|
* `newArchEnabled` property). Is ignored otherwise.
|
||||||
|
*/
|
||||||
|
public class MainApplicationTurboModuleManagerDelegate
|
||||||
|
extends ReactPackageTurboModuleManagerDelegate {
|
||||||
|
|
||||||
|
private static volatile boolean sIsSoLibraryLoaded;
|
||||||
|
|
||||||
|
protected MainApplicationTurboModuleManagerDelegate(
|
||||||
|
ReactApplicationContext reactApplicationContext, List<ReactPackage> packages) {
|
||||||
|
super(reactApplicationContext, packages);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected native HybridData initHybrid();
|
||||||
|
|
||||||
|
native boolean canCreateTurboModule(String moduleName);
|
||||||
|
|
||||||
|
public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {
|
||||||
|
protected MainApplicationTurboModuleManagerDelegate build(
|
||||||
|
ReactApplicationContext context, List<ReactPackage> packages) {
|
||||||
|
return new MainApplicationTurboModuleManagerDelegate(context, packages);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected synchronized void maybeLoadOtherSoLibraries() {
|
||||||
|
if (!sIsSoLibraryLoaded) {
|
||||||
|
// If you change the name of your application .so file in the Android.mk file,
|
||||||
|
// make sure you update the name here as well.
|
||||||
|
SoLoader.loadLibrary("testhotupdate_appmodules");
|
||||||
|
sIsSoLibraryLoaded = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
49
Example/testHotUpdate/android/app/src/main/jni/Android.mk
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
THIS_DIR := $(call my-dir)
|
||||||
|
|
||||||
|
include $(REACT_ANDROID_DIR)/Android-prebuilt.mk
|
||||||
|
|
||||||
|
# If you wish to add a custom TurboModule or Fabric component in your app you
|
||||||
|
# will have to include the following autogenerated makefile.
|
||||||
|
# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
|
LOCAL_PATH := $(THIS_DIR)
|
||||||
|
|
||||||
|
# You can customize the name of your application .so file here.
|
||||||
|
LOCAL_MODULE := testhotupdate_appmodules
|
||||||
|
|
||||||
|
LOCAL_C_INCLUDES := $(LOCAL_PATH)
|
||||||
|
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
|
||||||
|
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
|
||||||
|
|
||||||
|
# If you wish to add a custom TurboModule or Fabric component in your app you
|
||||||
|
# will have to uncomment those lines to include the generated source
|
||||||
|
# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)
|
||||||
|
#
|
||||||
|
# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni
|
||||||
|
# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)
|
||||||
|
# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni
|
||||||
|
|
||||||
|
# Here you should add any native library you wish to depend on.
|
||||||
|
LOCAL_SHARED_LIBRARIES := \
|
||||||
|
libfabricjni \
|
||||||
|
libfbjni \
|
||||||
|
libfolly_futures \
|
||||||
|
libfolly_json \
|
||||||
|
libglog \
|
||||||
|
libjsi \
|
||||||
|
libreact_codegen_rncore \
|
||||||
|
libreact_debug \
|
||||||
|
libreact_nativemodule_core \
|
||||||
|
libreact_render_componentregistry \
|
||||||
|
libreact_render_core \
|
||||||
|
libreact_render_debug \
|
||||||
|
libreact_render_graphics \
|
||||||
|
librrc_view \
|
||||||
|
libruntimeexecutor \
|
||||||
|
libturbomodulejsijni \
|
||||||
|
libyoga
|
||||||
|
|
||||||
|
LOCAL_CFLAGS := -DLOG_TAG=\"ReactNative\" -fexceptions -frtti -std=c++17 -Wall
|
||||||
|
|
||||||
|
include $(BUILD_SHARED_LIBRARY)
|
@@ -0,0 +1,24 @@
|
|||||||
|
#include "MainApplicationModuleProvider.h"
|
||||||
|
|
||||||
|
#include <rncore.h>
|
||||||
|
|
||||||
|
namespace facebook {
|
||||||
|
namespace react {
|
||||||
|
|
||||||
|
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
|
||||||
|
const std::string moduleName,
|
||||||
|
const JavaTurboModule::InitParams ¶ms) {
|
||||||
|
// Here you can provide your own module provider for TurboModules coming from
|
||||||
|
// either your application or from external libraries. The approach to follow
|
||||||
|
// is similar to the following (for a library called `samplelibrary`:
|
||||||
|
//
|
||||||
|
// auto module = samplelibrary_ModuleProvider(moduleName, params);
|
||||||
|
// if (module != nullptr) {
|
||||||
|
// return module;
|
||||||
|
// }
|
||||||
|
// return rncore_ModuleProvider(moduleName, params);
|
||||||
|
return rncore_ModuleProvider(moduleName, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace react
|
||||||
|
} // namespace facebook
|
@@ -0,0 +1,16 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include <ReactCommon/JavaTurboModule.h>
|
||||||
|
|
||||||
|
namespace facebook {
|
||||||
|
namespace react {
|
||||||
|
|
||||||
|
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
|
||||||
|
const std::string moduleName,
|
||||||
|
const JavaTurboModule::InitParams ¶ms);
|
||||||
|
|
||||||
|
} // namespace react
|
||||||
|
} // namespace facebook
|
@@ -0,0 +1,45 @@
|
|||||||
|
#include "MainApplicationTurboModuleManagerDelegate.h"
|
||||||
|
#include "MainApplicationModuleProvider.h"
|
||||||
|
|
||||||
|
namespace facebook {
|
||||||
|
namespace react {
|
||||||
|
|
||||||
|
jni::local_ref<MainApplicationTurboModuleManagerDelegate::jhybriddata>
|
||||||
|
MainApplicationTurboModuleManagerDelegate::initHybrid(
|
||||||
|
jni::alias_ref<jhybridobject>) {
|
||||||
|
return makeCxxInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainApplicationTurboModuleManagerDelegate::registerNatives() {
|
||||||
|
registerHybrid({
|
||||||
|
makeNativeMethod(
|
||||||
|
"initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid),
|
||||||
|
makeNativeMethod(
|
||||||
|
"canCreateTurboModule",
|
||||||
|
MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<TurboModule>
|
||||||
|
MainApplicationTurboModuleManagerDelegate::getTurboModule(
|
||||||
|
const std::string name,
|
||||||
|
const std::shared_ptr<CallInvoker> jsInvoker) {
|
||||||
|
// Not implemented yet: provide pure-C++ NativeModules here.
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<TurboModule>
|
||||||
|
MainApplicationTurboModuleManagerDelegate::getTurboModule(
|
||||||
|
const std::string name,
|
||||||
|
const JavaTurboModule::InitParams ¶ms) {
|
||||||
|
return MainApplicationModuleProvider(name, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(
|
||||||
|
std::string name) {
|
||||||
|
return getTurboModule(name, nullptr) != nullptr ||
|
||||||
|
getTurboModule(name, {.moduleName = name}) != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace react
|
||||||
|
} // namespace facebook
|
@@ -0,0 +1,38 @@
|
|||||||
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include <ReactCommon/TurboModuleManagerDelegate.h>
|
||||||
|
#include <fbjni/fbjni.h>
|
||||||
|
|
||||||
|
namespace facebook {
|
||||||
|
namespace react {
|
||||||
|
|
||||||
|
class MainApplicationTurboModuleManagerDelegate
|
||||||
|
: public jni::HybridClass<
|
||||||
|
MainApplicationTurboModuleManagerDelegate,
|
||||||
|
TurboModuleManagerDelegate> {
|
||||||
|
public:
|
||||||
|
// Adapt it to the package you used for your Java class.
|
||||||
|
static constexpr auto kJavaDescriptor =
|
||||||
|
"Lcom/testhotupdate/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;";
|
||||||
|
|
||||||
|
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject>);
|
||||||
|
|
||||||
|
static void registerNatives();
|
||||||
|
|
||||||
|
std::shared_ptr<TurboModule> getTurboModule(
|
||||||
|
const std::string name,
|
||||||
|
const std::shared_ptr<CallInvoker> jsInvoker) override;
|
||||||
|
std::shared_ptr<TurboModule> getTurboModule(
|
||||||
|
const std::string name,
|
||||||
|
const JavaTurboModule::InitParams ¶ms) override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test-only method. Allows user to verify whether a TurboModule can be
|
||||||
|
* created by instances of this class.
|
||||||
|
*/
|
||||||
|
bool canCreateTurboModule(std::string name);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace react
|
||||||
|
} // namespace facebook
|
@@ -0,0 +1,61 @@
|
|||||||
|
#include "MainComponentsRegistry.h"
|
||||||
|
|
||||||
|
#include <CoreComponentsRegistry.h>
|
||||||
|
#include <fbjni/fbjni.h>
|
||||||
|
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||||
|
#include <react/renderer/components/rncore/ComponentDescriptors.h>
|
||||||
|
|
||||||
|
namespace facebook {
|
||||||
|
namespace react {
|
||||||
|
|
||||||
|
MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}
|
||||||
|
|
||||||
|
std::shared_ptr<ComponentDescriptorProviderRegistry const>
|
||||||
|
MainComponentsRegistry::sharedProviderRegistry() {
|
||||||
|
auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();
|
||||||
|
|
||||||
|
// Custom Fabric Components go here. You can register custom
|
||||||
|
// components coming from your App or from 3rd party libraries here.
|
||||||
|
//
|
||||||
|
// providerRegistry->add(concreteComponentDescriptorProvider<
|
||||||
|
// AocViewerComponentDescriptor>());
|
||||||
|
return providerRegistry;
|
||||||
|
}
|
||||||
|
|
||||||
|
jni::local_ref<MainComponentsRegistry::jhybriddata>
|
||||||
|
MainComponentsRegistry::initHybrid(
|
||||||
|
jni::alias_ref<jclass>,
|
||||||
|
ComponentFactory *delegate) {
|
||||||
|
auto instance = makeCxxInstance(delegate);
|
||||||
|
|
||||||
|
auto buildRegistryFunction =
|
||||||
|
[](EventDispatcher::Weak const &eventDispatcher,
|
||||||
|
ContextContainer::Shared const &contextContainer)
|
||||||
|
-> ComponentDescriptorRegistry::Shared {
|
||||||
|
auto registry = MainComponentsRegistry::sharedProviderRegistry()
|
||||||
|
->createComponentDescriptorRegistry(
|
||||||
|
{eventDispatcher, contextContainer});
|
||||||
|
|
||||||
|
auto mutableRegistry =
|
||||||
|
std::const_pointer_cast<ComponentDescriptorRegistry>(registry);
|
||||||
|
|
||||||
|
mutableRegistry->setFallbackComponentDescriptor(
|
||||||
|
std::make_shared<UnimplementedNativeViewComponentDescriptor>(
|
||||||
|
ComponentDescriptorParameters{
|
||||||
|
eventDispatcher, contextContainer, nullptr}));
|
||||||
|
|
||||||
|
return registry;
|
||||||
|
};
|
||||||
|
|
||||||
|
delegate->buildRegistryFunction = buildRegistryFunction;
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainComponentsRegistry::registerNatives() {
|
||||||
|
registerHybrid({
|
||||||
|
makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace react
|
||||||
|
} // namespace facebook
|
@@ -0,0 +1,32 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <ComponentFactory.h>
|
||||||
|
#include <fbjni/fbjni.h>
|
||||||
|
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||||
|
#include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>
|
||||||
|
|
||||||
|
namespace facebook {
|
||||||
|
namespace react {
|
||||||
|
|
||||||
|
class MainComponentsRegistry
|
||||||
|
: public facebook::jni::HybridClass<MainComponentsRegistry> {
|
||||||
|
public:
|
||||||
|
// Adapt it to the package you used for your Java class.
|
||||||
|
constexpr static auto kJavaDescriptor =
|
||||||
|
"Lcom/testhotupdate/newarchitecture/components/MainComponentsRegistry;";
|
||||||
|
|
||||||
|
static void registerNatives();
|
||||||
|
|
||||||
|
MainComponentsRegistry(ComponentFactory *delegate);
|
||||||
|
|
||||||
|
private:
|
||||||
|
static std::shared_ptr<ComponentDescriptorProviderRegistry const>
|
||||||
|
sharedProviderRegistry();
|
||||||
|
|
||||||
|
static jni::local_ref<jhybriddata> initHybrid(
|
||||||
|
jni::alias_ref<jclass>,
|
||||||
|
ComponentFactory *delegate);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace react
|
||||||
|
} // namespace facebook
|
11
Example/testHotUpdate/android/app/src/main/jni/OnLoad.cpp
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#include <fbjni/fbjni.h>
|
||||||
|
#include "MainApplicationTurboModuleManagerDelegate.h"
|
||||||
|
#include "MainComponentsRegistry.h"
|
||||||
|
|
||||||
|
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
|
||||||
|
return facebook::jni::initialize(vm, [] {
|
||||||
|
facebook::react::MainApplicationTurboModuleManagerDelegate::
|
||||||
|
registerNatives();
|
||||||
|
facebook::react::MainComponentsRegistry::registerNatives();
|
||||||
|
});
|
||||||
|
}
|
@@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2014 The Android Open Source Project
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
|
||||||
|
android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
|
||||||
|
android:insetTop="@dimen/abc_edit_text_inset_top_material"
|
||||||
|
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
|
||||||
|
|
||||||
|
<selector>
|
||||||
|
<!--
|
||||||
|
This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
|
||||||
|
The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
|
||||||
|
NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'
|
||||||
|
|
||||||
|
<item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
|
||||||
|
|
||||||
|
For more info, see https://bit.ly/3CdLStv (react-native/pull/29452) and https://bit.ly/3nxOMoR.
|
||||||
|
-->
|
||||||
|
<item android:state_enabled="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
|
||||||
|
<item android:drawable="@drawable/abc_textfield_activated_mtrl_alpha"/>
|
||||||
|
</selector>
|
||||||
|
|
||||||
|
</inset>
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 15 KiB |
@@ -1,3 +1,3 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">testHotUpdate</string>
|
<string name="app_name">testHotupdate</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -1,8 +1,9 @@
|
|||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
|
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -1,12 +1,30 @@
|
|||||||
|
import org.apache.tools.ant.taskdefs.condition.Os
|
||||||
|
|
||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
|
ext {
|
||||||
|
buildToolsVersion = "31.0.0"
|
||||||
|
minSdkVersion = 21
|
||||||
|
compileSdkVersion = 31
|
||||||
|
targetSdkVersion = 31
|
||||||
|
|
||||||
|
if (System.properties['os.arch'] == "aarch64") {
|
||||||
|
// For M1 Users we need to use the NDK 24 which added support for aarch64
|
||||||
|
ndkVersion = "24.0.8215888"
|
||||||
|
} else {
|
||||||
|
// Otherwise we default to the side-by-side NDK version from AGP.
|
||||||
|
ndkVersion = "21.4.7075529"
|
||||||
|
}
|
||||||
|
}
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
google()
|
||||||
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:1.3.1'
|
classpath("com.android.tools.build:gradle:7.0.4")
|
||||||
|
classpath("com.facebook.react:react-native-gradle-plugin")
|
||||||
|
classpath("de.undercouch:gradle-download-task:4.1.2")
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
}
|
}
|
||||||
@@ -14,7 +32,22 @@ buildscript {
|
|||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
maven {
|
||||||
jcenter()
|
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
|
||||||
|
url("$rootDir/../node_modules/react-native/android")
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
// Android JSC is installed from npm
|
||||||
|
url("$rootDir/../node_modules/jsc-android/dist")
|
||||||
|
}
|
||||||
|
mavenCentral {
|
||||||
|
// We don't want to fetch react-native from Maven Central as there are
|
||||||
|
// older versions over there.
|
||||||
|
content {
|
||||||
|
excludeGroup "com.facebook.react"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
google()
|
||||||
|
maven { url 'https://www.jitpack.io' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -9,12 +9,32 @@
|
|||||||
|
|
||||||
# Specifies the JVM arguments used for the daemon process.
|
# Specifies the JVM arguments used for the daemon process.
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
# The setting is particularly useful for tweaking memory settings.
|
||||||
# Default value: -Xmx10248m -XX:MaxPermSize=256m
|
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
|
||||||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
|
||||||
|
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
# This option should only be used with decoupled projects. More details, visit
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
# org.gradle.parallel=true
|
# org.gradle.parallel=true
|
||||||
|
|
||||||
android.useDeprecatedNdk=true
|
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||||
|
# Android operating system, and which are packaged with your app's APK
|
||||||
|
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||||
|
android.useAndroidX=true
|
||||||
|
# Automatically convert third-party libraries to use AndroidX
|
||||||
|
android.enableJetifier=true
|
||||||
|
|
||||||
|
# Version of flipper SDK to use with React Native
|
||||||
|
FLIPPER_VERSION=0.125.0
|
||||||
|
|
||||||
|
# Use this property to specify which architecture you want to build.
|
||||||
|
# You can also override it from the CLI using
|
||||||
|
# ./gradlew <task> -PreactNativeArchitectures=x86_64
|
||||||
|
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
|
||||||
|
|
||||||
|
# Use this property to enable support to the new architecture.
|
||||||
|
# This will allow you to use TurboModules and the Fabric render in
|
||||||
|
# your application. You should enable this flag either if you want
|
||||||
|
# to write custom TurboModules/Fabric components OR use libraries that
|
||||||
|
# are providing them.
|
||||||
|
newArchEnabled=false
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
|
|
||||||
|
302
Example/testHotUpdate/android/gradlew
vendored
@@ -1,79 +1,129 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# Copyright © 2015-2021 the original authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
##
|
#
|
||||||
## Gradle start up script for UN*X
|
# Gradle start up script for POSIX generated by Gradle.
|
||||||
##
|
#
|
||||||
|
# Important for running:
|
||||||
|
#
|
||||||
|
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||||
|
# noncompliant, but you have some other compliant shell such as ksh or
|
||||||
|
# bash, then to run this script, type that shell name before the whole
|
||||||
|
# command line, like:
|
||||||
|
#
|
||||||
|
# ksh Gradle
|
||||||
|
#
|
||||||
|
# Busybox and similar reduced shells will NOT work, because this script
|
||||||
|
# requires all of these POSIX shell features:
|
||||||
|
# * functions;
|
||||||
|
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||||
|
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||||
|
# * compound commands having a testable exit status, especially «case»;
|
||||||
|
# * various built-in commands including «command», «set», and «ulimit».
|
||||||
|
#
|
||||||
|
# Important for patching:
|
||||||
|
#
|
||||||
|
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||||
|
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||||
|
#
|
||||||
|
# The "traditional" practice of packing multiple parameters into a
|
||||||
|
# space-separated string is a well documented source of bugs and security
|
||||||
|
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||||
|
# options in "$@", and eventually passing that to Java.
|
||||||
|
#
|
||||||
|
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||||
|
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||||
|
# see the in-line comments for details.
|
||||||
|
#
|
||||||
|
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||||
|
# Darwin, MinGW, and NonStop.
|
||||||
|
#
|
||||||
|
# (3) This script is generated from the Groovy template
|
||||||
|
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
|
# within the Gradle project.
|
||||||
|
#
|
||||||
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Attempt to set APP_HOME
|
||||||
DEFAULT_JVM_OPTS=""
|
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
app_path=$0
|
||||||
|
|
||||||
|
# Need this for daisy-chained symlinks.
|
||||||
|
while
|
||||||
|
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||||
|
[ -h "$app_path" ]
|
||||||
|
do
|
||||||
|
ls=$( ls -ld "$app_path" )
|
||||||
|
link=${ls#*' -> '}
|
||||||
|
case $link in #(
|
||||||
|
/*) app_path=$link ;; #(
|
||||||
|
*) app_path=$APP_HOME$link ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||||
|
|
||||||
APP_NAME="Gradle"
|
APP_NAME="Gradle"
|
||||||
APP_BASE_NAME=`basename "$0"`
|
APP_BASE_NAME=${0##*/}
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD="maximum"
|
MAX_FD=maximum
|
||||||
|
|
||||||
warn ( ) {
|
warn () {
|
||||||
echo "$*"
|
echo "$*"
|
||||||
}
|
} >&2
|
||||||
|
|
||||||
die ( ) {
|
die () {
|
||||||
echo
|
echo
|
||||||
echo "$*"
|
echo "$*"
|
||||||
echo
|
echo
|
||||||
exit 1
|
exit 1
|
||||||
}
|
} >&2
|
||||||
|
|
||||||
# OS specific support (must be 'true' or 'false').
|
# OS specific support (must be 'true' or 'false').
|
||||||
cygwin=false
|
cygwin=false
|
||||||
msys=false
|
msys=false
|
||||||
darwin=false
|
darwin=false
|
||||||
case "`uname`" in
|
nonstop=false
|
||||||
CYGWIN* )
|
case "$( uname )" in #(
|
||||||
cygwin=true
|
CYGWIN* ) cygwin=true ;; #(
|
||||||
;;
|
Darwin* ) darwin=true ;; #(
|
||||||
Darwin* )
|
MSYS* | MINGW* ) msys=true ;; #(
|
||||||
darwin=true
|
NONSTOP* ) nonstop=true ;;
|
||||||
;;
|
|
||||||
MINGW* )
|
|
||||||
msys=true
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
|
||||||
if $cygwin ; then
|
|
||||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Attempt to set APP_HOME
|
|
||||||
# Resolve links: $0 may be a link
|
|
||||||
PRG="$0"
|
|
||||||
# Need this for relative symlinks.
|
|
||||||
while [ -h "$PRG" ] ; do
|
|
||||||
ls=`ls -ld "$PRG"`
|
|
||||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
||||||
if expr "$link" : '/.*' > /dev/null; then
|
|
||||||
PRG="$link"
|
|
||||||
else
|
|
||||||
PRG=`dirname "$PRG"`"/$link"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
SAVED="`pwd`"
|
|
||||||
cd "`dirname \"$PRG\"`/" >&-
|
|
||||||
APP_HOME="`pwd -P`"
|
|
||||||
cd "$SAVED" >&-
|
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
if [ -n "$JAVA_HOME" ] ; then
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
# IBM's JDK on AIX uses strange locations for the executables
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||||
else
|
else
|
||||||
JAVACMD="$JAVA_HOME/bin/java"
|
JAVACMD=$JAVA_HOME/bin/java
|
||||||
fi
|
fi
|
||||||
if [ ! -x "$JAVACMD" ] ; then
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
@@ -82,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
|
|||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
JAVACMD="java"
|
JAVACMD=java
|
||||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
@@ -90,75 +140,95 @@ location of your Java installation."
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# Increase the maximum file descriptors if we can.
|
||||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
MAX_FD_LIMIT=`ulimit -H -n`
|
case $MAX_FD in #(
|
||||||
if [ $? -eq 0 ] ; then
|
max*)
|
||||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
MAX_FD="$MAX_FD_LIMIT"
|
warn "Could not query maximum file descriptor limit"
|
||||||
fi
|
esac
|
||||||
ulimit -n $MAX_FD
|
case $MAX_FD in #(
|
||||||
if [ $? -ne 0 ] ; then
|
'' | soft) :;; #(
|
||||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
*)
|
||||||
fi
|
ulimit -n "$MAX_FD" ||
|
||||||
else
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# For Darwin, add options to specify how the application appears in the dock
|
|
||||||
if $darwin; then
|
|
||||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
||||||
fi
|
|
||||||
|
|
||||||
# For Cygwin, switch paths to Windows format before running java
|
|
||||||
if $cygwin ; then
|
|
||||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
||||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
||||||
|
|
||||||
# We build the pattern for arguments to be converted via cygpath
|
|
||||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
||||||
SEP=""
|
|
||||||
for dir in $ROOTDIRSRAW ; do
|
|
||||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
||||||
SEP="|"
|
|
||||||
done
|
|
||||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
||||||
# Add a user-defined pattern to the cygpath arguments
|
|
||||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
||||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
||||||
fi
|
|
||||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
||||||
i=0
|
|
||||||
for arg in "$@" ; do
|
|
||||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
|
||||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
|
||||||
|
|
||||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
|
||||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
|
||||||
else
|
|
||||||
eval `echo args$i`="\"$arg\""
|
|
||||||
fi
|
|
||||||
i=$((i+1))
|
|
||||||
done
|
|
||||||
case $i in
|
|
||||||
(0) set -- ;;
|
|
||||||
(1) set -- "$args0" ;;
|
|
||||||
(2) set -- "$args0" "$args1" ;;
|
|
||||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
|
||||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
||||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
||||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
||||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
||||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
||||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
# Collect all arguments for the java command, stacking in reverse order:
|
||||||
function splitJvmOpts() {
|
# * args from the command line
|
||||||
JVM_OPTS=("$@")
|
# * the main class name
|
||||||
}
|
# * -classpath
|
||||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
# * -D...appname settings
|
||||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
# * --module-path (only if needed)
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||||
|
|
||||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
|
if "$cygwin" || "$msys" ; then
|
||||||
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
|
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||||
|
|
||||||
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
|
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
for arg do
|
||||||
|
if
|
||||||
|
case $arg in #(
|
||||||
|
-*) false ;; # don't mess with options #(
|
||||||
|
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||||
|
[ -e "$t" ] ;; #(
|
||||||
|
*) false ;;
|
||||||
|
esac
|
||||||
|
then
|
||||||
|
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||||
|
fi
|
||||||
|
# Roll the args list around exactly as many times as the number of
|
||||||
|
# args, so each arg winds up back in the position where it started, but
|
||||||
|
# possibly modified.
|
||||||
|
#
|
||||||
|
# NB: a `for` loop captures its iteration list before it begins, so
|
||||||
|
# changing the positional parameters here affects neither the number of
|
||||||
|
# iterations, nor the values presented in `arg`.
|
||||||
|
shift # remove old arg
|
||||||
|
set -- "$@" "$arg" # push replacement arg
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Collect all arguments for the java command;
|
||||||
|
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||||
|
# shell script including quotes and variable substitutions, so put them in
|
||||||
|
# double quotes to make sure that they get re-expanded; and
|
||||||
|
# * put everything else in single quotes, so that it's not re-expanded.
|
||||||
|
|
||||||
|
set -- \
|
||||||
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
-classpath "$CLASSPATH" \
|
||||||
|
org.gradle.wrapper.GradleWrapperMain \
|
||||||
|
"$@"
|
||||||
|
|
||||||
|
# Use "xargs" to parse quoted args.
|
||||||
|
#
|
||||||
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
#
|
||||||
|
# In Bash we could simply go:
|
||||||
|
#
|
||||||
|
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||||
|
# set -- "${ARGS[@]}" "$@"
|
||||||
|
#
|
||||||
|
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||||
|
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||||
|
# character that might be a shell metacharacter, then use eval to reverse
|
||||||
|
# that process (while maintaining the separation between arguments), and wrap
|
||||||
|
# the whole thing up as a single "set" statement.
|
||||||
|
#
|
||||||
|
# This will of course break if any of these variables contains a newline or
|
||||||
|
# an unmatched quote.
|
||||||
|
#
|
||||||
|
|
||||||
|
eval "set -- $(
|
||||||
|
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||||
|
xargs -n1 |
|
||||||
|
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||||
|
tr '\n' ' '
|
||||||
|
)" '"$@"'
|
||||||
|
|
||||||
|
exec "$JAVACMD" "$@"
|
||||||
|
53
Example/testHotUpdate/android/gradlew.bat
vendored
@@ -1,3 +1,19 @@
|
|||||||
|
@rem
|
||||||
|
@rem Copyright 2015 the original author or authors.
|
||||||
|
@rem
|
||||||
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@rem you may not use this file except in compliance with the License.
|
||||||
|
@rem You may obtain a copy of the License at
|
||||||
|
@rem
|
||||||
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@rem
|
||||||
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@rem See the License for the specific language governing permissions and
|
||||||
|
@rem limitations under the License.
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%" == "" @echo off
|
@if "%DEBUG%" == "" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@@ -8,20 +24,23 @@
|
|||||||
@rem Set local scope for the variables with windows NT shell
|
@rem Set local scope for the variables with windows NT shell
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
set DEFAULT_JVM_OPTS=
|
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
@rem Find java.exe
|
@rem Find java.exe
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
set JAVA_EXE=java.exe
|
set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if "%ERRORLEVEL%" == "0" goto init
|
if "%ERRORLEVEL%" == "0" goto execute
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
@@ -35,7 +54,7 @@ goto fail
|
|||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto init
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
@@ -45,34 +64,14 @@ echo location of your Java installation.
|
|||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:init
|
|
||||||
@rem Get command-line arguments, handling Windowz variants
|
|
||||||
|
|
||||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
|
||||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
|
||||||
|
|
||||||
:win9xME_args
|
|
||||||
@rem Slurp the command line arguments.
|
|
||||||
set CMD_LINE_ARGS=
|
|
||||||
set _SKIP=2
|
|
||||||
|
|
||||||
:win9xME_args_slurp
|
|
||||||
if "x%~1" == "x" goto execute
|
|
||||||
|
|
||||||
set CMD_LINE_ARGS=%*
|
|
||||||
goto execute
|
|
||||||
|
|
||||||
:4NT_args
|
|
||||||
@rem Get arguments from the 4NT Shell from JP Software
|
|
||||||
set CMD_LINE_ARGS=%$
|
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
@@ -1,5 +1,9 @@
|
|||||||
rootProject.name = 'testHotUpdate'
|
rootProject.name = 'testHotupdate'
|
||||||
|
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
|
||||||
include ':app'
|
include ':app'
|
||||||
include ':react-native-update'
|
includeBuild('../node_modules/react-native-gradle-plugin')
|
||||||
project(':react-native-update').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-update/android')
|
|
||||||
|
if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
|
||||||
|
include(":ReactAndroid")
|
||||||
|
project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
|
||||||
|
}
|
||||||
|
4
Example/testHotUpdate/app.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"name": "testHotupdate",
|
||||||
|
"displayName": "testHotupdate"
|
||||||
|
}
|
3
Example/testHotUpdate/babel.config.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
module.exports = {
|
||||||
|
presets: ['module:metro-react-native-babel-preset'],
|
||||||
|
};
|
@@ -1 +0,0 @@
|
|||||||
require('./js/index');
|
|
@@ -1 +0,0 @@
|
|||||||
require('./js/index');
|
|
9
Example/testHotUpdate/index.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* @format
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {AppRegistry} from 'react-native';
|
||||||
|
import App from './src';
|
||||||
|
import {name as appName} from './app.json';
|
||||||
|
|
||||||
|
AppRegistry.registerComponent(appName, () => App);
|
33
Example/testHotUpdate/ios/Podfile
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
require_relative '../node_modules/react-native/scripts/react_native_pods'
|
||||||
|
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
|
||||||
|
|
||||||
|
platform :ios, '11.0'
|
||||||
|
install! 'cocoapods', :deterministic_uuids => false
|
||||||
|
|
||||||
|
target 'testHotupdate' do
|
||||||
|
config = use_native_modules!
|
||||||
|
|
||||||
|
# Flags change depending on the env values.
|
||||||
|
flags = get_default_flags()
|
||||||
|
|
||||||
|
use_react_native!(
|
||||||
|
:path => config[:reactNativePath],
|
||||||
|
# to enable hermes on iOS, change `false` to `true` and then install pods
|
||||||
|
:hermes_enabled => flags[:hermes_enabled],
|
||||||
|
:fabric_enabled => flags[:fabric_enabled],
|
||||||
|
# An absolute path to your application root.
|
||||||
|
:app_path => "#{Pod::Config.instance.installation_root}/.."
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Enables Flipper.
|
||||||
|
#
|
||||||
|
# Note that if you have use_frameworks! enabled, Flipper will not work and
|
||||||
|
# you should disable the next line.
|
||||||
|
use_flipper!()
|
||||||
|
|
||||||
|
post_install do |installer|
|
||||||
|
react_native_post_install(installer)
|
||||||
|
__apply_Xcode_12_5_M1_post_install_workaround(installer)
|
||||||
|
end
|
||||||
|
end
|
562
Example/testHotUpdate/ios/Podfile.lock
Normal file
@@ -0,0 +1,562 @@
|
|||||||
|
PODS:
|
||||||
|
- boost (1.76.0)
|
||||||
|
- CocoaAsyncSocket (7.6.5)
|
||||||
|
- DoubleConversion (1.1.6)
|
||||||
|
- FBLazyVector (0.68.2)
|
||||||
|
- FBReactNativeSpec (0.68.2):
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- RCTRequired (= 0.68.2)
|
||||||
|
- RCTTypeSafety (= 0.68.2)
|
||||||
|
- React-Core (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- ReactCommon/turbomodule/core (= 0.68.2)
|
||||||
|
- Flipper (0.125.0):
|
||||||
|
- Flipper-Folly (~> 2.6)
|
||||||
|
- Flipper-RSocket (~> 1.4)
|
||||||
|
- Flipper-Boost-iOSX (1.76.0.1.11)
|
||||||
|
- Flipper-DoubleConversion (3.2.0)
|
||||||
|
- Flipper-Fmt (7.1.7)
|
||||||
|
- Flipper-Folly (2.6.10):
|
||||||
|
- Flipper-Boost-iOSX
|
||||||
|
- Flipper-DoubleConversion
|
||||||
|
- Flipper-Fmt (= 7.1.7)
|
||||||
|
- Flipper-Glog
|
||||||
|
- libevent (~> 2.1.12)
|
||||||
|
- OpenSSL-Universal (= 1.1.1100)
|
||||||
|
- Flipper-Glog (0.5.0.4)
|
||||||
|
- Flipper-PeerTalk (0.0.4)
|
||||||
|
- Flipper-RSocket (1.4.3):
|
||||||
|
- Flipper-Folly (~> 2.6)
|
||||||
|
- FlipperKit (0.125.0):
|
||||||
|
- FlipperKit/Core (= 0.125.0)
|
||||||
|
- FlipperKit/Core (0.125.0):
|
||||||
|
- Flipper (~> 0.125.0)
|
||||||
|
- FlipperKit/CppBridge
|
||||||
|
- FlipperKit/FBCxxFollyDynamicConvert
|
||||||
|
- FlipperKit/FBDefines
|
||||||
|
- FlipperKit/FKPortForwarding
|
||||||
|
- SocketRocket (~> 0.6.0)
|
||||||
|
- FlipperKit/CppBridge (0.125.0):
|
||||||
|
- Flipper (~> 0.125.0)
|
||||||
|
- FlipperKit/FBCxxFollyDynamicConvert (0.125.0):
|
||||||
|
- Flipper-Folly (~> 2.6)
|
||||||
|
- FlipperKit/FBDefines (0.125.0)
|
||||||
|
- FlipperKit/FKPortForwarding (0.125.0):
|
||||||
|
- CocoaAsyncSocket (~> 7.6)
|
||||||
|
- Flipper-PeerTalk (~> 0.0.4)
|
||||||
|
- FlipperKit/FlipperKitHighlightOverlay (0.125.0)
|
||||||
|
- FlipperKit/FlipperKitLayoutHelpers (0.125.0):
|
||||||
|
- FlipperKit/Core
|
||||||
|
- FlipperKit/FlipperKitHighlightOverlay
|
||||||
|
- FlipperKit/FlipperKitLayoutTextSearchable
|
||||||
|
- FlipperKit/FlipperKitLayoutIOSDescriptors (0.125.0):
|
||||||
|
- FlipperKit/Core
|
||||||
|
- FlipperKit/FlipperKitHighlightOverlay
|
||||||
|
- FlipperKit/FlipperKitLayoutHelpers
|
||||||
|
- YogaKit (~> 1.18)
|
||||||
|
- FlipperKit/FlipperKitLayoutPlugin (0.125.0):
|
||||||
|
- FlipperKit/Core
|
||||||
|
- FlipperKit/FlipperKitHighlightOverlay
|
||||||
|
- FlipperKit/FlipperKitLayoutHelpers
|
||||||
|
- FlipperKit/FlipperKitLayoutIOSDescriptors
|
||||||
|
- FlipperKit/FlipperKitLayoutTextSearchable
|
||||||
|
- YogaKit (~> 1.18)
|
||||||
|
- FlipperKit/FlipperKitLayoutTextSearchable (0.125.0)
|
||||||
|
- FlipperKit/FlipperKitNetworkPlugin (0.125.0):
|
||||||
|
- FlipperKit/Core
|
||||||
|
- FlipperKit/FlipperKitReactPlugin (0.125.0):
|
||||||
|
- FlipperKit/Core
|
||||||
|
- FlipperKit/FlipperKitUserDefaultsPlugin (0.125.0):
|
||||||
|
- FlipperKit/Core
|
||||||
|
- FlipperKit/SKIOSNetworkPlugin (0.125.0):
|
||||||
|
- FlipperKit/Core
|
||||||
|
- FlipperKit/FlipperKitNetworkPlugin
|
||||||
|
- fmt (6.2.1)
|
||||||
|
- glog (0.3.5)
|
||||||
|
- libevent (2.1.12)
|
||||||
|
- OpenSSL-Universal (1.1.1100)
|
||||||
|
- RCT-Folly (2021.06.28.00-v2):
|
||||||
|
- boost
|
||||||
|
- DoubleConversion
|
||||||
|
- fmt (~> 6.2.1)
|
||||||
|
- glog
|
||||||
|
- RCT-Folly/Default (= 2021.06.28.00-v2)
|
||||||
|
- RCT-Folly/Default (2021.06.28.00-v2):
|
||||||
|
- boost
|
||||||
|
- DoubleConversion
|
||||||
|
- fmt (~> 6.2.1)
|
||||||
|
- glog
|
||||||
|
- RCTRequired (0.68.2)
|
||||||
|
- RCTTypeSafety (0.68.2):
|
||||||
|
- FBLazyVector (= 0.68.2)
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- RCTRequired (= 0.68.2)
|
||||||
|
- React-Core (= 0.68.2)
|
||||||
|
- React (0.68.2):
|
||||||
|
- React-Core (= 0.68.2)
|
||||||
|
- React-Core/DevSupport (= 0.68.2)
|
||||||
|
- React-Core/RCTWebSocket (= 0.68.2)
|
||||||
|
- React-RCTActionSheet (= 0.68.2)
|
||||||
|
- React-RCTAnimation (= 0.68.2)
|
||||||
|
- React-RCTBlob (= 0.68.2)
|
||||||
|
- React-RCTImage (= 0.68.2)
|
||||||
|
- React-RCTLinking (= 0.68.2)
|
||||||
|
- React-RCTNetwork (= 0.68.2)
|
||||||
|
- React-RCTSettings (= 0.68.2)
|
||||||
|
- React-RCTText (= 0.68.2)
|
||||||
|
- React-RCTVibration (= 0.68.2)
|
||||||
|
- React-callinvoker (0.68.2)
|
||||||
|
- React-Codegen (0.68.2):
|
||||||
|
- FBReactNativeSpec (= 0.68.2)
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- RCTRequired (= 0.68.2)
|
||||||
|
- RCTTypeSafety (= 0.68.2)
|
||||||
|
- React-Core (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-jsiexecutor (= 0.68.2)
|
||||||
|
- ReactCommon/turbomodule/core (= 0.68.2)
|
||||||
|
- React-Core (0.68.2):
|
||||||
|
- glog
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-Core/Default (= 0.68.2)
|
||||||
|
- React-cxxreact (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-jsiexecutor (= 0.68.2)
|
||||||
|
- React-perflogger (= 0.68.2)
|
||||||
|
- Yoga
|
||||||
|
- React-Core/CoreModulesHeaders (0.68.2):
|
||||||
|
- glog
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-Core/Default
|
||||||
|
- React-cxxreact (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-jsiexecutor (= 0.68.2)
|
||||||
|
- React-perflogger (= 0.68.2)
|
||||||
|
- Yoga
|
||||||
|
- React-Core/Default (0.68.2):
|
||||||
|
- glog
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-cxxreact (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-jsiexecutor (= 0.68.2)
|
||||||
|
- React-perflogger (= 0.68.2)
|
||||||
|
- Yoga
|
||||||
|
- React-Core/DevSupport (0.68.2):
|
||||||
|
- glog
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-Core/Default (= 0.68.2)
|
||||||
|
- React-Core/RCTWebSocket (= 0.68.2)
|
||||||
|
- React-cxxreact (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-jsiexecutor (= 0.68.2)
|
||||||
|
- React-jsinspector (= 0.68.2)
|
||||||
|
- React-perflogger (= 0.68.2)
|
||||||
|
- Yoga
|
||||||
|
- React-Core/RCTActionSheetHeaders (0.68.2):
|
||||||
|
- glog
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-Core/Default
|
||||||
|
- React-cxxreact (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-jsiexecutor (= 0.68.2)
|
||||||
|
- React-perflogger (= 0.68.2)
|
||||||
|
- Yoga
|
||||||
|
- React-Core/RCTAnimationHeaders (0.68.2):
|
||||||
|
- glog
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-Core/Default
|
||||||
|
- React-cxxreact (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-jsiexecutor (= 0.68.2)
|
||||||
|
- React-perflogger (= 0.68.2)
|
||||||
|
- Yoga
|
||||||
|
- React-Core/RCTBlobHeaders (0.68.2):
|
||||||
|
- glog
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-Core/Default
|
||||||
|
- React-cxxreact (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-jsiexecutor (= 0.68.2)
|
||||||
|
- React-perflogger (= 0.68.2)
|
||||||
|
- Yoga
|
||||||
|
- React-Core/RCTImageHeaders (0.68.2):
|
||||||
|
- glog
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-Core/Default
|
||||||
|
- React-cxxreact (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-jsiexecutor (= 0.68.2)
|
||||||
|
- React-perflogger (= 0.68.2)
|
||||||
|
- Yoga
|
||||||
|
- React-Core/RCTLinkingHeaders (0.68.2):
|
||||||
|
- glog
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-Core/Default
|
||||||
|
- React-cxxreact (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-jsiexecutor (= 0.68.2)
|
||||||
|
- React-perflogger (= 0.68.2)
|
||||||
|
- Yoga
|
||||||
|
- React-Core/RCTNetworkHeaders (0.68.2):
|
||||||
|
- glog
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-Core/Default
|
||||||
|
- React-cxxreact (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-jsiexecutor (= 0.68.2)
|
||||||
|
- React-perflogger (= 0.68.2)
|
||||||
|
- Yoga
|
||||||
|
- React-Core/RCTSettingsHeaders (0.68.2):
|
||||||
|
- glog
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-Core/Default
|
||||||
|
- React-cxxreact (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-jsiexecutor (= 0.68.2)
|
||||||
|
- React-perflogger (= 0.68.2)
|
||||||
|
- Yoga
|
||||||
|
- React-Core/RCTTextHeaders (0.68.2):
|
||||||
|
- glog
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-Core/Default
|
||||||
|
- React-cxxreact (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-jsiexecutor (= 0.68.2)
|
||||||
|
- React-perflogger (= 0.68.2)
|
||||||
|
- Yoga
|
||||||
|
- React-Core/RCTVibrationHeaders (0.68.2):
|
||||||
|
- glog
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-Core/Default
|
||||||
|
- React-cxxreact (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-jsiexecutor (= 0.68.2)
|
||||||
|
- React-perflogger (= 0.68.2)
|
||||||
|
- Yoga
|
||||||
|
- React-Core/RCTWebSocket (0.68.2):
|
||||||
|
- glog
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-Core/Default (= 0.68.2)
|
||||||
|
- React-cxxreact (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-jsiexecutor (= 0.68.2)
|
||||||
|
- React-perflogger (= 0.68.2)
|
||||||
|
- Yoga
|
||||||
|
- React-CoreModules (0.68.2):
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- RCTTypeSafety (= 0.68.2)
|
||||||
|
- React-Codegen (= 0.68.2)
|
||||||
|
- React-Core/CoreModulesHeaders (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-RCTImage (= 0.68.2)
|
||||||
|
- ReactCommon/turbomodule/core (= 0.68.2)
|
||||||
|
- React-cxxreact (0.68.2):
|
||||||
|
- boost (= 1.76.0)
|
||||||
|
- DoubleConversion
|
||||||
|
- glog
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-callinvoker (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-jsinspector (= 0.68.2)
|
||||||
|
- React-logger (= 0.68.2)
|
||||||
|
- React-perflogger (= 0.68.2)
|
||||||
|
- React-runtimeexecutor (= 0.68.2)
|
||||||
|
- React-jsi (0.68.2):
|
||||||
|
- boost (= 1.76.0)
|
||||||
|
- DoubleConversion
|
||||||
|
- glog
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-jsi/Default (= 0.68.2)
|
||||||
|
- React-jsi/Default (0.68.2):
|
||||||
|
- boost (= 1.76.0)
|
||||||
|
- DoubleConversion
|
||||||
|
- glog
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-jsiexecutor (0.68.2):
|
||||||
|
- DoubleConversion
|
||||||
|
- glog
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-cxxreact (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-perflogger (= 0.68.2)
|
||||||
|
- React-jsinspector (0.68.2)
|
||||||
|
- React-logger (0.68.2):
|
||||||
|
- glog
|
||||||
|
- react-native-update (7.4.2):
|
||||||
|
- React
|
||||||
|
- react-native-update/HDiffPatch (= 7.4.2)
|
||||||
|
- react-native-update/RCTPushy (= 7.4.2)
|
||||||
|
- SSZipArchive
|
||||||
|
- react-native-update/HDiffPatch (7.4.2):
|
||||||
|
- React
|
||||||
|
- SSZipArchive
|
||||||
|
- react-native-update/RCTPushy (7.4.2):
|
||||||
|
- React
|
||||||
|
- SSZipArchive
|
||||||
|
- React-perflogger (0.68.2)
|
||||||
|
- React-RCTActionSheet (0.68.2):
|
||||||
|
- React-Core/RCTActionSheetHeaders (= 0.68.2)
|
||||||
|
- React-RCTAnimation (0.68.2):
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- RCTTypeSafety (= 0.68.2)
|
||||||
|
- React-Codegen (= 0.68.2)
|
||||||
|
- React-Core/RCTAnimationHeaders (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- ReactCommon/turbomodule/core (= 0.68.2)
|
||||||
|
- React-RCTBlob (0.68.2):
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-Codegen (= 0.68.2)
|
||||||
|
- React-Core/RCTBlobHeaders (= 0.68.2)
|
||||||
|
- React-Core/RCTWebSocket (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-RCTNetwork (= 0.68.2)
|
||||||
|
- ReactCommon/turbomodule/core (= 0.68.2)
|
||||||
|
- React-RCTImage (0.68.2):
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- RCTTypeSafety (= 0.68.2)
|
||||||
|
- React-Codegen (= 0.68.2)
|
||||||
|
- React-Core/RCTImageHeaders (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-RCTNetwork (= 0.68.2)
|
||||||
|
- ReactCommon/turbomodule/core (= 0.68.2)
|
||||||
|
- React-RCTLinking (0.68.2):
|
||||||
|
- React-Codegen (= 0.68.2)
|
||||||
|
- React-Core/RCTLinkingHeaders (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- ReactCommon/turbomodule/core (= 0.68.2)
|
||||||
|
- React-RCTNetwork (0.68.2):
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- RCTTypeSafety (= 0.68.2)
|
||||||
|
- React-Codegen (= 0.68.2)
|
||||||
|
- React-Core/RCTNetworkHeaders (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- ReactCommon/turbomodule/core (= 0.68.2)
|
||||||
|
- React-RCTSettings (0.68.2):
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- RCTTypeSafety (= 0.68.2)
|
||||||
|
- React-Codegen (= 0.68.2)
|
||||||
|
- React-Core/RCTSettingsHeaders (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- ReactCommon/turbomodule/core (= 0.68.2)
|
||||||
|
- React-RCTText (0.68.2):
|
||||||
|
- React-Core/RCTTextHeaders (= 0.68.2)
|
||||||
|
- React-RCTVibration (0.68.2):
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-Codegen (= 0.68.2)
|
||||||
|
- React-Core/RCTVibrationHeaders (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- ReactCommon/turbomodule/core (= 0.68.2)
|
||||||
|
- React-runtimeexecutor (0.68.2):
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- ReactCommon/turbomodule/core (0.68.2):
|
||||||
|
- DoubleConversion
|
||||||
|
- glog
|
||||||
|
- RCT-Folly (= 2021.06.28.00-v2)
|
||||||
|
- React-callinvoker (= 0.68.2)
|
||||||
|
- React-Core (= 0.68.2)
|
||||||
|
- React-cxxreact (= 0.68.2)
|
||||||
|
- React-jsi (= 0.68.2)
|
||||||
|
- React-logger (= 0.68.2)
|
||||||
|
- React-perflogger (= 0.68.2)
|
||||||
|
- SocketRocket (0.6.0)
|
||||||
|
- SSZipArchive (2.4.3)
|
||||||
|
- Yoga (1.14.0)
|
||||||
|
- YogaKit (1.18.1):
|
||||||
|
- Yoga (~> 1.14)
|
||||||
|
|
||||||
|
DEPENDENCIES:
|
||||||
|
- boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
|
||||||
|
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
|
||||||
|
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
|
||||||
|
- FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
|
||||||
|
- Flipper (= 0.125.0)
|
||||||
|
- Flipper-Boost-iOSX (= 1.76.0.1.11)
|
||||||
|
- Flipper-DoubleConversion (= 3.2.0)
|
||||||
|
- Flipper-Fmt (= 7.1.7)
|
||||||
|
- Flipper-Folly (= 2.6.10)
|
||||||
|
- Flipper-Glog (= 0.5.0.4)
|
||||||
|
- Flipper-PeerTalk (= 0.0.4)
|
||||||
|
- Flipper-RSocket (= 1.4.3)
|
||||||
|
- FlipperKit (= 0.125.0)
|
||||||
|
- FlipperKit/Core (= 0.125.0)
|
||||||
|
- FlipperKit/CppBridge (= 0.125.0)
|
||||||
|
- FlipperKit/FBCxxFollyDynamicConvert (= 0.125.0)
|
||||||
|
- FlipperKit/FBDefines (= 0.125.0)
|
||||||
|
- FlipperKit/FKPortForwarding (= 0.125.0)
|
||||||
|
- FlipperKit/FlipperKitHighlightOverlay (= 0.125.0)
|
||||||
|
- FlipperKit/FlipperKitLayoutPlugin (= 0.125.0)
|
||||||
|
- FlipperKit/FlipperKitLayoutTextSearchable (= 0.125.0)
|
||||||
|
- FlipperKit/FlipperKitNetworkPlugin (= 0.125.0)
|
||||||
|
- FlipperKit/FlipperKitReactPlugin (= 0.125.0)
|
||||||
|
- FlipperKit/FlipperKitUserDefaultsPlugin (= 0.125.0)
|
||||||
|
- FlipperKit/SKIOSNetworkPlugin (= 0.125.0)
|
||||||
|
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
|
||||||
|
- OpenSSL-Universal (= 1.1.1100)
|
||||||
|
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
|
||||||
|
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
|
||||||
|
- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
|
||||||
|
- React (from `../node_modules/react-native/`)
|
||||||
|
- React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`)
|
||||||
|
- React-Codegen (from `build/generated/ios`)
|
||||||
|
- React-Core (from `../node_modules/react-native/`)
|
||||||
|
- React-Core/DevSupport (from `../node_modules/react-native/`)
|
||||||
|
- React-Core/RCTWebSocket (from `../node_modules/react-native/`)
|
||||||
|
- React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
|
||||||
|
- React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
|
||||||
|
- React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
|
||||||
|
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
|
||||||
|
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
|
||||||
|
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
|
||||||
|
- react-native-update (from `../../..`)
|
||||||
|
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
|
||||||
|
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
|
||||||
|
- React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
|
||||||
|
- React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
|
||||||
|
- React-RCTImage (from `../node_modules/react-native/Libraries/Image`)
|
||||||
|
- React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)
|
||||||
|
- React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`)
|
||||||
|
- React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)
|
||||||
|
- React-RCTText (from `../node_modules/react-native/Libraries/Text`)
|
||||||
|
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
|
||||||
|
- React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)
|
||||||
|
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
|
||||||
|
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
|
||||||
|
|
||||||
|
SPEC REPOS:
|
||||||
|
trunk:
|
||||||
|
- CocoaAsyncSocket
|
||||||
|
- Flipper
|
||||||
|
- Flipper-Boost-iOSX
|
||||||
|
- Flipper-DoubleConversion
|
||||||
|
- Flipper-Fmt
|
||||||
|
- Flipper-Folly
|
||||||
|
- Flipper-Glog
|
||||||
|
- Flipper-PeerTalk
|
||||||
|
- Flipper-RSocket
|
||||||
|
- FlipperKit
|
||||||
|
- fmt
|
||||||
|
- libevent
|
||||||
|
- OpenSSL-Universal
|
||||||
|
- SocketRocket
|
||||||
|
- SSZipArchive
|
||||||
|
- YogaKit
|
||||||
|
|
||||||
|
EXTERNAL SOURCES:
|
||||||
|
boost:
|
||||||
|
:podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec"
|
||||||
|
DoubleConversion:
|
||||||
|
:podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
|
||||||
|
FBLazyVector:
|
||||||
|
:path: "../node_modules/react-native/Libraries/FBLazyVector"
|
||||||
|
FBReactNativeSpec:
|
||||||
|
:path: "../node_modules/react-native/React/FBReactNativeSpec"
|
||||||
|
glog:
|
||||||
|
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
|
||||||
|
RCT-Folly:
|
||||||
|
:podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
|
||||||
|
RCTRequired:
|
||||||
|
:path: "../node_modules/react-native/Libraries/RCTRequired"
|
||||||
|
RCTTypeSafety:
|
||||||
|
:path: "../node_modules/react-native/Libraries/TypeSafety"
|
||||||
|
React:
|
||||||
|
:path: "../node_modules/react-native/"
|
||||||
|
React-callinvoker:
|
||||||
|
:path: "../node_modules/react-native/ReactCommon/callinvoker"
|
||||||
|
React-Codegen:
|
||||||
|
:path: build/generated/ios
|
||||||
|
React-Core:
|
||||||
|
:path: "../node_modules/react-native/"
|
||||||
|
React-CoreModules:
|
||||||
|
:path: "../node_modules/react-native/React/CoreModules"
|
||||||
|
React-cxxreact:
|
||||||
|
:path: "../node_modules/react-native/ReactCommon/cxxreact"
|
||||||
|
React-jsi:
|
||||||
|
:path: "../node_modules/react-native/ReactCommon/jsi"
|
||||||
|
React-jsiexecutor:
|
||||||
|
:path: "../node_modules/react-native/ReactCommon/jsiexecutor"
|
||||||
|
React-jsinspector:
|
||||||
|
:path: "../node_modules/react-native/ReactCommon/jsinspector"
|
||||||
|
React-logger:
|
||||||
|
:path: "../node_modules/react-native/ReactCommon/logger"
|
||||||
|
react-native-update:
|
||||||
|
:path: "../../.."
|
||||||
|
React-perflogger:
|
||||||
|
:path: "../node_modules/react-native/ReactCommon/reactperflogger"
|
||||||
|
React-RCTActionSheet:
|
||||||
|
:path: "../node_modules/react-native/Libraries/ActionSheetIOS"
|
||||||
|
React-RCTAnimation:
|
||||||
|
:path: "../node_modules/react-native/Libraries/NativeAnimation"
|
||||||
|
React-RCTBlob:
|
||||||
|
:path: "../node_modules/react-native/Libraries/Blob"
|
||||||
|
React-RCTImage:
|
||||||
|
:path: "../node_modules/react-native/Libraries/Image"
|
||||||
|
React-RCTLinking:
|
||||||
|
:path: "../node_modules/react-native/Libraries/LinkingIOS"
|
||||||
|
React-RCTNetwork:
|
||||||
|
:path: "../node_modules/react-native/Libraries/Network"
|
||||||
|
React-RCTSettings:
|
||||||
|
:path: "../node_modules/react-native/Libraries/Settings"
|
||||||
|
React-RCTText:
|
||||||
|
:path: "../node_modules/react-native/Libraries/Text"
|
||||||
|
React-RCTVibration:
|
||||||
|
:path: "../node_modules/react-native/Libraries/Vibration"
|
||||||
|
React-runtimeexecutor:
|
||||||
|
:path: "../node_modules/react-native/ReactCommon/runtimeexecutor"
|
||||||
|
ReactCommon:
|
||||||
|
:path: "../node_modules/react-native/ReactCommon"
|
||||||
|
Yoga:
|
||||||
|
:path: "../node_modules/react-native/ReactCommon/yoga"
|
||||||
|
|
||||||
|
SPEC CHECKSUMS:
|
||||||
|
boost: a7c83b31436843459a1961bfd74b96033dc77234
|
||||||
|
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
|
||||||
|
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
|
||||||
|
FBLazyVector: a7a655862f6b09625d11c772296b01cd5164b648
|
||||||
|
FBReactNativeSpec: 81ce99032d5b586fddd6a38d450f8595f7e04be4
|
||||||
|
Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0
|
||||||
|
Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
|
||||||
|
Flipper-DoubleConversion: 3d3d04a078d4f3a1b6c6916587f159dc11f232c4
|
||||||
|
Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b
|
||||||
|
Flipper-Folly: 584845625005ff068a6ebf41f857f468decd26b3
|
||||||
|
Flipper-Glog: 87bc98ff48de90cb5b0b5114ed3da79d85ee2dd4
|
||||||
|
Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
|
||||||
|
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
|
||||||
|
FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86
|
||||||
|
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
|
||||||
|
glog: 476ee3e89abb49e07f822b48323c51c57124b572
|
||||||
|
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
|
||||||
|
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
|
||||||
|
RCT-Folly: 4d8508a426467c48885f1151029bc15fa5d7b3b8
|
||||||
|
RCTRequired: 3e917ea5377751094f38145fdece525aa90545a0
|
||||||
|
RCTTypeSafety: c43c072a4bd60feb49a9570b0517892b4305c45e
|
||||||
|
React: 176dd882de001854ced260fad41bb68a31aa4bd0
|
||||||
|
React-callinvoker: c2864d1818d6e64928d2faf774a3800dfc38fe1f
|
||||||
|
React-Codegen: 98b6f97f0a7abf7d67e4ce435c77c05b7a95cf05
|
||||||
|
React-Core: fdaa2916b1c893f39f02cff0476d1fb0cab1e352
|
||||||
|
React-CoreModules: fd8705b80699ec36c2cdd635c2ce9d874b9cfdfc
|
||||||
|
React-cxxreact: 1832d971f7b0cb2c7b943dc0ec962762c90c906e
|
||||||
|
React-jsi: 72af715135abe8c3f0dcf3b2548b71d048b69a7e
|
||||||
|
React-jsiexecutor: b7b553412f2ec768fe6c8f27cd6bafdb9d8719e6
|
||||||
|
React-jsinspector: c5989c77cb89ae6a69561095a61cce56a44ae8e8
|
||||||
|
React-logger: a0833912d93b36b791b7a521672d8ee89107aff1
|
||||||
|
react-native-update: 35b44bdcfd37e0f0bbef8ceb1bdda85067e591ff
|
||||||
|
React-perflogger: a18b4f0bd933b8b24ecf9f3c54f9bf65180f3fe6
|
||||||
|
React-RCTActionSheet: 547fe42fdb4b6089598d79f8e1d855d7c23e2162
|
||||||
|
React-RCTAnimation: bc9440a1c37b06ae9ebbb532d244f607805c6034
|
||||||
|
React-RCTBlob: a1295c8e183756d7ef30ba6e8f8144dfe8a19215
|
||||||
|
React-RCTImage: a30d1ee09b1334067fbb6f30789aae2d7ac150c9
|
||||||
|
React-RCTLinking: ffc6d5b88d1cb9aca13c54c2ec6507fbf07f2ac4
|
||||||
|
React-RCTNetwork: f807a2facab6cf5cf36d592e634611de9cf12d81
|
||||||
|
React-RCTSettings: 861806819226ed8332e6a8f90df2951a34bb3e7f
|
||||||
|
React-RCTText: f3fb464cc41a50fc7a1aba4deeb76a9ad8282cb9
|
||||||
|
React-RCTVibration: 79040b92bfa9c3c2d2cb4f57e981164ec7ab9374
|
||||||
|
React-runtimeexecutor: b960b687d2dfef0d3761fbb187e01812ebab8b23
|
||||||
|
ReactCommon: 095366164a276d91ea704ce53cb03825c487a3f2
|
||||||
|
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
|
||||||
|
SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef
|
||||||
|
Yoga: 99652481fcd320aefa4a7ef90095b95acd181952
|
||||||
|
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
|
||||||
|
|
||||||
|
PODFILE CHECKSUM: 3360a41d7ffd204bbb0ce92d9f9025f372649143
|
||||||
|
|
||||||
|
COCOAPODS: 1.11.3
|
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Scheme
|
<Scheme
|
||||||
LastUpgradeVersion = "0620"
|
LastUpgradeVersion = "1210"
|
||||||
version = "1.3">
|
version = "1.3">
|
||||||
<BuildAction
|
<BuildAction
|
||||||
parallelizeBuildables = "YES"
|
parallelizeBuildables = "YES"
|
||||||
@@ -15,90 +15,66 @@
|
|||||||
<BuildableReference
|
<BuildableReference
|
||||||
BuildableIdentifier = "primary"
|
BuildableIdentifier = "primary"
|
||||||
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
||||||
BuildableName = "testHotUpdate.app"
|
BuildableName = "testHotupdate.app"
|
||||||
BlueprintName = "testHotUpdate"
|
BlueprintName = "testHotupdate"
|
||||||
ReferencedContainer = "container:testHotUpdate.xcodeproj">
|
ReferencedContainer = "container:testHotupdate.xcodeproj">
|
||||||
</BuildableReference>
|
|
||||||
</BuildActionEntry>
|
|
||||||
<BuildActionEntry
|
|
||||||
buildForTesting = "YES"
|
|
||||||
buildForRunning = "YES"
|
|
||||||
buildForProfiling = "NO"
|
|
||||||
buildForArchiving = "NO"
|
|
||||||
buildForAnalyzing = "YES">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
|
|
||||||
BuildableName = "testHotUpdateTests.xctest"
|
|
||||||
BlueprintName = "testHotUpdateTests"
|
|
||||||
ReferencedContainer = "container:testHotUpdate.xcodeproj">
|
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</BuildActionEntry>
|
</BuildActionEntry>
|
||||||
</BuildActionEntries>
|
</BuildActionEntries>
|
||||||
</BuildAction>
|
</BuildAction>
|
||||||
<TestAction
|
<TestAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
buildConfiguration = "Debug">
|
|
||||||
<Testables>
|
<Testables>
|
||||||
<TestableReference
|
<TestableReference
|
||||||
skipped = "NO">
|
skipped = "NO">
|
||||||
<BuildableReference
|
<BuildableReference
|
||||||
BuildableIdentifier = "primary"
|
BuildableIdentifier = "primary"
|
||||||
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
|
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
|
||||||
BuildableName = "testHotUpdateTests.xctest"
|
BuildableName = "testHotupdateTests.xctest"
|
||||||
BlueprintName = "testHotUpdateTests"
|
BlueprintName = "testHotupdateTests"
|
||||||
ReferencedContainer = "container:testHotUpdate.xcodeproj">
|
ReferencedContainer = "container:testHotupdate.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</TestableReference>
|
</TestableReference>
|
||||||
</Testables>
|
</Testables>
|
||||||
<MacroExpansion>
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
|
||||||
BuildableName = "testHotUpdate.app"
|
|
||||||
BlueprintName = "testHotUpdate"
|
|
||||||
ReferencedContainer = "container:testHotUpdate.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</MacroExpansion>
|
|
||||||
</TestAction>
|
</TestAction>
|
||||||
<LaunchAction
|
<LaunchAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
launchStyle = "0"
|
launchStyle = "0"
|
||||||
useCustomWorkingDirectory = "NO"
|
useCustomWorkingDirectory = "NO"
|
||||||
buildConfiguration = "Debug"
|
|
||||||
ignoresPersistentStateOnLaunch = "NO"
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
debugDocumentVersioning = "YES"
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
allowLocationSimulation = "YES">
|
allowLocationSimulation = "YES">
|
||||||
<BuildableProductRunnable
|
<BuildableProductRunnable
|
||||||
runnableDebuggingMode = "0">
|
runnableDebuggingMode = "0">
|
||||||
<BuildableReference
|
<BuildableReference
|
||||||
BuildableIdentifier = "primary"
|
BuildableIdentifier = "primary"
|
||||||
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
||||||
BuildableName = "testHotUpdate.app"
|
BuildableName = "testHotupdate.app"
|
||||||
BlueprintName = "testHotUpdate"
|
BlueprintName = "testHotupdate"
|
||||||
ReferencedContainer = "container:testHotUpdate.xcodeproj">
|
ReferencedContainer = "container:testHotupdate.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</BuildableProductRunnable>
|
</BuildableProductRunnable>
|
||||||
<AdditionalOptions>
|
|
||||||
</AdditionalOptions>
|
|
||||||
</LaunchAction>
|
</LaunchAction>
|
||||||
<ProfileAction
|
<ProfileAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
savedToolIdentifier = ""
|
savedToolIdentifier = ""
|
||||||
useCustomWorkingDirectory = "NO"
|
useCustomWorkingDirectory = "NO"
|
||||||
buildConfiguration = "Release"
|
|
||||||
debugDocumentVersioning = "YES">
|
debugDocumentVersioning = "YES">
|
||||||
<BuildableProductRunnable
|
<BuildableProductRunnable
|
||||||
runnableDebuggingMode = "0">
|
runnableDebuggingMode = "0">
|
||||||
<BuildableReference
|
<BuildableReference
|
||||||
BuildableIdentifier = "primary"
|
BuildableIdentifier = "primary"
|
||||||
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
||||||
BuildableName = "testHotUpdate.app"
|
BuildableName = "testHotupdate.app"
|
||||||
BlueprintName = "testHotUpdate"
|
BlueprintName = "testHotupdate"
|
||||||
ReferencedContainer = "container:testHotUpdate.xcodeproj">
|
ReferencedContainer = "container:testHotupdate.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</BuildableProductRunnable>
|
</BuildableProductRunnable>
|
||||||
</ProfileAction>
|
</ProfileAction>
|
||||||
|
10
Example/testHotUpdate/ios/testHotUpdate.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "group:testHotupdate.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
<FileRef
|
||||||
|
location = "group:Pods/Pods.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
@@ -1,15 +1,7 @@
|
|||||||
/**
|
#import <React/RCTBridgeDelegate.h>
|
||||||
* Copyright (c) 2015-present, Facebook, Inc.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the BSD-style license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
@interface AppDelegate : UIResponder <UIApplicationDelegate>
|
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
|
||||||
|
|
||||||
@property (nonatomic, strong) UIWindow *window;
|
@property (nonatomic, strong) UIWindow *window;
|
||||||
|
|
||||||
|
@@ -1,59 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2015-present, Facebook, Inc.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the BSD-style license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#import "AppDelegate.h"
|
|
||||||
|
|
||||||
#import "RCTRootView.h"
|
|
||||||
#import "RCTHotUpdate.h"
|
|
||||||
|
|
||||||
@implementation AppDelegate
|
|
||||||
|
|
||||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
||||||
{
|
|
||||||
NSURL *jsCodeLocation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Loading JavaScript code - uncomment the one you want.
|
|
||||||
*
|
|
||||||
* OPTION 1
|
|
||||||
* Load from development server. Start the server from the repository root:
|
|
||||||
*
|
|
||||||
* $ npm start
|
|
||||||
*
|
|
||||||
* To run on device, change `localhost` to the IP address of your computer
|
|
||||||
* (you can get this by typing `ifconfig` into the terminal and selecting the
|
|
||||||
* `inet` value under `en0:`) and make sure your computer and iOS device are
|
|
||||||
* on the same Wi-Fi network.
|
|
||||||
*/
|
|
||||||
|
|
||||||
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OPTION 2
|
|
||||||
* Load from pre-bundled file on disk. The static bundle is automatically
|
|
||||||
* generated by "Bundle React Native code and images" build step.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
|
||||||
// jsCodeLocation = [RCTHotUpdate bundleURL];
|
|
||||||
|
|
||||||
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
|
|
||||||
moduleName:@"testHotUpdate"
|
|
||||||
initialProperties:nil
|
|
||||||
launchOptions:launchOptions];
|
|
||||||
|
|
||||||
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
|
||||||
UIViewController *rootViewController = [UIViewController new];
|
|
||||||
rootViewController.view = rootView;
|
|
||||||
self.window.rootViewController = rootViewController;
|
|
||||||
[self.window makeKeyAndVisible];
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
110
Example/testHotUpdate/ios/testHotUpdate/AppDelegate.mm
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
#import "AppDelegate.h"
|
||||||
|
|
||||||
|
#import <React/RCTBridge.h>
|
||||||
|
#import <React/RCTBundleURLProvider.h>
|
||||||
|
#import <React/RCTRootView.h>
|
||||||
|
#import "RCTPushy.h"
|
||||||
|
|
||||||
|
#import <React/RCTAppSetupUtils.h>
|
||||||
|
|
||||||
|
#if RCT_NEW_ARCH_ENABLED
|
||||||
|
#import <React/CoreModulesPlugins.h>
|
||||||
|
#import <React/RCTCxxBridgeDelegate.h>
|
||||||
|
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
|
||||||
|
#import <React/RCTSurfacePresenter.h>
|
||||||
|
#import <React/RCTSurfacePresenterBridgeAdapter.h>
|
||||||
|
#import <ReactCommon/RCTTurboModuleManager.h>
|
||||||
|
|
||||||
|
#import <react/config/ReactNativeConfig.h>
|
||||||
|
|
||||||
|
@interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> {
|
||||||
|
RCTTurboModuleManager *_turboModuleManager;
|
||||||
|
RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
|
||||||
|
std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
|
||||||
|
facebook::react::ContextContainer::Shared _contextContainer;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@implementation AppDelegate
|
||||||
|
|
||||||
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||||
|
{
|
||||||
|
RCTAppSetupPrepareApp(application);
|
||||||
|
|
||||||
|
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
|
||||||
|
|
||||||
|
#if RCT_NEW_ARCH_ENABLED
|
||||||
|
_contextContainer = std::make_shared<facebook::react::ContextContainer const>();
|
||||||
|
_reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
|
||||||
|
_contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
|
||||||
|
_bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];
|
||||||
|
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"testHotupdate", nil);
|
||||||
|
|
||||||
|
if (@available(iOS 13.0, *)) {
|
||||||
|
rootView.backgroundColor = [UIColor systemBackgroundColor];
|
||||||
|
} else {
|
||||||
|
rootView.backgroundColor = [UIColor whiteColor];
|
||||||
|
}
|
||||||
|
|
||||||
|
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||||
|
UIViewController *rootViewController = [UIViewController new];
|
||||||
|
rootViewController.view = rootView;
|
||||||
|
self.window.rootViewController = rootViewController;
|
||||||
|
[self.window makeKeyAndVisible];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
||||||
|
{
|
||||||
|
#if DEBUG
|
||||||
|
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
|
||||||
|
#else
|
||||||
|
// 非DEBUG情况下替换为热更新bundle
|
||||||
|
return [RCTPushy bundleURL];
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#if RCT_NEW_ARCH_ENABLED
|
||||||
|
|
||||||
|
#pragma mark - RCTCxxBridgeDelegate
|
||||||
|
|
||||||
|
- (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge
|
||||||
|
{
|
||||||
|
_turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
|
||||||
|
delegate:self
|
||||||
|
jsInvoker:bridge.jsCallInvoker];
|
||||||
|
return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark RCTTurboModuleManagerDelegate
|
||||||
|
|
||||||
|
- (Class)getModuleClassFromName:(const char *)name
|
||||||
|
{
|
||||||
|
return RCTCoreModulesClassProvider(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
|
||||||
|
jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
|
||||||
|
initParams:
|
||||||
|
(const facebook::react::ObjCTurboModule::InitParams &)params
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
|
||||||
|
{
|
||||||
|
return RCTAppSetupDefaultModuleFromClass(moduleClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@end
|
@@ -1,42 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
|
|
||||||
<dependencies>
|
|
||||||
<deployment identifier="iOS"/>
|
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
|
|
||||||
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
|
|
||||||
</dependencies>
|
|
||||||
<objects>
|
|
||||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
|
||||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
|
||||||
<view contentMode="scaleToFill" id="iN0-l3-epB">
|
|
||||||
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
|
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
|
||||||
<subviews>
|
|
||||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
|
|
||||||
<rect key="frame" x="20" y="439" width="441" height="21"/>
|
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
|
||||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
|
||||||
<nil key="highlightedColor"/>
|
|
||||||
</label>
|
|
||||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="testHotUpdate" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
|
|
||||||
<rect key="frame" x="20" y="140" width="441" height="43"/>
|
|
||||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
|
|
||||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
|
||||||
<nil key="highlightedColor"/>
|
|
||||||
</label>
|
|
||||||
</subviews>
|
|
||||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
|
||||||
<constraints>
|
|
||||||
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
|
|
||||||
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
|
|
||||||
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
|
|
||||||
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
|
|
||||||
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
|
|
||||||
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
|
|
||||||
</constraints>
|
|
||||||
<nil key="simulatedStatusBarMetrics"/>
|
|
||||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
|
||||||
<point key="canvasLocation" x="548" y="455"/>
|
|
||||||
</view>
|
|
||||||
</objects>
|
|
||||||
</document>
|
|
@@ -2,37 +2,52 @@
|
|||||||
"images" : [
|
"images" : [
|
||||||
{
|
{
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"size" : "29x29",
|
"scale" : "2x",
|
||||||
"scale" : "2x"
|
"size" : "20x20"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"size" : "29x29",
|
"scale" : "3x",
|
||||||
"scale" : "3x"
|
"size" : "20x20"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"size" : "40x40",
|
"scale" : "2x",
|
||||||
"scale" : "2x"
|
"size" : "29x29"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"size" : "40x40",
|
"scale" : "3x",
|
||||||
"scale" : "3x"
|
"size" : "29x29"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"size" : "60x60",
|
"scale" : "2x",
|
||||||
"scale" : "2x"
|
"size" : "40x40"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"size" : "60x60",
|
"scale" : "3x",
|
||||||
"scale" : "3x"
|
"size" : "40x40"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"scale" : "2x",
|
||||||
|
"size" : "60x60"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"scale" : "3x",
|
||||||
|
"size" : "60x60"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "ios-marketing",
|
||||||
|
"scale" : "1x",
|
||||||
|
"size" : "1024x1024"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"info" : {
|
"info" : {
|
||||||
"version" : 1,
|
"author" : "xcode",
|
||||||
"author" : "xcode"
|
"version" : 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,4 +3,4 @@
|
|||||||
"version" : 1,
|
"version" : 1,
|
||||||
"author" : "xcode"
|
"author" : "xcode"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"filename" : "shoucang.png",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"filename" : "shoucang@2x.png",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"filename" : "shoucang@3x.png",
|
|
||||||
"scale" : "3x"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"version" : 1,
|
|
||||||
"author" : "xcode"
|
|
||||||
}
|
|
||||||
}
|
|
@@ -4,10 +4,12 @@
|
|||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
|
<key>CFBundleDisplayName</key>
|
||||||
|
<string>testHotupdate</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
@@ -22,6 +24,19 @@
|
|||||||
<string>1</string>
|
<string>1</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>NSAppTransportSecurity</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSExceptionDomains</key>
|
||||||
|
<dict>
|
||||||
|
<key>localhost</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSExceptionAllowsInsecureHTTPLoads</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>NSLocationWhenInUseUsageDescription</key>
|
||||||
|
<string></string>
|
||||||
<key>UILaunchStoryboardName</key>
|
<key>UILaunchStoryboardName</key>
|
||||||
<string>LaunchScreen</string>
|
<string>LaunchScreen</string>
|
||||||
<key>UIRequiredDeviceCapabilities</key>
|
<key>UIRequiredDeviceCapabilities</key>
|
||||||
@@ -36,13 +51,5 @@
|
|||||||
</array>
|
</array>
|
||||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>NSLocationWhenInUseUsageDescription</key>
|
|
||||||
<string></string>
|
|
||||||
<key>NSAppTransportSecurity</key>
|
|
||||||
<dict>
|
|
||||||
<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
|
|
||||||
<key>NSAllowsArbitraryLoads</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
@@ -0,0 +1,47 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||||
|
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
||||||
|
<dependencies>
|
||||||
|
<deployment identifier="iOS"/>
|
||||||
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
|
||||||
|
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||||
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
|
</dependencies>
|
||||||
|
<scenes>
|
||||||
|
<!--View Controller-->
|
||||||
|
<scene sceneID="EHf-IW-A2E">
|
||||||
|
<objects>
|
||||||
|
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||||
|
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
|
<subviews>
|
||||||
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="testHotupdate" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
|
||||||
|
<rect key="frame" x="0.0" y="202" width="375" height="43"/>
|
||||||
|
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
|
||||||
|
<nil key="highlightedColor"/>
|
||||||
|
</label>
|
||||||
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="MN2-I3-ftu">
|
||||||
|
<rect key="frame" x="0.0" y="626" width="375" height="21"/>
|
||||||
|
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||||
|
<nil key="highlightedColor"/>
|
||||||
|
</label>
|
||||||
|
</subviews>
|
||||||
|
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||||
|
<constraints>
|
||||||
|
<constraint firstItem="Bcu-3y-fUS" firstAttribute="bottom" secondItem="MN2-I3-ftu" secondAttribute="bottom" constant="20" id="OZV-Vh-mqD"/>
|
||||||
|
<constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
|
||||||
|
<constraint firstItem="MN2-I3-ftu" firstAttribute="centerX" secondItem="Bcu-3y-fUS" secondAttribute="centerX" id="akx-eg-2ui"/>
|
||||||
|
<constraint firstItem="MN2-I3-ftu" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" id="i1E-0Y-4RG"/>
|
||||||
|
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
|
||||||
|
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="x7j-FC-K8j"/>
|
||||||
|
</constraints>
|
||||||
|
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
|
||||||
|
</view>
|
||||||
|
</viewController>
|
||||||
|
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||||
|
</objects>
|
||||||
|
<point key="canvasLocation" x="52.173913043478265" y="375"/>
|
||||||
|
</scene>
|
||||||
|
</scenes>
|
||||||
|
</document>
|
@@ -1,17 +1,9 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2015-present, Facebook, Inc.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the BSD-style license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
#import "AppDelegate.h"
|
#import "AppDelegate.h"
|
||||||
|
|
||||||
int main(int argc, char * argv[]) {
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
|
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
|
||||||
}
|
}
|
||||||
|
@@ -1,70 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2015-present, Facebook, Inc.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the BSD-style license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
#import <XCTest/XCTest.h>
|
|
||||||
|
|
||||||
#import "RCTLog.h"
|
|
||||||
#import "RCTRootView.h"
|
|
||||||
|
|
||||||
#define TIMEOUT_SECONDS 240
|
|
||||||
#define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
|
|
||||||
|
|
||||||
@interface testHotUpdateTests : XCTestCase
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation testHotUpdateTests
|
|
||||||
|
|
||||||
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
|
|
||||||
{
|
|
||||||
if (test(view)) {
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
for (UIView *subview in [view subviews]) {
|
|
||||||
if ([self findSubviewInView:subview matching:test]) {
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)testRendersWelcomeScreen
|
|
||||||
{
|
|
||||||
UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
|
|
||||||
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
|
|
||||||
BOOL foundElement = NO;
|
|
||||||
|
|
||||||
__block NSString *redboxError = nil;
|
|
||||||
RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
|
|
||||||
if (level >= RCTLogLevelError) {
|
|
||||||
redboxError = message;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
|
|
||||||
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
|
||||||
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
|
||||||
|
|
||||||
foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
|
|
||||||
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
return NO;
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
|
|
||||||
RCTSetLogFunction(RCTDefaultLogFunction);
|
|
||||||
|
|
||||||
XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
|
|
||||||
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
|
@@ -7,7 +7,7 @@
|
|||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
@@ -0,0 +1,66 @@
|
|||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
#import <XCTest/XCTest.h>
|
||||||
|
|
||||||
|
#import <React/RCTLog.h>
|
||||||
|
#import <React/RCTRootView.h>
|
||||||
|
|
||||||
|
#define TIMEOUT_SECONDS 600
|
||||||
|
#define TEXT_TO_LOOK_FOR @"Welcome to React"
|
||||||
|
|
||||||
|
@interface testHotupdateTests : XCTestCase
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation testHotupdateTests
|
||||||
|
|
||||||
|
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test
|
||||||
|
{
|
||||||
|
if (test(view)) {
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
for (UIView *subview in [view subviews]) {
|
||||||
|
if ([self findSubviewInView:subview matching:test]) {
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)testRendersWelcomeScreen
|
||||||
|
{
|
||||||
|
UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
|
||||||
|
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
|
||||||
|
BOOL foundElement = NO;
|
||||||
|
|
||||||
|
__block NSString *redboxError = nil;
|
||||||
|
#ifdef DEBUG
|
||||||
|
RCTSetLogFunction(
|
||||||
|
^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
|
||||||
|
if (level >= RCTLogLevelError) {
|
||||||
|
redboxError = message;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
#endif
|
||||||
|
|
||||||
|
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
|
||||||
|
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
||||||
|
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
||||||
|
|
||||||
|
foundElement = [self findSubviewInView:vc.view
|
||||||
|
matching:^BOOL(UIView *view) {
|
||||||
|
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
return NO;
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
RCTSetLogFunction(RCTDefaultLogFunction);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
|
||||||
|
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
Before Width: | Height: | Size: 521 B |
Before Width: | Height: | Size: 928 B |
Before Width: | Height: | Size: 1.3 KiB |
@@ -1,123 +0,0 @@
|
|||||||
/**
|
|
||||||
* Sample React Native App
|
|
||||||
* https://github.com/facebook/react-native
|
|
||||||
*/
|
|
||||||
'use strict';
|
|
||||||
import React, {
|
|
||||||
AppRegistry,
|
|
||||||
Component,
|
|
||||||
StyleSheet,
|
|
||||||
Platform,
|
|
||||||
Text,
|
|
||||||
View,
|
|
||||||
Alert,
|
|
||||||
TouchableOpacity,
|
|
||||||
Linking,
|
|
||||||
Image,
|
|
||||||
} from 'react-native';
|
|
||||||
|
|
||||||
import {
|
|
||||||
isFirstTime,
|
|
||||||
isRolledBack,
|
|
||||||
packageVersion,
|
|
||||||
currentVersion,
|
|
||||||
checkUpdate,
|
|
||||||
downloadUpdate,
|
|
||||||
switchVersion,
|
|
||||||
switchVersionLater,
|
|
||||||
markSuccess,
|
|
||||||
} from 'react-native-update';
|
|
||||||
|
|
||||||
import _updateConfig from '../update.json';
|
|
||||||
const {appKey} = _updateConfig[Platform.OS];
|
|
||||||
|
|
||||||
class MyProject extends Component {
|
|
||||||
componentWillMount(){
|
|
||||||
if (isRolledBack) {
|
|
||||||
Alert.alert('提示', '刚刚更新失败了,版本被回滚.');
|
|
||||||
} else if (isFirstTime) {
|
|
||||||
Alert.alert('提示', '这是当前版本第一次启动,是否要模拟启动失败?将回滚到上一版本', [
|
|
||||||
{text: '是', onPress: ()=>{throw new Error('模拟启动失败,请重启应用')}},
|
|
||||||
{text: '否', onPress: ()=>{markSuccess()}},
|
|
||||||
]);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
doUpdate = info => {
|
|
||||||
downloadUpdate(info).then(hash => {
|
|
||||||
Alert.alert('提示', '下载完毕,是否重启应用?', [
|
|
||||||
{text: '是', onPress: ()=>{switchVersion(hash);}},
|
|
||||||
{text: '否',},
|
|
||||||
{text: '下次启动时', onPress: ()=>{switchVersionLater(hash);}},
|
|
||||||
]);
|
|
||||||
}).catch(err => {
|
|
||||||
Alert.alert('提示', '更新失败.');
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
checkUpdate = () => {
|
|
||||||
checkUpdate(appKey).then(info => {
|
|
||||||
if (info.expired) {
|
|
||||||
Alert.alert('提示', '您的应用版本已更新,请前往应用商店下载新的版本', [
|
|
||||||
{text: '确定', onPress: ()=>{info.downloadUrl && Linking.openURL(info.downloadUrl)}},
|
|
||||||
]);
|
|
||||||
} else if (info.upToDate) {
|
|
||||||
Alert.alert('提示', '您的应用版本已是最新.');
|
|
||||||
} else {
|
|
||||||
Alert.alert('提示', '检查到新的版本'+info.name+',是否下载?\n'+ info.description, [
|
|
||||||
{text: '是', onPress: ()=>{this.doUpdate(info)}},
|
|
||||||
{text: '否',},
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
Alert.alert('提示', '检查更新失败.');
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<View style={styles.container}>
|
|
||||||
<Text style={styles.welcome}>
|
|
||||||
欢迎使用热更新服务
|
|
||||||
</Text>
|
|
||||||
<Image
|
|
||||||
resizeMode = {'contain'}
|
|
||||||
source = {require('./assets/shoucang.png')}
|
|
||||||
style = {styles.image}
|
|
||||||
/>
|
|
||||||
<Text style={styles.instructions}>
|
|
||||||
这是版本一 {'\n'}
|
|
||||||
当前包版本号: {packageVersion}{'\n'}
|
|
||||||
当前版本Hash: {currentVersion||'(空)'}{'\n'}
|
|
||||||
</Text>
|
|
||||||
<TouchableOpacity onPress={this.checkUpdate}>
|
|
||||||
<Text style={styles.instructions}>
|
|
||||||
点击这里检查更新
|
|
||||||
</Text>
|
|
||||||
</TouchableOpacity>
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
container: {
|
|
||||||
flex: 1,
|
|
||||||
justifyContent: 'center',
|
|
||||||
alignItems: 'center',
|
|
||||||
backgroundColor: '#F5FCFF',
|
|
||||||
},
|
|
||||||
welcome: {
|
|
||||||
fontSize: 20,
|
|
||||||
textAlign: 'center',
|
|
||||||
margin: 10,
|
|
||||||
},
|
|
||||||
instructions: {
|
|
||||||
textAlign: 'center',
|
|
||||||
color: '#333333',
|
|
||||||
marginBottom: 5,
|
|
||||||
},
|
|
||||||
image : {
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
AppRegistry.registerComponent('testHotUpdate', () => MyProject);
|
|
23
Example/testHotUpdate/metro.config.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const extraNodeModules = {
|
||||||
|
'react-native': path.resolve(__dirname, 'node_modules/react-native'),
|
||||||
|
'react-native-update': path.resolve(__dirname, '../..'),
|
||||||
|
'@babel/runtime': path.resolve(__dirname, 'node_modules/@babel/runtime'),
|
||||||
|
};
|
||||||
|
const watchFolders = [path.resolve(__dirname, '../..')];
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
transformer: {
|
||||||
|
getTransformOptions: async () => ({
|
||||||
|
transform: {
|
||||||
|
experimentalImportSupport: false,
|
||||||
|
inlineRequires: true,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
resolver: {
|
||||||
|
extraNodeModules,
|
||||||
|
},
|
||||||
|
watchFolders,
|
||||||
|
};
|
@@ -1,12 +1,31 @@
|
|||||||
{
|
{
|
||||||
"name": "testHotUpdate",
|
"name": "testhotupdate",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node node_modules/react-native/local-cli/cli.js start"
|
"android": "react-native run-android",
|
||||||
|
"ios": "react-native run-ios",
|
||||||
|
"start": "react-native start",
|
||||||
|
"test": "jest",
|
||||||
|
"lint": "eslint .",
|
||||||
|
"apk": "(cd android && ./gradlew aR)"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react-native": "^0.20.0",
|
"react": "17.0.2",
|
||||||
"react-native-pushy": "../.."
|
"react-native": "0.68.2",
|
||||||
|
"react-native-update": "link:../.."
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.12.9",
|
||||||
|
"@babel/runtime": "^7.12.5",
|
||||||
|
"@react-native-community/eslint-config": "^2.0.0",
|
||||||
|
"babel-jest": "^26.6.3",
|
||||||
|
"eslint": "^7.32.0",
|
||||||
|
"jest": "^26.6.3",
|
||||||
|
"metro-react-native-babel-preset": "^0.67.0",
|
||||||
|
"react-test-renderer": "17.0.2"
|
||||||
|
},
|
||||||
|
"jest": {
|
||||||
|
"preset": "react-native"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
76
Example/testHotUpdate/src/TestConsole.js
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import {
|
||||||
|
ActivityIndicator,
|
||||||
|
Alert,
|
||||||
|
Modal,
|
||||||
|
TextInput,
|
||||||
|
Button,
|
||||||
|
NativeModules,
|
||||||
|
StyleSheet,
|
||||||
|
SafeAreaView,
|
||||||
|
Text,
|
||||||
|
View,
|
||||||
|
} from 'react-native';
|
||||||
|
|
||||||
|
const Pushy = NativeModules.Pushy;
|
||||||
|
export default function TestConsole({visible}) {
|
||||||
|
const [text, setText] = React.useState('');
|
||||||
|
const [running, setRunning] = React.useState(false);
|
||||||
|
return (
|
||||||
|
<Modal visible={visible}>
|
||||||
|
<SafeAreaView style={{flex: 1, padding: 10}}>
|
||||||
|
<Text>调试Pushy方法(方法名,参数,值换行)</Text>
|
||||||
|
<TextInput
|
||||||
|
autoCorrect={false}
|
||||||
|
autoCapitalize="none"
|
||||||
|
style={{
|
||||||
|
borderWidth: StyleSheet.hairlineWidth * 4,
|
||||||
|
borderColor: 'black',
|
||||||
|
height: '30%',
|
||||||
|
marginTop: 20,
|
||||||
|
marginBottom: 20,
|
||||||
|
padding: 10,
|
||||||
|
fontSize: 20,
|
||||||
|
}}
|
||||||
|
textAlignVertical="top"
|
||||||
|
multiline={true}
|
||||||
|
value={text}
|
||||||
|
onChangeText={setText}
|
||||||
|
/>
|
||||||
|
{running && <ActivityIndicator />}
|
||||||
|
<Button
|
||||||
|
title="执行"
|
||||||
|
onPress={async () => {
|
||||||
|
setRunning(true);
|
||||||
|
try {
|
||||||
|
const inputs = text.split('\n');
|
||||||
|
const methodName = inputs[0];
|
||||||
|
let params;
|
||||||
|
if (inputs.length === 1) {
|
||||||
|
await Pushy[methodName]();
|
||||||
|
} else {
|
||||||
|
if (inputs.length === 2) {
|
||||||
|
params = inputs[1];
|
||||||
|
} else {
|
||||||
|
params = {};
|
||||||
|
for (let i = 1; i < inputs.length; i += 2) {
|
||||||
|
params[inputs[i]] = inputs[i + 1];
|
||||||
|
}
|
||||||
|
console.log({inputs, params});
|
||||||
|
}
|
||||||
|
await Pushy[methodName](params);
|
||||||
|
}
|
||||||
|
Alert.alert('done');
|
||||||
|
} catch (e) {
|
||||||
|
Alert.alert(e.message);
|
||||||
|
}
|
||||||
|
setRunning(false);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<View style={{marginTop: 15}}>
|
||||||
|
<Button title="重置" onPress={() => setText('')} />
|
||||||
|
</View>
|
||||||
|
</SafeAreaView>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
}
|
Before Width: | Height: | Size: 696 B After Width: | Height: | Size: 696 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 521 B After Width: | Height: | Size: 521 B |
Before Width: | Height: | Size: 928 B After Width: | Height: | Size: 928 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
205
Example/testHotUpdate/src/index.js
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
import React, {Component} from 'react';
|
||||||
|
import {
|
||||||
|
StyleSheet,
|
||||||
|
Platform,
|
||||||
|
Text,
|
||||||
|
View,
|
||||||
|
Alert,
|
||||||
|
TouchableOpacity,
|
||||||
|
Linking,
|
||||||
|
Image,
|
||||||
|
} from 'react-native';
|
||||||
|
|
||||||
|
import {
|
||||||
|
isFirstTime,
|
||||||
|
isRolledBack,
|
||||||
|
packageVersion,
|
||||||
|
currentVersion,
|
||||||
|
checkUpdate,
|
||||||
|
downloadUpdate,
|
||||||
|
switchVersion,
|
||||||
|
switchVersionLater,
|
||||||
|
markSuccess,
|
||||||
|
downloadAndInstallApk,
|
||||||
|
cInfo,
|
||||||
|
} from 'react-native-update';
|
||||||
|
|
||||||
|
import TestConsole from './TestConsole';
|
||||||
|
|
||||||
|
import _updateConfig from '../update.json';
|
||||||
|
const {appKey} = _updateConfig[Platform.OS];
|
||||||
|
export default class App extends Component {
|
||||||
|
state = {
|
||||||
|
received: 0,
|
||||||
|
total: 0,
|
||||||
|
showTestConsole: false,
|
||||||
|
};
|
||||||
|
componentDidMount() {
|
||||||
|
if (isRolledBack) {
|
||||||
|
Alert.alert('提示', '刚刚更新失败了,版本被回滚.');
|
||||||
|
} else if (isFirstTime) {
|
||||||
|
Alert.alert(
|
||||||
|
'提示',
|
||||||
|
'这是当前版本第一次启动,是否要模拟启动失败?将回滚到上一版本',
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: '是',
|
||||||
|
onPress: () => {
|
||||||
|
throw new Error('模拟启动失败,请重启应用');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '否',
|
||||||
|
onPress: () => {
|
||||||
|
markSuccess();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
doUpdate = async info => {
|
||||||
|
try {
|
||||||
|
const hash = await downloadUpdate(info, {
|
||||||
|
onDownloadProgress: ({received, total}) => {
|
||||||
|
this.setState({
|
||||||
|
received,
|
||||||
|
total,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (!hash) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Alert.alert('提示', '下载完毕,是否重启应用?', [
|
||||||
|
{
|
||||||
|
text: '是',
|
||||||
|
onPress: () => {
|
||||||
|
switchVersion(hash);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{text: '否'},
|
||||||
|
{
|
||||||
|
text: '下次启动时',
|
||||||
|
onPress: () => {
|
||||||
|
switchVersionLater(hash);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
} catch (err) {
|
||||||
|
Alert.alert('更新失败', err.message);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
checkUpdate = async () => {
|
||||||
|
let info;
|
||||||
|
try {
|
||||||
|
info = await checkUpdate(appKey);
|
||||||
|
} catch (err) {
|
||||||
|
Alert.alert('更新检查失败', err.message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (info.expired) {
|
||||||
|
Alert.alert('提示', '您的应用版本已更新,点击确定下载安装新版本', [
|
||||||
|
{
|
||||||
|
text: '确定',
|
||||||
|
onPress: () => {
|
||||||
|
if (info.downloadUrl) {
|
||||||
|
// apk可直接下载安装
|
||||||
|
if (
|
||||||
|
Platform.OS === 'android' &&
|
||||||
|
info.downloadUrl.endsWith('.apk')
|
||||||
|
) {
|
||||||
|
downloadAndInstallApk({
|
||||||
|
url: info.downloadUrl,
|
||||||
|
onDownloadProgress: ({received, total}) => {
|
||||||
|
this.setState({
|
||||||
|
received,
|
||||||
|
total,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Linking.openURL(info.downloadUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
} else if (info.upToDate) {
|
||||||
|
Alert.alert('提示', '您的应用版本已是最新.');
|
||||||
|
} else {
|
||||||
|
Alert.alert(
|
||||||
|
'提示',
|
||||||
|
'检查到新的版本' + info.name + ',是否下载?\n' + info.description,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: '是',
|
||||||
|
onPress: () => {
|
||||||
|
this.doUpdate(info);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{text: '否'},
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const {received, total, showTestConsole} = this.state;
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<Text style={styles.welcome}>欢迎使用热更新服务</Text>
|
||||||
|
<Image
|
||||||
|
resizeMode={'contain'}
|
||||||
|
source={require('./assets/shezhi.png')}
|
||||||
|
style={styles.image}
|
||||||
|
/>
|
||||||
|
<Text style={styles.instructions}>
|
||||||
|
这是版本一 {'\n'}
|
||||||
|
当前原生包版本号: {packageVersion}
|
||||||
|
{'\n'}
|
||||||
|
当前热更新版本Hash: {currentVersion || '(空)'}
|
||||||
|
{'\n'}
|
||||||
|
</Text>
|
||||||
|
<Text>
|
||||||
|
下载进度:{received} / {total}
|
||||||
|
</Text>
|
||||||
|
<TouchableOpacity onPress={this.checkUpdate}>
|
||||||
|
<Text style={styles.instructions}>点击这里检查更新</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
|
||||||
|
<TouchableOpacity
|
||||||
|
style={{marginTop: 15}}
|
||||||
|
onLongPress={() => {
|
||||||
|
this.setState({showTestConsole: true});
|
||||||
|
}}>
|
||||||
|
<Text style={styles.instructions}>
|
||||||
|
react-native-update版本:{cInfo.pushy}
|
||||||
|
</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
<TestConsole visible={showTestConsole} />
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
backgroundColor: '#F5FCFF',
|
||||||
|
},
|
||||||
|
welcome: {
|
||||||
|
fontSize: 20,
|
||||||
|
textAlign: 'center',
|
||||||
|
margin: 10,
|
||||||
|
},
|
||||||
|
instructions: {
|
||||||
|
textAlign: 'center',
|
||||||
|
color: '#333333',
|
||||||
|
marginBottom: 5,
|
||||||
|
},
|
||||||
|
image: {},
|
||||||
|
});
|
6937
Example/testHotUpdate/yarn.lock
Normal file
2
LICENSE
@@ -2,7 +2,7 @@ Update Plugin for React Native
|
|||||||
|
|
||||||
Powered by ReactNative.cn
|
Powered by ReactNative.cn
|
||||||
|
|
||||||
Copyright (c) Hangzhou Erica Network Technology Co., Ltd.
|
Copyright (c) Wuhan Charmlot Network Technology Co., Ltd.
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
68
README.md
@@ -1,63 +1,33 @@
|
|||||||
# 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 服务](http://update.reactnative.cn/)使用。
|
本组件是面向 React Native 提供热更新功能的组件,详情请访问我们的官方网站 <https://pushy.reactnative.cn>。
|
||||||
|
|
||||||
### 最新更新
|
### 快速开始
|
||||||
|
|
||||||
5.1.6: 解决 Android 热更新后部分图片丢失问题:
|
请查看[文档](https://pushy.reactnative.cn/docs/getting-started.html)
|
||||||
|
|
||||||
同一个项目中放置了多个完全相同的文件,在 5.1.0 至 5.1.5 之间的版本中,更新后有时会出现其中的部分无法显示。此问题在 5.1.6 版本修复。
|
|
||||||
|
|
||||||
修复此问题涉及原生部分,需要重新打包。
|
|
||||||
|
|
||||||
5.1.0 以上的版本增加了如下的优化:
|
|
||||||
|
|
||||||
1. 在项目中图片较多时,Android 更新速度大幅提升,达到和 iOS 基本一致的更新速度。
|
|
||||||
2. Android 的更新移到了单独的线程,避免更新过程对 AsyncStorage 等原生异步模块的影响。
|
|
||||||
3. Android 的.so 文件长时间没有任何改动,因而加入了预编译好的文件,避免对 ndk 的依赖。
|
|
||||||
|
|
||||||
### 版本
|
|
||||||
|
|
||||||
因为 React Native 不同版本代码结构不同,因而请按下面表格对号入座:
|
|
||||||
|
|
||||||
| React Native 版本 | react-native-update 版本 |
|
|
||||||
| ----------------- | ------------------------ |
|
|
||||||
| 0.26 及以下 | 1.0.x |
|
|
||||||
| 0.27 - 0.28 | 2.x |
|
|
||||||
| 0.29 - 0.33 | 3.x |
|
|
||||||
| 0.34 - 0.45 | 4.x |
|
|
||||||
| 0.46 及以上 | 5.x |
|
|
||||||
|
|
||||||
### 优势
|
### 优势
|
||||||
|
|
||||||
1. 命令行工具&网页双端管理,版本发布过程简单便捷,完全可以集成 CI。
|
1. 基于阿里云高速 CDN 分发,对比其他服务器在国外的热更新服务,分发更稳定,更新成功率极高。
|
||||||
2. 基于 bsdiff 算法创建的**超小更新包**,通常版本迭代后在 1-10KB 之间,避免数百 KB 的流量消耗。
|
2. 基于 bsdiff/hdiff 算法创建的**超小更新包**,通常版本迭代后在 1-10KB 之间,避免数百 KB 的流量消耗。
|
||||||
3. 支持崩溃回滚,安全可靠。
|
3. 跨越多个版本进行更新时,只需要下载**一个更新包**,不需要逐版本依次更新。
|
||||||
4. meta 信息及开放 API,提供更高扩展性。
|
4. 命令行工具&网页双端管理,版本发布过程简单便捷,完全可以集成 CI。
|
||||||
5. 跨越多个版本进行更新时,只需要下载**一个更新包**,不需要逐版本依次更新。
|
5. 支持崩溃回滚,安全可靠。
|
||||||
|
6. meta 信息及开放 API,提供更高扩展性。
|
||||||
|
|
||||||
### 安装与快速入门
|
### 本地开发
|
||||||
|
|
||||||
请查阅
|
```
|
||||||
|
$ git clone git@github.com:reactnativecn/react-native-pushy.git
|
||||||
|
$ cd react-native-pushy/Example/testHotUpdate
|
||||||
|
$ yarn
|
||||||
|
$ yarn start
|
||||||
|
```
|
||||||
|
|
||||||
- [文档-快速入门-准备工作](docs/guide.md)。
|
本地库文件使用 yarn link 链接,因此可直接在源文件中修改,在 testHotUpdate 项目中调试。
|
||||||
|
|
||||||
- [文档-快速入门-添加热更新功能](docs/guide2.md)。
|
|
||||||
|
|
||||||
- [文档-快速入门-发布版本](docs/guide3.md)。
|
|
||||||
|
|
||||||
- [文档-常见问题与高级指南](docs/faq_advance.md)。
|
|
||||||
|
|
||||||
### 命令行工具
|
|
||||||
|
|
||||||
请查阅[文档-命令行工具](docs/cli.md)。
|
|
||||||
|
|
||||||
### API 接口
|
|
||||||
|
|
||||||
请查阅[文档-API 接口](docs/api.md)。
|
|
||||||
|
|
||||||
### 关于我们
|
### 关于我们
|
||||||
|
|
||||||
本组件由[React Native 中文网](http://reactnative.cn/)独家发布,如有定制需求可以[联系我们](http://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)发帖提问。
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
int MILLIS_IN_MINUTE = 1000 * 60
|
||||||
|
int minutesSinceEpoch = System.currentTimeMillis() / MILLIS_IN_MINUTE
|
||||||
|
|
||||||
def safeExtGet(prop, fallback) {
|
def safeExtGet(prop, fallback) {
|
||||||
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
||||||
@@ -14,6 +16,7 @@ android {
|
|||||||
targetSdkVersion safeExtGet('targetSdkVersion', 27)
|
targetSdkVersion safeExtGet('targetSdkVersion', 27)
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
|
consumerProguardFiles "proguard.pro"
|
||||||
}
|
}
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
@@ -21,6 +24,15 @@ android {
|
|||||||
jniLibs.srcDirs = ['./lib']
|
jniLibs.srcDirs = ['./lib']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
resValue("string", "pushy_build_time", "${minutesSinceEpoch}")
|
||||||
|
}
|
||||||
|
debug {
|
||||||
|
resValue("string", "pushy_build_time", "0")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
18
android/jni/Android.mk
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
|
LOCAL_MODULE := rnupdate
|
||||||
|
|
||||||
|
Hdp_Files := \
|
||||||
|
hpatch.c \
|
||||||
|
HDiffPatch/libHDiffPatch/HPatch/patch.c \
|
||||||
|
HDiffPatch/file_for_patch.c \
|
||||||
|
lzma/C/LzmaDec.c \
|
||||||
|
lzma/C/Lzma2Dec.c
|
||||||
|
|
||||||
|
LOCAL_SRC_FILES := \
|
||||||
|
DownloadTask.c \
|
||||||
|
$(Hdp_Files)
|
||||||
|
|
||||||
|
include $(BUILD_SHARED_LIBRARY)
|