File tree 3 files changed +40
-2
lines changed
main/java/com/instabug/reactlibrary
test/java/com/instabug/reactlibrary
3 files changed +40
-2
lines changed Original file line number Diff line number Diff line change 1
1
project. ext. instabug = [
2
- version : ' 14.0.0'
2
+ version : ' 14.0.0.6407912-SNAPSHOT '
3
3
]
4
4
5
5
dependencies {
Original file line number Diff line number Diff line change @@ -1148,7 +1148,26 @@ public void run() {
1148
1148
}
1149
1149
});
1150
1150
}
1151
-
1151
+ /**
1152
+ * Enables or disables network logs sensitive information auto masking.
1153
+ * @param isEnabled A boolean to enable/disable.
1154
+ */
1155
+ @ ReactMethod
1156
+ public void setAutoMaskingEnabled (final boolean isEnabled ) {
1157
+ MainThreadHandler .runOnMainThread (new Runnable () {
1158
+ @ Override
1159
+ public void run () {
1160
+ try {
1161
+ if (isEnabled )
1162
+ Instabug .setNetworkAutoMaskingState (Feature .State .ENABLED );
1163
+ else
1164
+ Instabug .setNetworkAutoMaskingState (Feature .State .DISABLED );
1165
+ } catch (Exception e ) {
1166
+ e .printStackTrace ();
1167
+ }
1168
+ }
1169
+ });
1170
+ }
1152
1171
/**
1153
1172
* Map between the exported JS constant and the arg key in {@link ArgsRegistry}.
1154
1173
* The constant name and the arg key should match to be able to resolve the
Original file line number Diff line number Diff line change @@ -635,4 +635,23 @@ public void testWillRedirectToStore() {
635
635
// then
636
636
mockInstabug .verify (() -> Instabug .willRedirectToStore ());
637
637
}
638
+
639
+ @ Test
640
+ public void testEnableAutoMasking () {
641
+
642
+ rnModule .setAutoMaskingEnabled (true );
643
+
644
+ verify (Instabug .class , times (1 ));
645
+ Instabug .setNetworkAutoMaskingState (Feature .State .ENABLED );
646
+ }
647
+
648
+ @ Test
649
+ public void testDisableAutoMasking () {
650
+
651
+ rnModule .setAutoMaskingEnabled (false );
652
+
653
+ verify (Instabug .class , times (1 ));
654
+ Instabug .setNetworkAutoMaskingState (Feature .State .DISABLED );
655
+ }
656
+
638
657
}
You can’t perform that action at this time.
0 commit comments