From 498588f725ec80300d85fd9252b0002b1303cd20 Mon Sep 17 00:00:00 2001 From: Ahmed alaa Date: Wed, 9 Jul 2025 15:18:18 +0300 Subject: [PATCH 1/9] feat: support ignore flag secure on android. --- CHANGELOG.md | 6 ++ .../com/instabug/reactlibrary/RNInstabug.java | 56 +++++++++++++------ .../RNInstabugReactnativeModule.java | 4 +- .../instabug/reactlibrary/RNInstabugTest.java | 9 ++- .../ios/InstabugTests/InstabugSampleTests.m | 4 +- ios/RNInstabug/InstabugReactBridge.h | 4 +- ios/RNInstabug/InstabugReactBridge.m | 4 +- src/models/InstabugConfig.ts | 5 ++ src/modules/Instabug.ts | 1 + src/native/NativeInstabug.ts | 1 + test/modules/Instabug.spec.ts | 2 + 11 files changed, 71 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abda7ed70..2186e7451 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [Unreleased](https://github.com/Instabug/Instabug-React-Native/compare/v15.1.0...dev) + +### Added + +- Add support ignore flag secure on android. ([#1394](https://github.com/Instabug/Instabug-React-Native/pull/1394)) + ## [15.0.1](https://github.com/Instabug/Instabug-React-Native/compare/v14.3.0...v15.0.1) ### Added diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabug.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabug.java index 9b6348ab4..7c0901936 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabug.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabug.java @@ -19,7 +19,8 @@ public class RNInstabug { private static RNInstabug instance; - private RNInstabug() {} + private RNInstabug() { + } public static RNInstabug getInstance() { @@ -36,14 +37,13 @@ public static RNInstabug getInstance() { /** * Initializes the SDK on the native side, which is useful for capturing startup issues specific to the native part of the app. * - * @param application The application context. + * @param application The application context. * @param applicationToken The app's identifying token, available on your dashboard. - * @param logLevel The level of detail in logs that you want to print. - *

Pick one of the log levels described in {@link LogLevel}. - * default logLevel is {@link LogLevel#ERROR}

- * @param InvocationEvent The events that trigger the SDK's user interface. - * Choose from the available events listed in {@link InstabugInvocationEvent}. - * + * @param logLevel The level of detail in logs that you want to print. + *

Pick one of the log levels described in {@link LogLevel}. + * default logLevel is {@link LogLevel#ERROR}

+ * @param InvocationEvent The events that trigger the SDK's user interface. + * Choose from the available events listed in {@link InstabugInvocationEvent}. * @example

Here's an example usage:

*
      * RNInstabug.getInstance().init(
@@ -59,17 +59,24 @@ public void init(
             @NonNull Application application,
             @NonNull String applicationToken,
             int logLevel,
+            Boolean ignoreSecureFlag,
             @NonNull InstabugInvocationEvent... InvocationEvent
-    ) {
+            ) {
         try {
 
             setBaseUrlForDeprecationLogs();
             setCurrentPlatform();
 
-            new Instabug.Builder(application, applicationToken)
+            Instabug.Builder builder = new Instabug.Builder(application, applicationToken)
                     .setInvocationEvents(InvocationEvent)
-                    .setSdkDebugLogsLevel(logLevel)
-                    .build();
+                    .setSdkDebugLogsLevel(logLevel);
+
+            if (ignoreSecureFlag != null) {
+                builder.ignoreFlagSecure(ignoreSecureFlag);
+            }
+
+            builder.build();
+
 
             // Temporarily disabling APM hot launches
             APM.setHotAppLaunchEnabled(false);
@@ -80,15 +87,13 @@ public void init(
     }
 
 
-
     /**
      * Initializes the SDK on the native side, which is useful for capturing startup issues specific to the native part of the app.
      *
-     * @param application The application context.
+     * @param application      The application context.
      * @param applicationToken The app's identifying token, available on your dashboard.
-     * @param invocationEvent The events that trigger the SDK's user interface.
-     *      Choose from the available events listed in {@link InstabugInvocationEvent}.
-     *
+     * @param invocationEvent  The events that trigger the SDK's user interface.
+     *                         Choose from the available events listed in {@link InstabugInvocationEvent}.
      * @example 

Here's an example usage:

*
      * RNInstabug.getInstance().init(
@@ -104,7 +109,7 @@ public void init(
             @NonNull String applicationToken,
             @NonNull InstabugInvocationEvent... invocationEvent
     ) {
-        init(application, applicationToken, LogLevel.ERROR, invocationEvent);
+        init(application, applicationToken, LogLevel.ERROR,null, invocationEvent);
     }
 
     @VisibleForTesting
@@ -160,6 +165,7 @@ public static class Builder {
          * The events that trigger the SDK's user interface.
          */
         private InstabugInvocationEvent[] invocationEvents;
+        private Boolean ignoreFlagSecure;
 
 
         /**
@@ -210,6 +216,16 @@ public Builder setCodePushVersion(String codePushVersion) {
             return this;
         }
 
+        /**
+         * Sets flag to override SDK screenshot security behavior.
+         *
+         * @param ignoreFlagSecure flag to override SDK screenshot security behavior.
+         */
+        public Builder ignoreFlagSecure(boolean ignoreFlagSecure) {
+            this.ignoreFlagSecure = ignoreFlagSecure;
+            return this;
+        }
+
         /**
          * Sets the invocation triggering events for the SDK's user interface
          *
@@ -237,6 +253,10 @@ public void build() {
                     instabugBuilder.setCodePushVersion(codePushVersion);
                 }
 
+                if (ignoreFlagSecure != null) {
+                    instabugBuilder.ignoreFlagSecure(ignoreFlagSecure);
+                }
+
                 instabugBuilder.build();
 
                 // Temporarily disabling APM hot launches
diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
index 17f48656f..8bdb8bffa 100644
--- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
+++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
@@ -148,7 +148,8 @@ public void init(
             final ReadableArray invocationEventValues,
             final String logLevel,
             final boolean useNativeNetworkInterception,
-            @Nullable final String codePushVersion
+            @Nullable final String codePushVersion,
+            final Boolean ignoreFlagSecure
     ) {
         MainThreadHandler.runOnMainThread(new Runnable() {
             @Override
@@ -164,6 +165,7 @@ public void run() {
 
                 RNInstabug.Builder builder = new RNInstabug.Builder(application, token)
                         .setInvocationEvents(invocationEvents)
+                        .ignoreFlagSecure(ignoreFlagSecure)
                         .setLogLevel(parsedLogLevel);
 
                 if (codePushVersion != null) {
diff --git a/android/src/test/java/com/instabug/reactlibrary/RNInstabugTest.java b/android/src/test/java/com/instabug/reactlibrary/RNInstabugTest.java
index df169df1e..625eab1c9 100644
--- a/android/src/test/java/com/instabug/reactlibrary/RNInstabugTest.java
+++ b/android/src/test/java/com/instabug/reactlibrary/RNInstabugTest.java
@@ -4,6 +4,7 @@
 import static com.instabug.reactlibrary.util.GlobalMocks.reflected;
 import static org.junit.Assert.assertEquals;
 import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.mockConstruction;
@@ -62,18 +63,20 @@ public void testInitWithLogLevel() {
                     // Initializes Instabug with the correct token
                     assertEquals(token, actualToken);
                     when(mock.setSdkDebugLogsLevel(anyInt())).thenReturn(mock);
+                    when(mock.ignoreFlagSecure(anyBoolean())).thenReturn(mock);
                     when(mock.setInvocationEvents(any())).thenReturn(mock);
                 });
 
-        sut.init(mContext, token, logLevel, invocationEvents);
+        sut.init(mContext, token, logLevel, true, invocationEvents);
 
         Instabug.Builder builder = mInstabugBuilder.constructed().get(0);
 
         // Here we check that it has changed to verbose value of the `logLevel` property
         verify(builder).setSdkDebugLogsLevel(LogLevel.VERBOSE);
         verify(builder).setInvocationEvents(invocationEvents);
-        verify(builder).build();
+        verify(builder).ignoreFlagSecure(true);
 
+        verify(builder).build();
 
 
         verify(sut).setBaseUrlForDeprecationLogs();
@@ -95,7 +98,7 @@ public void testInitWithoutLogLevel() {
 
         sut.init(mContext, token, invocationEvents);
 
-        verify(sut).init(mContext, token, defaultLogLevel, invocationEvents);
+        verify(sut).init(mContext, token, defaultLogLevel, null,invocationEvents);
         mInstabugBuilder.close();
     }
 
diff --git a/examples/default/ios/InstabugTests/InstabugSampleTests.m b/examples/default/ios/InstabugTests/InstabugSampleTests.m
index ded37c3af..0774f8625 100644
--- a/examples/default/ios/InstabugTests/InstabugSampleTests.m
+++ b/examples/default/ios/InstabugTests/InstabugSampleTests.m
@@ -75,7 +75,9 @@ - (void)testInit {
 
   OCMStub([mock setCodePushVersion:codePushVersion]);
 
-  [self.instabugBridge init:appToken invocationEvents:invocationEvents debugLogsLevel:sdkDebugLogsLevel useNativeNetworkInterception:useNativeNetworkInterception codePushVersion:codePushVersion];
+  [self.instabugBridge init:appToken invocationEvents:invocationEvents debugLogsLevel:sdkDebugLogsLevel useNativeNetworkInterception:useNativeNetworkInterception codePushVersion:codePushVersion
+    ignoreAndroidSecureFlag:nil
+  ];
   OCMVerify([mock setCodePushVersion:codePushVersion]);
 
   OCMVerify([self.mRNInstabug initWithToken:appToken invocationEvents:floatingButtonInvocationEvent debugLogsLevel:sdkDebugLogsLevel useNativeNetworkInterception:useNativeNetworkInterception]);
diff --git a/ios/RNInstabug/InstabugReactBridge.h b/ios/RNInstabug/InstabugReactBridge.h
index 1fe5505d3..c603ba456 100644
--- a/ios/RNInstabug/InstabugReactBridge.h
+++ b/ios/RNInstabug/InstabugReactBridge.h
@@ -26,7 +26,9 @@
 
 - (void)setEnabled:(BOOL)isEnabled;
 
-- (void)init:(NSString *)token invocationEvents:(NSArray *)invocationEventsArray debugLogsLevel:(IBGSDKDebugLogsLevel)sdkDebugLogsLevel useNativeNetworkInterception:(BOOL)useNativeNetworkInterception codePushVersion:(NSString *)codePushVersion;
+- (void)init:(NSString *)token invocationEvents:(NSArray *)invocationEventsArray debugLogsLevel:(IBGSDKDebugLogsLevel)sdkDebugLogsLevel useNativeNetworkInterception:(BOOL)useNativeNetworkInterception codePushVersion:(NSString *)codePushVersion
+ignoreAndroidSecureFlag:(nullable NSNumber *)ignoreAndroidSecureFlag
+;
 
 - (void)setCodePushVersion:(NSString *)version;
 
diff --git a/ios/RNInstabug/InstabugReactBridge.m b/ios/RNInstabug/InstabugReactBridge.m
index a48851ba8..de463ec08 100644
--- a/ios/RNInstabug/InstabugReactBridge.m
+++ b/ios/RNInstabug/InstabugReactBridge.m
@@ -41,7 +41,9 @@ - (dispatch_queue_t)methodQueue {
           invocationEvents:(NSArray *)invocationEventsArray
           debugLogsLevel:(IBGSDKDebugLogsLevel)sdkDebugLogsLevel
           useNativeNetworkInterception:(BOOL)useNativeNetworkInterception
-          codePushVersion:(NSString *)codePushVersion) {
+          codePushVersion:(NSString *)codePushVersion
+                  ignoreAndroidSecureFlag:(nullable NSNumber *)ignoreAndroidSecureFlag
+ ) {
     IBGInvocationEvent invocationEvents = 0;
 
     for (NSNumber *boxedValue in invocationEventsArray) {
diff --git a/src/models/InstabugConfig.ts b/src/models/InstabugConfig.ts
index 614ade892..af1d6e841 100644
--- a/src/models/InstabugConfig.ts
+++ b/src/models/InstabugConfig.ts
@@ -19,6 +19,11 @@ export interface InstabugConfig {
    */
   codePushVersion?: string;
 
+  /**
+   * An optional flag to override SDK screenshot security behavior.
+   */
+  ignoreAndroidSecureFlag?: boolean;
+
   /**
    * An optional network interception mode, this determines whether network interception
    * is done in the JavaScript side or in the native Android and iOS SDK side.
diff --git a/src/modules/Instabug.ts b/src/modules/Instabug.ts
index f7d582e70..ff8afdd65 100644
--- a/src/modules/Instabug.ts
+++ b/src/modules/Instabug.ts
@@ -275,6 +275,7 @@ const initializeNativeInstabug = (config: InstabugConfig) => {
     shouldEnableNativeInterception &&
       config.networkInterceptionMode === NetworkInterceptionMode.native,
     config.codePushVersion,
+    config.ignoreAndroidSecureFlag,
   );
 };
 
diff --git a/src/native/NativeInstabug.ts b/src/native/NativeInstabug.ts
index 7032bbc07..9e82dab48 100644
--- a/src/native/NativeInstabug.ts
+++ b/src/native/NativeInstabug.ts
@@ -26,6 +26,7 @@ export interface InstabugNativeModule extends NativeModule {
     debugLogsLevel: LogLevel,
     useNativeNetworkInterception: boolean,
     codePushVersion?: string,
+    ignoreAndroidSecureFlag?: boolean,
   ): void;
   show(): void;
 
diff --git a/test/modules/Instabug.spec.ts b/test/modules/Instabug.spec.ts
index f6e36d8e4..b3b3f5534 100644
--- a/test/modules/Instabug.spec.ts
+++ b/test/modules/Instabug.spec.ts
@@ -289,6 +289,7 @@ describe('Instabug Module', () => {
       invocationEvents: [InvocationEvent.floatingButton, InvocationEvent.shake],
       debugLogsLevel: LogLevel.debug,
       codePushVersion: '1.1.0',
+      ignoreAndroidSecureFlag: true,
     };
     const usesNativeNetworkInterception = false;
 
@@ -302,6 +303,7 @@ describe('Instabug Module', () => {
       instabugConfig.debugLogsLevel,
       usesNativeNetworkInterception,
       instabugConfig.codePushVersion,
+      instabugConfig.ignoreAndroidSecureFlag,
     );
   });
 

From 6ac5626d285673ee6611de0206e0abfa3cd74b40 Mon Sep 17 00:00:00 2001
From: Ahmed alaa 
Date: Wed, 9 Jul 2025 15:50:32 +0300
Subject: [PATCH 2/9] feat: support ignore flag secure on android.

---
 test/modules/Instabug.spec.ts | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/test/modules/Instabug.spec.ts b/test/modules/Instabug.spec.ts
index b3b3f5534..49bc45341 100644
--- a/test/modules/Instabug.spec.ts
+++ b/test/modules/Instabug.spec.ts
@@ -323,6 +323,7 @@ describe('Instabug Module', () => {
       debugLogsLevel: LogLevel.debug,
       networkInterceptionMode: NetworkInterceptionMode.native,
       codePushVersion: '1.1.0',
+      ignoreAndroidSecureFlag: true,
     };
 
     // Stubbing Network feature flags
@@ -355,6 +356,7 @@ describe('Instabug Module', () => {
         // usesNativeNetworkInterception should be true when using native interception mode with iOS
         true,
         instabugConfig.codePushVersion,
+        instabugConfig.ignoreAndroidSecureFlag,
       );
     }
   });
@@ -954,6 +956,7 @@ describe('Instabug iOS initialization tests', () => {
       config.debugLogsLevel,
       false, // Disable native interception
       config.codePushVersion,
+      config.ignoreAndroidSecureFlag,
     );
   });
 
@@ -972,6 +975,7 @@ describe('Instabug iOS initialization tests', () => {
       config.debugLogsLevel,
       true, // Enable native interception
       config.codePushVersion,
+      config.ignoreAndroidSecureFlag,
     );
   });
 
@@ -990,6 +994,7 @@ describe('Instabug iOS initialization tests', () => {
       config.debugLogsLevel,
       false, // Disable native interception
       config.codePushVersion,
+      config.ignoreAndroidSecureFlag,
     );
   });
 
@@ -1034,6 +1039,7 @@ describe('Instabug Android initialization tests', () => {
         config.debugLogsLevel,
         false, // always disable native interception to insure sending network logs to core (Bugs & Crashes).
         config.codePushVersion,
+        config.ignoreAndroidSecureFlag,
       );
     });
   });

From c8c9608527cb51dc2f8c5118c2a84d18f2925b85 Mon Sep 17 00:00:00 2001
From: Ahmed alaa 
Date: Wed, 9 Jul 2025 17:15:17 +0300
Subject: [PATCH 3/9] feat: support ignore flag secure on android.

---
 .../instabug/reactlibrary/RNInstabugReactnativeModule.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
index 8bdb8bffa..529d38f3a 100644
--- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
+++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
@@ -165,9 +165,12 @@ public void run() {
 
                 RNInstabug.Builder builder = new RNInstabug.Builder(application, token)
                         .setInvocationEvents(invocationEvents)
-                        .ignoreFlagSecure(ignoreFlagSecure)
                         .setLogLevel(parsedLogLevel);
 
+                 if(ignoreFlagSecure!=null){
+                     builder.ignoreFlagSecure(ignoreFlagSecure)
+                }
+
                 if (codePushVersion != null) {
                     if (Instabug.isBuilt()) {
                         Instabug.setCodePushVersion(codePushVersion);

From f0c0e2e0ff5400ecd077c7aa23fbc214dd4f4040 Mon Sep 17 00:00:00 2001
From: Ahmed alaa 
Date: Wed, 9 Jul 2025 17:31:27 +0300
Subject: [PATCH 4/9] feat: support ignore flag secure on android.

---
 .../com/instabug/reactlibrary/RNInstabugReactnativeModule.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
index 529d38f3a..92ed5c5f5 100644
--- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
+++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
@@ -168,7 +168,7 @@ public void run() {
                         .setLogLevel(parsedLogLevel);
 
                  if(ignoreFlagSecure!=null){
-                     builder.ignoreFlagSecure(ignoreFlagSecure)
+                     builder.ignoreFlagSecure(ignoreFlagSecure);
                 }
 
                 if (codePushVersion != null) {

From 8daf4e1a45dfe1456dd30c19e734b1c28485a6ec Mon Sep 17 00:00:00 2001
From: Ahmed alaa 
Date: Wed, 9 Jul 2025 19:36:17 +0300
Subject: [PATCH 5/9] feat: support ignore flag secure on android.

---
 .../com/instabug/reactlibrary/RNInstabugReactnativeModule.java  | 2 +-
 src/modules/Instabug.ts                                         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
index 92ed5c5f5..50469dfa7 100644
--- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
+++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
@@ -149,7 +149,7 @@ public void init(
             final String logLevel,
             final boolean useNativeNetworkInterception,
             @Nullable final String codePushVersion,
-            final Boolean ignoreFlagSecure
+            final boolean ignoreFlagSecure
     ) {
         MainThreadHandler.runOnMainThread(new Runnable() {
             @Override
diff --git a/src/modules/Instabug.ts b/src/modules/Instabug.ts
index ff8afdd65..c78565e98 100644
--- a/src/modules/Instabug.ts
+++ b/src/modules/Instabug.ts
@@ -275,7 +275,7 @@ const initializeNativeInstabug = (config: InstabugConfig) => {
     shouldEnableNativeInterception &&
       config.networkInterceptionMode === NetworkInterceptionMode.native,
     config.codePushVersion,
-    config.ignoreAndroidSecureFlag,
+    config.ignoreAndroidSecureFlag ?? true,
   );
 };
 

From 3d87adf8131745e824f65c84367da3a65cde1c40 Mon Sep 17 00:00:00 2001
From: Ahmed alaa 
Date: Thu, 10 Jul 2025 00:49:17 +0300
Subject: [PATCH 6/9] feat: support ignore flag secure on android.

---
 .../instabug/reactlibrary/RNInstabugReactnativeModule.java  | 6 +++---
 ios/RNInstabug/InstabugReactBridge.h                        | 3 +--
 ios/RNInstabug/InstabugReactBridge.m                        | 2 +-
 src/modules/Instabug.ts                                     | 6 +++++-
 src/native/NativeInstabug.ts                                | 4 +++-
 test/modules/Instabug.spec.ts                               | 6 +++---
 6 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
index 50469dfa7..cb4fb93d9 100644
--- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
+++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
@@ -149,7 +149,7 @@ public void init(
             final String logLevel,
             final boolean useNativeNetworkInterception,
             @Nullable final String codePushVersion,
-            final boolean ignoreFlagSecure
+            final ReadableMap map
     ) {
         MainThreadHandler.runOnMainThread(new Runnable() {
             @Override
@@ -167,8 +167,8 @@ public void run() {
                         .setInvocationEvents(invocationEvents)
                         .setLogLevel(parsedLogLevel);
 
-                 if(ignoreFlagSecure!=null){
-                     builder.ignoreFlagSecure(ignoreFlagSecure);
+                if (map.hasKey("ignoreFlagSecure")) {
+                    builder.ignoreFlagSecure(map.getBoolean("ignoreFlagSecure"));
                 }
 
                 if (codePushVersion != null) {
diff --git a/ios/RNInstabug/InstabugReactBridge.h b/ios/RNInstabug/InstabugReactBridge.h
index c603ba456..45c075098 100644
--- a/ios/RNInstabug/InstabugReactBridge.h
+++ b/ios/RNInstabug/InstabugReactBridge.h
@@ -27,8 +27,7 @@
 - (void)setEnabled:(BOOL)isEnabled;
 
 - (void)init:(NSString *)token invocationEvents:(NSArray *)invocationEventsArray debugLogsLevel:(IBGSDKDebugLogsLevel)sdkDebugLogsLevel useNativeNetworkInterception:(BOOL)useNativeNetworkInterception codePushVersion:(NSString *)codePushVersion
-ignoreAndroidSecureFlag:(nullable NSNumber *)ignoreAndroidSecureFlag
-;
+options:(nullable NSDictionary *)options;
 
 - (void)setCodePushVersion:(NSString *)version;
 
diff --git a/ios/RNInstabug/InstabugReactBridge.m b/ios/RNInstabug/InstabugReactBridge.m
index de463ec08..682896515 100644
--- a/ios/RNInstabug/InstabugReactBridge.m
+++ b/ios/RNInstabug/InstabugReactBridge.m
@@ -42,7 +42,7 @@ - (dispatch_queue_t)methodQueue {
           debugLogsLevel:(IBGSDKDebugLogsLevel)sdkDebugLogsLevel
           useNativeNetworkInterception:(BOOL)useNativeNetworkInterception
           codePushVersion:(NSString *)codePushVersion
-                  ignoreAndroidSecureFlag:(nullable NSNumber *)ignoreAndroidSecureFlag
+                options:(nullable NSDictionary *)options
  ) {
     IBGInvocationEvent invocationEvents = 0;
 
diff --git a/src/modules/Instabug.ts b/src/modules/Instabug.ts
index c78565e98..1e021626f 100644
--- a/src/modules/Instabug.ts
+++ b/src/modules/Instabug.ts
@@ -275,7 +275,11 @@ const initializeNativeInstabug = (config: InstabugConfig) => {
     shouldEnableNativeInterception &&
       config.networkInterceptionMode === NetworkInterceptionMode.native,
     config.codePushVersion,
-    config.ignoreAndroidSecureFlag ?? true,
+    config.ignoreAndroidSecureFlag != null
+      ? {
+          ignoreAndroidSecureFlag: config.ignoreAndroidSecureFlag,
+        }
+      : undefined,
   );
 };
 
diff --git a/src/native/NativeInstabug.ts b/src/native/NativeInstabug.ts
index 9e82dab48..c9c078f37 100644
--- a/src/native/NativeInstabug.ts
+++ b/src/native/NativeInstabug.ts
@@ -26,7 +26,9 @@ export interface InstabugNativeModule extends NativeModule {
     debugLogsLevel: LogLevel,
     useNativeNetworkInterception: boolean,
     codePushVersion?: string,
-    ignoreAndroidSecureFlag?: boolean,
+    options?: {
+      ignoreAndroidSecureFlag?: boolean;
+    },
   ): void;
   show(): void;
 
diff --git a/test/modules/Instabug.spec.ts b/test/modules/Instabug.spec.ts
index 49bc45341..a0a294533 100644
--- a/test/modules/Instabug.spec.ts
+++ b/test/modules/Instabug.spec.ts
@@ -303,7 +303,7 @@ describe('Instabug Module', () => {
       instabugConfig.debugLogsLevel,
       usesNativeNetworkInterception,
       instabugConfig.codePushVersion,
-      instabugConfig.ignoreAndroidSecureFlag,
+      { ignoreAndroidSecureFlag: instabugConfig.ignoreAndroidSecureFlag },
     );
   });
 
@@ -356,7 +356,7 @@ describe('Instabug Module', () => {
         // usesNativeNetworkInterception should be true when using native interception mode with iOS
         true,
         instabugConfig.codePushVersion,
-        instabugConfig.ignoreAndroidSecureFlag,
+        { ignoreAndroidSecureFlag: instabugConfig.ignoreAndroidSecureFlag },
       );
     }
   });
@@ -1039,7 +1039,7 @@ describe('Instabug Android initialization tests', () => {
         config.debugLogsLevel,
         false, // always disable native interception to insure sending network logs to core (Bugs & Crashes).
         config.codePushVersion,
-        config.ignoreAndroidSecureFlag,
+        { ignoreAndroidSecureFlag: config.ignoreAndroidSecureFlag },
       );
     });
   });

From 62d6167bde6d0efc0a0589b194f566217f084dda Mon Sep 17 00:00:00 2001
From: Ahmed alaa 
Date: Fri, 11 Jul 2025 01:24:26 +0300
Subject: [PATCH 7/9] feat: support ignore flag secure on android.

---
 .../default/ios/InstabugTests/InstabugSampleTests.m    | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/examples/default/ios/InstabugTests/InstabugSampleTests.m b/examples/default/ios/InstabugTests/InstabugSampleTests.m
index 0774f8625..34fe9cfe3 100644
--- a/examples/default/ios/InstabugTests/InstabugSampleTests.m
+++ b/examples/default/ios/InstabugTests/InstabugSampleTests.m
@@ -76,7 +76,7 @@ - (void)testInit {
   OCMStub([mock setCodePushVersion:codePushVersion]);
 
   [self.instabugBridge init:appToken invocationEvents:invocationEvents debugLogsLevel:sdkDebugLogsLevel useNativeNetworkInterception:useNativeNetworkInterception codePushVersion:codePushVersion
-    ignoreAndroidSecureFlag:nil
+    options:nil
   ];
   OCMVerify([mock setCodePushVersion:codePushVersion]);
 
@@ -612,18 +612,18 @@ - (void) testIsW3CaughtHeaderEnabled {
 
 - (void)testEnableAutoMasking {
     id mock = OCMClassMock([Instabug class]);
-     
+
     NSArray *autoMaskingTypes = [NSArray arrayWithObjects:
          [NSNumber numberWithInteger:IBGAutoMaskScreenshotOptionLabels],
          [NSNumber numberWithInteger:IBGAutoMaskScreenshotOptionTextInputs],
          [NSNumber numberWithInteger:IBGAutoMaskScreenshotOptionMedia],
          [NSNumber numberWithInteger:IBGAutoMaskScreenshotOptionMaskNothing],
          nil];
-     
+
      OCMStub([mock setAutoMaskScreenshots:IBGAutoMaskScreenshotOptionLabels | IBGAutoMaskScreenshotOptionTextInputs | IBGAutoMaskScreenshotOptionMedia | IBGAutoMaskScreenshotOptionMaskNothing]);
-     
+
      [self.instabugBridge enableAutoMasking:autoMaskingTypes];
- 
+
      OCMVerify([mock setAutoMaskScreenshots:IBGAutoMaskScreenshotOptionLabels | IBGAutoMaskScreenshotOptionTextInputs | IBGAutoMaskScreenshotOptionMedia | IBGAutoMaskScreenshotOptionMaskNothing]);
 }
 

From a411313dd96af22b3df38adff34a0c5b08f41a7f Mon Sep 17 00:00:00 2001
From: Ahmed alaa 
Date: Sun, 13 Jul 2025 04:12:13 +0300
Subject: [PATCH 8/9] feat: support ignore flag secure on android.

---
 .../com/instabug/reactlibrary/RNInstabugReactnativeModule.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
index cb4fb93d9..69df22869 100644
--- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
+++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java
@@ -167,7 +167,7 @@ public void run() {
                         .setInvocationEvents(invocationEvents)
                         .setLogLevel(parsedLogLevel);
 
-                if (map.hasKey("ignoreFlagSecure")) {
+                if (map!=null&&map.hasKey("ignoreFlagSecure")) {
                     builder.ignoreFlagSecure(map.getBoolean("ignoreFlagSecure"));
                 }
 

From ab18955ad355dba8f225f23da649bfb5ba9e35bb Mon Sep 17 00:00:00 2001
From: Andrew Amin <160974398+AndrewAminInstabug@users.noreply.github.com>
Date: Sun, 13 Jul 2025 17:07:19 +0300
Subject: [PATCH 9/9] Update CHANGELOG.md

---
 CHANGELOG.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2186e7451..0f07e1900 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,7 +4,7 @@
 
 ### Added
 
-- Add support ignore flag secure on android. ([#1394](https://github.com/Instabug/Instabug-React-Native/pull/1394))
+- Add support for ignoreFlagSecure to bypass SDK screenshot security protocols on Android. ([#1394](https://github.com/Instabug/Instabug-React-Native/pull/1394))
 
 ## [15.0.1](https://github.com/Instabug/Instabug-React-Native/compare/v14.3.0...v15.0.1)