diff --git a/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/.ninja_log b/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/.ninja_log index a10e382f..bee04bec 100644 --- a/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/.ninja_log +++ b/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/.ninja_log @@ -48,3 +48,5 @@ 6 42 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/CMakeFiles/cmake.verify_globs 5250f1b80cb55465 4 42 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/CMakeFiles/cmake.verify_globs 5250f1b80cb55465 3 29 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/CMakeFiles/cmake.verify_globs 5250f1b80cb55465 +9 105 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/CMakeFiles/cmake.verify_globs 5250f1b80cb55465 +5 31 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/CMakeFiles/cmake.verify_globs 5250f1b80cb55465 diff --git a/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/configure_fingerprint.bin b/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/configure_fingerprint.bin index 42828209..8c3d4476 100644 --- a/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/configure_fingerprint.bin +++ b/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/configure_fingerprint.bin @@ -2,41 +2,41 @@ C/C++ Structured Logg e cC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\additional_project_files.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  Áû·þ‚4Å, Üû—ö‚4d +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  «”õ€ƒ4Å, Üû—ö‚4d b -`C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\android_gradle_build.json  Áû·þ‚4û" Þû—ö‚4i +`C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\android_gradle_build.json  «”õ€ƒ4û" Þû—ö‚4i g -eC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\android_gradle_build_mini.json  Áû·þ‚4ï —ü—ö‚4V +eC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\android_gradle_build_mini.json  «”õ€ƒ4ï —ü—ö‚4V T -RC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\build.ninja  Áû·þ‚4œÞ Íø—ö‚4Z +RC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\build.ninja  «”õ€ƒ4œÞ Íø—ö‚4Z X -VC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\build.ninja.txt  Áû·þ‚4_ +VC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\build.ninja.txt  «”õ€ƒ4_ ] -[C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\build_file_index.txt  Áû·þ‚4� ™ü—ö‚4` +[C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\build_file_index.txt  «”õ€ƒ4� ™ü—ö‚4` ^ -\C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\compile_commands.json  Áû·þ‚4‘Ø Ëø—ö‚4d +\C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\compile_commands.json  «”õ€ƒ4‘Ø Ëø—ö‚4d b -`C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\compile_commands.json.bin  Áû·þ‚4 Ê„ Ëø—ö‚4j +`C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\compile_commands.json.bin  «”õ€ƒ4 Ê„ Ëø—ö‚4j h -fC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\metadata_generation_command.txt  Áû·þ‚4 +fC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\metadata_generation_command.txt  «”õ€ƒ4 ¸ ˜ü—ö‚4] [ -YC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\prefab_config.json  Áû·þ‚4 € ˜ü—ö‚4b +YC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\prefab_config.json  «”õ€ƒ4 € ˜ü—ö‚4b ` -^C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\symbol_folder_index.txt  Áû·þ‚4  ] ˜ü—ö‚4{ +^C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\symbol_folder_index.txt  «”õ€ƒ4  ] ˜ü—ö‚4{ y -wC:\GitHub\Schnappix\node_modules\react-native-gesture-handler\android\build\generated\source\codegen\jni\CMakeLists.txt  Áû·þ‚4 ¾ ‡•‚ö‚4v +wC:\GitHub\Schnappix\node_modules\react-native-gesture-handler\android\build\generated\source\codegen\jni\CMakeLists.txt  «”õ€ƒ4 ¾ ‡•‚ö‚4v t -rC:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\generated\source\codegen\jni\CMakeLists.txt  Áû·þ‚4ö ’•‚ö‚4µ +rC:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\generated\source\codegen\jni\CMakeLists.txt  «”õ€ƒ4ö ’•‚ö‚4µ ² -¯C:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json  Áû·þ‚4Y +¯C:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json  «”õ€ƒ4Y W -UC:\GitHub\Schnappix\node_modules\react-native-svg\android\src\main\jni\CMakeLists.txt  Áû·þ‚4½ œ§ØÖç3u +UC:\GitHub\Schnappix\node_modules\react-native-svg\android\src\main\jni\CMakeLists.txt  «”õ€ƒ4½ œ§ØÖç3u s -qC:\GitHub\Schnappix\node_modules\react-native-view-shot\android\build\generated\source\codegen\jni\CMakeLists.txt  Áû·þ‚4ê û”‚ö‚4t +qC:\GitHub\Schnappix\node_modules\react-native-view-shot\android\build\generated\source\codegen\jni\CMakeLists.txt  «”õ€ƒ4ê û”‚ö‚4t r -pC:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\generated\source\codegen\jni\CMakeLists.txt  Áû·þ‚4ê Ÿ•‚ö‚4³ +pC:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\generated\source\codegen\jni\CMakeLists.txt  «”õ€ƒ4ê Ÿ•‚ö‚4³ ° -­C:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json  Áû·þ‚4k +­C:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json  «”õ€ƒ4k i -gC:\GitHub\Schnappix\node_modules\react-native\ReactAndroid\cmake-utils\default-app-setup\CMakeLists.txt  Áû·þ‚4ð ®¡ÈÑç3 \ No newline at end of file +gC:\GitHub\Schnappix\node_modules\react-native\ReactAndroid\cmake-utils\default-app-setup\CMakeLists.txt  «”õ€ƒ4ð ®¡ÈÑç3 \ No newline at end of file diff --git a/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/.ninja_log b/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/.ninja_log index f2a4a3a9..ad325ca3 100644 --- a/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/.ninja_log +++ b/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/.ninja_log @@ -48,3 +48,5 @@ 3 28 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/CMakeFiles/cmake.verify_globs 1eb2d1da6ebc2e74 5 33 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/CMakeFiles/cmake.verify_globs 1eb2d1da6ebc2e74 4 36 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/CMakeFiles/cmake.verify_globs 1eb2d1da6ebc2e74 +4 60 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/CMakeFiles/cmake.verify_globs 1eb2d1da6ebc2e74 +4 30 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/CMakeFiles/cmake.verify_globs 1eb2d1da6ebc2e74 diff --git a/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/configure_fingerprint.bin b/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/configure_fingerprint.bin index 68572d8c..0f10a952 100644 --- a/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/configure_fingerprint.bin +++ b/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/configure_fingerprint.bin @@ -2,41 +2,41 @@ C/C++ Structured Logi g eC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\additional_project_files.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ôü·þ‚4ý, Óì™ö‚4f +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  è•õ€ƒ4ý, Óì™ö‚4f d -bC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\android_gradle_build.json  ôü·þ‚4�# Øì™ö‚4k +bC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\android_gradle_build.json  è•õ€ƒ4�# Øì™ö‚4k i -gC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\android_gradle_build_mini.json  ôü·þ‚4‘ ˆí™ö‚4X +gC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\android_gradle_build_mini.json  é•õ€ƒ4‘ ˆí™ö‚4X V -TC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\build.ninja  ôü·þ‚4Áå  é™ö‚4\ +TC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\build.ninja  é•õ€ƒ4Áå  é™ö‚4\ Z -XC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\build.ninja.txt  ôü·þ‚4a +XC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\build.ninja.txt  é•õ€ƒ4a _ -]C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\build_file_index.txt  ôü·þ‚4� �í™ö‚4b +]C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\build_file_index.txt  é•õ€ƒ4� �í™ö‚4b ` -^C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\compile_commands.json  ôü·þ‚4´à žé™ö‚4f +^C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\compile_commands.json  é•õ€ƒ4´à žé™ö‚4f d -bC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\compile_commands.json.bin  ôü·þ‚4 ò„ žé™ö‚4l +bC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\compile_commands.json.bin  é•õ€ƒ4 ò„ žé™ö‚4l j -hC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\metadata_generation_command.txt  ôü·þ‚4 +hC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\metadata_generation_command.txt  é•õ€ƒ4 Ä Ší™ö‚4_ ] -[C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\prefab_config.json  ôü·þ‚4 € ‹í™ö‚4d +[C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\prefab_config.json  é•õ€ƒ4 € ‹í™ö‚4d b -`C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\symbol_folder_index.txt  ôü·þ‚4  _ Œí™ö‚4{ +`C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\symbol_folder_index.txt  é•õ€ƒ4  _ Œí™ö‚4{ y -wC:\GitHub\Schnappix\node_modules\react-native-gesture-handler\android\build\generated\source\codegen\jni\CMakeLists.txt  ôü·þ‚4 ¾ ‡•‚ö‚4v +wC:\GitHub\Schnappix\node_modules\react-native-gesture-handler\android\build\generated\source\codegen\jni\CMakeLists.txt  é•õ€ƒ4 ¾ ‡•‚ö‚4v t -rC:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\generated\source\codegen\jni\CMakeLists.txt  ôü·þ‚4ö ’•‚ö‚4µ +rC:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\generated\source\codegen\jni\CMakeLists.txt  é•õ€ƒ4ö ’•‚ö‚4µ ² -¯C:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json  ôü·þ‚4Y +¯C:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json  é•õ€ƒ4Y W -UC:\GitHub\Schnappix\node_modules\react-native-svg\android\src\main\jni\CMakeLists.txt  ôü·þ‚4½ œ§ØÖç3u +UC:\GitHub\Schnappix\node_modules\react-native-svg\android\src\main\jni\CMakeLists.txt  é•õ€ƒ4½ œ§ØÖç3u s -qC:\GitHub\Schnappix\node_modules\react-native-view-shot\android\build\generated\source\codegen\jni\CMakeLists.txt  ôü·þ‚4ê û”‚ö‚4t +qC:\GitHub\Schnappix\node_modules\react-native-view-shot\android\build\generated\source\codegen\jni\CMakeLists.txt  é•õ€ƒ4ê û”‚ö‚4t r -pC:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\generated\source\codegen\jni\CMakeLists.txt  ôü·þ‚4ê Ÿ•‚ö‚4³ +pC:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\generated\source\codegen\jni\CMakeLists.txt  é•õ€ƒ4ê Ÿ•‚ö‚4³ ° -­C:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json  ôü·þ‚4k +­C:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json  é•õ€ƒ4k i -gC:\GitHub\Schnappix\node_modules\react-native\ReactAndroid\cmake-utils\default-app-setup\CMakeLists.txt  ôü·þ‚4ð ®¡ÈÑç3 \ No newline at end of file +gC:\GitHub\Schnappix\node_modules\react-native\ReactAndroid\cmake-utils\default-app-setup\CMakeLists.txt  é•õ€ƒ4ð ®¡ÈÑç3 \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index 7c48d98e..3340bf61 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -92,8 +92,8 @@ android { applicationId 'de.orfel.schnappix' minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 63 - versionName "23.01.63" + versionCode 64 + versionName "23.01.64" buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\"${findProperty('reactNativeReleaseLevel') ?: 'stable'}\"" } diff --git a/apks/Schnappix_v23.01.64.apk b/apks/Schnappix_v23.01.64.apk new file mode 100644 index 00000000..a4877250 --- /dev/null +++ b/apks/Schnappix_v23.01.64.apk @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94bbdf319e21b70cb1820b0ca6f0aff455228d5273afc49f49ea8c232b96adba +size 115456622 diff --git a/app.json b/app.json index 6d82d0e7..87b6edd5 100644 --- a/app.json +++ b/app.json @@ -3,7 +3,7 @@ "newArchEnabled": true, "name": "Schnappix", "slug": "Schnappix", - "version": "23.01.63", + "version": "23.01.64", "orientation": "landscape", "icon": "./Icon.png", "userInterfaceStyle": "dark", @@ -13,7 +13,7 @@ }, "android": { "package": "de.orfel.schnappix", - "versionCode": 63, + "versionCode": 64, "usesCleartextTraffic": true, "adaptiveIcon": { "backgroundColor": "#050510", diff --git a/modules/usb-camera/android/src/main/java/expo/modules/usbcamera/UsbCameraView.kt b/modules/usb-camera/android/src/main/java/expo/modules/usbcamera/UsbCameraView.kt index 12fed220..6582aca7 100644 --- a/modules/usb-camera/android/src/main/java/expo/modules/usbcamera/UsbCameraView.kt +++ b/modules/usb-camera/android/src/main/java/expo/modules/usbcamera/UsbCameraView.kt @@ -124,57 +124,6 @@ class UsbCameraView(context: Context, appContext: AppContext) : ExpoView(context .setFrontCamera(false) .create() - // Explicitly request permission for any connected USB camera before starting ausbc - try { - val usbManager = context.getSystemService(Context.USB_SERVICE) as android.hardware.usb.UsbManager - val devices = usbManager.deviceList.values - android.util.Log.e("UsbCameraView", "Found ${devices.size} USB devices connected") - for (device in devices) { - android.util.Log.e("UsbCameraView", "Checking device: ${device.deviceName}, class: ${device.deviceClass}, interfaces: ${device.interfaceCount}") - if (!usbManager.hasPermission(device)) { - val intent = android.content.Intent("com.schnappix.USB_PERMISSION") - intent.setPackage(context.packageName) - val permissionIntent = android.app.PendingIntent.getBroadcast( - activityContext, - 0, - intent, - android.app.PendingIntent.FLAG_MUTABLE or android.app.PendingIntent.FLAG_UPDATE_CURRENT - ) - usbManager.requestPermission(device, permissionIntent) - android.util.Log.e("UsbCameraView", "Requested USB permission manually for ${device.deviceName}") - } else { - android.util.Log.e("UsbCameraView", "Already has USB permission for ${device.deviceName}") - } - } - } catch (e: Exception) { - e.printStackTrace() - android.util.Log.e("UsbCameraView", "Error checking USB devices: ${e.message}", e) - } - - permissionReceiver = object : android.content.BroadcastReceiver() { - override fun onReceive(context: Context, intent: android.content.Intent) { - if ("com.schnappix.USB_PERMISSION" == intent.action) { - synchronized(this) { - val granted = intent.getBooleanExtra(android.hardware.usb.UsbManager.EXTRA_PERMISSION_GRANTED, false) - if (granted) { - android.util.Log.e("UsbCameraView", "Permission granted from Broadcast!") - startPreview() - } else { - android.util.Log.e("UsbCameraView", "Permission denied from Broadcast!") - } - } - } - } - } - - val filter = android.content.IntentFilter("com.schnappix.USB_PERMISSION") - registeredContext = activityContext - if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.TIRAMISU) { - activityContext.registerReceiver(permissionReceiver, filter, Context.RECEIVER_EXPORTED) - } else { - activityContext.registerReceiver(permissionReceiver, filter) - } - cameraClient = CameraClient.newBuilder(safeContextVal) .setCameraStrategy(CameraUvcStrategy(safeContextVal)) .setCameraRequest(cameraRequest) @@ -280,11 +229,21 @@ class UsbCameraView(context: Context, appContext: AppContext) : ExpoView(context } cameraClient = null - try { - safeContext?.destroy() - } catch (e: Exception) { - e.printStackTrace() - } + val contextToDestroy = safeContext safeContext = null + + // Delay destroying the context by 1000ms. + // This is crucial because safeContext.destroy() triggers ON_DESTROY in ICameraStrategy, + // which forcefully closes the USB device (UsbControlBlock) on the main thread. + // If we don't delay, the native UVCCamera thread (which is stopped asynchronously) + // will crash or hang when the USB device fd is yanked from underneath it, + // causing a black screen on the next open. + android.os.Handler(android.os.Looper.getMainLooper()).postDelayed({ + try { + contextToDestroy?.destroy() + } catch (e: Exception) { + e.printStackTrace() + } + }, 1000) } } diff --git a/modules/usb-camera/android/src/main/java/expo/modules/usbcamera/UsbContextWrapperJava.java b/modules/usb-camera/android/src/main/java/expo/modules/usbcamera/UsbContextWrapperJava.java index 8eb612e3..8d0b6b0c 100644 --- a/modules/usb-camera/android/src/main/java/expo/modules/usbcamera/UsbContextWrapperJava.java +++ b/modules/usb-camera/android/src/main/java/expo/modules/usbcamera/UsbContextWrapperJava.java @@ -78,7 +78,9 @@ public class UsbContextWrapperJava extends ContextWrapper implements LifecycleOw @Override public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter, int flags) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - flags |= Context.RECEIVER_EXPORTED; + if ((flags & Context.RECEIVER_EXPORTED) == 0 && (flags & Context.RECEIVER_NOT_EXPORTED) == 0) { + flags |= Context.RECEIVER_EXPORTED; + } } return super.registerReceiver(receiver, filter, flags); } @@ -95,7 +97,9 @@ public class UsbContextWrapperJava extends ContextWrapper implements LifecycleOw @Override public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter, String broadcastPermission, Handler scheduler, int flags) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - flags |= Context.RECEIVER_EXPORTED; + if ((flags & Context.RECEIVER_EXPORTED) == 0 && (flags & Context.RECEIVER_NOT_EXPORTED) == 0) { + flags |= Context.RECEIVER_EXPORTED; + } } return super.registerReceiver(receiver, filter, broadcastPermission, scheduler, flags); } diff --git a/package.json b/package.json index 8388d970..ba77c622 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "schnappix", - "version": "23.01.63", + "version": "23.01.64", "main": "index.ts", "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.7.2",