Patch for Android 14's receivers
This commit is contained in:
parent
310c30be90
commit
89a3844f56
|
@ -136,7 +136,7 @@
|
|||
"remove-markdown": "0.3.0",
|
||||
"reselect": "4.0.0",
|
||||
"rn-extensions-share": "RocketChat/rn-extensions-share",
|
||||
"rn-fetch-blob": "^0.12.0",
|
||||
"rn-fetch-blob": "0.12.0",
|
||||
"rn-root-view": "RocketChat/rn-root-view",
|
||||
"semver": "7.3.8",
|
||||
"transliteration": "2.3.5",
|
||||
|
|
|
@ -32,3 +32,24 @@ index de22598..eafedfe 100644
|
|||
}
|
||||
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
|
||||
diff --git a/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java b/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java
|
||||
index b01e9d2..9a6ac38 100644
|
||||
--- a/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java
|
||||
+++ b/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java
|
||||
@@ -31,6 +31,7 @@ import android.hardware.Camera;
|
||||
import android.hardware.camera2.CameraManager;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
+import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.facebook.react.bridge.Arguments;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
@@ -130,7 +131,7 @@ public class RNDeviceModule extends ReactContextBaseJavaModule {
|
||||
}
|
||||
};
|
||||
|
||||
- getReactApplicationContext().registerReceiver(receiver, filter);
|
||||
+ ContextCompat.registerReceiver(getReactApplicationContext(), receiver, filter, ContextCompat.RECEIVER_NOT_EXPORTED);
|
||||
initializeHeadphoneConnectionReceiver();
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
diff --git a/node_modules/react-native-orientation-locker/android/src/main/java/org/wonday/orientation/OrientationModule.java b/node_modules/react-native-orientation-locker/android/src/main/java/org/wonday/orientation/OrientationModule.java
|
||||
index af1d952..ba056e4 100644
|
||||
--- a/node_modules/react-native-orientation-locker/android/src/main/java/org/wonday/orientation/OrientationModule.java
|
||||
+++ b/node_modules/react-native-orientation-locker/android/src/main/java/org/wonday/orientation/OrientationModule.java
|
||||
@@ -22,6 +22,7 @@ import android.view.Surface;
|
||||
import android.view.WindowManager;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.hardware.SensorManager;
|
||||
+import android.os.Build;
|
||||
|
||||
import com.facebook.common.logging.FLog;
|
||||
import com.facebook.react.bridge.Arguments;
|
||||
@@ -345,7 +346,11 @@ public class OrientationModule extends ReactContextBaseJavaModule implements Lif
|
||||
|
||||
final Activity activity = getCurrentActivity();
|
||||
if (activity == null) return;
|
||||
- activity.registerReceiver(mReceiver, new IntentFilter("onConfigurationChanged"));
|
||||
+ if (Build.VERSION.SDK_INT >= 34 && ctx.getApplicationInfo().targetSdkVersion >= 34) {
|
||||
+ ctx.registerReceiver(mReceiver, new IntentFilter("onConfigurationChanged"), Context.RECEIVER_NOT_EXPORTED);
|
||||
+ }else{
|
||||
+ ctx.registerReceiver(mReceiver, new IntentFilter("onConfigurationChanged"));
|
||||
+ }
|
||||
}
|
||||
@Override
|
||||
public void onHostPause() {
|
|
@ -22,3 +22,21 @@ index 602d51d..920d975 100644
|
|||
@Override
|
||||
public String getName() {
|
||||
return "RNFetchBlob";
|
||||
diff --git a/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java b/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java
|
||||
index a8abd71..06c02a4 100644
|
||||
--- a/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java
|
||||
+++ b/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java
|
||||
@@ -196,7 +196,12 @@ public class RNFetchBlobReq extends BroadcastReceiver implements Runnable {
|
||||
DownloadManager dm = (DownloadManager) appCtx.getSystemService(Context.DOWNLOAD_SERVICE);
|
||||
downloadManagerId = dm.enqueue(req);
|
||||
androidDownloadManagerTaskTable.put(taskId, Long.valueOf(downloadManagerId));
|
||||
- appCtx.registerReceiver(this, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
|
||||
+ // https://github.com/joltup/rn-fetch-blob/issues/866#issuecomment-2030940568
|
||||
+ if (Build.VERSION.SDK_INT >= 34 && appCtx.getApplicationInfo().targetSdkVersion >= 34) {
|
||||
+ appCtx.registerReceiver(this, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE), Context.RECEIVER_EXPORTED);
|
||||
+ }else{
|
||||
+ appCtx.registerReceiver(this, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
|
||||
+ }
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -12744,7 +12744,7 @@ rn-extensions-share@RocketChat/rn-extensions-share:
|
|||
version "2.4.1"
|
||||
resolved "https://codeload.github.com/RocketChat/rn-extensions-share/tar.gz/4d7c0e4c2f300e4fb116af7b7cc0dbbc8169150c"
|
||||
|
||||
rn-fetch-blob@^0.12.0:
|
||||
rn-fetch-blob@0.12.0:
|
||||
version "0.12.0"
|
||||
resolved "https://registry.yarnpkg.com/rn-fetch-blob/-/rn-fetch-blob-0.12.0.tgz#ec610d2f9b3f1065556b58ab9c106eeb256f3cba"
|
||||
integrity sha512-+QnR7AsJ14zqpVVUbzbtAjq0iI8c9tCg49tIoKO2ezjzRunN7YL6zFSFSWZm6d+mE/l9r+OeDM3jmb2tBb2WbA==
|
||||
|
|
Loading…
Reference in New Issue