Skip to content

Commit 9feb31b

Browse files
author
Pedro Pombeiro
committed
Upgrade react-native to 0.60.5
- Use community net-info, react-native-webview instead of deprecated react-native classes - Remove react-native-tcp - Upgrade react-native libs (react-native-camera, react-native-firebase, react-native-mail, react-native-udp, react-native-webview-bridge) - Do not include `:react-native-android` module explicitly - Take advantage of RN AutoLinking - nix: Update Gradle dependencies
1 parent 5db0a58 commit 9feb31b

File tree

43 files changed

+3892
-11046
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3892
-11046
lines changed

Diff for: .eslintrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native-community',
4+
};

Diff for: .flowconfig

+32-7
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,20 @@
2020

2121
# Ignore duplicate module providers
2222
# For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root
23-
.*/Libraries/react-native/React.js
23+
node_modules/react-native/Libraries/react-native/React.js
2424
.*/Libraries/react-native/ReactNative.js
2525
.*/node_modules/jest-runtime/build/__tests__/.*
2626

2727
; Ignore polyfills
28-
.*/Libraries/polyfills/.*
28+
node_modules/react-native/Libraries/polyfills/.*
2929

30-
; Ignore metro
31-
.*/node_modules/metro/.*
30+
; These should not be required directly
31+
; require from fbjs/lib instead: require('fbjs/lib/warning')
32+
node_modules/warning/.*
33+
; Flow doesn't support platforms
34+
.*/Libraries/Utilities/HMRLoadingView.js
35+
[untyped]
36+
.*/node_modules/@react-native-community/cli/.*/.*
3237

3338
[include]
3439

@@ -40,11 +45,31 @@ node_modules/react-native/flow/
4045
esproposal.optional_chaining=enable
4146
esproposal.nullish_coalescing=enable
4247

43-
module.system=haste
44-
4548
esproposal.class_static_fields=enable
4649
esproposal.class_instance_fields=enable
4750

51+
module.file_ext=.js
52+
module.file_ext=.json
53+
module.file_ext=.ios.js
54+
55+
module.system=haste
56+
module.system.haste.use_name_reducers=true
57+
# get basename
58+
# get basename
59+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
60+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
61+
module.system.haste.paths.blacklist=.*/__tests__/.*
62+
module.system.haste.paths.blacklist=.*/__tests__/.*
63+
module.system.haste.paths.blacklist=.*/__mocks__/.*
64+
module.system.haste.paths.blacklist=.*/__mocks__/.*
65+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
66+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
67+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
68+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
69+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/IntegrationTests/.*
70+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation.js
71+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
72+
4873
experimental.strict_type_args=true
4974

5075
munge_underscores=true
@@ -67,4 +92,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*
6792
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
6893

6994
[version]
70-
^0.92.0
95+
^0.98.0

Diff for: .gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ doo-index.html
9696
Statusgo.framework
9797

9898
#ios
99-
ios/Pods
100-
ios/StatusIm.xcworkspace
99+
/ios/Pods/
100+
/ios/StatusIm.xcworkspace
101101
.ruby-version
102102
status-e2e/
103103

Diff for: .prettierrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
bracketSpacing: false,
3+
jsxBracketSameLine: true,
4+
singleQuote: true,
5+
trailingComma: 'all',
6+
};

Diff for: android/app/build.gradle

+67-33
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,15 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.Copy
7979
project.ext.react = [
8080
nodeExecutableAndArgs: ["node", "--max-old-space-size=16384"],
8181
entryFile: "index.android.js",
82+
enableHermes: false, // clean and rebuild if changing
8283
bundleInPr: true,
8384
inputExcludes: ["android/**", "ios/**", "react-native/**", "src/**", "test/**"]
8485
]
8586

86-
configurations.all {
87-
exclude group: 'com.facebook.react', module: 'react-native'
88-
}
87+
// NOTE: Uncomment if building RN from a fork
88+
// configurations.all {
89+
// exclude group: 'com.facebook.react', module: 'react-native'
90+
// }
8991

9092
apply from: "../../node_modules/react-native/react.gradle"
9193

@@ -104,6 +106,28 @@ def enableSeparateBuildPerCPUArchitecture = false
104106
*/
105107
def enableProguardInReleaseBuilds = false
106108

109+
/**
110+
* The preferred build flavor of JavaScriptCore.
111+
*
112+
* For example, to use the international variant, you can use:
113+
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
114+
*
115+
* The international variant includes ICU i18n library and necessary data
116+
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
117+
* give correct results when using with locales other than en-US. Note that
118+
* this variant is about 6MiB larger per architecture than default.
119+
*/
120+
def jscFlavor = 'org.webkit:android-jsc:+'
121+
122+
/**
123+
* Whether to enable the Hermes VM.
124+
*
125+
* This should be set on project.ext.react and mirrored here. If it is not set
126+
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
127+
* and the benefits of using Hermes will therefore be sharply reduced.
128+
*/
129+
def enableHermes = project.ext.react.get("enableHermes", false);
130+
107131
def getVersionCode = { ->
108132
new ByteArrayOutputStream().withStream { stdOut ->
109133
if (project.hasProperty("versionCode")) {
@@ -162,6 +186,7 @@ android {
162186
ndk {
163187
abiFilters getEnvOrConfig('NDK_ABI_FILTERS').split(';')
164188
}
189+
missingDimensionStrategy 'react-native-camera', 'general'
165190
}
166191
/**
167192
* Arbitrary project metadata
@@ -179,8 +204,15 @@ android {
179204
packagingOptions {
180205
exclude 'META-INF/rxjava.properties'
181206
exclude '/lib/mips64/**'
182-
exclude '/lib/arm64-v8a/**'
183207
exclude '/lib/armeabi/**'
208+
209+
pickFirst '**/armeabi-v7a/libc++_shared.so'
210+
pickFirst '**/x86/libc++_shared.so'
211+
pickFirst '**/arm64-v8a/libc++_shared.so'
212+
pickFirst '**/x86_64/libc++_shared.so'
213+
pickFirst '**/x86/libjsc.so'
214+
pickFirst '**/armeabi-v7a/libjsc.so'
215+
184216
/** Fix for: Execution failed for task ':app:transformNativeLibsWithStripDebugSymbolForDebug'.
185217
* with recent version of ndk (17.0.4754217)
186218
*/
@@ -192,6 +224,12 @@ android {
192224
javaMaxHeapSize "8g"
193225
}
194226
signingConfigs {
227+
debug {
228+
storeFile file('debug.keystore')
229+
storePassword 'android'
230+
keyAlias 'androiddebugkey'
231+
keyPassword 'android'
232+
}
195233
release {
196234
/* environment variables take precedence over gradle.properties file */
197235
storeFile file(getEnvOrConfig('STATUS_RELEASE_STORE_FILE').replaceAll("~", System.properties['user.home']))
@@ -213,9 +251,13 @@ android {
213251
applicationIdSuffix ".debug"
214252
debuggable true
215253
versionNameSuffix "-SNAPSHOT"
254+
signingConfig signingConfigs.debug
216255
resValue "string", "build_config_package", "im.status.ethereum"
217256
}
218257
release {
258+
// Caution! In production, you need to generate your own keystore file.
259+
// see https://facebook.github.io/react-native/docs/signed-apk-android.
260+
signingConfig signingConfigs.debug
219261
minifyEnabled enableProguardInReleaseBuilds
220262
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
221263
signingConfig signingConfigs.release
@@ -242,6 +284,7 @@ android {
242284
output.versionCodeOverride =
243285
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
244286
}
287+
245288
}
246289
}
247290

@@ -256,44 +299,33 @@ android {
256299
}
257300

258301
dependencies {
259-
implementation project(':@react-native-community_netinfo')
260-
implementation project(':react-native-background-timer')
261-
implementation project(':react-native-svg')
302+
implementation fileTree(dir: "libs", include: ["*.jar"])
303+
implementation "com.facebook.react:react-native:+" // From node_modules
304+
305+
if (enableHermes) {
306+
def hermesPath = "../../node_modules/hermesvm/android/";
307+
debugImplementation files(hermesPath + "hermes-debug.aar")
308+
releaseImplementation files(hermesPath + "hermes-release.aar")
309+
prImplementation files(hermesPath + "hermes-release.aar")
310+
} else {
311+
implementation jscFlavor
312+
}
313+
262314
implementation 'com.android.support:multidex:1.0.2'
263-
implementation project(':react-native-splash-screen')
264-
implementation project(':react-native-image-resizer')
265315
implementation project(':react-native-dialogs')
266-
implementation fileTree(dir: "libs", include: ["*.jar"])
267316
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
268317
// Force using exact RN version instead of relying on gradle dependency resolution
269318
// https://docs.gradle.org/current/userguide/introduction_dependency_management.html#sec:dependency_resolution
319+
// NOTE: Uncomment if building RN from a fork
270320
//compile ("com.facebook.react:react-native:0.55.4") { force = true } // From node_modules
271-
implementation project(':react-native-android')
272-
implementation project(':react-native-languages')
273321
implementation project(':react-native-status')
274-
implementation project(':react-native-fs')
275-
implementation project(':react-native-image-crop-picker')
276322
implementation project(':react-native-webview-bridge')
277-
implementation project(':react-native-touch-id')
278-
implementation project(':react-native-config')
279-
implementation project(':react-native-firebase')
280-
implementation project(':react-native-shake')
281-
implementation project(':react-native-gesture-handler')
282-
implementation project(':react-native-screens')
283-
implementation project(':RNMail')
284-
compile ('com.google.android.gms:play-services-base:16.0.1') {
285-
force = true
286-
}
287-
compile (project(':react-native-camera')) {
288-
exclude group: "com.google.android.gms"
289-
compile 'com.android.support:exifinterface:28.+'
290-
}
291323
implementation project(':react-native-status-keycard')
292-
implementation 'com.google.firebase:firebase-core:16.0.3' //this decides your firebase SDK version
293-
implementation 'com.google.firebase:firebase-messaging:17.1.0'
294-
implementation project(':react-native-keychain')
324+
implementation "com.google.android.gms:play-services-base:${rootProject.ext.googlePlayServicesVersion}"
325+
implementation 'com.google.firebase:firebase-core:16.0.9' //this decides your firebase SDK version
326+
implementation 'com.google.firebase:firebase-messaging:18.0.0'
295327

296-
compile 'com.github.status-im:function:0.0.1'
328+
implementation 'com.github.status-im:function:0.0.1'
297329
implementation 'com.facebook.fresco:animated-gif:1.10.0'
298330
}
299331

@@ -318,5 +350,7 @@ task hemroidBuild(type: Exec) {
318350
preBuild.dependsOn hemroidBuild
319351

320352
// Must be at bottom to avoid dependency collision
321-
apply plugin: "com.google.gms.google-services"
353+
apply plugin: 'com.google.gms.google-services'
322354
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
355+
356+
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

Diff for: android/app/debug.keystore

2.2 KB
Binary file not shown.

Diff for: android/app/proguard-rules.pro

-7
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@
99

1010
# Add any project specific keep options here:
1111

12-
# If your project uses WebView with JS, uncomment the following
13-
# and specify the fully qualified class name to the JavaScript interface
14-
# class:
15-
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16-
# public *;
17-
#}
18-
1912
# Disabling obfuscation is useful if you collect stack traces from production crashes
2013
# (unless you are using a system that supports de-obfuscate the stack traces).
2114
-dontobfuscate

Diff for: android/app/src/main/AndroidManifest.xml

-5
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@
8383
<action android:name="com.google.firebase.MESSAGING_EVENT" />
8484
</intent-filter>
8585
</service>
86-
<service android:name="io.invertase.firebase.messaging.RNFirebaseInstanceIdService">
87-
<intent-filter>
88-
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
89-
</intent-filter>
90-
</service>
9186
<service android:name="io.invertase.firebase.messaging.RNFirebaseBackgroundMessagingService" />
9287
<provider
9388
android:name="android.support.v4.content.FileProvider"

Diff for: android/app/src/main/java/im/status/ethereum/MainApplication.java

+12-47
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,24 @@
11
package im.status.ethereum;
22

33
import android.support.multidex.MultiDexApplication;
4+
import android.util.Log;
5+
import com.facebook.react.PackageList;
6+
import com.facebook.hermes.reactexecutor.HermesExecutorFactory;
7+
import com.facebook.react.bridge.JavaScriptExecutorFactory;
48

59
import com.aakashns.reactnativedialogs.ReactNativeDialogsPackage;
610
import com.facebook.react.ReactApplication;
7-
import com.reactnativecommunity.netinfo.NetInfoPackage;
811
import com.facebook.react.ReactNativeHost;
912
import com.facebook.react.ReactPackage;
10-
import com.facebook.react.shell.MainReactPackage;
1113
import com.facebook.soloader.SoLoader;
1214
import com.github.alinz.reactnativewebviewbridge.WebViewBridgePackage;
13-
import com.horcrux.svg.SvgPackage;
14-
import com.lugg.ReactNativeConfig.ReactNativeConfigPackage;
15-
import com.oblador.keychain.KeychainPackage;
16-
import com.ocetnik.timer.BackgroundTimerPackage;
17-
import com.reactcommunity.rnlanguages.RNLanguagesPackage;
18-
import com.reactnative.ivpusic.imagepicker.PickerPackage;
19-
import com.rnfs.RNFSPackage;
20-
import com.rnfingerprint.FingerprintAuthPackage;
2115

22-
import org.devio.rn.splashscreen.SplashScreenReactPackage;
23-
import org.reactnative.camera.RNCameraPackage;
24-
25-
import java.util.Arrays;
2616
import java.util.List;
2717

28-
import fr.bamlab.rnimageresizer.ImageResizerPackage;
29-
import im.status.ethereum.function.Function;
3018
import im.status.ethereum.keycard.RNStatusKeycardPackage;
3119
import im.status.ethereum.module.StatusPackage;
32-
import io.invertase.firebase.RNFirebasePackage;
3320
import io.invertase.firebase.messaging.RNFirebaseMessagingPackage;
3421
import io.invertase.firebase.notifications.RNFirebaseNotificationsPackage;
35-
import com.chirag.RNMail.*;
36-
import com.clipsub.RNShake.RNShakeEventPackage;
37-
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
38-
import com.swmansion.rnscreens.RNScreensPackage;
3922

4023
public class MainApplication extends MultiDexApplication implements ReactApplication {
4124

@@ -48,32 +31,14 @@ public boolean getUseDeveloperSupport() {
4831
@Override
4932
protected List<ReactPackage> getPackages() {
5033
StatusPackage statusPackage = new StatusPackage(RootUtil.isDeviceRooted());
51-
Function<String, String> callRPC = statusPackage.getCallRPC();
52-
return Arrays.asList(
53-
new MainReactPackage(),
54-
new NetInfoPackage(),
55-
new RNMail(),
56-
new RNFirebasePackage(),
57-
new RNFirebaseMessagingPackage(),
58-
new RNFirebaseNotificationsPackage(),
59-
new BackgroundTimerPackage(),
60-
new SvgPackage(),
61-
new SplashScreenReactPackage(),
62-
statusPackage,
63-
new RNStatusKeycardPackage(),
64-
new RNLanguagesPackage(),
65-
new RNCameraPackage(),
66-
new RNFSPackage(),
67-
new ReactNativeDialogsPackage(),
68-
new ImageResizerPackage(),
69-
new PickerPackage(),
70-
new WebViewBridgePackage(BuildConfig.DEBUG_WEBVIEW == "1", callRPC),
71-
new ReactNativeConfigPackage(),
72-
new KeychainPackage(),
73-
new RNShakeEventPackage(),
74-
new FingerprintAuthPackage(),
75-
new RNGestureHandlerPackage(),
76-
new RNScreensPackage());
34+
List<ReactPackage> packages = new PackageList(this).getPackages();
35+
packages.add(statusPackage);
36+
packages.add(new RNFirebaseMessagingPackage());
37+
packages.add(new RNFirebaseNotificationsPackage());
38+
packages.add(new ReactNativeDialogsPackage());
39+
packages.add(new RNStatusKeycardPackage());
40+
packages.add(new WebViewBridgePackage(BuildConfig.DEBUG_WEBVIEW == "1"));
41+
return packages;
7742
}
7843

7944
@Override

Diff for: android/app/src/main/res/values/styles.xml

+2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@
77
<item name="colorControlNormal">@color/primary</item>
88
<item name="colorControlActivated">@color/primary</item>
99
<item name="android:windowBackground">@color/background</item>
10+
<item name="android:textColor">#000000</item>
1011
</style>
12+
1113
</resources>

0 commit comments

Comments
 (0)