@@ -16,8 +16,8 @@ class ApplicationLinker {
16
16
if ( ! this . applicationPath ) {
17
17
errorn (
18
18
'MainApplication.kt not found! Does the file exist in the correct folder?\n' +
19
- ' Please check the manual installation docs:\n' +
20
- ' https://wix.github.io/react-native-navigation/docs/installing#3-update-mainapplicationjava'
19
+ ' Please check the manual installation docs:\n' +
20
+ ' https://wix.github.io/react-native-navigation/docs/installing#3-update-mainapplicationjava'
21
21
) ;
22
22
}
23
23
@@ -78,10 +78,7 @@ class ApplicationLinker {
78
78
if ( this . _doesExtendApplication ( applicationContent ) ) {
79
79
debugn ( ' Extending NavigationApplication' ) ;
80
80
return applicationContent
81
- . replace (
82
- / : \s * A p p l i c a t i o n \( \) \s * , \s * R e a c t A p p l i c a t i o n / gi,
83
- ': NavigationApplication()'
84
- )
81
+ . replace ( / : \s * A p p l i c a t i o n \( \) \s * , \s * R e a c t A p p l i c a t i o n / gi, ': NavigationApplication()' )
85
82
. replace (
86
83
'import com.facebook.react.ReactApplication' ,
87
84
'import com.reactnativenavigation.NavigationApplication'
@@ -114,21 +111,21 @@ class ApplicationLinker {
114
111
return applicationContent ;
115
112
}
116
113
117
- if ( this . _doesExtendReactNativeHost ( applicationContent ) ) {
114
+ if ( this . _doesExtendDefaultReactNativeHost ( applicationContent ) ) {
118
115
debugn ( ' Changing host implementation to NavigationReactNativeHost' ) ;
119
116
return applicationContent
120
- . replace ( 'ReactNativeHost (this)' , 'NavigationReactNativeHost(this)' )
117
+ . replace ( 'DefaultReactNativeHost (this)' , 'NavigationReactNativeHost(this)' )
121
118
. replace (
122
- 'import com.facebook.react.ReactNativeHost ' ,
123
- 'import com.facebook.react.ReactNativeHost \nimport com.reactnativenavigation.react.NavigationReactNativeHost'
119
+ 'import com.facebook.react.defaults.DefaultReactNativeHost ' ,
120
+ 'import com.facebook.react.defaults.DefaultReactNativeHost \nimport com.reactnativenavigation.react.NavigationReactNativeHost'
124
121
) ;
125
- } else if ( this . _doesExtendDefaultReactNativeHost ( applicationContent ) ) {
122
+ } else if ( this . _doesExtendReactNativeHost ( applicationContent ) ) {
126
123
debugn ( ' Changing host implementation to NavigationReactNativeHost' ) ;
127
124
return applicationContent
128
- . replace ( 'DefaultReactNativeHost (this)' , 'NavigationReactNativeHost(this)' )
125
+ . replace ( 'ReactNativeHost (this)' , 'NavigationReactNativeHost(this)' )
129
126
. replace (
130
- 'import com.facebook.react.defaults.DefaultReactNativeHost ' ,
131
- 'import com.facebook.react.defaults.DefaultReactNativeHost \nimport com.reactnativenavigation.react.NavigationReactNativeHost'
127
+ 'import com.facebook.react.ReactNativeHost ' ,
128
+ 'import com.facebook.react.ReactNativeHost \nimport com.reactnativenavigation.react.NavigationReactNativeHost'
132
129
) ;
133
130
}
134
131
@@ -160,7 +157,9 @@ class ApplicationLinker {
160
157
}
161
158
162
159
_isSOLoaderInitCalled ( applicationContent ) {
163
- return / S o L o a d e r \. i n i t \( \s * t h i s \s * , \s * O p e n S o u r c e M e r g e d S o M a p p i n g \s * \) ; ? / . test ( applicationContent ) ;
160
+ return / S o L o a d e r \. i n i t \( \s * t h i s \s * , \s * O p e n S o u r c e M e r g e d S o M a p p i n g \s * \) ; ? / . test (
161
+ applicationContent
162
+ ) ;
164
163
}
165
164
166
165
_removeNewArchEntryPointLoad ( applicationContent ) {
@@ -176,7 +175,9 @@ class ApplicationLinker {
176
175
}
177
176
178
177
_isNewArchEntryPointLoadCalled ( applicationContent ) {
179
- return / i f \s * \( \s * B u i l d C o n f i g \. I S _ N E W _ A R C H I T E C T U R E _ E N A B L E D \s * \) \s * \{ [ \s \S ] * ?l o a d \( \) \s * [ \s } ] * ?\} / . test ( applicationContent ) ;
178
+ return / i f \s * \( \s * B u i l d C o n f i g \. I S _ N E W _ A R C H I T E C T U R E _ E N A B L E D \s * \) \s * \{ [ \s \S ] * ?l o a d \( \) \s * [ \s } ] * ?\} / . test (
179
+ applicationContent
180
+ ) ;
180
181
}
181
182
}
182
183
0 commit comments