File tree Expand file tree Collapse file tree
example/android/app/src/main/java/in/juspay/hypersdkreact/example Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,7 +63,18 @@ def rnVersion = getRNVersion()
6363println " Found react native version as ${ rnVersion} "
6464
6565def isNewArchitectureEnabled () {
66- return rootProject. hasProperty(" newArchEnabled" ) && rootProject. getProperty(" newArchEnabled" ) == " true"
66+ if (rootProject. hasProperty(" newArchEnabled" ) && rootProject. getProperty(" newArchEnabled" ) == " true" ) {
67+ return true
68+ }
69+
70+ def version = rnVersion. replaceAll(/ [^0-9.]/ , " " )
71+ def parts = version. tokenize(' .' )
72+ if (parts. size() < 2 ) {
73+ return false
74+ }
75+ def major = parts[0 ] as int
76+ def minor = parts[1 ] as int
77+ return (major > 0 ) || (major == 0 && minor >= 82 )
6778}
6879
6980apply plugin : ' com.android.library'
Original file line number Diff line number Diff line change @@ -47,7 +47,21 @@ protected String getJSMainModuleName() {
4747
4848 @ Override
4949 protected boolean isNewArchEnabled () {
50- return BuildConfig .IS_NEW_ARCHITECTURE_ENABLED ;
50+ if (BuildConfig .IS_NEW_ARCHITECTURE_ENABLED ) {
51+ return true ;
52+ }
53+
54+ String version = BuildConfig .REACT_NATIVE_VERSION ;
55+ String [] parts = version .split ("\\ ." );
56+
57+ if (parts .length < 2 ) {
58+ return false ;
59+ }
60+
61+ int major = Integer .parseInt (parts [0 ]);
62+ int minor = Integer .parseInt (parts [1 ]);
63+
64+ return major > 0 || (major == 0 && minor >= 82 );
5165 }
5266
5367 @ Override
You can’t perform that action at this time.
0 commit comments