Skip to content

Commit 2ff6ea3

Browse files
Merge remote-tracking branch 'origin/dev' into feat/screen-render/react-native-testing
# Conflicts: # CHANGELOG.md # examples/default/ios/Podfile.lock # examples/default/src/App.tsx
2 parents 241cc27 + 40bfc35 commit 2ff6ea3

File tree

18 files changed

+174
-143
lines changed

18 files changed

+174
-143
lines changed

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@
88

99
### Added
1010

11-
- Add Support Advanced UI customization. ([#1411](https://github.com/Instabug/Instabug-React-Native/pull/1411))
11+
- Add support Advanced UI customization. ([#1411](https://github.com/Instabug/Instabug-React-Native/pull/1411))
12+
13+
## [15.0.2](https://github.com/Instabug/Instabug-React-Native/compare/v15.2.0...dev)
14+
15+
### Added
16+
17+
- Add support for ignoreFlagSecure to bypass SDK screenshot security protocols on Android. ([#1394](https://github.com/Instabug/Instabug-React-Native/pull/1394))
18+
19+
### Fixed
20+
21+
- async initialization. ([#1427](https://github.com/Instabug/Instabug-React-Native/pull/1427))
1222

1323
## [15.0.1](https://github.com/Instabug/Instabug-React-Native/compare/v14.3.0...v15.0.1)
1424

android/src/main/java/com/instabug/reactlibrary/RNInstabug.java

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ public class RNInstabug {
1919

2020
private static RNInstabug instance;
2121

22-
private RNInstabug() {}
22+
private RNInstabug() {
23+
}
2324

2425

2526
public static RNInstabug getInstance() {
@@ -36,14 +37,13 @@ public static RNInstabug getInstance() {
3637
/**
3738
* Initializes the SDK on the native side, which is useful for capturing startup issues specific to the native part of the app.
3839
*
39-
* @param application The application context.
40+
* @param application The application context.
4041
* @param applicationToken The app's identifying token, available on your dashboard.
41-
* @param logLevel The level of detail in logs that you want to print.
42-
* <p>Pick one of the log levels described in {@link LogLevel}.
43-
* default logLevel is {@link LogLevel#ERROR}</p>
44-
* @param InvocationEvent The events that trigger the SDK's user interface.
45-
* Choose from the available events listed in {@link InstabugInvocationEvent}.
46-
*
42+
* @param logLevel The level of detail in logs that you want to print.
43+
* <p>Pick one of the log levels described in {@link LogLevel}.
44+
* default logLevel is {@link LogLevel#ERROR}</p>
45+
* @param InvocationEvent The events that trigger the SDK's user interface.
46+
* Choose from the available events listed in {@link InstabugInvocationEvent}.
4747
* @example <p>Here's an example usage: </p>
4848
* <blockquote><pre>
4949
* RNInstabug.getInstance().init(
@@ -59,17 +59,24 @@ public void init(
5959
@NonNull Application application,
6060
@NonNull String applicationToken,
6161
int logLevel,
62+
Boolean ignoreSecureFlag,
6263
@NonNull InstabugInvocationEvent... InvocationEvent
63-
) {
64+
) {
6465
try {
6566

6667
setBaseUrlForDeprecationLogs();
6768
setCurrentPlatform();
6869

69-
new Instabug.Builder(application, applicationToken)
70+
Instabug.Builder builder = new Instabug.Builder(application, applicationToken)
7071
.setInvocationEvents(InvocationEvent)
71-
.setSdkDebugLogsLevel(logLevel)
72-
.build();
72+
.setSdkDebugLogsLevel(logLevel);
73+
74+
if (ignoreSecureFlag != null) {
75+
builder.ignoreFlagSecure(ignoreSecureFlag);
76+
}
77+
78+
builder.build();
79+
7380

7481
// Temporarily disabling APM hot launches
7582
APM.setHotAppLaunchEnabled(false);
@@ -80,15 +87,13 @@ public void init(
8087
}
8188

8289

83-
8490
/**
8591
* Initializes the SDK on the native side, which is useful for capturing startup issues specific to the native part of the app.
8692
*
87-
* @param application The application context.
93+
* @param application The application context.
8894
* @param applicationToken The app's identifying token, available on your dashboard.
89-
* @param invocationEvent The events that trigger the SDK's user interface.
90-
* Choose from the available events listed in {@link InstabugInvocationEvent}.
91-
*
95+
* @param invocationEvent The events that trigger the SDK's user interface.
96+
* Choose from the available events listed in {@link InstabugInvocationEvent}.
9297
* @example <p>Here's an example usage: </p>
9398
* <blockquote><pre>
9499
* RNInstabug.getInstance().init(
@@ -104,7 +109,7 @@ public void init(
104109
@NonNull String applicationToken,
105110
@NonNull InstabugInvocationEvent... invocationEvent
106111
) {
107-
init(application, applicationToken, LogLevel.ERROR, invocationEvent);
112+
init(application, applicationToken, LogLevel.ERROR,null, invocationEvent);
108113
}
109114

110115
@VisibleForTesting
@@ -160,6 +165,7 @@ public static class Builder {
160165
* The events that trigger the SDK's user interface.
161166
*/
162167
private InstabugInvocationEvent[] invocationEvents;
168+
private Boolean ignoreFlagSecure;
163169

164170

165171
/**
@@ -210,6 +216,16 @@ public Builder setCodePushVersion(String codePushVersion) {
210216
return this;
211217
}
212218

219+
/**
220+
* Sets flag to override SDK screenshot security behavior.
221+
*
222+
* @param ignoreFlagSecure flag to override SDK screenshot security behavior.
223+
*/
224+
public Builder ignoreFlagSecure(boolean ignoreFlagSecure) {
225+
this.ignoreFlagSecure = ignoreFlagSecure;
226+
return this;
227+
}
228+
213229
/**
214230
* Sets the invocation triggering events for the SDK's user interface
215231
*
@@ -237,6 +253,10 @@ public void build() {
237253
instabugBuilder.setCodePushVersion(codePushVersion);
238254
}
239255

256+
if (ignoreFlagSecure != null) {
257+
instabugBuilder.ignoreFlagSecure(ignoreFlagSecure);
258+
}
259+
240260
instabugBuilder.build();
241261

242262
// Temporarily disabling APM hot launches

android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ public void init(
150150
final ReadableArray invocationEventValues,
151151
final String logLevel,
152152
final boolean useNativeNetworkInterception,
153-
@Nullable final String codePushVersion
153+
@Nullable final String codePushVersion,
154+
final ReadableMap map
154155
) {
155156
MainThreadHandler.runOnMainThread(new Runnable() {
156157
@Override
@@ -168,6 +169,10 @@ public void run() {
168169
.setInvocationEvents(invocationEvents)
169170
.setLogLevel(parsedLogLevel);
170171

172+
if (map!=null&&map.hasKey("ignoreAndroidSecureFlag")) {
173+
builder.ignoreFlagSecure(map.getBoolean("ignoreAndroidSecureFlag"));
174+
}
175+
171176
if (codePushVersion != null) {
172177
if (Instabug.isBuilt()) {
173178
Instabug.setCodePushVersion(codePushVersion);

android/src/test/java/com/instabug/reactlibrary/RNInstabugTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import static com.instabug.reactlibrary.util.GlobalMocks.reflected;
55
import static org.junit.Assert.assertEquals;
66
import static org.mockito.ArgumentMatchers.any;
7+
import static org.mockito.ArgumentMatchers.anyBoolean;
78
import static org.mockito.ArgumentMatchers.anyInt;
89
import static org.mockito.Mockito.mock;
910
import static org.mockito.Mockito.mockConstruction;
@@ -62,18 +63,20 @@ public void testInitWithLogLevel() {
6263
// Initializes Instabug with the correct token
6364
assertEquals(token, actualToken);
6465
when(mock.setSdkDebugLogsLevel(anyInt())).thenReturn(mock);
66+
when(mock.ignoreFlagSecure(anyBoolean())).thenReturn(mock);
6567
when(mock.setInvocationEvents(any())).thenReturn(mock);
6668
});
6769

68-
sut.init(mContext, token, logLevel, invocationEvents);
70+
sut.init(mContext, token, logLevel, true, invocationEvents);
6971

7072
Instabug.Builder builder = mInstabugBuilder.constructed().get(0);
7173

7274
// Here we check that it has changed to verbose value of the `logLevel` property
7375
verify(builder).setSdkDebugLogsLevel(LogLevel.VERBOSE);
7476
verify(builder).setInvocationEvents(invocationEvents);
75-
verify(builder).build();
77+
verify(builder).ignoreFlagSecure(true);
7678

79+
verify(builder).build();
7780

7881

7982
verify(sut).setBaseUrlForDeprecationLogs();
@@ -95,7 +98,7 @@ public void testInitWithoutLogLevel() {
9598

9699
sut.init(mContext, token, invocationEvents);
97100

98-
verify(sut).init(mContext, token, defaultLogLevel, invocationEvents);
101+
verify(sut).init(mContext, token, defaultLogLevel, null,invocationEvents);
99102
mInstabugBuilder.close();
100103
}
101104

examples/default/ios/InstabugTests/InstabugSampleTests.m

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ - (void)testInit {
7575

7676
OCMStub([mock setCodePushVersion:codePushVersion]);
7777

78-
[self.instabugBridge init:appToken invocationEvents:invocationEvents debugLogsLevel:sdkDebugLogsLevel useNativeNetworkInterception:useNativeNetworkInterception codePushVersion:codePushVersion];
78+
[self.instabugBridge init:appToken invocationEvents:invocationEvents debugLogsLevel:sdkDebugLogsLevel useNativeNetworkInterception:useNativeNetworkInterception codePushVersion:codePushVersion
79+
options:nil
80+
];
7981
OCMVerify([mock setCodePushVersion:codePushVersion]);
8082

8183
OCMVerify([self.mRNInstabug initWithToken:appToken invocationEvents:floatingButtonInvocationEvent debugLogsLevel:sdkDebugLogsLevel useNativeNetworkInterception:useNativeNetworkInterception]);
@@ -573,18 +575,18 @@ - (void) testIsW3CaughtHeaderEnabled {
573575

574576
- (void)testEnableAutoMasking {
575577
id mock = OCMClassMock([Instabug class]);
576-
578+
577579
NSArray *autoMaskingTypes = [NSArray arrayWithObjects:
578580
[NSNumber numberWithInteger:IBGAutoMaskScreenshotOptionLabels],
579581
[NSNumber numberWithInteger:IBGAutoMaskScreenshotOptionTextInputs],
580582
[NSNumber numberWithInteger:IBGAutoMaskScreenshotOptionMedia],
581583
[NSNumber numberWithInteger:IBGAutoMaskScreenshotOptionMaskNothing],
582584
nil];
583-
585+
584586
OCMStub([mock setAutoMaskScreenshots:IBGAutoMaskScreenshotOptionLabels | IBGAutoMaskScreenshotOptionTextInputs | IBGAutoMaskScreenshotOptionMedia | IBGAutoMaskScreenshotOptionMaskNothing]);
585-
587+
586588
[self.instabugBridge enableAutoMasking:autoMaskingTypes];
587-
589+
588590
OCMVerify([mock setAutoMaskScreenshots:IBGAutoMaskScreenshotOptionLabels | IBGAutoMaskScreenshotOptionTextInputs | IBGAutoMaskScreenshotOptionMedia | IBGAutoMaskScreenshotOptionMaskNothing]);
589591
}
590592

examples/default/ios/Podfile.lock

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ PODS:
3131
- hermes-engine (0.75.4):
3232
- hermes-engine/Pre-built (= 0.75.4)
3333
- hermes-engine/Pre-built (0.75.4)
34-
- Instabug (15.1.26)
34+
- Instabug (15.1.1)
3535
- instabug-reactnative-ndk (0.1.0):
3636
- DoubleConversion
3737
- glog
@@ -1625,8 +1625,8 @@ PODS:
16251625
- ReactCommon/turbomodule/bridging
16261626
- ReactCommon/turbomodule/core
16271627
- Yoga
1628-
- RNInstabug (15.0.1):
1629-
- Instabug (= 15.1.26)
1628+
- RNInstabug (15.0.2):
1629+
- Instabug (= 15.1.1)
16301630
- React-Core
16311631
- RNReanimated (3.16.1):
16321632
- DoubleConversion
@@ -1770,7 +1770,6 @@ DEPENDENCIES:
17701770
- fmt (from `../node_modules/react-native/third-party-podspecs/fmt.podspec`)
17711771
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
17721772
- hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
1773-
- Instabug (from `https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.26/Instabug.podspec`)
17741773
- instabug-reactnative-ndk (from `../node_modules/instabug-reactnative-ndk`)
17751774
- OCMock
17761775
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
@@ -1851,6 +1850,7 @@ SPEC REPOS:
18511850
trunk:
18521851
- Google-Maps-iOS-Utils
18531852
- GoogleMaps
1853+
- Instabug
18541854
- OCMock
18551855
- SocketRocket
18561856

@@ -1868,8 +1868,6 @@ EXTERNAL SOURCES:
18681868
hermes-engine:
18691869
:podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec"
18701870
:tag: hermes-2024-08-15-RNv0.75.1-4b3bf912cc0f705b51b71ce1a5b8bd79b93a451b
1871-
Instabug:
1872-
:podspec: https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.26/Instabug.podspec
18731871
instabug-reactnative-ndk:
18741872
:path: "../node_modules/instabug-reactnative-ndk"
18751873
RCT-Folly:
@@ -2024,7 +2022,7 @@ SPEC CHECKSUMS:
20242022
Google-Maps-iOS-Utils: f77eab4c4326d7e6a277f8e23a0232402731913a
20252023
GoogleMaps: 032f676450ba0779bd8ce16840690915f84e57ac
20262024
hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0
2027-
Instabug: c47bd604b5212496da79b19b368eb5de73833d69
2025+
Instabug: 3e7af445c14d7823fcdecba223f09b5f7c0c6ce1
20282026
instabug-reactnative-ndk: d765ac289d56e8896398d02760d9abf2562fc641
20292027
OCMock: 589f2c84dacb1f5aaf6e4cec1f292551fe748e74
20302028
RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740
@@ -2092,14 +2090,14 @@ SPEC CHECKSUMS:
20922090
ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad
20932091
RNCClipboard: 2821ac938ef46f736a8de0c8814845dde2dcbdfb
20942092
RNGestureHandler: 511250b190a284388f9dd0d2e56c1df76f14cfb8
2095-
RNInstabug: 35bf420d77731598fae13c33ceecf0343fd8dd99
2093+
RNInstabug: c4d26c830b40c474422012d1a216d8ea37c88151
20962094
RNReanimated: f42a5044d121d68e91680caacb0293f4274228eb
20972095
RNScreens: c7ceced6a8384cb9be5e7a5e88e9e714401fd958
20982096
RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d
20992097
RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136
21002098
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
21012099
Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6
21022100

2103-
PODFILE CHECKSUM: 4e2ae668f4fb59c72dfd359d3d9c86ec6d4967e5
2101+
PODFILE CHECKSUM: 837b933596e1616ff02cc206bb17dee4f611fdbc
21042102

21052103
COCOAPODS: 1.14.0

0 commit comments

Comments
 (0)