react-native-security-suite 0.9.6 → 0.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Security solutions for React Native both platform Android and iOS
|
|
4
4
|
You can use any of the following:
|
|
5
5
|
|
|
6
|
-
<ol><li>Android Root device or iOS Jailbreak device detection</li><li>Text Encryption/Decryption</li><li>Secure storage</li><li>Diffie–Hellman key exchange</li><li>SSL Pinning & public key pinning</li><li>Network Logger (Android Chucker - iOS Pulse)</li></ol>
|
|
6
|
+
<ol><li>Android Root device or iOS Jailbreak device detection</li><li>Disable capture/screenshot</li><li>Text Encryption/Decryption</li><li>Secure storage</li><li>Diffie–Hellman key exchange</li><li>SSL Pinning & public key pinning</li><li>Network Logger (Android Chucker - iOS Pulse)</li></ol>
|
|
7
7
|
|
|
8
8
|
## Installation
|
|
9
9
|
|
|
@@ -2,6 +2,7 @@ package com.securitysuite;
|
|
|
2
2
|
|
|
3
3
|
import android.app.Activity;
|
|
4
4
|
import android.graphics.Color;
|
|
5
|
+
import android.view.View;
|
|
5
6
|
import android.view.Window;
|
|
6
7
|
import android.view.WindowManager;
|
|
7
8
|
import android.widget.FrameLayout;
|
|
@@ -33,12 +34,9 @@ public class SecureView extends FrameLayout {
|
|
|
33
34
|
super.onAttachedToWindow();
|
|
34
35
|
final Activity activity = reactContext.getCurrentActivity();
|
|
35
36
|
if (activity != null) {
|
|
36
|
-
activity.runOnUiThread(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Window window = activity.getWindow();
|
|
40
|
-
window.addFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
|
41
|
-
}
|
|
37
|
+
activity.runOnUiThread(() -> {
|
|
38
|
+
Window window = activity.getWindow();
|
|
39
|
+
window.addFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
|
42
40
|
});
|
|
43
41
|
}
|
|
44
42
|
}
|
|
@@ -48,16 +46,18 @@ public class SecureView extends FrameLayout {
|
|
|
48
46
|
super.onDetachedFromWindow();
|
|
49
47
|
final Activity activity = reactContext.getCurrentActivity();
|
|
50
48
|
if (activity != null) {
|
|
51
|
-
activity.runOnUiThread(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Window window = activity.getWindow();
|
|
55
|
-
window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
|
56
|
-
}
|
|
49
|
+
activity.runOnUiThread(() -> {
|
|
50
|
+
Window window = activity.getWindow();
|
|
51
|
+
window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
|
57
52
|
});
|
|
58
53
|
}
|
|
59
54
|
}
|
|
60
55
|
|
|
56
|
+
@Override
|
|
57
|
+
public void addView(View child, int index) {
|
|
58
|
+
super.addView(child, index);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
61
|
private final Runnable measureAndLayout = () -> {
|
|
62
62
|
measure(
|
|
63
63
|
MeasureSpec.makeMeasureSpec(getWidth(), MeasureSpec.EXACTLY),
|
|
@@ -46,11 +46,13 @@ public class SecureViewManager extends ViewGroupManager<SecureView> {
|
|
|
46
46
|
@Nullable
|
|
47
47
|
@Override
|
|
48
48
|
public Map<String, Integer> getCommandsMap() {
|
|
49
|
-
|
|
49
|
+
Log.d("hereeeee", "1");
|
|
50
|
+
return MapBuilder.of("1", 1);
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
@Override
|
|
53
54
|
public void receiveCommand(@NonNull SecureView root, String commandId, @Nullable ReadableArray args) {
|
|
55
|
+
Log.d("hereeeee", commandId);
|
|
54
56
|
super.receiveCommand(root, commandId, args);
|
|
55
57
|
int commandIdInt = Integer.parseInt(commandId);
|
|
56
58
|
if (commandIdInt == COMMAND_CREATE) {
|
|
@@ -59,6 +61,17 @@ public class SecureViewManager extends ViewGroupManager<SecureView> {
|
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
63
|
|
|
64
|
+
@Override
|
|
65
|
+
public boolean needsCustomLayoutForChildren() {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@Override
|
|
70
|
+
public void onAfterUpdateTransaction(@NonNull SecureView view) {
|
|
71
|
+
super.onAfterUpdateTransaction(view);
|
|
72
|
+
view.requestLayout();
|
|
73
|
+
}
|
|
74
|
+
|
|
62
75
|
public void createFragment(FrameLayout root, int reactNativeViewId) {
|
|
63
76
|
ViewGroup parentView = (ViewGroup) root.findViewById(reactNativeViewId);
|
|
64
77
|
if (parentView == null) {
|