Android working on 0.69.8

This commit is contained in:
Diego Mello 2023-03-15 15:38:45 -03:00
parent c544a17f0e
commit 88dbfb2796
16 changed files with 55 additions and 36 deletions

View File

@ -168,7 +168,8 @@ android {
"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"
"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
"NODE_MODULES_DIR=$rootDir/../node_modules"
cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
cppFlags "-std=c++17"
// Make sure this target name is the same you specify inside the
@ -366,9 +367,10 @@ dependencies {
}
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
//noinspection GradleDynamicVersion
implementation("com.facebook.react:hermes-engine:+") { // From node_modules
exclude group:'com.facebook.fbjni'
}
} else {
implementation jscFlavor
}
@ -389,7 +391,11 @@ if (isNewArchitectureEnabled()) {
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")
.using(project(":ReactAndroid"))
.because("On New Architecture we're building React Native from source")
substitute(module("com.facebook.react:hermes-engine"))
.using(project(":ReactAndroid:hermes-engine"))
.because("On New Architecture we're building Hermes from source")
}
}
}

View File

@ -22,7 +22,7 @@ import com.facebook.react.ReactInstanceEventListener;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
import com.facebook.react.modules.network.CustomClientBuilder;
// import com.facebook.react.modules.network.CustomClientBuilder;
import okhttp3.OkHttpClient;
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
@ -35,7 +35,7 @@ public class ReactNativeFlipper {
client.addPlugin(CrashReporterPlugin.getInstance());
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
NetworkingModule.setCustomClientBuilder(
new CustomClientBuilder() {
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));

View File

@ -45,7 +45,8 @@ public class MainActivity extends ReactActivity {
/**
* 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).
* you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer
* (Paper).
*/
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
@ -64,5 +65,12 @@ public class MainActivity extends ReactActivity {
reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);
return reactRootView;
}
@Override
protected boolean isConcurrentRootEnabled() {
// If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).
// More on this on https://reactjs.org/blog/2022/03/29/react-v18.html
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
}
}
}

View File

@ -24,7 +24,7 @@ import java.util.Arrays;
import java.util.List;
import chat.rocket.reactnative.newarchitecture.MainApplicationReactNativeHost;
import chat.rocket.reactnative.networking.SSLPinningPackage;
// import chat.rocket.reactnative.networking.SSLPinningPackage;
public class MainApplication extends Application implements ReactApplication {
@ -39,7 +39,7 @@ public class MainApplication extends Application implements ReactApplication {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new RNCViewPagerPackage());
packages.add(new SSLPinningPackage());
// packages.add(new SSLPinningPackage());
List<ReactPackage> additionalModules = new AdditionalModules().getAdditionalModules(MainApplication.this);
packages.addAll(additionalModules);
return packages;

View File

@ -16,8 +16,8 @@ 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.fabric.ReactNativeConfig;
import com.facebook.react.uimanager.ViewManagerRegistry;
import chat.rocket.reactnative.BuildConfig;
import chat.rocket.reactnative.newarchitecture.components.MainComponentsRegistry;
@ -105,7 +105,7 @@ public class MainApplicationReactNativeHost extends ReactNativeHost {
return new FabricJSIModuleProvider(
reactApplicationContext,
componentFactory,
new EmptyReactNativeConfig(),
ReactNativeConfig.DEFAULT_CONFIG,
viewManagerRegistry);
}
});

View File

@ -28,8 +28,7 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_SHARED_LIBRARIES := \
libfabricjni \
libfbjni \
libfolly_futures \
libfolly_json \
libfolly_runtime \
libglog \
libjsi \
libreact_codegen_rncore \

View File

@ -39,9 +39,9 @@ buildscript {
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.0'
classpath 'com.bugsnag:bugsnag-android-gradle-plugin:7.+'
}
classpath("com.android.tools.build:gradle:7.0.4")
classpath("com.android.tools.build:gradle:7.1.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:4.1.2")
classpath("de.undercouch:gradle-download-task:5.0.1")
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

View File

@ -14,6 +14,8 @@ includeBuild('../node_modules/react-native-gradle-plugin')
if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
include(":ReactAndroid")
project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
include(":ReactAndroid:hermes-engine")
project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine')
}
apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")

View File

@ -1,7 +1,7 @@
import { Q } from '@nozbe/watermelondb';
import { shareSetSettings, shareSelectServer, shareSetUser } from '../../actions/share';
import SSLPinning from './helpers/sslPinning';
// import SSLPinning from './helpers/sslPinning';
import log from './helpers/log';
import { IShareServer, IShareUser } from '../../reducers/share';
import UserPreferences from './userPreferences';
@ -19,9 +19,9 @@ export async function shareExtensionInit(server: string) {
try {
const certificate = UserPreferences.getString(`${CERTIFICATE_KEY}-${server}`);
if (SSLPinning && certificate) {
await SSLPinning.setCertificate(certificate, server);
}
// if (SSLPinning && certificate) {
// await SSLPinning.setCertificate(certificate, server);
// }
} catch {
// Do nothing
}

View File

@ -18,7 +18,7 @@ import { BASIC_AUTH_KEY, setBasicAuth } from '../lib/methods/helpers/fetch';
import { appStart } from '../actions/app';
import UserPreferences from '../lib/methods/userPreferences';
import { encryptionStop } from '../actions/encryption';
import SSLPinning from '../lib/methods/helpers/sslPinning';
// import SSLPinning from '../lib/methods/helpers/sslPinning';
import { inquiryReset } from '../ee/omnichannel/actions/inquiry';
import { RootEnum } from '../definitions';
import { CERTIFICATE_KEY, CURRENT_SERVER, TOKEN_KEY } from '../lib/constants';
@ -73,7 +73,7 @@ const handleSelectServer = function* handleSelectServer({ server, version, fetch
try {
// SSL Pinning - Read certificate alias and set it to be used by network requests
const certificate = UserPreferences.getString(`${CERTIFICATE_KEY}-${server}`);
SSLPinning.setCertificate(certificate, server);
// SSLPinning.setCertificate(certificate, server);
yield put(inquiryReset());
yield put(encryptionStop());
yield put(clearActiveUsers());
@ -149,7 +149,7 @@ const handleServerRequest = function* handleServerRequest({ server, username, fr
try {
// SSL Pinning - Read certificate alias and set it to be used by network requests
const certificate = UserPreferences.getString(`${CERTIFICATE_KEY}-${server}`);
SSLPinning.setCertificate(certificate, server);
// SSLPinning.setCertificate(certificate, server);
const serverInfo = yield getServerInfo({ server });
const serversDB = database.servers;

View File

@ -28,7 +28,7 @@ import { BASIC_AUTH_KEY, setBasicAuth } from '../../lib/methods/helpers/fetch';
import { showConfirmationAlert } from '../../lib/methods/helpers/info';
import { events, logEvent } from '../../lib/methods/helpers/log';
import { moderateScale, verticalScale } from './scaling';
import SSLPinning from '../../lib/methods/helpers/sslPinning';
// import SSLPinning from '../../lib/methods/helpers/sslPinning';
import sharedStyles from '../Styles';
import ServerInput from './ServerInput';
import { serializeAsciiUrl } from '../../lib/methods';
@ -242,8 +242,8 @@ class NewServerView extends React.Component<INewServerViewProps, INewServerViewS
chooseCertificate = async () => {
try {
const certificate = await SSLPinning?.pickCertificate();
this.setState({ certificate });
// const certificate = await SSLPinning?.pickCertificate();
// this.setState({ certificate });
} catch {
// Do nothing
}

View File

@ -117,10 +117,10 @@
"react-native-orientation-locker": "1.1.8",
"react-native-picker-select": "^8.0.4",
"react-native-platform-touchable": "1.1.1",
"react-native-popover-view": "4.0.1",
"react-native-popover-view": "^5.1.7",
"react-native-progress": "5.0.0",
"react-native-prompt-android": "^1.1.0",
"react-native-reanimated": "2.8.0",
"react-native-reanimated": "2.9",
"react-native-restart": "0.0.22",
"react-native-safe-area-context": "3.2.0",
"react-native-screens": "3.13.1",

View File

@ -17393,10 +17393,13 @@ react-native-platform-touchable@1.1.1:
resolved "https://registry.yarnpkg.com/react-native-platform-touchable/-/react-native-platform-touchable-1.1.1.tgz#fde4acc65eea585d28b164d0c3716a42129a68e4"
integrity sha1-/eSsxl7qWF0osWTQw3FqQhKaaOQ=
react-native-popover-view@4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/react-native-popover-view/-/react-native-popover-view-4.0.1.tgz#f25db84e6774d9f9edfceba8e03bfa2d9ce22a4b"
integrity sha512-A5M1RRPVoWXCP/+zP/JOeadanRc/crgz0VCFfH1nW3PiinmYYpWxtFoJEYAmotjwo5uKzS2FO7uapFHhJJ+zaw==
react-native-popover-view@^5.1.7:
version "5.1.7"
resolved "https://registry.yarnpkg.com/react-native-popover-view/-/react-native-popover-view-5.1.7.tgz#12f1df9b7c142ab8fa1a3ded2919a4164823be45"
integrity sha512-Xa+zKYp9x62UNezT8o9SnqQaBQEHdGwGHZnFnA2bsXLneVRvvlBopNwMNj+p7N65qnPf3mmzWj+57ThtM1qFuw==
dependencies:
deprecated-react-native-prop-types "^2.3.0"
prop-types "^15.8.1"
react-native-progress@5.0.0:
version "5.0.0"
@ -17410,11 +17413,12 @@ react-native-prompt-android@^1.1.0:
resolved "https://registry.yarnpkg.com/react-native-prompt-android/-/react-native-prompt-android-1.1.0.tgz#3c5168029075cb9f72549fd5f92403372fb234e9"
integrity sha512-4JoyEaT2ZnK9IH+tDFpbTiQBgva8UIFGQf4/Uw/tnEVWBERlVlzcs5B82T9BkeEhEqXhp89JaiSBnLWj30lciw==
react-native-reanimated@2.8.0:
version "2.8.0"
resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-2.8.0.tgz#93c06ca84d91fb3865110b0857c49a24e316130e"
integrity sha512-kJvf/UWLBMaGCs9X66MKq5zdFMgwx8D0nHnolbHR7s8ZnbLdb7TlQ/yuzIXqn/9wABfnwtNRI3CyaP1aHWMmZg==
react-native-reanimated@2.9:
version "2.9.1"
resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-2.9.1.tgz#d9a932e312c13c05b4f919e43ebbf76d996e0bc1"
integrity sha512-309SIhDBwY4F1n6e5Mr5D1uPZm2ESIcmZsGXHUu8hpKX4oIOlZj2MilTk+kHhi05LjChoJkcpfkstotCJmPRPg==
dependencies:
"@babel/plugin-proposal-export-namespace-from" "^7.17.12"
"@babel/plugin-transform-object-assign" "^7.16.7"
"@babel/preset-typescript" "^7.16.7"
"@types/invariant" "^2.2.35"