773c976822
- Native ApkInstallerModule: FileProvider content:// URI for Android 7+ - REQUEST_INSTALL_PACKAGES permission in AndroidManifest - file_paths.xml for FileProvider cache access - APP_VERSION reads from package.json (not hardcoded) - "Auf Updates pruefen" button in Settings - Version display reads from package.json dynamically Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
45 lines
1.6 KiB
Kotlin
45 lines
1.6 KiB
Kotlin
package com.ariacockpit
|
|
|
|
import android.app.Application
|
|
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.flipper.ReactNativeFlipper
|
|
import com.facebook.soloader.SoLoader
|
|
|
|
class MainApplication : Application(), ReactApplication {
|
|
|
|
override val reactNativeHost: ReactNativeHost =
|
|
object : DefaultReactNativeHost(this) {
|
|
override fun getPackages(): List<ReactPackage> =
|
|
PackageList(this).packages.apply {
|
|
add(ApkInstallerPackage())
|
|
}
|
|
|
|
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
|
|
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
|
|
|
|
override fun onCreate() {
|
|
super.onCreate()
|
|
SoLoader.init(this, false)
|
|
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
|
// If you opted-in for the New Architecture, we load the native entry point for this app.
|
|
load()
|
|
}
|
|
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
|
|
}
|
|
}
|