Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:usesCleartextTraffic="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:supportsRtl="true">
<meta-data android:name="io.sentry.auto-init" android:value="false" />
<meta-data android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@mipmap/edge_logo_hollow" />
Expand Down
7 changes: 6 additions & 1 deletion android/app/src/main/java/co/edgesecure/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate
import com.zoontek.rnbootsplash.RNBootSplash
import expo.modules.ReactActivityDelegateWrapper

class MainActivity : ReactActivity() {
/**
Expand All @@ -21,7 +22,11 @@ class MainActivity : ReactActivity() {
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
*/
override fun createReactActivityDelegate(): ReactActivityDelegate =
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
ReactActivityDelegateWrapper(
this,
BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled),
)

// Edge addition
override fun onCreate(savedInstanceState: Bundle?) {
Expand Down
60 changes: 21 additions & 39 deletions android/app/src/main/java/co/edgesecure/app/MainApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,10 @@ import android.content.res.Configuration
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
import com.facebook.react.modules.i18nmanager.I18nUtil
import com.facebook.react.soloader.OpenSourceMergedSoMapping
import com.facebook.soloader.SoLoader
import expo.modules.ApplicationLifecycleDispatcher.onApplicationCreate
import expo.modules.ApplicationLifecycleDispatcher.onConfigurationChanged
import expo.modules.ReactNativeHostWrapper
import expo.modules.ApplicationLifecycleDispatcher
import expo.modules.ExpoReactHostFactory
import io.sentry.Hint
import io.sentry.SentryEvent
import io.sentry.SentryLevel
Expand All @@ -26,28 +19,16 @@ import io.sentry.android.core.SentryAndroid
class MainApplication :
Application(),
ReactApplication {
override val reactNativeHost: ReactNativeHost =
ReactNativeHostWrapper(
this,
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> {
// Packages that cannot be autolinked yet can be added manually here, for
// example:
// packages.add(new MyReactNativePackage());
return PackageList(this).packages
}

override fun getJSMainModuleName(): String = "index"

override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG

override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
},
override val reactHost: ReactHost by lazy {
ExpoReactHostFactory.getDefaultReactHost(
context = applicationContext,
packageList =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here, for example:
// add(MyReactNativePackage())
},
)

override val reactHost: ReactHost
get() = getDefaultReactHost(applicationContext, reactNativeHost)
}

override fun onCreate() {
super.onCreate()
Expand Down Expand Up @@ -102,17 +83,18 @@ class MainApplication :
// Background task:
MessagesWorker.ensureScheduled(context)
// MessagesWorker.testRun(context);
SoLoader.init(this, OpenSourceMergedSoMapping)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this
// app.
load()
}
onApplicationCreate(this)

// React Native template code:
loadReactNative(this)

// Expo integration:
ApplicationLifecycleDispatcher.onApplicationCreate(this)
}

override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
onConfigurationChanged(this, newConfig)

// Expo integration:
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)
}
}
7 changes: 4 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ buildscript {
ext {
buildToolsVersion = "35.0.0"
minSdkVersion = 28 // Edge modified from 21
compileSdkVersion = 35
targetSdkVersion = 35
compileSdkVersion = 36
targetSdkVersion = 36
ndkVersion = "27.1.12297006"
kotlinVersion = "2.0.21"
kotlinVersion = "2.1.20"
}
repositories {
google()
Expand All @@ -29,3 +29,4 @@ buildscript {
}

apply plugin: "com.facebook.react.rootproject"
apply plugin: "expo-root-project"
10 changes: 6 additions & 4 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.125.0

# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
# ./gradlew <task> -PreactNativeArchitectures=x86_64
Expand All @@ -37,10 +34,15 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
newArchEnabled=true

# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true

# Use this property to enable edge-to-edge display support.
# This allows your app to draw behind system bars for an immersive UI.
# Note: Only works with ReactActivity and should not be used with custom Activity.
edgeToEdgeEnabled=false

VisionCamera_enableCodeScanner=true
Binary file modified android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
4 changes: 2 additions & 2 deletions android/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions android/gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 18 additions & 5 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
// Expo integration:
pluginManagement {
includeBuild("../node_modules/@react-native/gradle-plugin")
includeBuild("../node_modules/expo-modules-autolinking/android/expo-gradle-plugin")
}
plugins {
id("com.facebook.react.settings")
id("expo-autolinking-settings")
}
extensions.configure(com.facebook.react.ReactSettingsExtension) {
ex -> ex.autolinkLibrariesFromCommand(expoAutolinking.rnConfigCommand)
}

// React template code:
rootProject.name = 'co.edgesecure.app'
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')

apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")
useExpoModules()
// Expo integration:
expoAutolinking.useExpoModules()
expoAutolinking.useExpoVersionCatalog()
includeBuild(expoAutolinking.reactNativeGradlePlugin)
14 changes: 3 additions & 11 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
module.exports = function (api) {
const isAndroid = api.caller(c => c.platform === 'android')

return {
presets: ['module:@react-native/babel-preset'],
plugins: [
isAndroid
? './node_modules/r3-hack/node_modules/react-native-reanimated/plugin'
: 'react-native-worklets/plugin'
]
}
module.exports = {
presets: ['babel-preset-expo'],
plugins: ['react-native-worklets/plugin']
}
Loading
Loading