Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
208db30
update react and some libs
dnlsilva Jun 7, 2022
13e2c6e
android
dnlsilva Jun 7, 2022
0292f08
update expo av patch
dnlsilva Jun 7, 2022
5e6a1e0
update bugsnag gradlew version
dnlsilva Jun 7, 2022
234ce57
android live
dnlsilva Jun 8, 2022
77d7e21
fix list handler
dnlsilva Jun 8, 2022
65a7729
ios building
dnlsilva Jun 15, 2022
647ab00
update keyboard aware view
dnlsilva Jun 17, 2022
be26b67
iOS building
diegolmello Jun 24, 2022
7144ac8
Temp remove UIKit
diegolmello Jun 24, 2022
54079c2
Temp remove mmkv workaround
diegolmello Jun 24, 2022
db0d898
Patching this VERY obscure issue on FlatList props
diegolmello Jun 24, 2022
a4aa1e9
Fix rn-root-view android
diegolmello Jul 1, 2022
9a13db4
Stash iOS proj
diegolmello Jul 1, 2022
a9b5db4
Apply "stock" RN 0.68.2
diegolmello Jul 1, 2022
36b6c35
hasPermission apparently working
diegolmello Jul 1, 2022
f14292d
Temp remove react-native-keycommands
diegolmello Jul 7, 2022
598b30f
Apply 12.5 M1 podfile
diegolmello Jul 7, 2022
f50ea54
AppDelegate.m -> AppDelegate.mm
diegolmello Jul 7, 2022
d7b6409
Apply Expo changes
diegolmello Jul 7, 2022
dd217d6
Remove unused expo modules
diegolmello Jul 7, 2022
b61ce04
Remove some mmkv patches
diegolmello Jul 8, 2022
2086b11
Remove animatable patch
diegolmello Jul 8, 2022
2f609e5
Prettier
diegolmello Jul 8, 2022
90fc7e7
Update MMKV mock
diegolmello Jul 8, 2022
32bf617
Use jest-expo instead of our mocks and update tests
diegolmello Jul 8, 2022
4a2704c
Fix lint
diegolmello Jul 8, 2022
9683731
Temp disable LoadMore tests
diegolmello Jul 8, 2022
51abd8b
Update gems iOS
diegolmello Jul 8, 2022
d09fefc
Building release on M1 with Flipper disabled
diegolmello Jul 14, 2022
a9a3677
Merge branch 'develop' into upgrade-react-native-68
diegolmello Jul 14, 2022
873ee3f
Temp disable test
diegolmello Jul 14, 2022
c1c62d7
Manually enable Hermes on iOS
diegolmello Jul 14, 2022
ff04532
Fix jumpTo functions
diegolmello Jul 19, 2022
678f29c
Upgrade react-native-scrollable-tab-view
diegolmello Jul 19, 2022
65991d4
autoCompleteType -> autoComplete
diegolmello Jul 20, 2022
495af1a
Fix emoji picker
diegolmello Jul 20, 2022
a56015e
Remove unused expo-error-recovery
diegolmello Jul 20, 2022
273bcbb
Use our react-native fork
diegolmello Jul 20, 2022
74c2234
Patch react-native-mmkv-storage
diegolmello Jul 21, 2022
34d804d
Use analytics without ad id
diegolmello Jul 21, 2022
8684f1d
Flipper comment
diegolmello Jul 21, 2022
4f5029f
Fix CircleCI pods cache
diegolmello Jul 21, 2022
6f4e10b
Try running pods from gem and with deployment mode
diegolmello Jul 21, 2022
a335132
Cleanup CI config
diegolmello Jul 21, 2022
3bdd519
Fix react-native-mmkv-storage installation
diegolmello Jul 21, 2022
33b1daf
Remove jcenter
diegolmello Jul 21, 2022
643de6e
Update blur
diegolmello Jul 21, 2022
a4609ac
Fix SSL pinning
diegolmello Jul 22, 2022
b1b37eb
Reenable keycommands
diegolmello Jul 22, 2022
90d928c
Cleanup
diegolmello Jul 22, 2022
35ea50a
Re add a few methods to AppDelegate
diegolmello Jul 22, 2022
9bff334
Update podfile.lock
diegolmello Jul 26, 2022
3d90394
Remove the need for metro-babel-register
diegolmello Jul 27, 2022
4f62973
Try tests on CI
diegolmello Jul 27, 2022
8d1ba2e
Reenable LoadMore tests
diegolmello Jul 27, 2022
9aed1ed
Point to maven only fix on rn-root-view
diegolmello Jul 27, 2022
c06146c
Merge branch 'develop' into upgrade-react-native-68
diegolmello Jul 27, 2022
a5d94f7
Update supported iOS version
diegolmello Jul 27, 2022
7a38822
Update pods
diegolmello Jul 27, 2022
724e534
Update gradle.properties on CI
diegolmello Jul 27, 2022
74c0a82
Upload source maps to Bugsnag
diegolmello Jul 27, 2022
6eb009d
Build Order: Manual Order -> Dependency Order
diegolmello Jul 27, 2022
7024f90
Run Detox on iOS
diegolmello Jul 29, 2022
082a63b
Fix ImageViewer thread usage
diegolmello Aug 1, 2022
b89380f
Merge branch 'develop' into upgrade-react-native-68
diegolmello Aug 1, 2022
172bd6d
Merge branch 'develop' into upgrade-react-native-68
diegolmello Aug 8, 2022
a2deadb
Revert mappedIcons and selection changes from Prettier
diegolmello Aug 8, 2022
26bee5f
Remove fixed implementation of okhttp
diegolmello Aug 8, 2022
61a3932
Merge and apply rn-root-view branch
diegolmello Aug 8, 2022
96a6794
Apply gson 2.8.9
diegolmello Aug 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ DerivedData
project.xcworkspace
*.mobileprovision
ios/Pods/
/vendor/bundle/

# Android/IntelliJ
#
Expand Down
4 changes: 2 additions & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module.exports = {
bracketSpacing: true,
jsxBracketSameLine: true,
singleQuote: true,
jsxSingleQuote: true,
trailingComma: 'none',
printWidth: 130,
useTabs: true,
arrowParens: 'avoid'
arrowParens: 'avoid',
bracketSameLine: true
};
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.4
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
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'
119 changes: 107 additions & 12 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ project.ext.react = [
]

apply from: "../../node_modules/react-native/react.gradle"
apply from: '../../node_modules/react-native-unimodules/gradle.groovy'

/**
* Set this to true to create two separate APKs instead of one:
Expand Down Expand Up @@ -131,14 +130,17 @@ def jscFlavor = 'org.webkit:android-jsc:+'
*/
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 {
compileSdkVersion rootProject.ext.compileSdkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
applicationId APPLICATION_ID
minSdkVersion rootProject.ext.minSdkVersion
Expand All @@ -153,6 +155,76 @@ android {
resValue "string", "rn_config_reader_custom_package", "chat.rocket.reactnative"
testBuildType System.getProperty('testBuildType', 'debug')
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
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 "rndiffapp_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")
}
}
}
}

signingConfigs {
Expand All @@ -170,7 +242,7 @@ android {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
include (*reactNativeArchitectures())
}
}
buildTypes {
Expand All @@ -181,6 +253,8 @@ android {
if (!isFoss) {
firebaseCrashlytics {
nativeSymbolUploadEnabled true
strippedNativeLibsDir 'build/intermediates/stripped_native_libs/release/out/lib'
unstrippedNativeLibsDir 'build/intermediates/merged_native_libs/release/out/lib'
}
}
}
Expand Down Expand Up @@ -275,7 +349,6 @@ android {
}

dependencies {
addUnimodulesDependencies()
implementation project(':@react-native-community_viewpager')
playImplementation project(':react-native-notifications')
playImplementation 'com.google.firebase:firebase-core:16.0.0'
Expand All @@ -286,14 +359,16 @@ dependencies {
exclude group: 'com.facebook.react',module:'react-native-svg'
}
implementation fileTree(dir: "libs", include: ["*.jar"])

//noinspection GradleDynamicVersion
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'
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'
Expand All @@ -311,20 +386,40 @@ dependencies {
implementation "com.github.bumptech.glide:glide:4.9.0"
annotationProcessor "com.github.bumptech.glide:compiler:4.9.0"
implementation "com.tencent:mmkv-static:1.2.1"
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
implementation "com.squareup.okhttp3:okhttp-urlconnection:4.9.0"
// implementation 'com.squareup.okhttp3:okhttp:4.9.0'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this working?

// implementation "com.squareup.okhttp3:okhttp-urlconnection:4.9.0"
androidTestImplementation('com.wix:detox:+') { transitive = true }
androidTestImplementation 'junit:junit:4.12'
}

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.compile
from configurations.implementation
into 'libs'
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
if (!isFoss) {
apply plugin: 'com.google.gms.google-services'
}

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"
}
2 changes: 1 addition & 1 deletion android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
tools:replace="android:name"
tools:targetApi="28"
android:networkSecurityConfig="@xml/network_security_config">
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="true" />
</application>

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
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 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) {
Expand All @@ -34,7 +35,7 @@ public static void initializeFlipper(Context context, ReactInstanceManager react
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));
Expand All @@ -47,7 +48,7 @@ public void apply(OkHttpClient.Builder builder) {
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
if (reactContext == null) {
reactInstanceManager.addReactInstanceEventListener(
new ReactInstanceManager.ReactInstanceEventListener() {
new ReactInstanceEventListener() {
@Override
public void onReactContextInitialized(ReactContext reactContext) {
reactInstanceManager.removeReactInstanceEventListener(this);
Expand Down
8 changes: 5 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@
tools:replace="android:allowBackup">
<activity
android:name="com.zoontek.rnbootsplash.RNBootSplashActivity"
android:theme="@style/BootTheme">
android:theme="@style/BootTheme"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="chat.rocket.reactnative.MainActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:exported="true"
android:label="@string/app_name"
android:launchMode="singleTask"
Expand Down Expand Up @@ -62,7 +63,8 @@
android:label="@string/share_extension_name"
android:noHistory="true"
android:screenOrientation="portrait"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SEND_MULTIPLE" />
Expand Down
47 changes: 27 additions & 20 deletions android/app/src/main/java/chat/rocket/reactnative/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,33 +1,18 @@
package chat.rocket.reactnative;

import android.os.Bundle;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.SharedPreferences;

import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.ReactRootView;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactFragmentActivity;
import com.facebook.react.ReactActivity;

import com.zoontek.rnbootsplash.RNBootSplash;
import com.google.gson.Gson;

class ThemePreferences {
String currentTheme;
String darkLevel;
}
import expo.modules.ReactActivityDelegateWrapper;

class SortPreferences {
String sortBy;
Boolean groupByType;
Boolean showFavorites;
Boolean showUnread;
}
import com.zoontek.rnbootsplash.RNBootSplash;

public class MainActivity extends ReactFragmentActivity {
public class MainActivity extends ReactActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -58,5 +43,27 @@ public void onConfigurationChanged(Configuration newConfig) {
intent.putExtra("newConfig", newConfig);
this.sendBroadcast(intent);
}
}

/**
* 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 ReactActivityDelegateWrapper(this, 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;
}
}
}
Loading